[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Contract Source Code Verified (Exact Match)
Contract Name: Destabilizer
Compiler Text: v0.4.25+commit.59dbf8f1
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.24;

/**
 * @title ERC165
 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
 */
interface ERC165 {

  /**
   * @notice Query if a contract implements an interface
   * @param _interfaceId The interface identifier, as specified in ERC-165
   * @dev Interface identification is specified in ERC-165. This function
   * uses less than 30,000 gas.
   */
  function supportsInterface(bytes4 _interfaceId)
    external
    view
    returns (bool);
}


/**
 * @title ERC721 Non-Fungible Token Standard basic interface
 * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721Basic is ERC165 {

  bytes4 internal constant InterfaceId_ERC721 = 0x80ac58cd;
  /*
   * 0x80ac58cd ===
   *   bytes4(keccak256('balanceOf(address)')) ^
   *   bytes4(keccak256('ownerOf(uint256)')) ^
   *   bytes4(keccak256('approve(address,uint256)')) ^
   *   bytes4(keccak256('getApproved(uint256)')) ^
   *   bytes4(keccak256('setApprovalForAll(address,bool)')) ^
   *   bytes4(keccak256('isApprovedForAll(address,address)')) ^
   *   bytes4(keccak256('transferFrom(address,address,uint256)')) ^
   *   bytes4(keccak256('safeTransferFrom(address,address,uint256)')) ^
   *   bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)'))
   */

  bytes4 internal constant InterfaceId_ERC721Exists = 0x4f558e79;
  /*
   * 0x4f558e79 ===
   *   bytes4(keccak256('exists(uint256)'))
   */

  bytes4 internal constant InterfaceId_ERC721Enumerable = 0x780e9d63;
  /**
   * 0x780e9d63 ===
   *   bytes4(keccak256('totalSupply()')) ^
   *   bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) ^
   *   bytes4(keccak256('tokenByIndex(uint256)'))
   */

  bytes4 internal constant InterfaceId_ERC721Metadata = 0x5b5e139f;
  /**
   * 0x5b5e139f ===
   *   bytes4(keccak256('name()')) ^
   *   bytes4(keccak256('symbol()')) ^
   *   bytes4(keccak256('tokenURI(uint256)'))
   */

  event Transfer(
    address indexed _from,
    address indexed _to,
    uint256 indexed _tokenId
  );
  event Approval(
    address indexed _owner,
    address indexed _approved,
    uint256 indexed _tokenId
  );
  event ApprovalForAll(
    address indexed _owner,
    address indexed _operator,
    bool _approved
  );

  function balanceOf(address _owner) public view returns (uint256 _balance);
  function ownerOf(uint256 _tokenId) public view returns (address _owner);
  function exists(uint256 _tokenId) public view returns (bool _exists);

  function approve(address _to, uint256 _tokenId) public;
  function getApproved(uint256 _tokenId)
    public view returns (address _operator);

  function setApprovalForAll(address _operator, bool _approved) public;
  function isApprovedForAll(address _owner, address _operator)
    public view returns (bool);

  function transferFrom(address _from, address _to, uint256 _tokenId) public;
  function safeTransferFrom(address _from, address _to, uint256 _tokenId)
    public;

  function safeTransferFrom(
    address _from,
    address _to,
    uint256 _tokenId,
    bytes _data
  )
    public;
}



/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;


  event OwnershipRenounced(address indexed previousOwner);
  event OwnershipTransferred(
    address indexed previousOwner,
    address indexed newOwner
  );


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() public {
    owner = msg.sender;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  /**
   * @dev Allows the current owner to relinquish control of the contract.
   * @notice Renouncing to ownership will leave the contract without an owner.
   * It will not be possible to call the functions with the `onlyOwner`
   * modifier anymore.
   */
  function renounceOwnership() public onlyOwner {
    emit OwnershipRenounced(owner);
    owner = address(0);
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function transferOwnership(address _newOwner) public onlyOwner {
    _transferOwnership(_newOwner);
  }

  /**
   * @dev Transfers control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function _transferOwnership(address _newOwner) internal {
    require(_newOwner != address(0));
    emit OwnershipTransferred(owner, _newOwner);
    owner = _newOwner;
  }
}











/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721Enumerable is ERC721Basic {
  function totalSupply() public view returns (uint256);
  function tokenOfOwnerByIndex(
    address _owner,
    uint256 _index
  )
    public
    view
    returns (uint256 _tokenId);

  function tokenByIndex(uint256 _index) public view returns (uint256);
}


/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721Metadata is ERC721Basic {
  function name() external view returns (string _name);
  function symbol() external view returns (string _symbol);
  function tokenURI(uint256 _tokenId) public view returns (string);
}


/**
 * @title ERC-721 Non-Fungible Token Standard, full implementation interface
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721 is ERC721Basic, ERC721Enumerable, ERC721Metadata {
}







/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
contract ERC721Receiver {
  /**
   * @dev Magic value to be returned upon successful reception of an NFT
   *  Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`,
   *  which can be also obtained as `ERC721Receiver(0).onERC721Received.selector`
   */
  bytes4 internal constant ERC721_RECEIVED = 0x150b7a02;

  /**
   * @notice Handle the receipt of an NFT
   * @dev The ERC721 smart contract calls this function on the recipient
   * after a `safetransfer`. This function MAY throw to revert and reject the
   * transfer. Return of other than the magic value MUST result in the
   * transaction being reverted.
   * Note: the contract address is always the message sender.
   * @param _operator The address which called `safeTransferFrom` function
   * @param _from The address which previously owned the token
   * @param _tokenId The NFT identifier which is being transferred
   * @param _data Additional data with no specified format
   * @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
   */
  function onERC721Received(
    address _operator,
    address _from,
    uint256 _tokenId,
    bytes _data
  )
    public
    returns(bytes4);
}




/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
    // Gas optimization: this is cheaper than asserting 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
    if (_a == 0) {
      return 0;
    }

    c = _a * _b;
    assert(c / _a == _b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
    // assert(_b > 0); // Solidity automatically throws when dividing by 0
    // uint256 c = _a / _b;
    // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
    return _a / _b;
  }

  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
    assert(_b <= _a);
    return _a - _b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
    c = _a + _b;
    assert(c >= _a);
    return c;
  }
}




