ETH Price: $2,530.39 (+0.88%)

Token

CryptoServal (CS)
 

Overview

Max Total Supply

100 CS

Holders

25

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
1 CS
0x3e04d9b6bcdfd9f4b8a74315a0fba22a88777af6
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

CryptoServal is a game based on smart contracts running on the Ethereum blockchain, centered around breedable, collectible, and fighting creatures.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
CryptoServal

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-09-27
*/

pragma solidity 0.4.24;

// File: openzeppelin-solidity/contracts/AddressUtils.sol

/**
 * 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;
  }

}

// File: openzeppelin-solidity/contracts/introspection/ERC165.sol

/**
 * @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);
}

// File: openzeppelin-solidity/contracts/token/ERC721/ERC721Basic.sol

/**
 * @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;
}

// File: openzeppelin-solidity/contracts/token/ERC721/ERC721.sol

/**
 * @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 {
}

// File: openzeppelin-solidity/contracts/token/ERC721/ERC721Receiver.sol

/**
 * @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);
}

// File: openzeppelin-solidity/contracts/math/SafeMath.sol

/**
 * @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;
  }
}

// File: openzeppelin-solidity/contracts/introspection/SupportsInterfaceWithLookup.sol

/**
 * @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;
  }
}

// File: openzeppelin-solidity/contracts/token/ERC721/ERC721BasicToken.sol

/**
 * @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);
  }
}

// File: openzeppelin-solidity/contracts/token/ERC721/ERC721Token.sol

/**
 * @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;
  }

}

// File: contracts/IMarketplace.sol

contract IMarketplace {
    function createAuction(
        uint256 _tokenId,
        uint128 startPrice,
        uint128 endPrice,
        uint128 duration
    )
        external;
}

// File: contracts/GameData.sol

contract GameData {
    struct Country {       
        bytes2 isoCode;
        uint8 animalsCount;
        uint256[3] animalIds;
    }

    struct Animal {
        bool isSold;
        uint256 currentValue;
        uint8 rarity; // 0-4, rarity = stat range, higher rarity = better stats

        bytes32 name;         
        uint256 countryId; // country of origin

    }

    struct Dna {
        uint256 animalId; 
        uint8 effectiveness; //  1 - 100, 100 = same stats as a wild card
    }    
}

// File: openzeppelin-solidity/contracts/ownership/Ownable.sol

/**
 * @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;
  }
}

// File: contracts/Restricted.sol

contract Restricted is Ownable {
    mapping(address => bool) private addressIsAdmin;
    bool private isActive = true;

    modifier onlyAdmin() {
        require(addressIsAdmin[msg.sender] || msg.sender == owner);
        _;
    }

    modifier contractIsActive() {
        require(isActive);
        _;
    }

    function addAdmin(address adminAddress) public onlyOwner {
        addressIsAdmin[adminAddress] = true;
    }

    function removeAdmin(address adminAddress) public onlyOwner {
        addressIsAdmin[adminAddress] = false;
    }

    function pauseContract() public onlyOwner {
        isActive = false;
    }

    function activateContract() public onlyOwner {
        isActive = true;
    }
}

// File: contracts/CryptoServal.sol

contract CryptoServal is ERC721Token("CryptoServal", "CS"), GameData, Restricted {

    using AddressUtils for address;

    uint8 internal developersFee = 5;
    uint256[3] internal rarityTargetValue = [0.5 ether, 1 ether, 2 ether];

    Country[] internal countries;
    Animal[] internal animals;
    Dna[] internal dnas;

    using SafeMath for uint256;

    event AnimalBoughtEvent(
        uint256 animalId,
        address previousOwner,
        address newOwner,
        uint256 pricePaid,
        bool isSold
    );

    mapping (address => uint256) private addressToDnaCount;

    mapping (uint => address) private dnaIdToOwnerAddress;

    uint256 private startingAnimalPrice = 0.001 ether;

    IMarketplace private marketplaceContract;

    bool private shouldGenerateDna = true;

    modifier validTokenId(uint256 _tokenId) {
        require(_tokenId < animals.length);
        _;
    }

    modifier soldOnly(uint256 _tokenId) {
        require(animals[_tokenId].isSold);
        _;
    }

    modifier isNotFromContract() {
        require(!msg.sender.isContract());
        _;
    }

    function () public payable {
    }

    function createAuction(
        uint256 _tokenId,
        uint128 startPrice,
        uint128 endPrice,
        uint128 duration
    )
        external
        isNotFromContract
    {
        // approve, not a transfer, let marketplace confirm the original owner and take ownership
        approve(address(marketplaceContract), _tokenId);
        marketplaceContract.createAuction(_tokenId, startPrice, endPrice, duration);
    }

    function setMarketplaceContract(address marketplaceAddress) external onlyOwner {
        marketplaceContract = IMarketplace(marketplaceAddress);
    }

    function getPlayerAnimals(address playerAddress)
        external
        view
        returns(uint256[])
    {
        uint256 animalsOwned = ownedTokensCount[playerAddress];
        uint256[] memory playersAnimals = new uint256[](animalsOwned);

        if (animalsOwned == 0) {
            return playersAnimals;
        }

        uint256 animalsLength = animals.length;
        uint256 playersAnimalsIndex = 0;
        uint256 animalId = 0;
        while (playersAnimalsIndex < animalsOwned && animalId < animalsLength) {
            if (tokenOwner[animalId] == playerAddress) {
                playersAnimals[playersAnimalsIndex] = animalId;
                playersAnimalsIndex++;
            }
            animalId++;
        }

        return playersAnimals;
    }

    function getPlayerDnas(address playerAddress) external view returns(uint256[]) {
        uint256 dnasOwned = addressToDnaCount[playerAddress];
        uint256[] memory playersDnas = new uint256[](dnasOwned);

        if (dnasOwned == 0) {
            return playersDnas;
        }

        uint256 dnasLength = dnas.length;
        uint256 playersDnasIndex = 0;
        uint256 dnaId = 0;
        while (playersDnasIndex < dnasOwned && dnaId < dnasLength) {
            if (dnaIdToOwnerAddress[dnaId] == playerAddress) {
                playersDnas[playersDnasIndex] = dnaId;
                playersDnasIndex++;
            }
            dnaId++;
        }

        return playersDnas;
    }

    function transferFrom(address _from, address _to, uint256 _tokenId)
        public
        validTokenId(_tokenId)
        soldOnly(_tokenId)
    {
        super.transferFrom(_from, _to, _tokenId);
    }

    function safeTransferFrom(address _from, address _to, uint256 _tokenId)
        public
        validTokenId(_tokenId)
        soldOnly(_tokenId)
    {
        super.safeTransferFrom(_from, _to, _tokenId);
    }

    function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes _data)
        public
        validTokenId(_tokenId)
        soldOnly(_tokenId)
    {
        super.safeTransferFrom(_from, _to, _tokenId, _data);
    }

    function buyAnimal(uint256 id) public payable isNotFromContract contractIsActive {
        uint256 etherSent = msg.value;
        address sender = msg.sender;

        Animal storage animalToBuy = animals[id];

        require(etherSent >= animalToBuy.currentValue);
        require(tokenOwner[id] != sender);
        require(!animalToBuy.isSold);
        uint256 etherToPay = animalToBuy.currentValue;
        uint256 etherToRefund = etherSent.sub(etherToPay);
        address previousOwner = tokenOwner[id];

        // Inlined transferFrom
        clearApproval(previousOwner, id);
        removeTokenFrom(previousOwner, id);
        addTokenTo(sender, id);

        emit Transfer(previousOwner, sender, id);
        //

        // subtract developers fee
        uint256 ownersShare = etherToPay.sub(etherToPay * developersFee / 100);
        // pay previous owner
        previousOwner.transfer(ownersShare);
        // refund overpaid ether
        refundSender(sender, etherToRefund);

        // If the bid is above the target price, lock the buying via this contract and enable ERC721
        if (etherToPay >= rarityTargetValue[animalToBuy.rarity]) {
            animalToBuy.isSold = true;
            animalToBuy.currentValue = 0;
        } else {
            // calculate new value, multiplier depends on current amount of ether
            animalToBuy.currentValue = calculateNextEtherValue(animalToBuy.currentValue);
        }

        if (shouldGenerateDna) {
            generateDna(sender, id, etherToPay, animalToBuy);
        }
        emit AnimalBoughtEvent(id, previousOwner, sender, etherToPay, animalToBuy.isSold);
    }

    function getAnimal(uint256 _animalId)
        public
        view
        returns(
            uint256 countryId,
            bytes32 name,
            uint8 rarity,
            uint256 currentValue,
            uint256 targetValue,
            address owner,
            uint256 id
        )
    {
        Animal storage animal = animals[_animalId];
        return (
            animal.countryId,
            animal.name,
            animal.rarity,
            animal.currentValue,
            rarityTargetValue[animal.rarity],
            tokenOwner[_animalId],
            _animalId
        );
    }

    function getAnimalsCount() public view returns(uint256 animalsCount) {
        return animals.length;
    }

    function getDna(uint256 _dnaId)
        public
        view
        returns(
            uint animalId,
            address owner,
            uint16 effectiveness,
            uint256 id
        )
    {
        Dna storage dna = dnas[_dnaId];
        return (dna.animalId, dnaIdToOwnerAddress[_dnaId], dna.effectiveness, _dnaId);
    }

    function getDnasCount() public view returns(uint256) {
        return dnas.length;
    }

    function getCountry(uint256 _countryId)
        public
        view
        returns(
            bytes2 isoCode,
            uint8 animalsCount,
            uint256[3] animalIds,
            uint256 id
        )
    {
        Country storage country = countries[_countryId];
        return(country.isoCode, country.animalsCount, country.animalIds, _countryId);
    }

    function getCountriesCount() public view returns(uint256 countriesCount) {
        return countries.length;
    }

    function getDevelopersFee() public view returns(uint8) {
        return developersFee;
    }

    function getMarketplaceContract() public view returns(address) {
        return marketplaceContract;
    }

    function getShouldGenerateDna() public view returns(bool) {
        return shouldGenerateDna;
    }

    function withdrawContract() public onlyOwner {
        msg.sender.transfer(address(this).balance);
    }

    function setDevelopersFee(uint8 _developersFee) public onlyOwner {
        require((_developersFee >= 0) && (_developersFee <= 8));
        developersFee = _developersFee;
    }

    function setShouldGenerateDna(bool _shouldGenerateDna) public onlyAdmin {
        shouldGenerateDna = _shouldGenerateDna;
    }

    function addCountry(bytes2 isoCode) public onlyAdmin {
        Country memory country;
        country.isoCode = isoCode;
        countries.push(country);
    }

    function addAnimal(uint256 countryId, bytes32 animalName, uint8 rarity) public onlyAdmin {
        require((rarity >= 0) && (rarity < 3));
        Country storage country = countries[countryId];

        uint256 id = animals.length; // id is assigned before push

        Animal memory animal = Animal(
            false, // new animal is not sold yet
            startingAnimalPrice,
            rarity,
            animalName,
            countryId
        );

        animals.push(animal);
        addAnimalIdToCountry(id, country);
        _mint(address(this), id);
    }

    function changeCountry(uint256 id, bytes2 isoCode) public onlyAdmin {
        Country storage country = countries[id];
        country.isoCode = isoCode;
    }

    function changeAnimal(uint256 animalId, uint256 countryId, bytes32 name, uint8 rarity)
        public
        onlyAdmin
    {
        require(countryId < countries.length);
        Animal storage animal = animals[animalId];
        if (animal.name != name) {
            animal.name = name;
        }
        if (animal.rarity != rarity) {
            require((rarity >= 0) && (rarity < 3));
            animal.rarity = rarity;
        }
        if (animal.countryId != countryId) {
            Country storage country = countries[countryId];

            uint256 oldCountryId = animal.countryId;

            addAnimalIdToCountry(animalId, country);
            removeAnimalIdFromCountry(animalId, oldCountryId);

            animal.countryId = countryId;
        }
    }

    function setRarityTargetValue(uint8 index, uint256 targetValue) public onlyAdmin {
        rarityTargetValue[index] = targetValue;
    }

    function calculateNextEtherValue(uint256 currentEtherValue) public pure returns(uint256) {
        if (currentEtherValue < 0.1 ether) {
            return currentEtherValue.mul(2);
        } else if (currentEtherValue < 0.5 ether) {
            return currentEtherValue.mul(3).div(2); // x1.5
        } else if (currentEtherValue < 1 ether) {
            return currentEtherValue.mul(4).div(3); // x1.33
        } else if (currentEtherValue < 5 ether) {
            return currentEtherValue.mul(5).div(4); // x1.25
        } else if (currentEtherValue < 10 ether) {
            return currentEtherValue.mul(6).div(5); // x1.2
        } else {
            return currentEtherValue.mul(7).div(6); // 1.16
        }
    }

    function refundSender(address sender, uint256 etherToRefund) private {
        if (etherToRefund > 0) {
            sender.transfer(etherToRefund);
        }
    }

    function generateDna(
        address sender,
        uint256 animalId,
        uint256 pricePaid,
        Animal animal
    )
        private
    {
        uint256 id = dnas.length; // id is assigned before push
        Dna memory dna = Dna(
            animalId,
            calculateAnimalEffectiveness(pricePaid, animal)
        );

        dnas.push(dna);

        dnaIdToOwnerAddress[id] = sender;
        addressToDnaCount[sender] = addressToDnaCount[sender].add(1);
    }

    function calculateAnimalEffectiveness(
        uint256 pricePaid,
        Animal animal
    )
        private
        view
        returns(uint8)
    {
        if (animal.isSold) {
            return 100;
        }

        uint256 effectiveness = 10; // 10-90;
        // more common the animal = cheaper effectiveness
        uint256 effectivenessPerEther = 10**18 * 80 / rarityTargetValue[animal.rarity];
        effectiveness = effectiveness.add(pricePaid * effectivenessPerEther / 10**18);

        if (effectiveness > 90) {
            effectiveness = 90;
        }

        return uint8(effectiveness);
    }

    function addAnimalIdToCountry(
        uint256 animalId,
        Country storage country
    )
        private
    {
        uint8 animalSlotIndex = country.animalsCount;
        require(animalSlotIndex < 3);
        country.animalIds[animalSlotIndex] = animalId;
        country.animalsCount += 1;
    }

    function removeAnimalIdFromCountry(uint256 animalId, uint256 countryId) private {
        Country storage country = countries[countryId];
        for (uint8 i = 0; i < country.animalsCount; i++) {
            if (country.animalIds[i] == animalId) {
                if (i != country.animalsCount - 1) {
                    country.animalIds[i] = country.animalIds[country.animalsCount - 1];
                }
                country.animalsCount -= 1;
                return;
            }
        }
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"getShouldGenerateDna","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"},{"name":"startPrice","type":"uint128"},{"name":"endPrice","type":"uint128"},{"name":"duration","type":"uint128"}],"name":"createAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getAnimalsCount","outputs":[{"name":"animalsCount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"marketplaceAddress","type":"address"}],"name":"setMarketplaceContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"playerAddress","type":"address"}],"name":"getPlayerDnas","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"animalId","type":"uint256"},{"name":"countryId","type":"uint256"},{"name":"name","type":"bytes32"},{"name":"rarity","type":"uint8"}],"name":"changeAnimal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"adminAddress","type":"address"}],"name":"removeAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"InterfaceId_ERC165","outputs":[{"name":"","type":"bytes4"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"buyAnimal","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"countryId","type":"uint256"},{"name":"animalName","type":"bytes32"},{"name":"rarity","type":"uint8"}],"name":"addAnimal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_dnaId","type":"uint256"}],"name":"getDna","outputs":[{"name":"animalId","type":"uint256"},{"name":"owner","type":"address"},{"name":"effectiveness","type":"uint16"},{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pauseContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_animalId","type":"uint256"}],"name":"getAnimal","outputs":[{"name":"countryId","type":"uint256"},{"name":"name","type":"bytes32"},{"name":"rarity","type":"uint8"},{"name":"currentValue","type":"uint256"},{"name":"targetValue","type":"uint256"},{"name":"owner","type":"address"},{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"index","type":"uint8"},{"name":"targetValue","type":"uint256"}],"name":"setRarityTargetValue","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_shouldGenerateDna","type":"bool"}],"name":"setShouldGenerateDna","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getDevelopersFee","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"adminAddress","type":"address"}],"name":"addAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","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":"activateContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_developersFee","type":"uint8"}],"name":"setDevelopersFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getDnasCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_countryId","type":"uint256"}],"name":"getCountry","outputs":[{"name":"isoCode","type":"bytes2"},{"name":"animalsCount","type":"uint8"},{"name":"animalIds","type":"uint256[3]"},{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getMarketplaceContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"playerAddress","type":"address"}],"name":"getPlayerAnimals","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"isoCode","type":"bytes2"}],"name":"addCountry","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getCountriesCount","outputs":[{"name":"countriesCount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"isoCode","type":"bytes2"}],"name":"changeCountry","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"currentEtherValue","type":"uint256"}],"name":"calculateNextEtherValue","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"animalId","type":"uint256"},{"indexed":false,"name":"previousOwner","type":"address"},{"indexed":false,"name":"newOwner","type":"address"},{"indexed":false,"name":"pricePaid","type":"uint256"},{"indexed":false,"name":"isSold","type":"bool"}],"name":"AnimalBoughtEvent","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"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":true,"name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_approved","type":"address"},{"indexed":true,"name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_operator","type":"address"},{"indexed":false,"name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"}]

600e8054600160ff199091161761ff00191661050017905560e06040526706f05b59d3b200006080908152670de0b6b3a764000060a052671bc16d674ec8000060c0526200005290600f906003620002a5565b5066038d7ea4c680006017556018805460a060020a60ff02191674010000000000000000000000000000000000000000179055604080518082018252600c81527f43727970746f53657276616c00000000000000000000000000000000000000006020808301919091528251808401909352600283527f43530000000000000000000000000000000000000000000000000000000000009083015290620001227f01ffc9a70000000000000000000000000000000000000000000000000000000064010000000062000238810204565b620001567f80ac58cd0000000000000000000000000000000000000000000000000000000064010000000062000238810204565b6200018a7f4f558e790000000000000000000000000000000000000000000000000000000064010000000062000238810204565b81516200019f906005906020850190620002f4565b508051620001b5906006906020840190620002f4565b50620001ea7f780e9d630000000000000000000000000000000000000000000000000000000064010000000062000238810204565b6200021e7f5b5e139f0000000000000000000000000000000000000000000000000000000064010000000062000238810204565b5050600c8054600160a060020a0319163317905562000387565b7fffffffff0000000000000000000000000000000000000000000000000000000080821614156200026857600080fd5b7fffffffff00000000000000000000000000000000000000000000000000000000166000908152602081905260409020805460ff19166001179055565b8260038101928215620002e2579160200282015b82811115620002e2578251829067ffffffffffffffff16905591602001919060010190620002b9565b50620002f092915062000367565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200033757805160ff1916838001178555620002e2565b82800160010185558215620002e2579182015b82811115620002e25782518255916020019190600101906200034a565b6200038491905b80821115620002f057600081556001016200036e565b90565b6128ed80620003976000396000f3006080604052600436106102445763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662173d658114610246578063011879db1461026f57806301ffc9a7146102a857806306fdde03146102ca578063081812fc146103545780630931ce6714610388578063095ea7b3146103af5780631102610e146103d3578063157cb62c146103f457806316244907146104655780631785f53c1461048957806318160ddd146104aa57806319fa8f50146104bf5780631a14e94a146104f157806323b872dd146104fc5780632f745c591461052657806330e656d81461054a578063422627c31461056b57806342842e0e146105b4578063439766ce146105de57806345d3cc81146105f35780634f558e791461064e5780634f6ccce714610666578063541bb3581461067e5780635675db9c1461069c578063595f40d6146106b65780636352211e146106e157806370480275146106f957806370a082311461071a578063715018a61461073b5780638da5cb5b146107505780638fda356d1461076557806395d89b411461077a5780639da9df3e1461078f578063a22cb465146107a4578063a437ab52146107ca578063a8575102146107e5578063afa5e0a9146107fa578063aff465721461086c578063b88d4fde14610881578063ba622ddc146108f0578063c87b56dd14610911578063dc5936f014610929578063dc667d0c1461094b578063e985e9c514610960578063ef739d0f14610987578063f2fde38b146109ac578063f337c2e1146109cd575b005b34801561025257600080fd5b5061025b6109e5565b604080519115158252519081900360200190f35b34801561027b57600080fd5b506102446004356fffffffffffffffffffffffffffffffff60243581169060443581169060643516610a07565b3480156102b457600080fd5b5061025b600160e060020a031960043516610adc565b3480156102d657600080fd5b506102df610aff565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610319578181015183820152602001610301565b50505050905090810190601f1680156103465780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561036057600080fd5b5061036c600435610b95565b60408051600160a060020a039092168252519081900360200190f35b34801561039457600080fd5b5061039d610bb0565b60408051918252519081900360200190f35b3480156103bb57600080fd5b50610244600160a060020a0360043516602435610bb6565b3480156103df57600080fd5b50610244600160a060020a0360043516610c5f565b34801561040057600080fd5b50610415600160a060020a0360043516610c98565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610451578181015183820152602001610439565b505050509050019250505060405180910390f35b34801561047157600080fd5b5061024460043560243560443560ff60643516610d7d565b34801561049557600080fd5b50610244600160a060020a0360043516610e90565b3480156104b657600080fd5b5061039d610ec8565b3480156104cb57600080fd5b506104d4610ece565b60408051600160e060020a03199092168252519081900360200190f35b610244600435610ef2565b34801561050857600080fd5b50610244600160a060020a03600435811690602435166044356111a6565b34801561053257600080fd5b5061039d600160a060020a03600435166024356111f7565b34801561055657600080fd5b5061024460043560243560ff60443516611245565b34801561057757600080fd5b506105836004356113b3565b60408051948552600160a060020a03909316602085015261ffff909116838301526060830152519081900360800190f35b3480156105c057600080fd5b50610244600160a060020a0360043581169060243516604435611410565b3480156105ea57600080fd5b5061024461145a565b3480156105ff57600080fd5b5061060b60043561147d565b60408051978852602088019690965260ff9094168686015260608601929092526080850152600160a060020a031660a084015260c0830152519081900360e00190f35b34801561065a57600080fd5b5061025b600435611508565b34801561067257600080fd5b5061039d600435611525565b34801561068a57600080fd5b5061024460ff6004351660243561155a565b3480156106a857600080fd5b5061024460043515156115a4565b3480156106c257600080fd5b506106cb611617565b6040805160ff9092168252519081900360200190f35b3480156106ed57600080fd5b5061036c600435611625565b34801561070557600080fd5b50610244600160a060020a0360043516611649565b34801561072657600080fd5b5061039d600160a060020a0360043516611684565b34801561074757600080fd5b506102446116b7565b34801561075c57600080fd5b5061036c611718565b34801561077157600080fd5b50610244611727565b34801561078657600080fd5b506102df61174d565b34801561079b57600080fd5b506102446117ae565b3480156107b057600080fd5b50610244600160a060020a036004351660243515156117f5565b3480156107d657600080fd5b5061024460ff60043516611879565b3480156107f157600080fd5b5061039d6118cf565b34801561080657600080fd5b506108126004356118d5565b60408051600160f060020a03198616815260ff8516602082015290810183606080838360005b83811015610850578181015183820152602001610838565b5050505090500182815260200194505050505060405180910390f35b34801561087857600080fd5b5061036c611960565b34801561088d57600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261024494600160a060020a03813581169560248035909216956044359536956084940191819084018382808284375094975061196f9650505050505050565b3480156108fc57600080fd5b50610415600160a060020a03600435166119ba565b34801561091d57600080fd5b506102df600435611a91565b34801561093557600080fd5b50610244600160f060020a031960043516611b46565b34801561095757600080fd5b5061039d611c32565b34801561096c57600080fd5b5061025b600160a060020a0360043581169060243516611c38565b34801561099357600080fd5b50610244600435600160f060020a031960243516611c66565b3480156109b857600080fd5b50610244600160a060020a0360043516611cd1565b3480156109d957600080fd5b5061039d600435611cf1565b60185474010000000000000000000000000000000000000000900460ff165b90565b610a1033611dd5565b15610a1a57600080fd5b601854610a3090600160a060020a031685610bb6565b601854604080517f011879db000000000000000000000000000000000000000000000000000000008152600481018790526fffffffffffffffffffffffffffffffff80871660248301528086166044830152841660648201529051600160a060020a039092169163011879db9160848082019260009290919082900301818387803b158015610abe57600080fd5b505af1158015610ad2573d6000803e3d6000fd5b5050505050505050565b600160e060020a0319811660009081526020819052604090205460ff165b919050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b8b5780601f10610b6057610100808354040283529160200191610b8b565b820191906000526020600020905b815481529060010190602001808311610b6e57829003601f168201915b5050505050905090565b600090815260026020526040902054600160a060020a031690565b60135490565b6000610bc182611625565b9050600160a060020a038381169082161415610bdc57600080fd5b33600160a060020a0382161480610bf85750610bf88133611c38565b1515610c0357600080fd5b6000828152600260205260408082208054600160a060020a031916600160a060020a0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600c54600160a060020a03163314610c7657600080fd5b60188054600160a060020a031916600160a060020a0392909216919091179055565b60606000606060008060006015600088600160a060020a0316600160a060020a0316815260200190815260200160002054945084604051908082528060200260200182016040528015610cf5578160200160208202803883390190505b509350841515610d0757839550610d73565b505060145490506000805b8482108015610d2057508281105b15610d6f57600081815260166020526040902054600160a060020a0388811691161415610d6757808483815181101515610d5657fe5b602090810290910101526001909101905b600101610d12565b8395505b5050505050919050565b336000908152600d60205260408120548190819060ff1680610da95750600c54600160a060020a031633145b1515610db457600080fd5b6012548610610dc257600080fd5b6013805488908110610dd057fe5b6000918252602090912060059091020160038101549093508514610df657600383018590555b600283015460ff858116911614610e3b5760008460ff1610158015610e1e575060038460ff16105b1515610e2957600080fd5b60028301805460ff191660ff86161790555b60048301548614610e87576012805487908110610e5457fe5b9060005260206000209060040201915082600401549050610e758783611ddd565b610e7f8782611e2d565b600483018690555b50505050505050565b600c54600160a060020a03163314610ea757600080fd5b600160a060020a03166000908152600d60205260409020805460ff19169055565b60095490565b7f01ffc9a70000000000000000000000000000000000000000000000000000000081565b6000808080808080610f0333611dd5565b15610f0d57600080fd5b600e5460ff161515610f1e57600080fd5b6013805434985033975089908110610f3257fe5b9060005260206000209060050201945084600101548710151515610f5557600080fd5b600088815260016020526040902054600160a060020a0387811691161415610f7c57600080fd5b845460ff1615610f8b57600080fd5b60018501549350610fa2878563ffffffff611f0c16565b600089815260016020526040902054909350600160a060020a03169150610fc98289611f1e565b610fd38289611f82565b610fdd8689612089565b8786600160a060020a031683600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4600e5461104190606490610100900460ff1686028691900463ffffffff611f0c16565b604051909150600160a060020a0383169082156108fc029083906000818181858888f1935050505015801561107a573d6000803e3d6000fd5b5061108586846120d2565b6002850154600f9060ff166003811061109a57fe5b015484106110ba57845460ff1916600190811786556000908601556110cd565b6110c78560010154611cf1565b60018601555b60185474010000000000000000000000000000000000000000900460ff161561113f576040805160a081018252865460ff908116151582526001880154602083015260028801541691810191909152600386015460608201526004860154608082015261113f9087908a908790612116565b8454604080518a8152600160a060020a0380861660208301528916818301526060810187905260ff90921615156080830152517f9194a7d1733b512e9071b62b491b79442553b8579d4f6a5d7c4294634ed3e3029181900360a00190a15050505050505050565b601354819081106111b657600080fd5b816013818154811015156111c657fe5b600091825260209091206005909102015460ff1615156111e557600080fd5b6111f0858585612223565b5050505050565b600061120283611684565b821061120d57600080fd5b600160a060020a038316600090815260076020526040902080548390811061123157fe5b906000526020600020015490505b92915050565b6000806112506127bd565b336000908152600d602052604090205460ff16806112785750600c54600160a060020a031633145b151561128357600080fd5b60008460ff161015801561129a575060038460ff16105b15156112a557600080fd5b60128054879081106112b357fe5b90600052602060002090600402019250601380549050915060a06040519081016040528060001515815260200160175481526020018560ff168152602001866000191681526020018781525090506013819080600181540180825580915050906001820390600052602060002090600502016000909192909190915060008201518160000160006101000a81548160ff0219169083151502179055506020820151816001015560408201518160020160006101000a81548160ff021916908360ff16021790555060608201518160030190600019169055608082015181600401555050506113a18284611ddd565b6113ab30836122c6565b505050505050565b60008060008060006014868154811015156113ca57fe5b60009182526020808320600292909202909101805489845260169092526040909220546001909201549098600160a060020a039092169760ff9091169650945092505050565b6013548190811061142057600080fd5b8160138181548110151561143057fe5b600091825260209091206005909102015460ff16151561144f57600080fd5b6111f0858585612315565b600c54600160a060020a0316331461147157600080fd5b600e805460ff19169055565b60008060008060008060008060138981548110151561149857fe5b600091825260209091206005909102016004810154600380830154600284015460018501549495509293909260ff1691600f90839081106114d557fe5b015460008e815260016020526040902054949e939d929c50909a509850600160a060020a03909216965090945092505050565b600090815260016020526040902054600160a060020a0316151590565b600061152f610ec8565b821061153a57600080fd5b600980548390811061154857fe5b90600052602060002001549050919050565b336000908152600d602052604090205460ff16806115825750600c54600160a060020a031633145b151561158d57600080fd5b80600f60ff84166003811061159e57fe5b01555050565b336000908152600d602052604090205460ff16806115cc5750600c54600160a060020a031633145b15156115d757600080fd5b60188054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b600e54610100900460ff1690565b600081815260016020526040812054600160a060020a031680151561123f57600080fd5b600c54600160a060020a0316331461166057600080fd5b600160a060020a03166000908152600d60205260409020805460ff19166001179055565b6000600160a060020a038216151561169b57600080fd5b50600160a060020a031660009081526003602052604090205490565b600c54600160a060020a031633146116ce57600080fd5b600c54604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a2600c8054600160a060020a0319169055565b600c54600160a060020a031681565b600c54600160a060020a0316331461173e57600080fd5b600e805460ff19166001179055565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b8b5780601f10610b6057610100808354040283529160200191610b8b565b600c54600160a060020a031633146117c557600080fd5b6040513390303180156108fc02916000818181858888f193505050501580156117f2573d6000803e3d6000fd5b50565b600160a060020a03821633141561180b57600080fd5b336000818152600460209081526040808320600160a060020a03871680855290835292819020805460ff1916861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600c54600160a060020a0316331461189057600080fd5b60008160ff16101580156118a8575060088160ff1611155b15156118b357600080fd5b600e805460ff9092166101000261ff0019909216919091179055565b60145490565b6000806118e06127eb565b6000806012868154811015156118f257fe5b60009182526020909120600490910201805460408051606081019182905292935060f060020a8202926201000090920460ff169160018501918a9190839060039082845b81548152602001906001019080831161193657505050505091509450945094509450509193509193565b601854600160a060020a031690565b6013548290811061197f57600080fd5b8260138181548110151561198f57fe5b600091825260209091206005909102015460ff1615156119ae57600080fd5b6113ab86868686612331565b60606000606060008060006003600088600160a060020a0316600160a060020a0316815260200190815260200160002054945084604051908082528060200260200182016040528015611a17578160200160208202803883390190505b509350841515611a2957839550610d73565b505060135490506000805b8482108015611a4257508281105b15610d6f57600081815260016020526040902054600160a060020a0388811691161415611a8957808483815181101515611a7857fe5b602090810290910101526001909101905b600101611a34565b6060611a9c82611508565b1515611aa757600080fd5b6000828152600b602090815260409182902080548351601f600260001961010060018616150201909316929092049182018490048402810184019094528084529091830182828015611b3a5780601f10611b0f57610100808354040283529160200191611b3a565b820191906000526020600020905b815481529060010190602001808311611b1d57829003601f168201915b50505050509050919050565b611b4e61280a565b336000908152600d602052604090205460ff1680611b765750600c54600160a060020a031633145b1515611b8157600080fd5b600160f060020a0319821681526012805460018101808355600092909252825160049091027fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec344481018054602086015160ff16620100000262ff00001960f060020a90950461ffff19909216919091179390931692909217825560408401518492916113ab917fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec344590910190600361282e565b60125490565b600160a060020a03918216600090815260046020908152604080832093909416825291909152205460ff1690565b336000908152600d602052604081205460ff1680611c8e5750600c54600160a060020a031633145b1515611c9957600080fd5b6012805484908110611ca757fe5b60009182526020909120600490910201805461ffff191660f060020a909304929092179091555050565b600c54600160a060020a03163314611ce857600080fd5b6117f281612353565b600067016345785d8a0000821015611d1b57611d1482600263ffffffff6123c416565b9050610afa565b6706f05b59d3b20000821015611d4d57611d146002611d4184600363ffffffff6123c416565b9063ffffffff6123ed16565b670de0b6b3a7640000821015611d7357611d146003611d4184600463ffffffff6123c416565b674563918244f40000821015611d9957611d146004611d4184600563ffffffff6123c416565b678ac7230489e80000821015611dbf57611d146005611d4184600663ffffffff6123c416565b611d146006611d4184600763ffffffff6123c416565b6000903b1190565b805462010000900460ff1660038110611df557600080fd5b826001830160ff831660038110611e0857fe5b015550805460ff6201000080830482166001019091160262ff00001990911617905550565b600080601283815481101515611e3f57fe5b90600052602060002090600402019150600090505b815460ff6201000090910481169082161015611f0657836001830160ff831660038110611e7d57fe5b01541415611efe57815462010000900460ff90811660001901811690821614611ed8578154600183019060001960ff620100009092048216011660038110611ec157fe5b01546001830160ff831660038110611ed557fe5b01555b815460001960ff62010000808404821692909201160262ff000019909116178255611f06565b600101611e54565b50505050565b600082821115611f1857fe5b50900390565b81600160a060020a0316611f3182611625565b600160a060020a031614611f4457600080fd5b600081815260026020526040902054600160a060020a031615611f7e5760008181526002602052604090208054600160a060020a03191690555b5050565b6000806000611f918585612402565b600084815260086020908152604080832054600160a060020a0389168452600790925290912054909350611fcc90600163ffffffff611f0c16565b600160a060020a038616600090815260076020526040902080549193509083908110611ff457fe5b90600052602060002001549050806007600087600160a060020a0316600160a060020a031681526020019081526020016000208481548110151561203457fe5b6000918252602080832090910192909255600160a060020a038716815260079091526040902080549061206b90600019830161286c565b50600093845260086020526040808520859055908452909220555050565b6000612095838361248b565b50600160a060020a039091166000908152600760209081526040808320805460018101825590845282842081018590559383526008909152902055565b6000811115611f7e57604051600160a060020a0383169082156108fc029083906000818181858888f19350505050158015612111573d6000803e3d6000fd5b505050565b6000612120612890565b6014546040805180820190915286815290925060208101612141868661250e565b60ff9081169091526014805460018082018355600092835284517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec6002909302928301556020808601517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ed909301805460ff191693909516929092179093558582526016815260408083208054600160a060020a031916600160a060020a038d16908117909155835260159091529020549192506121ff9190612589565b600160a060020a039096166000908152601560205260409020959095555050505050565b61222d3382612596565b151561223857600080fd5b600160a060020a038316151561224d57600080fd5b600160a060020a038216151561226257600080fd5b61226c8382611f1e565b6122768382611f82565b6122808282612089565b8082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6122d082826125f5565b600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af015550565b612111838383602060405190810160405280600081525061196f565b61233c8484846111a6565b61234884848484612650565b1515611f0657600080fd5b600160a060020a038116151561236857600080fd5b600c54604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600c8054600160a060020a031916600160a060020a0392909216919091179055565b60008215156123d55750600061123f565b508181028183828115156123e557fe5b041461123f57fe5b600081838115156123fa57fe5b049392505050565b81600160a060020a031661241582611625565b600160a060020a03161461242857600080fd5b600160a060020a03821660009081526003602052604090205461245290600163ffffffff611f0c16565b600160a060020a039092166000908152600360209081526040808320949094559181526001909152208054600160a060020a0319169055565b600081815260016020526040902054600160a060020a0316156124ad57600080fd5b60008181526001602081815260408084208054600160a060020a031916600160a060020a03881690811790915584526003909152909120546124ee91612589565b600160a060020a0390921660009081526003602052604090209190915550565b60008060008360000151156125265760649250612581565b6040840151600a9250600f9060ff166003811061253f57fe5b01546804563918244f40000081151561255457fe5b04905061256d82670de0b6b3a764000087840204612589565b9150605a82111561257d57605a91505b8192505b505092915050565b8181018281101561123f57fe5b6000806125a283611625565b905080600160a060020a031684600160a060020a031614806125dd575083600160a060020a03166125d284610b95565b600160a060020a0316145b806125ed57506125ed8185611c38565b949350505050565b600160a060020a038216151561260a57600080fd5b6126148282612089565b6040518190600160a060020a038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60008061266585600160a060020a0316611dd5565b151561267457600191506127b4565b6040517f150b7a020000000000000000000000000000000000000000000000000000000081523360048201818152600160a060020a03898116602485015260448401889052608060648501908152875160848601528751918a169463150b7a0294938c938b938b93909160a490910190602085019080838360005b838110156127075781810151838201526020016126ef565b50505050905090810190601f1680156127345780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15801561275657600080fd5b505af115801561276a573d6000803e3d6000fd5b505050506040513d602081101561278057600080fd5b5051600160e060020a031981167f150b7a020000000000000000000000000000000000000000000000000000000014925090505b50949350505050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6060604051908101604052806003906020820280388339509192915050565b6040805160a081018252600080825260208201529081016128296127eb565b905290565b826003810192821561285c579160200282015b8281111561285c578251825591602001919060010190612841565b506128689291506128a7565b5090565b815481835581811115612111576000838152602090206121119181019083016128a7565b604080518082019091526000808252602082015290565b610a0491905b8082111561286857600081556001016128ad5600a165627a7a723058201fa0cedc23d23efd98ebd35730380347299846e08b318f5d1fd91b14cf65430a0029

Deployed Bytecode

0x6080604052600436106102445763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662173d658114610246578063011879db1461026f57806301ffc9a7146102a857806306fdde03146102ca578063081812fc146103545780630931ce6714610388578063095ea7b3146103af5780631102610e146103d3578063157cb62c146103f457806316244907146104655780631785f53c1461048957806318160ddd146104aa57806319fa8f50146104bf5780631a14e94a146104f157806323b872dd146104fc5780632f745c591461052657806330e656d81461054a578063422627c31461056b57806342842e0e146105b4578063439766ce146105de57806345d3cc81146105f35780634f558e791461064e5780634f6ccce714610666578063541bb3581461067e5780635675db9c1461069c578063595f40d6146106b65780636352211e146106e157806370480275146106f957806370a082311461071a578063715018a61461073b5780638da5cb5b146107505780638fda356d1461076557806395d89b411461077a5780639da9df3e1461078f578063a22cb465146107a4578063a437ab52146107ca578063a8575102146107e5578063afa5e0a9146107fa578063aff465721461086c578063b88d4fde14610881578063ba622ddc146108f0578063c87b56dd14610911578063dc5936f014610929578063dc667d0c1461094b578063e985e9c514610960578063ef739d0f14610987578063f2fde38b146109ac578063f337c2e1146109cd575b005b34801561025257600080fd5b5061025b6109e5565b604080519115158252519081900360200190f35b34801561027b57600080fd5b506102446004356fffffffffffffffffffffffffffffffff60243581169060443581169060643516610a07565b3480156102b457600080fd5b5061025b600160e060020a031960043516610adc565b3480156102d657600080fd5b506102df610aff565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610319578181015183820152602001610301565b50505050905090810190601f1680156103465780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561036057600080fd5b5061036c600435610b95565b60408051600160a060020a039092168252519081900360200190f35b34801561039457600080fd5b5061039d610bb0565b60408051918252519081900360200190f35b3480156103bb57600080fd5b50610244600160a060020a0360043516602435610bb6565b3480156103df57600080fd5b50610244600160a060020a0360043516610c5f565b34801561040057600080fd5b50610415600160a060020a0360043516610c98565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610451578181015183820152602001610439565b505050509050019250505060405180910390f35b34801561047157600080fd5b5061024460043560243560443560ff60643516610d7d565b34801561049557600080fd5b50610244600160a060020a0360043516610e90565b3480156104b657600080fd5b5061039d610ec8565b3480156104cb57600080fd5b506104d4610ece565b60408051600160e060020a03199092168252519081900360200190f35b610244600435610ef2565b34801561050857600080fd5b50610244600160a060020a03600435811690602435166044356111a6565b34801561053257600080fd5b5061039d600160a060020a03600435166024356111f7565b34801561055657600080fd5b5061024460043560243560ff60443516611245565b34801561057757600080fd5b506105836004356113b3565b60408051948552600160a060020a03909316602085015261ffff909116838301526060830152519081900360800190f35b3480156105c057600080fd5b50610244600160a060020a0360043581169060243516604435611410565b3480156105ea57600080fd5b5061024461145a565b3480156105ff57600080fd5b5061060b60043561147d565b60408051978852602088019690965260ff9094168686015260608601929092526080850152600160a060020a031660a084015260c0830152519081900360e00190f35b34801561065a57600080fd5b5061025b600435611508565b34801561067257600080fd5b5061039d600435611525565b34801561068a57600080fd5b5061024460ff6004351660243561155a565b3480156106a857600080fd5b5061024460043515156115a4565b3480156106c257600080fd5b506106cb611617565b6040805160ff9092168252519081900360200190f35b3480156106ed57600080fd5b5061036c600435611625565b34801561070557600080fd5b50610244600160a060020a0360043516611649565b34801561072657600080fd5b5061039d600160a060020a0360043516611684565b34801561074757600080fd5b506102446116b7565b34801561075c57600080fd5b5061036c611718565b34801561077157600080fd5b50610244611727565b34801561078657600080fd5b506102df61174d565b34801561079b57600080fd5b506102446117ae565b3480156107b057600080fd5b50610244600160a060020a036004351660243515156117f5565b3480156107d657600080fd5b5061024460ff60043516611879565b3480156107f157600080fd5b5061039d6118cf565b34801561080657600080fd5b506108126004356118d5565b60408051600160f060020a03198616815260ff8516602082015290810183606080838360005b83811015610850578181015183820152602001610838565b5050505090500182815260200194505050505060405180910390f35b34801561087857600080fd5b5061036c611960565b34801561088d57600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261024494600160a060020a03813581169560248035909216956044359536956084940191819084018382808284375094975061196f9650505050505050565b3480156108fc57600080fd5b50610415600160a060020a03600435166119ba565b34801561091d57600080fd5b506102df600435611a91565b34801561093557600080fd5b50610244600160f060020a031960043516611b46565b34801561095757600080fd5b5061039d611c32565b34801561096c57600080fd5b5061025b600160a060020a0360043581169060243516611c38565b34801561099357600080fd5b50610244600435600160f060020a031960243516611c66565b3480156109b857600080fd5b50610244600160a060020a0360043516611cd1565b3480156109d957600080fd5b5061039d600435611cf1565b60185474010000000000000000000000000000000000000000900460ff165b90565b610a1033611dd5565b15610a1a57600080fd5b601854610a3090600160a060020a031685610bb6565b601854604080517f011879db000000000000000000000000000000000000000000000000000000008152600481018790526fffffffffffffffffffffffffffffffff80871660248301528086166044830152841660648201529051600160a060020a039092169163011879db9160848082019260009290919082900301818387803b158015610abe57600080fd5b505af1158015610ad2573d6000803e3d6000fd5b5050505050505050565b600160e060020a0319811660009081526020819052604090205460ff165b919050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b8b5780601f10610b6057610100808354040283529160200191610b8b565b820191906000526020600020905b815481529060010190602001808311610b6e57829003601f168201915b5050505050905090565b600090815260026020526040902054600160a060020a031690565b60135490565b6000610bc182611625565b9050600160a060020a038381169082161415610bdc57600080fd5b33600160a060020a0382161480610bf85750610bf88133611c38565b1515610c0357600080fd5b6000828152600260205260408082208054600160a060020a031916600160a060020a0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600c54600160a060020a03163314610c7657600080fd5b60188054600160a060020a031916600160a060020a0392909216919091179055565b60606000606060008060006015600088600160a060020a0316600160a060020a0316815260200190815260200160002054945084604051908082528060200260200182016040528015610cf5578160200160208202803883390190505b509350841515610d0757839550610d73565b505060145490506000805b8482108015610d2057508281105b15610d6f57600081815260166020526040902054600160a060020a0388811691161415610d6757808483815181101515610d5657fe5b602090810290910101526001909101905b600101610d12565b8395505b5050505050919050565b336000908152600d60205260408120548190819060ff1680610da95750600c54600160a060020a031633145b1515610db457600080fd5b6012548610610dc257600080fd5b6013805488908110610dd057fe5b6000918252602090912060059091020160038101549093508514610df657600383018590555b600283015460ff858116911614610e3b5760008460ff1610158015610e1e575060038460ff16105b1515610e2957600080fd5b60028301805460ff191660ff86161790555b60048301548614610e87576012805487908110610e5457fe5b9060005260206000209060040201915082600401549050610e758783611ddd565b610e7f8782611e2d565b600483018690555b50505050505050565b600c54600160a060020a03163314610ea757600080fd5b600160a060020a03166000908152600d60205260409020805460ff19169055565b60095490565b7f01ffc9a70000000000000000000000000000000000000000000000000000000081565b6000808080808080610f0333611dd5565b15610f0d57600080fd5b600e5460ff161515610f1e57600080fd5b6013805434985033975089908110610f3257fe5b9060005260206000209060050201945084600101548710151515610f5557600080fd5b600088815260016020526040902054600160a060020a0387811691161415610f7c57600080fd5b845460ff1615610f8b57600080fd5b60018501549350610fa2878563ffffffff611f0c16565b600089815260016020526040902054909350600160a060020a03169150610fc98289611f1e565b610fd38289611f82565b610fdd8689612089565b8786600160a060020a031683600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4600e5461104190606490610100900460ff1686028691900463ffffffff611f0c16565b604051909150600160a060020a0383169082156108fc029083906000818181858888f1935050505015801561107a573d6000803e3d6000fd5b5061108586846120d2565b6002850154600f9060ff166003811061109a57fe5b015484106110ba57845460ff1916600190811786556000908601556110cd565b6110c78560010154611cf1565b60018601555b60185474010000000000000000000000000000000000000000900460ff161561113f576040805160a081018252865460ff908116151582526001880154602083015260028801541691810191909152600386015460608201526004860154608082015261113f9087908a908790612116565b8454604080518a8152600160a060020a0380861660208301528916818301526060810187905260ff90921615156080830152517f9194a7d1733b512e9071b62b491b79442553b8579d4f6a5d7c4294634ed3e3029181900360a00190a15050505050505050565b601354819081106111b657600080fd5b816013818154811015156111c657fe5b600091825260209091206005909102015460ff1615156111e557600080fd5b6111f0858585612223565b5050505050565b600061120283611684565b821061120d57600080fd5b600160a060020a038316600090815260076020526040902080548390811061123157fe5b906000526020600020015490505b92915050565b6000806112506127bd565b336000908152600d602052604090205460ff16806112785750600c54600160a060020a031633145b151561128357600080fd5b60008460ff161015801561129a575060038460ff16105b15156112a557600080fd5b60128054879081106112b357fe5b90600052602060002090600402019250601380549050915060a06040519081016040528060001515815260200160175481526020018560ff168152602001866000191681526020018781525090506013819080600181540180825580915050906001820390600052602060002090600502016000909192909190915060008201518160000160006101000a81548160ff0219169083151502179055506020820151816001015560408201518160020160006101000a81548160ff021916908360ff16021790555060608201518160030190600019169055608082015181600401555050506113a18284611ddd565b6113ab30836122c6565b505050505050565b60008060008060006014868154811015156113ca57fe5b60009182526020808320600292909202909101805489845260169092526040909220546001909201549098600160a060020a039092169760ff9091169650945092505050565b6013548190811061142057600080fd5b8160138181548110151561143057fe5b600091825260209091206005909102015460ff16151561144f57600080fd5b6111f0858585612315565b600c54600160a060020a0316331461147157600080fd5b600e805460ff19169055565b60008060008060008060008060138981548110151561149857fe5b600091825260209091206005909102016004810154600380830154600284015460018501549495509293909260ff1691600f90839081106114d557fe5b015460008e815260016020526040902054949e939d929c50909a509850600160a060020a03909216965090945092505050565b600090815260016020526040902054600160a060020a0316151590565b600061152f610ec8565b821061153a57600080fd5b600980548390811061154857fe5b90600052602060002001549050919050565b336000908152600d602052604090205460ff16806115825750600c54600160a060020a031633145b151561158d57600080fd5b80600f60ff84166003811061159e57fe5b01555050565b336000908152600d602052604090205460ff16806115cc5750600c54600160a060020a031633145b15156115d757600080fd5b60188054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b600e54610100900460ff1690565b600081815260016020526040812054600160a060020a031680151561123f57600080fd5b600c54600160a060020a0316331461166057600080fd5b600160a060020a03166000908152600d60205260409020805460ff19166001179055565b6000600160a060020a038216151561169b57600080fd5b50600160a060020a031660009081526003602052604090205490565b600c54600160a060020a031633146116ce57600080fd5b600c54604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a2600c8054600160a060020a0319169055565b600c54600160a060020a031681565b600c54600160a060020a0316331461173e57600080fd5b600e805460ff19166001179055565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b8b5780601f10610b6057610100808354040283529160200191610b8b565b600c54600160a060020a031633146117c557600080fd5b6040513390303180156108fc02916000818181858888f193505050501580156117f2573d6000803e3d6000fd5b50565b600160a060020a03821633141561180b57600080fd5b336000818152600460209081526040808320600160a060020a03871680855290835292819020805460ff1916861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600c54600160a060020a0316331461189057600080fd5b60008160ff16101580156118a8575060088160ff1611155b15156118b357600080fd5b600e805460ff9092166101000261ff0019909216919091179055565b60145490565b6000806118e06127eb565b6000806012868154811015156118f257fe5b60009182526020909120600490910201805460408051606081019182905292935060f060020a8202926201000090920460ff169160018501918a9190839060039082845b81548152602001906001019080831161193657505050505091509450945094509450509193509193565b601854600160a060020a031690565b6013548290811061197f57600080fd5b8260138181548110151561198f57fe5b600091825260209091206005909102015460ff1615156119ae57600080fd5b6113ab86868686612331565b60606000606060008060006003600088600160a060020a0316600160a060020a0316815260200190815260200160002054945084604051908082528060200260200182016040528015611a17578160200160208202803883390190505b509350841515611a2957839550610d73565b505060135490506000805b8482108015611a4257508281105b15610d6f57600081815260016020526040902054600160a060020a0388811691161415611a8957808483815181101515611a7857fe5b602090810290910101526001909101905b600101611a34565b6060611a9c82611508565b1515611aa757600080fd5b6000828152600b602090815260409182902080548351601f600260001961010060018616150201909316929092049182018490048402810184019094528084529091830182828015611b3a5780601f10611b0f57610100808354040283529160200191611b3a565b820191906000526020600020905b815481529060010190602001808311611b1d57829003601f168201915b50505050509050919050565b611b4e61280a565b336000908152600d602052604090205460ff1680611b765750600c54600160a060020a031633145b1515611b8157600080fd5b600160f060020a0319821681526012805460018101808355600092909252825160049091027fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec344481018054602086015160ff16620100000262ff00001960f060020a90950461ffff19909216919091179390931692909217825560408401518492916113ab917fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec344590910190600361282e565b60125490565b600160a060020a03918216600090815260046020908152604080832093909416825291909152205460ff1690565b336000908152600d602052604081205460ff1680611c8e5750600c54600160a060020a031633145b1515611c9957600080fd5b6012805484908110611ca757fe5b60009182526020909120600490910201805461ffff191660f060020a909304929092179091555050565b600c54600160a060020a03163314611ce857600080fd5b6117f281612353565b600067016345785d8a0000821015611d1b57611d1482600263ffffffff6123c416565b9050610afa565b6706f05b59d3b20000821015611d4d57611d146002611d4184600363ffffffff6123c416565b9063ffffffff6123ed16565b670de0b6b3a7640000821015611d7357611d146003611d4184600463ffffffff6123c416565b674563918244f40000821015611d9957611d146004611d4184600563ffffffff6123c416565b678ac7230489e80000821015611dbf57611d146005611d4184600663ffffffff6123c416565b611d146006611d4184600763ffffffff6123c416565b6000903b1190565b805462010000900460ff1660038110611df557600080fd5b826001830160ff831660038110611e0857fe5b015550805460ff6201000080830482166001019091160262ff00001990911617905550565b600080601283815481101515611e3f57fe5b90600052602060002090600402019150600090505b815460ff6201000090910481169082161015611f0657836001830160ff831660038110611e7d57fe5b01541415611efe57815462010000900460ff90811660001901811690821614611ed8578154600183019060001960ff620100009092048216011660038110611ec157fe5b01546001830160ff831660038110611ed557fe5b01555b815460001960ff62010000808404821692909201160262ff000019909116178255611f06565b600101611e54565b50505050565b600082821115611f1857fe5b50900390565b81600160a060020a0316611f3182611625565b600160a060020a031614611f4457600080fd5b600081815260026020526040902054600160a060020a031615611f7e5760008181526002602052604090208054600160a060020a03191690555b5050565b6000806000611f918585612402565b600084815260086020908152604080832054600160a060020a0389168452600790925290912054909350611fcc90600163ffffffff611f0c16565b600160a060020a038616600090815260076020526040902080549193509083908110611ff457fe5b90600052602060002001549050806007600087600160a060020a0316600160a060020a031681526020019081526020016000208481548110151561203457fe5b6000918252602080832090910192909255600160a060020a038716815260079091526040902080549061206b90600019830161286c565b50600093845260086020526040808520859055908452909220555050565b6000612095838361248b565b50600160a060020a039091166000908152600760209081526040808320805460018101825590845282842081018590559383526008909152902055565b6000811115611f7e57604051600160a060020a0383169082156108fc029083906000818181858888f19350505050158015612111573d6000803e3d6000fd5b505050565b6000612120612890565b6014546040805180820190915286815290925060208101612141868661250e565b60ff9081169091526014805460018082018355600092835284517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec6002909302928301556020808601517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ed909301805460ff191693909516929092179093558582526016815260408083208054600160a060020a031916600160a060020a038d16908117909155835260159091529020549192506121ff9190612589565b600160a060020a039096166000908152601560205260409020959095555050505050565b61222d3382612596565b151561223857600080fd5b600160a060020a038316151561224d57600080fd5b600160a060020a038216151561226257600080fd5b61226c8382611f1e565b6122768382611f82565b6122808282612089565b8082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6122d082826125f5565b600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af015550565b612111838383602060405190810160405280600081525061196f565b61233c8484846111a6565b61234884848484612650565b1515611f0657600080fd5b600160a060020a038116151561236857600080fd5b600c54604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600c8054600160a060020a031916600160a060020a0392909216919091179055565b60008215156123d55750600061123f565b508181028183828115156123e557fe5b041461123f57fe5b600081838115156123fa57fe5b049392505050565b81600160a060020a031661241582611625565b600160a060020a03161461242857600080fd5b600160a060020a03821660009081526003602052604090205461245290600163ffffffff611f0c16565b600160a060020a039092166000908152600360209081526040808320949094559181526001909152208054600160a060020a0319169055565b600081815260016020526040902054600160a060020a0316156124ad57600080fd5b60008181526001602081815260408084208054600160a060020a031916600160a060020a03881690811790915584526003909152909120546124ee91612589565b600160a060020a0390921660009081526003602052604090209190915550565b60008060008360000151156125265760649250612581565b6040840151600a9250600f9060ff166003811061253f57fe5b01546804563918244f40000081151561255457fe5b04905061256d82670de0b6b3a764000087840204612589565b9150605a82111561257d57605a91505b8192505b505092915050565b8181018281101561123f57fe5b6000806125a283611625565b905080600160a060020a031684600160a060020a031614806125dd575083600160a060020a03166125d284610b95565b600160a060020a0316145b806125ed57506125ed8185611c38565b949350505050565b600160a060020a038216151561260a57600080fd5b6126148282612089565b6040518190600160a060020a038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60008061266585600160a060020a0316611dd5565b151561267457600191506127b4565b6040517f150b7a020000000000000000000000000000000000000000000000000000000081523360048201818152600160a060020a03898116602485015260448401889052608060648501908152875160848601528751918a169463150b7a0294938c938b938b93909160a490910190602085019080838360005b838110156127075781810151838201526020016126ef565b50505050905090810190601f1680156127345780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15801561275657600080fd5b505af115801561276a573d6000803e3d6000fd5b505050506040513d602081101561278057600080fd5b5051600160e060020a031981167f150b7a020000000000000000000000000000000000000000000000000000000014925090505b50949350505050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6060604051908101604052806003906020820280388339509192915050565b6040805160a081018252600080825260208201529081016128296127eb565b905290565b826003810192821561285c579160200282015b8281111561285c578251825591602001919060010190612841565b506128689291506128a7565b5090565b815481835581811115612111576000838152602090206121119181019083016128a7565b604080518082019091526000808252602082015290565b610a0491905b8082111561286857600081556001016128ad5600a165627a7a723058201fa0cedc23d23efd98ebd35730380347299846e08b318f5d1fd91b14cf65430a0029

Swarm Source

bzzr://1fa0cedc23d23efd98ebd35730380347299846e08b318f5d1fd91b14cf65430a
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.