/**
 * Utility library of inline functions on addresses
 */
library AddressUtils {

  /**
   * Returns whether the target address is a contract
   * @dev This function will return false if invoked during the constructor of a contract,
   * as the code is not actually created until after the constructor finishes.
   * @param _addr address to check
   * @return whether the target address is a contract
   */
  function isContract(address _addr) internal view returns (bool) {
    uint256 size;
    // XXX Currently there is no better way to check if there is a contract in an address
    // than to check the size of the code at that address.
    // See https://ethereum.stackexchange.com/a/14016/36603
    // for more details about how this works.
    // TODO Check this again before the Serenity release, because all addresses will be
    // contracts then.
    // solium-disable-next-line security/no-inline-assembly
    assembly { size := extcodesize(_addr) }
    return size > 0;
  }

}





/**
 * @title SupportsInterfaceWithLookup
 * @author Matt Condon (@shrugs)
 * @dev Implements ERC165 using a lookup table.
 */
contract SupportsInterfaceWithLookup is ERC165 {

  bytes4 public constant InterfaceId_ERC165 = 0x01ffc9a7;
  /**
   * 0x01ffc9a7 ===
   *   bytes4(keccak256('supportsInterface(bytes4)'))
   */

  /**
   * @dev a mapping of interface id to whether or not it's supported
   */
  mapping(bytes4 => bool) internal supportedInterfaces;

  /**
   * @dev A contract implementing SupportsInterfaceWithLookup
   * implement ERC165 itself
   */
  constructor()
    public
  {
    _registerInterface(InterfaceId_ERC165);
  }

  /**
   * @dev implement supportsInterface(bytes4) using a lookup table
   */
  function supportsInterface(bytes4 _interfaceId)
    external
    view
    returns (bool)
  {
    return supportedInterfaces[_interfaceId];
  }

  /**
   * @dev private method for registering an interface
   */
  function _registerInterface(bytes4 _interfaceId)
    internal
  {
    require(_interfaceId != 0xffffffff);
    supportedInterfaces[_interfaceId] = true;
  }
}



/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721BasicToken is SupportsInterfaceWithLookup, ERC721Basic {

  using SafeMath for uint256;
  using AddressUtils for address;

  // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
  // which can be also obtained as `ERC721Receiver(0).onERC721Received.selector`
  bytes4 private constant ERC721_RECEIVED = 0x150b7a02;

  // Mapping from token ID to owner
  mapping (uint256 => address) internal tokenOwner;

  // Mapping from token ID to approved address
  mapping (uint256 => address) internal tokenApprovals;

  // Mapping from owner to number of owned token
  mapping (address => uint256) internal ownedTokensCount;

  // Mapping from owner to operator approvals
  mapping (address => mapping (address => bool)) internal operatorApprovals;

  constructor()
    public
  {
    // register the supported interfaces to conform to ERC721 via ERC165
    _registerInterface(InterfaceId_ERC721);
    _registerInterface(InterfaceId_ERC721Exists);
  }

  /**
   * @dev Gets the balance of the specified address
   * @param _owner address to query the balance of
   * @return uint256 representing the amount owned by the passed address
   */
  function balanceOf(address _owner) public view returns (uint256) {
    require(_owner != address(0));
    return ownedTokensCount[_owner];
  }

  /**
   * @dev Gets the owner of the specified token ID
   * @param _tokenId uint256 ID of the token to query the owner of
   * @return owner address currently marked as the owner of the given token ID
   */
  function ownerOf(uint256 _tokenId) public view returns (address) {
    address owner = tokenOwner[_tokenId];
    require(owner != address(0));
    return owner;
  }

  /**
   * @dev Returns whether the specified token exists
   * @param _tokenId uint256 ID of the token to query the existence of
   * @return whether the token exists
   */
  function exists(uint256 _tokenId) public view returns (bool) {
    address owner = tokenOwner[_tokenId];
    return owner != address(0);
  }

  /**
   * @dev Approves another address to transfer the given token ID
   * The zero address indicates there is no approved address.
   * There can only be one approved address per token at a given time.
   * Can only be called by the token owner or an approved operator.
   * @param _to address to be approved for the given token ID
   * @param _tokenId uint256 ID of the token to be approved
   */
  function approve(address _to, uint256 _tokenId) public {
    address owner = ownerOf(_tokenId);
    require(_to != owner);
    require(msg.sender == owner || isApprovedForAll(owner, msg.sender));

    tokenApprovals[_tokenId] = _to;
    emit Approval(owner, _to, _tokenId);
  }

  /**
   * @dev Gets the approved address for a token ID, or zero if no address set
   * @param _tokenId uint256 ID of the token to query the approval of
   * @return address currently approved for the given token ID
   */
  function getApproved(uint256 _tokenId) public view returns (address) {
    return tokenApprovals[_tokenId];
  }

  /**
   * @dev Sets or unsets the approval of a given operator
   * An operator is allowed to transfer all tokens of the sender on their behalf
   * @param _to operator address to set the approval
   * @param _approved representing the status of the approval to be set
   */
  function setApprovalForAll(address _to, bool _approved) public {
    require(_to != msg.sender);
    operatorApprovals[msg.sender][_to] = _approved;
    emit ApprovalForAll(msg.sender, _to, _approved);
  }

  /**
   * @dev Tells whether an operator is approved by a given owner
   * @param _owner owner address which you want to query the approval of
   * @param _operator operator address which you want to query the approval of
   * @return bool whether the given operator is approved by the given owner
   */
  function isApprovedForAll(
    address _owner,
    address _operator
  )
    public
    view
    returns (bool)
  {
    return operatorApprovals[_owner][_operator];
  }

  /**
   * @dev Transfers the ownership of a given token ID to another address
   * Usage of this method is discouraged, use `safeTransferFrom` whenever possible
   * Requires the msg sender to be the owner, approved, or operator
   * @param _from current owner of the token
   * @param _to address to receive the ownership of the given token ID
   * @param _tokenId uint256 ID of the token to be transferred
  */
  function transferFrom(
    address _from,
    address _to,
    uint256 _tokenId
  )
    public
  {
    require(isApprovedOrOwner(msg.sender, _tokenId));
    require(_from != address(0));
    require(_to != address(0));

    clearApproval(_from, _tokenId);
    removeTokenFrom(_from, _tokenId);
    addTokenTo(_to, _tokenId);

    emit Transfer(_from, _to, _tokenId);
  }

  /**
   * @dev Safely transfers the ownership of a given token ID to another address
   * If the target address is a contract, it must implement `onERC721Received`,
   * which is called upon a safe transfer, and return the magic value
   * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
   * the transfer is reverted.
   *
   * Requires the msg sender to be the owner, approved, or operator
   * @param _from current owner of the token
   * @param _to address to receive the ownership of the given token ID
   * @param _tokenId uint256 ID of the token to be transferred
  */
  function safeTransferFrom(
    address _from,
    address _to,
    uint256 _tokenId
  )
    public
  {
    // solium-disable-next-line arg-overflow
    safeTransferFrom(_from, _to, _tokenId, "");
  }

  /**
   * @dev Safely transfers the ownership of a given token ID to another address
   * If the target address is a contract, it must implement `onERC721Received`,
   * which is called upon a safe transfer, and return the magic value
   * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
   * the transfer is reverted.
   * Requires the msg sender to be the owner, approved, or operator
   * @param _from current owner of the token
   * @param _to address to receive the ownership of the given token ID
   * @param _tokenId uint256 ID of the token to be transferred
   * @param _data bytes data to send along with a safe transfer check
   */
  function safeTransferFrom(
    address _from,
    address _to,
    uint256 _tokenId,
    bytes _data
  )
    public
  {
    transferFrom(_from, _to, _tokenId);
    // solium-disable-next-line arg-overflow
    require(checkAndCallSafeTransfer(_from, _to, _tokenId, _data));
  }

  /**
   * @dev Returns whether the given spender can transfer a given token ID
   * @param _spender address of the spender to query
   * @param _tokenId uint256 ID of the token to be transferred
   * @return bool whether the msg.sender is approved for the given token ID,
   *  is an operator of the owner, or is the owner of the token
   */
  function isApprovedOrOwner(
    address _spender,
    uint256 _tokenId
  )
    internal
    view
    returns (bool)
  {
    address owner = ownerOf(_tokenId);
    // Disable solium check because of
    // https://github.com/duaraghav8/Solium/issues/175
    // solium-disable-next-line operator-whitespace
    return (
      _spender == owner ||
      getApproved(_tokenId) == _spender ||
      isApprovedForAll(owner, _spender)
    );
  }

  /**
   * @dev Internal function to mint a new token
   * Reverts if the given token ID already exists
   * @param _to The address that will own the minted token
   * @param _tokenId uint256 ID of the token to be minted by the msg.sender
   */
  function _mint(address _to, uint256 _tokenId) internal {
    require(_to != address(0));
    addTokenTo(_to, _tokenId);
    emit Transfer(address(0), _to, _tokenId);
  }

  /**
   * @dev Internal function to burn a specific token
   * Reverts if the token does not exist
   * @param _tokenId uint256 ID of the token being burned by the msg.sender
   */
  function _burn(address _owner, uint256 _tokenId) internal {
    clearApproval(_owner, _tokenId);
    removeTokenFrom(_owner, _tokenId);
    emit Transfer(_owner, address(0), _tokenId);
  }

  /**
   * @dev Internal function to clear current approval of a given token ID
   * Reverts if the given address is not indeed the owner of the token
   * @param _owner owner of the token
   * @param _tokenId uint256 ID of the token to be transferred
   */
  function clearApproval(address _owner, uint256 _tokenId) internal {
    require(ownerOf(_tokenId) == _owner);
    if (tokenApprovals[_tokenId] != address(0)) {
      tokenApprovals[_tokenId] = address(0);
    }
  }

  /**
   * @dev Internal function to add a token ID to the list of a given address
   * @param _to address representing the new owner of the given token ID
   * @param _tokenId uint256 ID of the token to be added to the tokens list of the given address
   */
  function addTokenTo(address _to, uint256 _tokenId) internal {
    require(tokenOwner[_tokenId] == address(0));
    tokenOwner[_tokenId] = _to;
    ownedTokensCount[_to] = ownedTokensCount[_to].add(1);
  }

  /**
   * @dev Internal function to remove a token ID from the list of a given address
   * @param _from address representing the previous owner of the given token ID
   * @param _tokenId uint256 ID of the token to be removed from the tokens list of the given address
   */
  function removeTokenFrom(address _from, uint256 _tokenId) internal {
    require(ownerOf(_tokenId) == _from);
    ownedTokensCount[_from] = ownedTokensCount[_from].sub(1);
    tokenOwner[_tokenId] = address(0);
  }

  /**
   * @dev Internal function to invoke `onERC721Received` on a target address
   * The call is not executed if the target address is not a contract
   * @param _from address representing the previous owner of the given token ID
   * @param _to target address that will receive the tokens
   * @param _tokenId uint256 ID of the token to be transferred
   * @param _data bytes optional data to send along with the call
   * @return whether the call correctly returned the expected magic value
   */
  function checkAndCallSafeTransfer(
    address _from,
    address _to,
    uint256 _tokenId,
    bytes _data
  )
    internal
    returns (bool)
  {
    if (!_to.isContract()) {
      return true;
    }
    bytes4 retval = ERC721Receiver(_to).onERC721Received(
      msg.sender, _from, _tokenId, _data);
    return (retval == ERC721_RECEIVED);
  }
}




/**
 * @title Full ERC721 Token
 * This implementation includes all the required and some optional functionality of the ERC721 standard
 * Moreover, it includes approve all functionality using operator terminology
 * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721Token is SupportsInterfaceWithLookup, ERC721BasicToken, ERC721 {

  // Token name
  string internal name_;

  // Token symbol
  string internal symbol_;

  // Mapping from owner to list of owned token IDs
  mapping(address => uint256[]) internal ownedTokens;

  // Mapping from token ID to index of the owner tokens list
  mapping(uint256 => uint256) internal ownedTokensIndex;

  // Array with all token ids, used for enumeration
  uint256[] internal allTokens;

  // Mapping from token id to position in the allTokens array
  mapping(uint256 => uint256) internal allTokensIndex;

  // Optional mapping for token URIs
  mapping(uint256 => string) internal tokenURIs;

  /**
   * @dev Constructor function
   */
  constructor(string _name, string _symbol) public {
    name_ = _name;
    symbol_ = _symbol;

    // register the supported interfaces to conform to ERC721 via ERC165
    _registerInterface(InterfaceId_ERC721Enumerable);
    _registerInterface(InterfaceId_ERC721Metadata);
  }

  /**
   * @dev Gets the token name
   * @return string representing the token name
   */
  function name() external view returns (string) {
    return name_;
  }

  /**
   * @dev Gets the token symbol
   * @return string representing the token symbol
   */
  function symbol() external view returns (string) {
    return symbol_;
  }

  /**
   * @dev Returns an URI for a given token ID
   * Throws if the token ID does not exist. May return an empty string.
   * @param _tokenId uint256 ID of the token to query
   */
  function tokenURI(uint256 _tokenId) public view returns (string) {
    require(exists(_tokenId));
    return tokenURIs[_tokenId];
  }

  /**
   * @dev Gets the token ID at a given index of the tokens list of the requested owner
   * @param _owner address owning the tokens list to be accessed
   * @param _index uint256 representing the index to be accessed of the requested tokens list
   * @return uint256 token ID at the given index of the tokens list owned by the requested address
   */
  function tokenOfOwnerByIndex(
    address _owner,
    uint256 _index
  )
    public
    view
    returns (uint256)
  {
    require(_index < balanceOf(_owner));
    return ownedTokens[_owner][_index];
  }

  /**
   * @dev Gets the total amount of tokens stored by the contract
   * @return uint256 representing the total amount of tokens
   */
  function totalSupply() public view returns (uint256) {
    return allTokens.length;
  }

  /**
   * @dev Gets the token ID at a given index of all the tokens in this contract
   * Reverts if the index is greater or equal to the total number of tokens
   * @param _index uint256 representing the index to be accessed of the tokens list
   * @return uint256 token ID at the given index of the tokens list
   */
  function tokenByIndex(uint256 _index) public view returns (uint256) {
    require(_index < totalSupply());
    return allTokens[_index];
  }

  /**
   * @dev Internal function to set the token URI for a given token
   * Reverts if the token ID does not exist
   * @param _tokenId uint256 ID of the token to set its URI
   * @param _uri string URI to assign
   */
  function _setTokenURI(uint256 _tokenId, string _uri) internal {
    require(exists(_tokenId));
    tokenURIs[_tokenId] = _uri;
  }

  /**
   * @dev Internal function to add a token ID to the list of a given address
   * @param _to address representing the new owner of the given token ID
   * @param _tokenId uint256 ID of the token to be added to the tokens list of the given address
   */
  function addTokenTo(address _to, uint256 _tokenId) internal {
    super.addTokenTo(_to, _tokenId);
    uint256 length = ownedTokens[_to].length;
    ownedTokens[_to].push(_tokenId);
    ownedTokensIndex[_tokenId] = length;
  }

  /**
   * @dev Internal function to remove a token ID from the list of a given address
   * @param _from address representing the previous owner of the given token ID
   * @param _tokenId uint256 ID of the token to be removed from the tokens list of the given address
   */
  function removeTokenFrom(address _from, uint256 _tokenId) internal {
    super.removeTokenFrom(_from, _tokenId);

    // To prevent a gap in the array, we store the last token in the index of the token to delete, and
    // then delete the last slot.
    uint256 tokenIndex = ownedTokensIndex[_tokenId];
    uint256 lastTokenIndex = ownedTokens[_from].length.sub(1);
    uint256 lastToken = ownedTokens[_from][lastTokenIndex];

    ownedTokens[_from][tokenIndex] = lastToken;
    // This also deletes the contents at the last position of the array
    ownedTokens[_from].length--;

    // Note that this will handle single-element arrays. In that case, both tokenIndex and lastTokenIndex are going to
    // be zero. Then we can make sure that we will remove _tokenId from the ownedTokens list since we are first swapping
    // the lastToken to the first position, and then dropping the element placed in the last position of the list

    ownedTokensIndex[_tokenId] = 0;
    ownedTokensIndex[lastToken] = tokenIndex;
  }

  /**
   * @dev Internal function to mint a new token
   * Reverts if the given token ID already exists
   * @param _to address the beneficiary that will own the minted token
   * @param _tokenId uint256 ID of the token to be minted by the msg.sender
   */
  function _mint(address _to, uint256 _tokenId) internal {
    super._mint(_to, _tokenId);

    allTokensIndex[_tokenId] = allTokens.length;
    allTokens.push(_tokenId);
  }

  /**
   * @dev Internal function to burn a specific token
   * Reverts if the token does not exist
   * @param _owner owner of the token to burn
   * @param _tokenId uint256 ID of the token being burned by the msg.sender
   */
  function _burn(address _owner, uint256 _tokenId) internal {
    super._burn(_owner, _tokenId);

    // Clear metadata (if any)
    if (bytes(tokenURIs[_tokenId]).length != 0) {
      delete tokenURIs[_tokenId];
    }

    // Reorg all tokens array
    uint256 tokenIndex = allTokensIndex[_tokenId];
    uint256 lastTokenIndex = allTokens.length.sub(1);
    uint256 lastToken = allTokens[lastTokenIndex];

    allTokens[tokenIndex] = lastToken;
    allTokens[lastTokenIndex] = 0;

    allTokens.length--;
    allTokensIndex[_tokenId] = 0;
    allTokensIndex[lastToken] = tokenIndex;
  }

}




contract RoxBase is ERC721Token, Ownable {
    event SeedChange(uint256 tokenId, string seed);
    event remixCountChange(uint256 tokenId, uint256 amount);
    event ParentsSets(uint256 tokenId, uint256 parent1, uint256 parent2);

    address minter;

    // Storage of the commission address.
    address public commissionAddress;

    // Template for MetaData
    struct metaData {
        string seed;
        uint parent1;
        uint parent2;
        uint remixCount;
    }

    modifier onlyApprovedContractAddresses () {
        // Used to require that the sender is an approved address.
        require(ApprovedContractAddress[msg.sender] == true);
        _;
    }

    modifier onlyMinter () {
        require(minter == msg.sender);
        _;
    }

    // Storage for Approve contract address
    mapping (address => bool) ApprovedContractAddress;
    // Storage for token metaDatas
    mapping (uint256 => metaData) tokenToMetaData;
    // Next available id (was count but that breaks if you burn a token).
    uint nextId = 0;
    // HostName for view of token(e.g. https://cryptorox.co/api/v1/)
    string URIToken;

    /**
    * @dev Overrides the default burn function to delete the token's meta data as well.
    */
    function _burn (uint256 _tokenId) internal {
        delete tokenToMetaData[_tokenId];
        super._burn(ownerOf(_tokenId), _tokenId);
    }

    // Mints / Creates a new token with a given seed
    /**
    * @dev Internal Mints a token.
    * @return New token's Id
    */
    function _mint(address _to, string _seed) internal returns (uint256){
        uint256 newTokenId = nextId;
        super._mint(_to, newTokenId);
        _setTokenSeed(newTokenId, _seed);
        nextId = nextId + 1;
        return newTokenId;
    }

    /**
    * @dev Internal Sets token id to a seed.
    */
    function _setTokenSeed(uint256 _tokenId, string _seed) private  {
        tokenToMetaData[_tokenId].seed = _seed;
        emit SeedChange(uint(_tokenId), string(_seed));
    }
}


/**
 * @title RoxOnlyMinterMethods
 * @dev Only Methods that can be called by the minter of the contract.
 */
contract RoxOnlyMinterMethods is RoxBase {
    /**
    * @dev Mints a new token with a seed.
    */
    function mintTo(address _to, string seed) external onlyMinter returns (uint) {
        return _mint(_to, seed);
    }
}


/**
 * @title RoxOnlyOwnerMethods
 * @dev Only Methods that can be called by the owner of the contract.
 */
contract RoxOnlyOwnerMethods is RoxBase {
    /**
    * @dev Sets the Approved value for contract address.
    */
    function setApprovedContractAddress (address _contractAddress, bool _value) public onlyOwner {
        ApprovedContractAddress[_contractAddress] = _value;
    }

    function kill() public onlyOwner {
        selfdestruct(msg.sender);
    }

    /**
    * @dev Sets base uriToken.
    */
    function setURIToken(string _uriToken) public onlyOwner {
        URIToken = _uriToken;
    }

    /**
    * @dev Sets the new commission address.
    */
    function setCommissionAddress (address _commissionAddress) public onlyOwner {
        commissionAddress = _commissionAddress;
    }
    /**
    * @dev Sets the minter's Address
    */
    function setMinterAddress (address _minterAddress) public onlyOwner{
        minter = _minterAddress;
    }

    /**
    * @dev Burns a token.
    */
    function adminBurnToken(uint256 _tokenId) public onlyOwner {
        _burn(_tokenId);
    }
}

/**
 * @title RoxAuthorisedContractMethods
 * @dev All methods that can be ran by authorised contract addresses.
 */
contract RoxAuthorisedContractMethods is RoxBase {
    // All these methods are ran via external authorised contracts.

    /**
    * @dev Burns a token.
    */
    function burnToken(uint256 _tokenId) public onlyApprovedContractAddresses {
        _burn(_tokenId);
    }

    /**
    * @dev Mints a new token.
    */
    function mintToPublic(address _to, string _seed) external onlyApprovedContractAddresses returns (uint) {
        return _mint(_to, _seed);
    }


    /**
    * @dev Sets the parents of a token.
    */
    function setParents(uint _tokenId, uint _parent1, uint _parent2) public onlyApprovedContractAddresses {
        tokenToMetaData[_tokenId].parent1 = _parent1;
        tokenToMetaData[_tokenId].parent2 = _parent2;
        emit ParentsSets(_tokenId, _parent1, _parent2);

    }

    /**
    * @dev Sets owner of token to given value.
    */
    function setTokenOwner(address _to, uint _tokenId) public onlyApprovedContractAddresses{
        tokenOwner[_tokenId] = _to;
    }

    /**
    * @dev Sets the seed of a given token.
    */
    function setTokenSeed(uint256 _tokenId, string _seed) public onlyApprovedContractAddresses {
        tokenToMetaData[_tokenId].seed = _seed;
        emit SeedChange(uint(_tokenId), string(_seed));
    }

    /**
    * @dev Sets the remixCount of a token
    */
    function setRemixCount(uint256 _tokenId, uint _remixCount) public onlyApprovedContractAddresses {
        tokenToMetaData[_tokenId].remixCount =_remixCount;
        emit remixCountChange(_tokenId, _remixCount);
    }
}

/**
 * @title RoxPublicGetters
 * @dev All public getter rox methods.
 */
contract RoxPublicGetters is RoxBase {
    /**
    * @dev Returns tokens for an address.
    * @return uint[] of tokens owned by an address.
    */
    function getTokensForOwner (address _owner) public view returns (uint[]) {
        return ownedTokens[_owner];
    }

    /**
    * @dev Returns the data about a token.
    */
    function getDataForTokenId(uint256 _tokenId) public view returns
    (
        uint,
        string,
        uint,
        uint,
        address,
        address,
        uint
    )
    {
         metaData storage meta = tokenToMetaData[_tokenId];
        return (
            _tokenId,
            meta.seed,
            meta.parent1,
            meta.parent2,
            ownerOf(_tokenId),
            getApproved(_tokenId),
            meta.remixCount
        );
    }

        /**
    * @dev Returns a seed for a token id.
    * @return string the seed for the token id.
    */
    function getSeedForTokenId(uint256 _tokenId) public view returns (string) {
        return tokenToMetaData[_tokenId].seed;
    }

    /**
    * @dev Gets the remix count for a given token
    * @return The remix count for a given token
    */
    function getRemixCount(uint256 _tokenId) public view returns (uint) {
        return tokenToMetaData[_tokenId].remixCount;
    }

    /**
    * @dev Returns the parents for token id
    * @return TUPLE of the parent ids for a token.
    */
    function getParentsForTokenId(uint256 _tokenId) public view returns (uint parent1, uint parent2) {
        metaData storage meta = tokenToMetaData[_tokenId];
        return (
            meta.parent1,
            meta.parent2
        );
    }

    // Converts uint to a string
    function uint2str(uint i) internal pure returns (string){
        if (i == 0) return "0";
        uint j = i;
        uint length;
        while (j != 0){
            length++;
            j /= 10;
        }
        bytes memory bstr = new bytes(length);
        uint k = length - 1;
        while (i != 0){
            bstr[k--] = byte(48 + i % 10);
            i /= 10;
        }
        return string(bstr);
    }


    /**
    * @dev Returns the Token uri for a token
    * @return Token URI for a token ID.
    */
    function tokenURI(uint256 _tokenId) public view returns (string) {
        return string(abi.encodePacked(URIToken, uint2str(_tokenId)));
    }

}


/**
 * @title Rox
 * @dev Full rox Contract with all imports.
 */
contract Rox is RoxOnlyOwnerMethods, RoxPublicGetters, RoxAuthorisedContractMethods, RoxOnlyMinterMethods {
    // Creates an instance of the contract
    constructor (string _name, string _symbol, string _uriToken) public ERC721Token(_name, _symbol) {
        URIToken = _uriToken;
    }

}


contract Destabilizer is Ownable {
    // Rox contract
    Rox public roxContract;

    event Destabilized(
        address owner,
        uint tokenId,
        uint parent1,
        uint parent2
    );
    // Storage for useFee
    uint useFee;

    // Creates a contract instance
    constructor (address _roxContract, uint256 _useFee) public {
        setRoxContract(_roxContract);
        setUseFee(_useFee);
    }

    // Sets the rox contract
    function setRoxContract (address _roxContract) onlyOwner {
        roxContract = Rox(_roxContract);
    }

    // Sets the Use fee
    function setUseFee(uint256 _useFee) onlyOwner {
        useFee = _useFee;
    }

    // Converts uint to a string
    function uint2str(uint i) internal pure returns (string){
        if (i == 0) return "0";
        uint j = i;
        uint length;
        while (j != 0){
            length++;
            j /= 10;
        }
        bytes memory bstr = new bytes(length);
        uint k = length - 1;
        while (i != 0){
            bstr[k--] = byte(48 + i % 10);
            i /= 10;
        }
        return string(bstr);
    }

    // Converts string to uint
    function string2Uint(string s) internal pure returns (uint result) {
        bytes memory b = bytes(s);
        uint i;
        result = 0;
        for (i = 0; i < b.length; i++) {
            uint c = uint(b[i]);
            if (c >= 48 && c <= 57) {
                result = result * 10 + (c - 48);
            }
        }
    }

    // Creates a substring of a string
    function substring(string str, uint startIndex, uint endIndex) constant returns (string) {
        bytes memory strBytes = bytes(str);
        bytes memory result = new bytes(endIndex-startIndex);
        for(uint i = startIndex; i < endIndex; i++) {
            result[i-startIndex] = strBytes[i];
        }
        return string(result);
    }

    /**
    * @dev Creates a semi random number from a hash of certain values between 0 and max value..
    * @return uint256: Random number between 0 and max value.
    */
    function _random(uint256 _nonce, uint128 _maxValue) private view returns (uint256) {
        uint256 randomHash = uint256(keccak256(block.difficulty, now , _nonce));
        return randomHash % _maxValue;
    }

    /**
    * @dev Mixes an index of two seeds together.
    * @return bytes of the mixed seed.
    */
    function _seed_mixing(bytes seed1, bytes seed2, uint index, uint8 _maxValueForDigit) internal returns (bytes) {

        // Used to vary the seed generation more.
        uint indexM1;

        if (index == 0) {
            indexM1 = 15;
        } else {
            indexM1 = index - 1;
        }

        // Creates a random number between 1 and 100
        uint256 chance = _random(uint(uint8(seed2[indexM1]) + 1 * uint8(seed1[indexM1]) + 1), 100);

        if (chance > 90) {
            // Genetic mutation
            seed1[index] = bytes(uint2str(_random(uint(uint8(seed2[indexM1]) + 1 * uint8(seed1[indexM1]) + 1), _maxValueForDigit)))[0];
        } else if (chance > 45) {
            // Uses the over seed's value
            seed1[index] = seed2[index];
        }

        return seed1;
    }

    /**
    * @dev Remixes the two seeds to generate a new one.
    */
    function remix(uint256 _tokenId1, uint256 _tokenId2) external payable returns (uint tokenId, string gene) {
        // Validation checks
        require(msg.sender == roxContract.ownerOf(_tokenId1));
        require(msg.sender == roxContract.ownerOf(_tokenId2));
        require(_tokenId1 != _tokenId2);
        require(msg.value >= useFee);

        bytes memory smelt_2_seed = bytes(roxContract.getSeedForTokenId(_tokenId2));
        bytes memory seed = bytes(roxContract.getSeedForTokenId(_tokenId1));

        // Type
        seed = _seed_mixing(seed, smelt_2_seed, 0, 9);
        // Cut
        seed = _seed_mixing(seed, smelt_2_seed, 1, 7);

        // Carat, colours
        for (uint i=3; i!=7; i++) {
            seed = _seed_mixing(seed, smelt_2_seed, i, 9);
        }

        // Clarity & inclusions
        for (uint8 j=7; j!=12; j++) {
            seed = _seed_mixing(seed, smelt_2_seed, j, 4);
        }
        // origin & spares
        for (uint8 g=12; g!=15; g++) {
            seed = _seed_mixing(seed, smelt_2_seed, g, 9);
        }

        // Appends the generation to end.
        string memory generationSeed = substring(string(seed), 15, seed.length);
        string memory seedWithoutGen = substring(string(seed), 0, 15);
        bytes memory generation  = bytes(uint2str(uint(uint(string2Uint(generationSeed)) + 1)));

        seed = abi.encodePacked(seedWithoutGen, generation);

        // Mints new token
        uint256 newTokenId = roxContract.mintToPublic(msg.sender, string(seed));
        updateParents(_tokenId1, _tokenId2, tokenId);
        roxContract.commissionAddress().transfer(msg.value);

        emit Destabilized(msg.sender, newTokenId, _tokenId1, _tokenId2);

    }


    /**
    * @dev Updates that parents of a given token after remixing.
    */
    function updateParents(uint _tokenId1, uint _tokenId2, uint _newTokenId) {
        // Updates parent Values
        roxContract.setRemixCount(_tokenId1, roxContract.getRemixCount(_tokenId1) + 1);
        roxContract.setRemixCount(_tokenId2, roxContract.getRemixCount(_tokenId2) + 1);

        roxContract.setTokenSeed(_tokenId1, updateCarat(roxContract.getSeedForTokenId(_tokenId1)));
        roxContract.setTokenSeed(_tokenId2, updateCarat(roxContract.getSeedForTokenId(_tokenId2)));

        roxContract.setParents(_newTokenId, _tokenId1, _tokenId2);
    }

    /**
    * @dev Updates the carat value of a seed or throws if carat size is too small
    * @return string: Updated seed so the carat size one smaller.
    */
    function updateCarat (string _seed) returns (string){
        // Gets parent's new carat and raise error if carat is to small.
        uint carat = string2Uint(substring(_seed, 2, 3));
        require(carat < 9);
        bytes memory bytesSeed = bytes(_seed);
        bytesSeed[2] = bytes1(bytes(uint2str(uint(carat + 1)))[0]);

        _seed = string(bytesSeed);
        return _seed;
    }


}

    Contract ABI  
[{"constant":true,"inputs":[{"name":"str","type":"string"},{"name":"startIndex","type":"uint256"},{"name":"endIndex","type":"uint256"}],"name":"substring","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"roxContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId1","type":"uint256"},{"name":"_tokenId2","type":"uint256"}],"name":"remix","outputs":[{"name":"tokenId","type":"uint256"},{"name":"gene","type":"string"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId1","type":"uint256"},{"name":"_tokenId2","type":"uint256"},{"name":"_newTokenId","type":"uint256"}],"name":"updateParents","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_roxContract","type":"address"}],"name":"setRoxContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_useFee","type":"uint256"}],"name":"setUseFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_seed","type":"string"}],"name":"updateCarat","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_roxContract","type":"address"},{"name":"_useFee","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"tokenId","type":"uint256"},{"indexed":false,"name":"parent1","type":"uint256"},{"indexed":false,"name":"parent2","type":"uint256"}],"name":"Destabilized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60806040523480156200001157600080fd5b50604051604080620023ef8339810180604052810190808051906020019092919080519060200190929190505050336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506200009982620000bb640100000000026401000000009004565b620000b3816200015b640100000000026401000000009004565b5050620001c1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156200011757600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515620001b757600080fd5b8060028190555050565b61221e80620001d16000396000f3006080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631dcd9b55146100a95780632cf76f2e1461019f5780633021c717146101f65780633ae8b86c146102a05780634c416add146102e1578063715018a61461032457806389f1401b1461033b5780638da5cb5b14610368578063ca0efecd146103bf578063f2fde38b146104a1575b600080fd5b3480156100b557600080fd5b50610124600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190803590602001909291905050506104e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610164578082015181840152602081019050610149565b50505050905090810190601f1680156101915780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ab57600080fd5b506101b46105e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61021e600480360381019080803590602001909291908035906020019092919050505061060b565b6040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610264578082015181840152602081019050610249565b50505050905090810190601f1680156102915780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b3480156102ac57600080fd5b506102df600480360381019080803590602001909291908035906020019092919080359060200190929190505050610f39565b005b3480156102ed57600080fd5b50610322600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611771565b005b34801561033057600080fd5b50610339611810565b005b34801561034757600080fd5b5061036660048036038101908080359060200190929190505050611912565b005b34801561037457600080fd5b5061037d611977565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103cb57600080fd5b50610426600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061199c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561046657808201518184015260208101905061044b565b50505050905090810190601f1680156104935780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104ad57600080fd5b506104e2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a7c565b005b606080606060008692508585036040519080825280601f01601f1916602001820160405280156105235781602001602082028038833980820191505090505b5091508590505b848110156105d857828181518110151561054057fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028287830381518110151561059b57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808060010191505061052a565b8193505050509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006060806060600080600060608060606000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e8e6040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1580156106af57600080fd5b505af11580156106c3573d6000803e3d6000fd5b505050506040513d60208110156106d957600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561072357600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e8d6040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1580156107b457600080fd5b505af11580156107c8573d6000803e3d6000fd5b505050506040513d60208110156107de57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561082857600080fd5b8b8d1415151561083757600080fd5b600254341015151561084857600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633b011b308d6040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b1580156108d957600080fd5b505af11580156108ed573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561091757600080fd5b81019080805164010000000081111561092f57600080fd5b8281019050602081018481111561094557600080fd5b815185600182028301116401000000008211171561096257600080fd5b50509291905050509850600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633b011b308e6040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b1580156109fd57600080fd5b505af1158015610a11573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015610a3b57600080fd5b810190808051640100000000811115610a5357600080fd5b82810190506020810184811115610a6957600080fd5b8151856001820283011164010000000082111715610a8657600080fd5b50509291905050509750610a9e888a60006009611ae3565b9750610aae888a60016007611ae3565b9750600396505b600787141515610adb57610acc888a896009611ae3565b97508680600101975050610ab5565b600795505b600c8660ff16141515610b0c57610afd888a8860ff166004611ae3565b97508580600101965050610ae0565b600c94505b600f8560ff16141515610b3d57610b2e888a8760ff166009611ae3565b97508480600101955050610b11565b610b4a88600f8a516104e4565b9350610b59886000600f6104e4565b9250610b6f6001610b6986611e79565b01611f4b565b915082826040516020018083805190602001908083835b602083101515610bab5780518252602082019150602081019050602083039250610b86565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b602083101515610bfe5780518252602082019150602081019050602083039250610bd9565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040529750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166324250852338a6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610d12578082015181840152602081019050610cf7565b50505050905090810190601f168015610d3f5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b158015610d5f57600080fd5b505af1158015610d73573d6000803e3d6000fd5b505050506040513d6020811015610d8957600080fd5b81019080805190602001909291905050509050610da78d8d8d610f39565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663931742d36040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610e2d57600080fd5b505af1158015610e41573d6000803e3d6000fd5b505050506040513d6020811015610e5757600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610ead573d6000803e3d6000fd5b507ff06a7e7738c6e90f45a7e502bd3b84c3333c526f1765c5c314082ef08c1275cd33828f8f604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a15050505050505050509250929050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166365141c208460018060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633d709ff1886040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b15801561100a57600080fd5b505af115801561101e573d6000803e3d6000fd5b505050506040513d602081101561103457600080fd5b8101908080519060200190929190505050016040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050600060405180830381600087803b15801561109f57600080fd5b505af11580156110b3573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166365141c208360018060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633d709ff1876040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b15801561118857600080fd5b505af115801561119c573d6000803e3d6000fd5b505050506040513d60208110156111b257600080fd5b8101908080519060200190929190505050016040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050600060405180830381600087803b15801561121d57600080fd5b505af1158015611231573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663083147988461139e600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633b011b30886040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561130857600080fd5b505af115801561131c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561134657600080fd5b81019080805164010000000081111561135e57600080fd5b8281019050602081018481111561137457600080fd5b815185600182028301116401000000008211171561139157600080fd5b505092919050505061199c565b6040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561140f5780820151818401526020810190506113f4565b50505050905090810190601f16801561143c5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b15801561145c57600080fd5b505af1158015611470573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166308314798836115dd600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633b011b30876040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561154757600080fd5b505af115801561155b573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561158557600080fd5b81019080805164010000000081111561159d57600080fd5b828101905060208101848111156115b357600080fd5b81518560018202830111640100000000821117156115d057600080fd5b505092919050505061199c565b6040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561164e578082015181840152602081019050611633565b50505050905090810190601f16801561167b5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b15801561169b57600080fd5b505af11580156116af573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632a952b4b8285856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018381526020018281526020019350505050600060405180830381600087803b15801561175457600080fd5b505af1158015611768573d6000803e3d6000fd5b50505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117cc57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561186b57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196d57600080fd5b8060028190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060600060606119b76119b285600260036104e4565b611e79565b91506009821015156119c857600080fd5b8390506119d760018301611f4b565b60008151811015156119e557fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002816002815181101515611a3f57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508093508392505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ad757600080fd5b611ae0816120a2565b50565b60606000806000851415611afa57600f9150611b01565b6001850391505b611c0d60018884815181101515611b1457fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090046001028885815181101515611b9357fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004010160ff16606461219c565b9050605a811115611dca57611d2e611d2960018985815181101515611c2e57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090046001028986815181101515611cad57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004010160ff168660ff1661219c565b611f4b565b6000815181101515611d3c57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028786815181101515611d9557fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611e6c565b602d811115611e6b578585815181101515611de157fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028786815181101515611e3a57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b5b8692505050949350505050565b6000606060008084925060009350600091505b8251821015611f43578282815181101515611ea357fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004905060308110158015611f25575060398111155b15611f365760308103600a85020193505b8180600101925050611e8c565b505050919050565b60606000806060600080861415611f99576040805190810160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509450612099565b8593505b600084141515611fc3578280600101935050600a84811515611fbb57fe5b049350611f9d565b826040519080825280601f01601f191660200182016040528015611ff65781602001602082028038833980820191505090505b5091506001830390505b60008614151561209557600a8681151561201657fe5b066030017f01000000000000000000000000000000000000000000000000000000000000000282828060019003935081518110151561205157fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8681151561208d57fe5b049550612000565b8194505b50505050919050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156120de57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000804442856040518084815260200183815260200182815260200193505050506040518091039020600190049050826fffffffffffffffffffffffffffffffff16818115156121e857fe5b06915050929150505600a165627a7a72305820a1fff1eea4b94b9b109d73a036efd3eabef0cbbe6b396da6eb7c6b6ea4c90e2900290000000000000000000000003a6fb46a0c9f376ac7f5de9ac50237ed6223f7ec000000000000000000000000000000000000000000000000002aa1efb94e0000

    Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003a6fb46a0c9f376ac7f5de9ac50237ed6223f7ec000000000000000000000000000000000000000000000000002aa1efb94e0000

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000003a6fb46a0c9f376ac7f5de9ac50237ed6223f7ec
Arg [1] : 000000000000000000000000000000000000000000000000002aa1efb94e0000


   Swarm Source:
bzzr://a1fff1eea4b94b9b109d73a036efd3eabef0cbbe6b396da6eb7c6b6ea4c90e29

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward