ETH Price: $2,025.56 (-1.15%)

Contract

0x37512EEc5e3EE7843a1aB59ef99Fb52589037774
 

Overview

ETH Balance

0.000075 ETH

Eth Value

$0.15 (@ $2,025.56/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw61585572018-08-16 15:42:522414 days ago1534434172IN
0x37512EEc...589037774
0 ETH0.000102723.34375
Withdraw61585572018-08-16 15:42:522414 days ago1534434172IN
0x37512EEc...589037774
0 ETH0.000073273.1
Withdraw Payment...61585312018-08-16 15:33:242414 days ago1534433604IN
0x37512EEc...589037774
0 ETH0.000200937.2
End Auction59708872018-07-15 21:01:532446 days ago1531688513IN
0x37512EEc...589037774
0 ETH0.00033948
Bid58541222018-06-25 22:23:012466 days ago1529965381IN
0x37512EEc...589037774
0.01 ETH0.000180063
End Auction58079162018-06-18 0:37:082474 days ago1529282228IN
0x37512EEc...589037774
0 ETH0.000084852
End Auction58079152018-06-18 0:35:402474 days ago1529282140IN
0x37512EEc...589037774
0 ETH0.000114852
End Auction58079122018-06-18 0:35:202474 days ago1529282120IN
0x37512EEc...589037774
0 ETH0.000057421
End Auction58077362018-06-17 23:55:562474 days ago1529279756IN
0x37512EEc...589037774
0 ETH0.000057421
End Auction58077332018-06-17 23:55:322474 days ago1529279732IN
0x37512EEc...589037774
0 ETH0.000057421
End Auction58077312018-06-17 23:54:542474 days ago1529279694IN
0x37512EEc...589037774
0 ETH0.000057421
End Auction58077302018-06-17 23:54:332474 days ago1529279673IN
0x37512EEc...589037774
0 ETH0.000057421
End Auction58077302018-06-17 23:54:332474 days ago1529279673IN
0x37512EEc...589037774
0 ETH0.000057421
End Auction58077262018-06-17 23:54:072474 days ago1529279647IN
0x37512EEc...589037774
0 ETH0.000057421
End Auction58077242018-06-17 23:53:392474 days ago1529279619IN
0x37512EEc...589037774
0 ETH0.000072421
Bid58074862018-06-17 22:59:152474 days ago1529276355IN
0x37512EEc...589037774
0.01 ETH0.000060021
Bid58065992018-06-17 19:23:142474 days ago1529263394IN
0x37512EEc...589037774
0.0133 ETH0.00009042
Bid57729472018-06-11 23:57:072480 days ago1528761427IN
0x37512EEc...589037774
0.01 ETH0.000180063
Bid57727512018-06-11 23:05:292480 days ago1528758329IN
0x37512EEc...589037774
0.0234 ETH0.00009042
Bid57727482018-06-11 23:05:002480 days ago1528758300IN
0x37512EEc...589037774
0.0234 ETH0.00009042
Bid57727452018-06-11 23:04:082480 days ago1528758248IN
0x37512EEc...589037774
0.0234 ETH0.00009042
Bid57711192018-06-11 16:19:322480 days ago1528733972IN
0x37512EEc...589037774
0.0176 ETH0.000226015
Bid57711172018-06-11 16:19:132480 days ago1528733953IN
0x37512EEc...589037774
0.0176 ETH0.000226015
Bid57711142018-06-11 16:18:162480 days ago1528733896IN
0x37512EEc...589037774
0.0176 ETH0.000226015
Bid57711122018-06-11 16:17:462480 days ago1528733866IN
0x37512EEc...589037774
0.0176 ETH0.000226015
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer61585572018-08-16 15:42:522414 days ago1534434172
0x37512EEc...589037774
0.0585 ETH
Transfer58541222018-06-25 22:23:012466 days ago1529965381
0x37512EEc...589037774
0.0095 ETH
Transfer58074862018-06-17 22:59:152474 days ago1529276355
0x37512EEc...589037774
0.0095 ETH
Transfer58065992018-06-17 19:23:142474 days ago1529263394
0x37512EEc...589037774
0.012635 ETH
Transfer57729472018-06-11 23:57:072480 days ago1528761427
0x37512EEc...589037774
0.0095 ETH
Transfer57727512018-06-11 23:05:292480 days ago1528758329
0x37512EEc...589037774
0.02223 ETH
Transfer57727482018-06-11 23:05:002480 days ago1528758300
0x37512EEc...589037774
0.02223 ETH
Transfer57727452018-06-11 23:04:082480 days ago1528758248
0x37512EEc...589037774
0.02223 ETH
Transfer57711192018-06-11 16:19:322480 days ago1528733972
0x37512EEc...589037774
0.01672 ETH
Transfer57711172018-06-11 16:19:132480 days ago1528733953
0x37512EEc...589037774
0.01672 ETH
Transfer57711142018-06-11 16:18:162480 days ago1528733896
0x37512EEc...589037774
0.01672 ETH
Transfer57711122018-06-11 16:17:462480 days ago1528733866
0x37512EEc...589037774
0.01672 ETH
Transfer57707272018-06-11 14:44:362480 days ago1528728276
0x37512EEc...589037774
0.012635 ETH
Transfer57707252018-06-11 14:44:222480 days ago1528728262
0x37512EEc...589037774
0.012635 ETH
Transfer57707202018-06-11 14:42:232480 days ago1528728143
0x37512EEc...589037774
0.012635 ETH
Transfer57707172018-06-11 14:42:002480 days ago1528728120
0x37512EEc...589037774
0.012635 ETH
Transfer57707152018-06-11 14:41:372480 days ago1528728097
0x37512EEc...589037774
0.0095 ETH
Transfer57707122018-06-11 14:41:082480 days ago1528728068
0x37512EEc...589037774
0.0095 ETH
Transfer57707092018-06-11 14:40:302480 days ago1528728030
0x37512EEc...589037774
0.0095 ETH
Transfer57707082018-06-11 14:40:272480 days ago1528728027
0x37512EEc...589037774
0.0095 ETH
Transfer57704832018-06-11 13:43:262480 days ago1528724606
0x37512EEc...589037774
0.0095 ETH
Transfer57704792018-06-11 13:41:372480 days ago1528724497
0x37512EEc...589037774
0.0095 ETH
Transfer57701892018-06-11 12:23:202480 days ago1528719800
0x37512EEc...589037774
0.0095 ETH
Transfer57701812018-06-11 12:20:572480 days ago1528719657
0x37512EEc...589037774
0.0095 ETH
Transfer57327892018-06-04 20:52:592487 days ago1528145579
0x37512EEc...589037774
0.012635 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AuctionManager

Compiler Version
v0.4.23+commit.124ca40d

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-05-04
*/

pragma solidity ^0.4.21;

/// @author Luis Freitas, Miguel Amaral (https://repop.world)
contract REPOPAccessControl {
    address public ceoAddress;
    address public cfoAddress;
    address public cooAddress;

    bool public paused = false;

    modifier onlyCEO() {
        require(msg.sender == ceoAddress);
        _;
    }

    modifier onlyCFO() {
        require(msg.sender == cfoAddress);
        _;
    }

    modifier onlyCOO() {
        require(msg.sender == cooAddress);
        _;
    }

    modifier onlyCLevel() {
        require(
            msg.sender == cooAddress ||
            msg.sender == ceoAddress ||
            msg.sender == cfoAddress
        );
        _;
    }

    function setCEO(address _newCEO) external onlyCEO {
        require(_newCEO != address(0));

        ceoAddress = _newCEO;
    }

    function setCFO(address _newCFO) external onlyCEO {
        require(_newCFO != address(0));

        cfoAddress = _newCFO;
    }

    function setCOO(address _newCOO) external onlyCEO {
        require(_newCOO != address(0));

        cooAddress = _newCOO;
    }

    modifier whenNotPaused() {
        require(!paused);
        _;
    }

    modifier whenPaused {
        require(paused);
        _;
    }

    function pause() external onlyCLevel whenNotPaused {
        paused = true;
    }

    function unpause() public onlyCEO whenPaused {

        paused = false;
    }
}

contract PullPayment {
  mapping(address => uint) public payments;

  function asyncSend(address dest, uint amount) internal {
    payments[dest] += amount;
  }

  function withdrawPayments() external {
    uint payment = payments[msg.sender];
    payments[msg.sender] = 0;
    if (!msg.sender.send(payment)) {
      payments[msg.sender] = payment;
    }
  }
}


/// @author Dieter Shirley <[email protected]> (https://github.com/dete)
contract ERC721 {

  function approve(address _to, uint256 _tokenId) public;
  function balanceOf(address _owner) public view returns (uint256 balance);
  function implementsERC721() public pure returns (bool);
  function ownerOf(uint256 _tokenId) public view returns (address addr);
  function takeOwnership(uint256 _tokenId) public;
  function totalSupply() public view returns (uint256 total);
  function transferFrom(address _from, address _to, uint256 _tokenId) public;
  function transfer(address _to, uint256 _tokenId) public;
  function tokenMetadata(uint256 _tokenId) public view returns (string infoUrl);

  event Transfer(address indexed from, address indexed to, uint256 tokenId);
  event Approval(address indexed owner, address indexed approved, uint256 tokenId);
  function supportsInterface(bytes4 _interfaceID) external view returns (bool);
}

library SafeMath {

  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    assert(c / a == b);
    return c;
  }

  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 c;
  }

  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract MetadataContract{

    function getMetadata(uint256 _tokenId) public view returns (bytes32[4] buffer, uint256 count) {
        buffer[0] = "https://meta.repop.world/";
        buffer[1] = uintToBytes(_tokenId);
        count = 64;
    }

      function _memcpy(uint _dest, uint _src, uint _len) private view {

        for(; _len >= 32; _len -= 32) {
            assembly {
                mstore(_dest, mload(_src))
            }
            _dest += 32;
            _src += 32;
        }

        uint256 mask = 256 ** (32 - _len) - 1;
        assembly {
            let srcpart := and(mload(_src), not(mask))
            let destpart := and(mload(_dest), mask)
            mstore(_dest, or(destpart, srcpart))
        }
    }

    function _toString(bytes32[4] _rawBytes, uint256 _stringLength) private view returns (string) {
        var outputString = new string(_stringLength);
        uint256 outputPtr;
        uint256 bytesPtr;

        assembly {
            outputPtr := add(outputString, 32)
            bytesPtr := _rawBytes
        }

        _memcpy(outputPtr, bytesPtr, _stringLength);

        return outputString;
    }

    function getMetadataUrl(uint256 _tokenId) external view returns (string infoUrl) {
        bytes32[4] memory buffer;
        uint256 count;
        (buffer, count) = getMetadata(_tokenId);

        return _toString(buffer, count);
    }

    function uintToBytes(uint v) public view returns (bytes32 ret) {
        if (v == 0) {
            ret = '0';
        }
        else {
            while (v > 0) {
                ret = bytes32(uint(ret) / (2 ** 8));
                ret |= bytes32(((v % 10) + 48) * 2 ** (8 * 31));
                v /= 10;
            }
        }
        return ret;
    }
}


/// @author Luis Freitas, Miguel Amaral (https://repop.world)
contract REPOPERC721 is ERC721, REPOPAccessControl{

  MetadataContract public metadataContract;

  bytes4 constant InterfaceSignature_ERC165 =
      bytes4(keccak256('supportsInterface(bytes4)'));

  bytes4 constant InterfaceSignature_ERC721 =
      bytes4(keccak256('name()')) ^
      bytes4(keccak256('symbol()')) ^
      bytes4(keccak256('totalSupply()')) ^
      bytes4(keccak256('balanceOf(address)')) ^
      bytes4(keccak256('ownerOf(uint256)')) ^
      bytes4(keccak256('approve(address,uint256)')) ^
      bytes4(keccak256('transfer(address,uint256)')) ^
      bytes4(keccak256('transferFrom(address,address,uint256)')) ^
      bytes4(keccak256('tokensOfOwner(address)')) ^
      bytes4(keccak256('tokenMetadata(uint256)'));

    function tokenMetadata(uint256 _tokenId) public view returns (string infoUrl) {
      require(metadataContract != address(0));
      require(_tokenId >= 0 && _tokenId <= pops.length);

      return metadataContract.getMetadataUrl(_tokenId);
    }

    function setMetadataContractAddress(address contractAddress) public onlyCEO{
      require(contractAddress != address(0));
      metadataContract = MetadataContract(contractAddress);
    }

    string public constant name = "REPOP WORLD";
    string public constant symbol = "POP";

    function supportsInterface(bytes4 _interfaceID) external view returns (bool)
    {
        return ((_interfaceID == InterfaceSignature_ERC165) || (_interfaceID == InterfaceSignature_ERC721));
    }

    function approve(address _to, uint256 _tokenId) public whenNotPaused{

        require(_owns(msg.sender, _tokenId));

        popIndexToApproved[_tokenId] = _to;

        emit Approval(msg.sender, _to, _tokenId);
    }

    function balanceOf(address _owner) public view returns (uint256 balance){
        return ownershipTokenCount[_owner];
    }

    function implementsERC721() public pure returns (bool){
        return true;
    }

    function ownerOf(uint256 _tokenId) public view returns (address owner) {
        owner = popIndexToOwner[_tokenId];
        require(owner != address(0));
    }

    function takeOwnership(uint256 _tokenId) public {
        address currentOwner = ownerOf(_tokenId);
        address newOwner = msg.sender;

        require(_addressNotNull(newOwner));
        require(_approved(newOwner, _tokenId));

        _transfer(newOwner, _tokenId);
        emit Transfer(currentOwner, newOwner, _tokenId);
    }

    function tokensOfOwner(address _owner) external view returns(uint256[] ownerTokens) {
        uint256 tokenCount = balanceOf(_owner);
        if (tokenCount == 0) {

            return new uint256[](0);
        } else {
            uint256[] memory result = new uint256[](tokenCount);
            uint256 totalPops = totalSupply();
            uint256 resultIndex = 0;
            uint256 popId;

            for (popId = 1; popId <= totalPops; popId++) {
                if (popIndexToOwner[popId] == _owner) {
                    result[resultIndex] = popId;
                    resultIndex++;
                }
            }
            return result;
        }
    }

    function totalSupply() public view returns (uint256 total) {
        return pops.length;
    }

    function transfer(address _to, uint256 _tokenId ) public whenNotPaused{
      require(_owns(msg.sender, _tokenId));
      require(_addressNotNull(_to));

      _transfer(_to, _tokenId);

      emit Transfer(msg.sender, _to, _tokenId);
    }

    function transferFrom(address _from, address _to, uint256 _tokenId) public whenNotPaused{
        require(_owns(_from, _tokenId));
        require(_approved(msg.sender, _tokenId));
        require(_addressNotNull(_to));

        _transfer(_to, _tokenId);

        emit Transfer(_from, _to, _tokenId);
    }


    function _addressNotNull(address _to) private pure returns (bool){
        return _to != address(0);
    }

    function _approved(address _to, uint256 _tokenId) private view returns (bool) {
        return popIndexToApproved[_tokenId] == _to;
    }

    function _owns(address claimant, uint256 _tokenId) private view returns (bool) {
        return claimant == popIndexToOwner[_tokenId];
    }

    function _transfer(address _to, uint256 _tokenID) internal {
        address owner = popIndexToOwner[_tokenID];
        ownershipTokenCount[owner] = ownershipTokenCount[owner] - 1 ;
        popIndexToApproved[_tokenID] = 0;
        popIndexToOwner[_tokenID] = _to;
        ownershipTokenCount[_to] = ownershipTokenCount[_to] + 1;
    }

    event Birth(address owner, uint256 popId, uint256 aParentId, uint256 bParentId, uint256 genes);
    event Transfer(address from, address to, uint256 tokenId);

    struct Pop {
      uint256 genes;
      uint64 birthTime;
      uint64 cooldownEndTimestamp;
      uint32 aParentId;
      uint32 bParentId;
      bytes32 popName;
      uint16 cooldownIndex;
      uint16 generation;
    }

    uint32[14] public cooldowns = [
        uint32(10 minutes),
        uint32(20 minutes),
        uint32(40 minutes),
        uint32(1 hours),
        uint32(2 hours),
        uint32(3 hours),
        uint32(4 hours),
        uint32(5 hours),
        uint32(6 hours),
        uint32(12 hours),
        uint32(1 days),
        uint32(3 days),
        uint32(5 days),
        uint32(7 days)
    ];

    Pop[] public pops;

    mapping (uint256 => address) public popIndexToOwner;
    mapping (address => uint256) public ownershipTokenCount;
    mapping (uint256 => address) public popIndexToApproved;
    mapping (uint256 => uint256) public genesToTokenId;

    function getPop(uint256 _popId) public view
                    returns (
                                bool isReady,
                                uint256 genes,
                                uint64 birthTime,
                                uint64 cooldownEndTimestamp,
                                uint32 aParentId,
                                uint32 bParentId,
                                bytes32 popName,
                                uint16 cooldownIndex,
                                uint16 generation){
        Pop memory pop = pops[_popId];
        return(
                isReady = (pop.cooldownEndTimestamp <= now),
                pop.genes,
                pop.birthTime,
                pop.cooldownEndTimestamp,
                pop.aParentId,
                pop.bParentId,
                pop.popName,
                pop.cooldownIndex,
                pop.generation);
    }


    function createNewPop(uint256 genes, string popName) public onlyCLevel whenNotPaused{
        bytes32 name32 = stringToBytes32(popName);
        uint256 index = pops.push(Pop(genes,uint64(now),1,0,0,name32,0,0)) -1;

        emit Birth(msg.sender,index,0,0,genes);

        genesToTokenId[genes] = index;

        popIndexToOwner[index] = msg.sender;
        ownershipTokenCount[msg.sender] = ownershipTokenCount[msg.sender]+1;
    }

    function _triggerCooldown(Pop storage _pop) internal {
        _pop.cooldownEndTimestamp = uint64(now + cooldowns[_pop.cooldownIndex]);
    }

    function stringToBytes32(string memory source) internal pure returns (bytes32 result) {
        bytes memory tempEmptyStringTest = bytes(source);
        if (tempEmptyStringTest.length == 0) {
            return 0x0;
        }
        assembly {
            result := mload(add(source, 32))
        }
    }

    function setPopNameOriginal(uint256 popId, string newName) external onlyCLevel{
      Pop storage pop = pops[popId];
      require(pop.generation == 0);
      bytes32 name32 = stringToBytes32(newName);
      pop.popName = name32;
    }

    function setDNA(uint256 popId, uint256 newDna) external onlyCLevel{
      require(_owns(msg.sender, popId));
      Pop storage pop = pops[popId];
      pop.genes = newDna;
    }

}

contract CarefulTransfer {
    uint constant suggestedExtraGasToIncludeWithSends = 23000;

    function carefulSendWithFixedGas(
        address _toAddress,
        uint _valueWei,
        uint _extraGasIncluded
    ) internal returns (bool success) {
        return _toAddress.call.value(_valueWei).gas(_extraGasIncluded)();
    }
}

contract MoneyManager is PullPayment, CarefulTransfer, REPOPAccessControl {

    function _repopTransaction(address _receiver, uint256 _amountWei, uint256 _marginPerThousandForDevelopers) internal {
        uint256 commissionWei = (_amountWei * _marginPerThousandForDevelopers) / 1000;
        uint256 compensationWei = _amountWei - commissionWei;

        if( ! carefulSendWithFixedGas(_receiver,compensationWei,23000)) {
            asyncSend(_receiver, compensationWei);
        }
    }

    function withdraw(uint amount) external onlyCFO {
        require(amount < address(this).balance);
        cfoAddress.transfer(amount);
    }

    function getBalance() public view returns (uint256 balance) {
        return address(this).balance;
    }
}

library RoundMoneyNicely {
    function roundMoneyDownNicely(uint _rawValueWei) internal pure
    returns (uint nicerValueWei) {
        if (_rawValueWei < 1 finney) {
            return _rawValueWei;
        } else if (_rawValueWei < 10 finney) {
            return 10 szabo * (_rawValueWei / 10 szabo);
        } else if (_rawValueWei < 100 finney) {
            return 100 szabo * (_rawValueWei / 100 szabo);
        } else if (_rawValueWei < 1 ether) {
            return 1 finney * (_rawValueWei / 1 finney);
        } else if (_rawValueWei < 10 ether) {
            return 10 finney * (_rawValueWei / 10 finney);
        } else if (_rawValueWei < 100 ether) {
            return 100 finney * (_rawValueWei / 100 finney);
        } else if (_rawValueWei < 1000 ether) {
            return 1 ether * (_rawValueWei / 1 ether);
        } else if (_rawValueWei < 10000 ether) {
            return 10 ether * (_rawValueWei / 10 ether);
        } else {
            return _rawValueWei;
        }
    }

    function roundMoneyUpToWholeFinney(uint _valueWei) pure internal
    returns (uint valueFinney) {
        return (1 finney + _valueWei - 1 wei) / 1 finney;
    }
}

contract AuctionManager is MoneyManager {
    event Bid(address bidder, uint256 bid, uint256 auctionId);
    event NewAuction( uint256 itemForAuctionID, uint256 durationSeconds, address seller);
    event NewAuctionWinner(address highestBidder, uint256 auctionId);

    struct Auction{
        uint auctionStart;
        uint auctionEnd;
        uint highestBid;
        address highestBidder;
        bool ended;
    }

    bool public isAuctionManager = true;
    uint256 private marginPerThousandForDevelopers = 50;
    uint256 private percentageBidIncrease = 33;
    uint256 private auctionsStartBid = 0.1 ether;
    address private auctionsStartAddress;

    mapping (uint256 => uint256) public _itemID2auctionID;
    mapping (uint256 => uint256) public _auctionID2itemID;
    Auction[] public _auctionsArray;

    ERC721 public nonFungibleContract;

    function AuctionManager() public {
        ceoAddress = msg.sender;
        cooAddress = msg.sender;
        cfoAddress = msg.sender;

        auctionsStartAddress = msg.sender;
        _auctionsArray.push(Auction(0,0,0,0,false));
    }

    function setERCContract(address candidateAddress) public onlyCEO {
        ERC721 candidateContract = ERC721(candidateAddress);

        nonFungibleContract = candidateContract;
    }

    function getERCContractAddress() public view returns (address) {
        return address(nonFungibleContract);
    }

    function getAllActiveAuctions()  external view returns (uint256[] popsIDs,uint256[] auctionsIDs,uint256[] sellingPrices, address[] highestBidders, bool[] canBeEnded){

        uint256[] memory toReturnPopsIDs = new uint256[](_auctionsArray.length);
        uint256[] memory toReturnAuctionsIDs = new uint256[](_auctionsArray.length);
        uint256[] memory toReturnSellingPrices = new uint256[](_auctionsArray.length);
        address[] memory toReturnSellerAddress = new address[](_auctionsArray.length);
        bool[] memory toReturnCanBeEnded = new bool[](_auctionsArray.length);
        uint256 index = 0;

        for(uint256 i = 1; i < _auctionsArray.length; i++){
            uint256 popId = _auctionID2itemID[i];
            uint256 price = requiredBid(i);

            if(_auctionsArray[i].ended == false){
                toReturnPopsIDs[index] = popId;
                toReturnAuctionsIDs[index] = i;
                toReturnSellingPrices[index] = price;
                toReturnSellerAddress[index] = _auctionsArray[i].highestBidder;
                toReturnCanBeEnded[index] = _auctionsArray[i].auctionEnd < now;
                index++;
            }
        }
        return (toReturnPopsIDs,toReturnAuctionsIDs,toReturnSellingPrices,toReturnSellerAddress,toReturnCanBeEnded);
    }

    function getAllAuctions()  external view returns (uint256[] popsIDs,uint256[] auctionsIDs,uint256[] sellingPrices){

        uint256[] memory toReturnPopsIDs = new uint256[](_auctionsArray.length);
        uint256[] memory toReturnAuctionsIDs = new uint256[](_auctionsArray.length);
        uint256[] memory toReturnSellingPrices = new uint256[](_auctionsArray.length);

        uint256 index = 0;

        for(uint256 i = 1; i < _auctionsArray.length; i++){
            uint256 popId = _auctionID2itemID[i];
            uint256 price = requiredBid(i);
            toReturnPopsIDs[index] = popId;
            toReturnAuctionsIDs[index] = i;
            toReturnSellingPrices[index] = price;
            index++;
        }
        return (toReturnPopsIDs,toReturnAuctionsIDs,toReturnSellingPrices);
    }


    function createAuction(uint256 _itemForAuctionID, uint256 _auctionDurationSeconds, address _seller) public {
        require(msg.sender == getERCContractAddress());
        require(_auctionDurationSeconds >= 20 seconds);
        require(_auctionDurationSeconds < 45 days);
        require(_itemForAuctionID != 0);
        require(_seller != 0);

        _takeOwnershipOfTokenFrom(_itemForAuctionID,_seller);

        uint256 auctionEnd = SafeMath.add(now,_auctionDurationSeconds);
        uint256 auctionID = _itemID2auctionID[_itemForAuctionID];
        if(auctionID == 0){
            uint256 index = _auctionsArray.push(Auction(now, auctionEnd, 0, _seller, false)) - 1;
            _itemID2auctionID[_itemForAuctionID] = index;
            _auctionID2itemID[index] = _itemForAuctionID;
        } else {
            Auction storage previousAuction = _auctionsArray[auctionID];
            require(previousAuction.ended == true);
            previousAuction.auctionStart = now;
            previousAuction.auctionEnd = auctionEnd;
            previousAuction.highestBidder = _seller;
            previousAuction.highestBid = 0;
            previousAuction.ended = false;
        }
        emit NewAuction(_itemForAuctionID, _auctionDurationSeconds, _seller);
    }

    function bid(uint auctionID) public payable whenNotPaused{
        require(auctionID != 0);
        Auction storage auction = _auctionsArray[auctionID];
        require(auction.ended == false);
        require(auction.auctionEnd >= now);
        uint claimBidPrice = requiredBid(auctionID);
        uint256 bidValue = msg.value;
        require(bidValue >= claimBidPrice);
        address previousHighestBidder = auction.highestBidder;
        auction.highestBid = msg.value;
        auction.highestBidder = msg.sender;
        _repopTransaction(previousHighestBidder, msg.value, marginPerThousandForDevelopers);
        emit Bid(msg.sender, msg.value, auctionID);
    }

    function endAuction(uint auctionID) public{
        require(auctionID != 0);
        Auction storage auction = _auctionsArray[auctionID];
        require(auction.ended == false);
        require(auction.auctionEnd < now);
        auction.ended = true;
        nonFungibleContract.transfer(auction.highestBidder, _auctionID2itemID[auctionID]);
        emit NewAuctionWinner(auction.highestBidder, auctionID);
    }

    function requiredBid(uint _auctionID) constant public returns (uint256 amountToOutBid) {
        require(_auctionID != 0);
        Auction memory auction = _auctionsArray[_auctionID];
        if(auction.highestBid == 0){
            return auctionsStartBid;
        } else {
            uint256 amountRequiredToOutBid = (auction.highestBid * (100 + percentageBidIncrease)) / 100;
            amountRequiredToOutBid = RoundMoneyNicely.roundMoneyDownNicely(amountRequiredToOutBid);
            return amountRequiredToOutBid;
        }
    }

    function getAuction(uint _itemForAuctionID) external constant returns (uint256 itemID, uint256 auctionStart, uint256 auctionEnd, address highestBidder, uint256 highestBid, bool ended){
        require(_itemForAuctionID != 0);
        Auction memory auction = _auctionsArray[_itemID2auctionID[_itemForAuctionID]];
        if(auction.highestBidder != 0) {
            itemID = _itemForAuctionID;
            auctionStart =  auction.auctionStart;
            auctionEnd =    auction.auctionEnd;
            highestBidder = auction.highestBidder;
            highestBid =    auction.highestBid;
            ended =         auction.ended;
            return(itemID,auctionStart,auctionEnd,highestBidder,highestBid,ended);
        } else {
            revert();
        }
    }

    function getAuctionStartBid() public view returns(uint256){
      return auctionsStartBid;
    }

    function setAuctionStartBid(uint256 _auctionStartBid) public onlyCLevel{
      auctionsStartBid = _auctionStartBid;
    }

    function _addressNotNull(address _to) private pure returns (bool){
        return _to != address(0);
    }


    function _takeOwnershipOfToken(uint256 _itemForAuctionID) internal {

        nonFungibleContract.takeOwnership(_itemForAuctionID);
    }

    function _takeOwnershipOfTokenFrom(uint256 _itemForAuctionID, address previousOwner) internal {
        nonFungibleContract.transferFrom(previousOwner,this,_itemForAuctionID);
    }
}

contract MarketManager is MoneyManager {
    event PopPurchased(address seller, address buyer, uint256 popId, uint256 sellingPrice);
    event PopCancelSale(address popOwner, uint256 popId);
    event PopChangedPrice(address popOwner, uint256 popId, uint256 newPrice);

    struct Sale {
        uint256 sellingPrice;

        address seller;
    }

    bool public isMarketManager = true;
    uint256 private marginPerThousandForDevelopers = 50;
    uint256 private MAX_SELLING_PRICE = 100000 ether;
    mapping (uint256 => uint256) public _itemID2saleID;
    mapping (uint256 => uint256) public _saleID2itemID;
    Sale[] public _salesArray;
    ERC721 public nonFungibleContract;

    function MarketManager() public {
        ceoAddress = msg.sender;
        cooAddress = msg.sender;
        cfoAddress = msg.sender;
        _salesArray.push(Sale(0,0));
        _itemID2saleID[0] = 0;
        _saleID2itemID[0] = 0;
    }

    function setERCContract(address candidateAddress) public onlyCEO {
        require(candidateAddress != address(0));
        ERC721 candidateContract = ERC721(candidateAddress);
        nonFungibleContract = candidateContract;
    }

    function getERCContractAddress() public view returns (address) {
        return address(nonFungibleContract);
    }

    function getAllActiveSales()  external view returns (uint256[] popsIDs,uint256[] sellingPrices,address[] sellerAddresses){

        uint256[] memory toReturnPopsIDs = new uint256[](_salesArray.length);
        uint256[] memory toReturnSellingPrices = new uint256[](_salesArray.length);
        address[] memory toReturnSellerAddress = new address[](_salesArray.length);
        uint256 index = 0;

        for(uint256 i = 1; i < _salesArray.length; i++){
            uint256 popId = _saleID2itemID[i];
            uint256 price = _salesArray[i].sellingPrice;
            address seller = _salesArray[i].seller;

            if(seller != 0){
                toReturnSellerAddress[index] = seller;
                toReturnPopsIDs[index] = popId;
                toReturnSellingPrices[index] = price;
                index++;
            }
        }
        return (toReturnPopsIDs,toReturnSellingPrices,toReturnSellerAddress);
    }

    function getAllSalesByAddress(address addr)  external view returns (uint256[] popsIDs,uint256[] sellingPrices,address[] sellerAddresses){

        uint256[] memory toReturnPopsIDs = new uint256[](_salesArray.length);
        uint256[] memory toReturnSellingPrices = new uint256[](_salesArray.length);
        address[] memory toReturnSellerAddress = new address[](_salesArray.length);
        uint256 index = 0;

        for(uint256 i = 1; i < _salesArray.length; i++){
            uint256 popId = _saleID2itemID[i];
            uint256 price = _salesArray[i].sellingPrice;
            address seller = _salesArray[i].seller;

            if(seller == addr){
                toReturnSellerAddress[index] = seller;
                toReturnPopsIDs[index] = popId;
                toReturnSellingPrices[index] = price;
                index++;
            }
        }
        return (toReturnPopsIDs,toReturnSellingPrices,toReturnSellerAddress);
    }

    function purchasePop(uint256 _popId) public payable whenNotPaused{
        uint256 saleID = _itemID2saleID[_popId];
        require(saleID != 0);
        Sale storage sale = _salesArray[saleID];
        address popOwner = sale.seller;
        require(popOwner != 0);
        address newOwner = msg.sender;
        uint256 sellingPrice = sale.sellingPrice;
        require(popOwner != newOwner);
        require(_addressNotNull(newOwner));
        require(msg.value == sellingPrice);
        sale.seller = 0;
        nonFungibleContract.transfer(newOwner,_popId);
        _repopTransaction(popOwner, msg.value, marginPerThousandForDevelopers);
        emit PopPurchased(popOwner, msg.sender, _popId, msg.value);
    }

    function sellerOf(uint _popId) public view returns (address) {
        uint256 saleID = _itemID2saleID[_popId];
        Sale memory sale = _salesArray[saleID];
        return sale.seller;
    }

    function sellPop(address seller, uint256 _popId, uint256 _sellingPrice) public whenNotPaused{
        require(_sellingPrice < MAX_SELLING_PRICE);
        require(msg.sender == getERCContractAddress());
        require(_sellingPrice > 0);
        _takeOwnershipOfTokenFrom(_popId,seller);
        uint256 saleID = _itemID2saleID[_popId];
        if(saleID == 0) {
            uint256  index = _salesArray.push(Sale(_sellingPrice,seller)) - 1;
            _itemID2saleID[_popId] = index;
            _saleID2itemID[index] = _popId;
        } else {
            Sale storage sale = _salesArray[saleID];
            require(sale.seller == 0);
            sale.seller = seller;
            sale.sellingPrice = _sellingPrice;
        }
    }

    function cancelSellPop(uint256 _popId) public {
        Sale storage sale = _salesArray[_itemID2saleID[_popId]];
        require(sale.seller == msg.sender);
        sale.seller = 0;
        nonFungibleContract.transfer(msg.sender,_popId);

        emit PopCancelSale(msg.sender, _popId);
    }

    function changeSellPOPPrice(uint256 _popId, uint256 _newSellingValue) public whenNotPaused{
      require(_newSellingValue < MAX_SELLING_PRICE);
      require(_newSellingValue > 0);
      Sale storage sale = _salesArray[_itemID2saleID[_popId]];
      require(sale.seller == msg.sender);
      sale.sellingPrice = _newSellingValue;
      emit PopChangedPrice(msg.sender, _popId, _newSellingValue);
    }

    function _addressNotNull(address _to) private pure returns (bool){
        return _to != address(0);
    }

    function _takeOwnershipOfToken(uint256 _itemForAuctionID) internal {
        nonFungibleContract.takeOwnership(_itemForAuctionID);
    }

    function _takeOwnershipOfTokenFrom(uint256 _itemForAuctionID, address previousOwner) internal {
        nonFungibleContract.transferFrom(previousOwner,this,_itemForAuctionID);
    }
}

contract CloningInterface{
  function isGeneScience() public pure returns (bool);
  function mixGenes(uint256 genes1, uint256 genes2) public returns (uint256);
}

contract GenesMarket is MoneyManager {
    event GenesCancelSale(address popOwner, uint256 popId);
    event GenesPurchased(address buyer, address popOwner, uint256 popId, uint256 amount, uint256 price);
    event GenesChangedPrice(address popOwner, uint256 popId, uint256 newPrice);

    struct GeneForSale {
            uint256 sellingPrice;
            address currentOwner;
    }

    mapping (uint256 => uint256) public _itemID2geneSaleID;
    mapping (uint256 => uint256) public _geneSaleID2itemID;
    GeneForSale[] public _genesForSaleArray;
    uint256 marginPerThousandForDevelopers = 50;
    uint256 MAX_SELLING_PRICE = 10000 ether;

    mapping(address => mapping (uint256 => uint256)) _genesOwned;
    mapping(address => uint256[]) _ownedGenesPopsId;
    bool public isGenesMarket = true;

    function GenesMarket() public {
        ceoAddress = msg.sender;
        cooAddress = msg.sender;
        cfoAddress = msg.sender;
        _genesForSaleArray.push(GeneForSale(0,0));
    }

    ERC721 public nonFungibleContract;
    function setERCContract(address candidateAddress) public onlyCEO() {
        ERC721 candidateContract = ERC721(candidateAddress);
        nonFungibleContract = candidateContract;
    }

    function getERCContractAddress() public view returns (address) {
        return address(nonFungibleContract);
    }

    function startSellingGenes(uint256 _popId, uint256 _sellingPrice, address _seller) public {
        require(_sellingPrice < MAX_SELLING_PRICE);
        require(msg.sender == getERCContractAddress());
        require(_sellingPrice > 0);
        _takeOwnershipOfTokenFrom(_popId,_seller);
        uint256 geneSaleID = _itemID2geneSaleID[_popId];
        if(geneSaleID == 0){

            uint256 index = _genesForSaleArray.push(GeneForSale(_sellingPrice,_seller)) - 1;
            _itemID2geneSaleID[_popId] = index;
            _geneSaleID2itemID[index] = _popId;

        }else {
            GeneForSale storage previousSale = _genesForSaleArray[geneSaleID];
            previousSale.sellingPrice = _sellingPrice;
            previousSale.currentOwner = _seller;
        }
    }

    function stopSellingGenes(uint _popId) public {
        uint256 geneSaleID = _itemID2geneSaleID[_popId];
        require(geneSaleID != 0);
        GeneForSale storage gene = _genesForSaleArray[geneSaleID];
        require(msg.sender == gene.currentOwner);
        require(gene.sellingPrice != 0);
        gene.sellingPrice = 0;
        nonFungibleContract.transfer(gene.currentOwner, _popId);

        emit GenesCancelSale(msg.sender, _popId);
    }


    function sellerOf(uint _popId) public view returns (address) {
        uint256 geneSaleID = _itemID2geneSaleID[_popId];
        GeneForSale memory gene = _genesForSaleArray[geneSaleID];
        if(gene.sellingPrice != 0) {
            return gene.currentOwner;
        } else {
            return 0;
        }
    }

    function useBottle(address _user, uint _popId) external whenNotPaused {
        require(msg.sender == getERCContractAddress());
        require(_genesOwned[_user][_popId] > 0);
        _genesOwned[_user][_popId] = _genesOwned[_user][_popId] - 1;
    }


    function purchaseGenes(uint256 _popId, uint256 _amountGenes, bool update) public payable whenNotPaused{
        require(_amountGenes > 0);
        uint256 geneSaleID = _itemID2geneSaleID[_popId];
        GeneForSale memory gene = _genesForSaleArray[geneSaleID];
        require(gene.sellingPrice != 0);
        address popOwner = gene.currentOwner;
        address genesReceiver = msg.sender;
        uint256 sellingPrice = gene.sellingPrice;
        require(popOwner != genesReceiver);
        require(msg.value == SafeMath.mul(sellingPrice, _amountGenes));
        if( update && _genesOwned[msg.sender][_popId] == 0) {
            _ownedGenesPopsId[msg.sender].push(_popId);
        }
        _genesOwned[msg.sender][_popId] = _genesOwned[msg.sender][_popId] + _amountGenes;
        _repopTransaction(popOwner, msg.value, marginPerThousandForDevelopers);
        emit GenesPurchased(msg.sender, popOwner, _popId, _amountGenes, msg.value);
    }

    function getGenesForSale() public view returns (uint[] popIDs, uint[] sellingPrices, uint[] geneSaleIDs, address[] sellers){
        uint256[] memory toReturnPopsIDs = new uint256[](_genesForSaleArray.length);
        uint256[] memory toReturnSellingPrices = new uint256[](_genesForSaleArray.length);
        uint256[] memory toReturnGeneSaleID = new uint256[](_genesForSaleArray.length);
        address[] memory toReturnSellers = new address[](_genesForSaleArray.length);
        uint256 index = 0;

        for(uint256 i = 1; i < _genesForSaleArray.length; i++){
            uint256 popId = _geneSaleID2itemID[i];
            uint256 price = _genesForSaleArray[i].sellingPrice;

            if(price != 0){
                toReturnGeneSaleID[index] = i;
                toReturnPopsIDs[index] = popId;
                toReturnSellingPrices[index] = price;
                toReturnSellers[index] = _genesForSaleArray[i].currentOwner;
                index++;
            }
        }
        return (toReturnPopsIDs,toReturnSellingPrices,toReturnGeneSaleID, toReturnSellers);
    }

    function getGenesForSaleBySeller(address seller) public view returns (uint[] popIDs, uint[] sellingPrices, uint[] geneSaleIDs, address[] sellers){
        uint256[] memory toReturnPopsIDs = new uint256[](_genesForSaleArray.length);
        uint256[] memory toReturnSellingPrices = new uint256[](_genesForSaleArray.length);
        uint256[] memory toReturnGeneSaleID = new uint256[](_genesForSaleArray.length);
        address[] memory toReturnSellers = new address[](_genesForSaleArray.length);
        uint256 index = 0;

        for(uint256 i = 1; i < _genesForSaleArray.length; i++){
            uint256 popId = _geneSaleID2itemID[i];
            uint256 price = _genesForSaleArray[i].sellingPrice;

            if(price != 0){
              if(_genesForSaleArray[i].currentOwner == seller){
                toReturnGeneSaleID[index] = i;
                toReturnPopsIDs[index] = popId;
                toReturnSellingPrices[index] = price;
                toReturnSellers[index] = _genesForSaleArray[i].currentOwner;
                index++;
              }
            }
        }
        return (toReturnPopsIDs,toReturnSellingPrices,toReturnGeneSaleID, toReturnSellers);
    }

    function getAmountOfGene(uint _popId) public view returns (uint amount){
        return _genesOwned[msg.sender][_popId];
    }

    function getMyGenes() public view returns (uint[] popIDs, uint[] amount) {
        uint256[] memory toReturnPopsIDs = new uint256[](_ownedGenesPopsId[msg.sender].length);
        uint256[] memory toReturnAmount = new uint256[](_ownedGenesPopsId[msg.sender].length);

        for(uint256 i = 0; i < _ownedGenesPopsId[msg.sender].length; i++) {
            toReturnPopsIDs[i] = _ownedGenesPopsId[msg.sender][i];
            toReturnAmount[i] = _genesOwned[msg.sender][_ownedGenesPopsId[msg.sender][i]];
        }
        return (toReturnPopsIDs,toReturnAmount);
    }

    function changeSellGenesPrice(uint256 _popId, uint256 _newSellingValue) public whenNotPaused{
      require(_newSellingValue < MAX_SELLING_PRICE);
      require(_newSellingValue > 0);
      uint256 geneSaleID = _itemID2geneSaleID[_popId];
      require(geneSaleID != 0);

      GeneForSale storage gene = _genesForSaleArray[geneSaleID];

      require(msg.sender == gene.currentOwner);
      require(gene.sellingPrice != 0);

      gene.sellingPrice = _newSellingValue;

      emit GenesChangedPrice(msg.sender, _popId, _newSellingValue);
    }

    function _takeOwnershipOfTokenFrom(uint256 _popId, address previousOwner) internal {
        nonFungibleContract.transferFrom(previousOwner,this,_popId);
    }
}

contract REPOPCore is REPOPERC721, MoneyManager{
    uint256 public refresherFee = 0.01 ether;
    AuctionManager public auctionManager;
    MarketManager public marketManager;
    GenesMarket public genesMarket;
    CloningInterface public geneScience;

    event CloneWithTwoPops(address creator, uint256 cloneId, uint256 aParentId, uint256 bParentId);
    event CloneWithPopAndBottle(address creator, uint256 cloneId, uint256 popId, uint256 bottleId);
    event SellingPop(address seller, uint256 popId, uint256 price);
    event SellingGenes(address seller, uint256 popId, uint256 price);
    event ChangedPopName(address owner, uint256 popId, bytes32 newName);
    event CooldownRemoval(uint256 popId, address owner, uint256 paidFee);

    function REPOPCore() public{

      ceoAddress = msg.sender;
      cooAddress = msg.sender;
      cfoAddress = msg.sender;

      createNewPop(0x0, "Satoshi Nakamoto");
    }

    function createNewAuction(uint256 _itemForAuctionID, uint256 _auctionDurationSeconds) public onlyCLevel{
        approve(address(auctionManager),_itemForAuctionID);
        auctionManager.createAuction(_itemForAuctionID,_auctionDurationSeconds,msg.sender);
    }

    function setAuctionManagerAddress(address _address) external onlyCEO {
        AuctionManager candidateContract = AuctionManager(_address);


        require(candidateContract.isAuctionManager());


        auctionManager = candidateContract;
    }

    function getAuctionManagerAddress() public view returns (address) {
        return address(auctionManager);
    }

    function setMarketManagerAddress(address _address) external onlyCEO {
        MarketManager candidateContract = MarketManager(_address);
        require(candidateContract.isMarketManager());
        marketManager = candidateContract;
    }

    function getMarketManagerAddress() public view returns (address) {
        return address(marketManager);
    }

    function setGeneScienceAddress(address _address) external onlyCEO {
      CloningInterface candidateContract = CloningInterface(_address);
      require(candidateContract.isGeneScience());
      geneScience = candidateContract;
    }

    function getGeneScienceAddress() public view returns (address) {
        return address(geneScience);
    }

    function setGenesMarketAddress(address _address) external onlyCEO {
      GenesMarket candidateContract = GenesMarket(_address);
      require(candidateContract.isGenesMarket());
      genesMarket = candidateContract;
    }

    function getGenesMarketAddress() public view returns (address) {
        return address(genesMarket);
    }

    function sellPop(uint256 _popId, uint256 _price) public {
        Pop storage pop = pops[_popId];
        require(pop.cooldownEndTimestamp <= now);
        approve(address(marketManager),_popId);
        marketManager.sellPop(msg.sender,_popId,_price);
        emit SellingPop(msg.sender, _popId, _price);
    }

    function sellGenes(uint256 _popId, uint256 _price) public {
        require(_popId > 0);
        approve(address(genesMarket),_popId);
        genesMarket.startSellingGenes(_popId,_price,msg.sender);
        emit SellingGenes(msg.sender, _popId, _price);
    }

    function getOwnerInAnyPlatformById(uint256 popId) public view returns (address){
      if(ownerOf(popId) == address(marketManager)){
        return marketManager.sellerOf(popId);
      }
      else if(ownerOf(popId) == address(genesMarket)){
        return genesMarket.sellerOf(popId);
      }
      else if(ownerOf(popId) == address(auctionManager)){
        return ceoAddress;
      }
      else{
        return ownerOf(popId);
      }
      return 0x0;
    }

    function setPopName(uint256 popId, string newName) external {
      require(_ownerOfPopInAnyPlatform(popId));
      Pop storage pop = pops[popId];
      require(pop.generation > 0);
      bytes32 name32 = stringToBytes32(newName);
      pop.popName = name32;
      emit ChangedPopName(msg.sender, popId, name32);
    }

    function removeCooldown(uint256 popId)
      external
      payable
      {
        require(_ownerOfPopInAnyPlatform(popId));
        require(msg.value >= refresherFee);
        Pop storage pop = pops[popId];
        pop.cooldownEndTimestamp = 1;
        emit CooldownRemoval(popId, msg.sender, refresherFee);
      }

    function _ownerOfPopInAnyPlatform(uint _popId) internal view returns (bool) {
      return ownerOf(_popId) == msg.sender || genesMarket.sellerOf(_popId) == msg.sender || marketManager.sellerOf(_popId) == msg.sender;
    }

    function getOwnershipForCloning(uint _popId) internal view returns (bool) {
        return ownerOf(_popId) == msg.sender || genesMarket.sellerOf(_popId) == msg.sender;
    }

    function changeRefresherFee(uint256 _newFee) public onlyCLevel{
        refresherFee = _newFee;
    }

    function cloneWithTwoPops(uint256 _aParentId, uint256 _bParentId)
      external
      whenNotPaused
      returns (uint256)
      {
        require(_aParentId > 0);
        require(_bParentId > 0);
        require(getOwnershipForCloning(_aParentId));
        require(getOwnershipForCloning(_bParentId));
        Pop storage aParent = pops[_aParentId];

        Pop storage bParent = pops[_bParentId];

        require(aParent.genes != bParent.genes);
        require(aParent.cooldownEndTimestamp <= now);
        require(bParent.cooldownEndTimestamp <= now);

        uint16 parentGen = aParent.generation;
        if (bParent.generation > aParent.generation) {
            parentGen = bParent.generation;
        }

        uint16 cooldownIndex = parentGen + 1;
        if (cooldownIndex > 13) {
            cooldownIndex = 13;
        }

        uint256 childGenes = geneScience.mixGenes(aParent.genes, bParent.genes);

        _triggerCooldown(aParent);
        _triggerCooldown(bParent);

        uint256 index = pops.push(Pop(childGenes,uint64(now), 1, uint32(_aParentId), uint32(_bParentId), 0, cooldownIndex, parentGen + 1)) -1;

        popIndexToOwner[index] = msg.sender;
        ownershipTokenCount[msg.sender] = ownershipTokenCount[msg.sender]+1;

        emit CloneWithTwoPops(msg.sender, index, _aParentId, _bParentId);
        emit Birth(msg.sender, index, _aParentId, _bParentId,childGenes);

        return index;
    }

    function cloneWithPopAndBottle(uint256 _aParentId, uint256 _bParentId_bottle)
        external
        whenNotPaused
        returns (uint256)
        {
          require(_aParentId > 0);
          require(getOwnershipForCloning(_aParentId));
          Pop storage aParent = pops[_aParentId];
          Pop memory bParent = pops[_bParentId_bottle];

          require(aParent.genes != bParent.genes);
          require(aParent.cooldownEndTimestamp <= now);

          uint16 parentGen = aParent.generation;
          if (bParent.generation > aParent.generation) {
              parentGen = bParent.generation;
          }

          uint16 cooldownIndex = parentGen + 1;
          if (cooldownIndex > 13) {
              cooldownIndex = 13;
          }

          genesMarket.useBottle(msg.sender, _bParentId_bottle);

          uint256 childGenes = geneScience.mixGenes(aParent.genes, bParent.genes);

          _triggerCooldown(aParent);

          uint256 index = pops.push(Pop(childGenes,uint64(now), 1, uint32(_aParentId), uint32(_bParentId_bottle), 0, cooldownIndex, parentGen + 1)) -1;

          popIndexToOwner[index] = msg.sender;
          ownershipTokenCount[msg.sender] = ownershipTokenCount[msg.sender]+1;

          emit CloneWithPopAndBottle(msg.sender, index, _aParentId, _bParentId_bottle);
          emit Birth(msg.sender, index, _aParentId, _bParentId_bottle, childGenes);

          return index;
        }
}

Contract Security Audit

Contract ABI

API
[{"constant":true,"inputs":[],"name":"cfoAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"candidateAddress","type":"address"}],"name":"setERCContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isAuctionManager","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ceoAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getBalance","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"_itemID2auctionID","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newCEO","type":"address"}],"name":"setCEO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newCOO","type":"address"}],"name":"setCOO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"_auctionsArray","outputs":[{"name":"auctionStart","type":"uint256"},{"name":"auctionEnd","type":"uint256"},{"name":"highestBid","type":"uint256"},{"name":"highestBidder","type":"address"},{"name":"ended","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getAllActiveAuctions","outputs":[{"name":"popsIDs","type":"uint256[]"},{"name":"auctionsIDs","type":"uint256[]"},{"name":"sellingPrices","type":"uint256[]"},{"name":"highestBidders","type":"address[]"},{"name":"canBeEnded","type":"bool[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"auctionID","type":"uint256"}],"name":"bid","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_newCFO","type":"address"}],"name":"setCFO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_itemForAuctionID","type":"uint256"},{"name":"_auctionDurationSeconds","type":"uint256"},{"name":"_seller","type":"address"}],"name":"createAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawPayments","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getERCContractAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_itemForAuctionID","type":"uint256"}],"name":"getAuction","outputs":[{"name":"itemID","type":"uint256"},{"name":"auctionStart","type":"uint256"},{"name":"auctionEnd","type":"uint256"},{"name":"highestBidder","type":"address"},{"name":"highestBid","type":"uint256"},{"name":"ended","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getAuctionStartBid","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_auctionStartBid","type":"uint256"}],"name":"setAuctionStartBid","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"_auctionID2itemID","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_auctionID","type":"uint256"}],"name":"requiredBid","outputs":[{"name":"amountToOutBid","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cooAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"auctionID","type":"uint256"}],"name":"endAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getAllAuctions","outputs":[{"name":"popsIDs","type":"uint256[]"},{"name":"auctionsIDs","type":"uint256[]"},{"name":"sellingPrices","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"nonFungibleContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"payments","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"bidder","type":"address"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"auctionId","type":"uint256"}],"name":"Bid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"itemForAuctionID","type":"uint256"},{"indexed":false,"name":"durationSeconds","type":"uint256"},{"indexed":false,"name":"seller","type":"address"}],"name":"NewAuction","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"highestBidder","type":"address"},{"indexed":false,"name":"auctionId","type":"uint256"}],"name":"NewAuctionWinner","type":"event"}]

60806040526003805460a060020a61ffff02191675010000000000000000000000000000000000000000001790556032600455602160055567016345785d8a000060065534801561004f57600080fd5b5060018054600160a060020a03338116600160a060020a031992831681178455600380548416821790556002805484168217905560078054841690911790556040805160a0810182526000808252602082018181529282018181526060830182815260808401838152600a8054998a018155909352925160049097027fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a881019790975592517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a987015591517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2aa860155517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ab909401805491511515740100000000000000000000000000000000000000000260a060020a60ff021995909316919093161792909216919091179055611884806101ab6000396000f3006080604052600436106101745763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630519ce79811461017957806305f8b0cf146101aa57806309c38bc8146101cd5780630a0f8168146101f657806312065fe01461020b5780631bfd2fe71461023257806327d7874c1461024a5780632ba73c151461026b5780632bce21941461028c5780632dee466d146102da5780632e1a7d4d146104575780633f4ba83a1461046f578063454a2ab3146104845780634e0a33791461048f57806354279bdd146104b05780635c975abb146104d75780636103d70b146104ec5780636c456d0f1461050157806378bd7935146105165780638456cb591461056b57806384acdae714610580578063885b63da146105955780639a26aec2146105ad5780639dbc041c146105c5578063b047fb50146105dd578063b9a2de3a146105f2578063cbd2bdfd1461060a578063dd1b7a0f146106fd578063e2982c2114610712575b600080fd5b34801561018557600080fd5b5061018e610733565b60408051600160a060020a039092168252519081900360200190f35b3480156101b657600080fd5b506101cb600160a060020a0360043516610742565b005b3480156101d957600080fd5b506101e2610783565b604080519115158252519081900360200190f35b34801561020257600080fd5b5061018e6107a5565b34801561021757600080fd5b506102206107b4565b60408051918252519081900360200190f35b34801561023e57600080fd5b506102206004356107c2565b34801561025657600080fd5b506101cb600160a060020a03600435166107d4565b34801561027757600080fd5b506101cb600160a060020a0360043516610826565b34801561029857600080fd5b506102a4600435610878565b60408051958652602086019490945284840192909252600160a060020a0316606084015215156080830152519081900360a00190f35b3480156102e657600080fd5b506102ef6108c5565b60405180806020018060200180602001806020018060200186810386528b818151815260200191508051906020019060200280838360005b8381101561033f578181015183820152602001610327565b5050505090500186810385528a818151815260200191508051906020019060200280838360005b8381101561037e578181015183820152602001610366565b50505050905001868103845289818151815260200191508051906020019060200280838360005b838110156103bd5781810151838201526020016103a5565b50505050905001868103835288818151815260200191508051906020019060200280838360005b838110156103fc5781810151838201526020016103e4565b50505050905001868103825287818151815260200191508051906020019060200280838360005b8381101561043b578181015183820152602001610423565b505050509050019a505050505050505050505060405180910390f35b34801561046357600080fd5b506101cb600435610b33565b34801561047b57600080fd5b506101cb610ba2565b6101cb600435610bf5565b34801561049b57600080fd5b506101cb600160a060020a0360043516610d13565b3480156104bc57600080fd5b506101cb600435602435600160a060020a0360443516610d65565b3480156104e357600080fd5b506101e261101e565b3480156104f857600080fd5b506101cb61102e565b34801561050d57600080fd5b5061018e61108c565b34801561052257600080fd5b5061052e60043561109b565b60408051968752602087019590955285850193909352600160a060020a0390911660608501526080840152151560a0830152519081900360c00190f35b34801561057757600080fd5b506101cb611169565b34801561058c57600080fd5b506102206111f5565b3480156105a157600080fd5b506101cb6004356111fb565b3480156105b957600080fd5b5061022060043561124f565b3480156105d157600080fd5b50610220600435611261565b3480156105e957600080fd5b5061018e61131e565b3480156105fe57600080fd5b506101cb60043561132d565b34801561061657600080fd5b5061061f61148b565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b8381101561066757818101518382015260200161064f565b50505050905001848103835286818151815260200191508051906020019060200280838360005b838110156106a657818101518382015260200161068e565b50505050905001848103825285818151815260200191508051906020019060200280838360005b838110156106e55781810151838201526020016106cd565b50505050905001965050505050505060405180910390f35b34801561070957600080fd5b5061018e6115c7565b34801561071e57600080fd5b50610220600160a060020a03600435166115d6565b600254600160a060020a031681565b60015460009033600160a060020a0390811691161461076057600080fd5b50600b8054600160a060020a031916600160a060020a0392909216919091179055565b6003547501000000000000000000000000000000000000000000900460ff1681565b600154600160a060020a031681565b600160a060020a0330163190565b60086020526000908152604090205481565b60015433600160a060020a039081169116146107ef57600080fd5b600160a060020a038116151561080457600080fd5b60018054600160a060020a031916600160a060020a0392909216919091179055565b60015433600160a060020a0390811691161461084157600080fd5b600160a060020a038116151561085657600080fd5b60038054600160a060020a031916600160a060020a0392909216919091179055565b600a80548290811061088657fe5b600091825260209091206004909102018054600182015460028301546003909301549193509190600160a060020a0381169060a060020a900460ff1685565b606080606080606080606080606080600080600080600a80549050604051908082528060200260200182016040528015610909578160200160208202803883390190505b50600a54604080518281526020808402820101909152919a508015610938578160200160208202803883390190505b50600a546040805182815260208084028201019091529199508015610967578160200160208202803883390190505b50600a546040805182815260208084028201019091529198508015610996578160200160208202803883390190505b50600a5460408051828152602080840282010190915291975080156109c5578160200160208202803883390190505b50945060009350600192505b600a54831015610b1d5760008381526009602052604090205491506109f583611261565b9050600a83815481101515610a0657fe5b600091825260209091206004909102016003015460a060020a900460ff161515610b1257818985815181101515610a3957fe5b6020908102909101015287518390899086908110610a5357fe5b6020908102909101015286518190889086908110610a6d57fe5b60209081029091010152600a805484908110610a8557fe5b60009182526020909120600360049092020101548651600160a060020a0390911690879086908110610ab357fe5b600160a060020a03909216602092830290910190910152600a805442919085908110610adb57fe5b906000526020600020906004020160010154108585815181101515610afc57fe5b9115156020928302909101909101526001909301925b6001909201916109d1565b50969c959b509399509197509550919350505050565b60025433600160a060020a03908116911614610b4e57600080fd5b600160a060020a033016318110610b6457600080fd5b600254604051600160a060020a039091169082156108fc029083906000818181858888f19350505050158015610b9e573d6000803e3d6000fd5b5050565b60015433600160a060020a03908116911614610bbd57600080fd5b60035460a060020a900460ff161515610bd557600080fd5b6003805474ff000000000000000000000000000000000000000019169055565b60035460009081908190819060a060020a900460ff1615610c1557600080fd5b841515610c2157600080fd5b600a805486908110610c2f57fe5b60009182526020909120600490910201600381015490945060a060020a900460ff1615610c5b57600080fd5b6001840154421115610c6c57600080fd5b610c7585611261565b925034915082821015610c8757600080fd5b50600383018054346002860181905533600160a060020a03908116600160a060020a03198416179093556004549290911691610cc49183916115e8565b60408051600160a060020a033316815234602082015280820187905290517f19421268847f42dd61705778018ddfc43bcdce8517e7a630acb12f122c7094819181900360600190a15050505050565b60015433600160a060020a03908116911614610d2e57600080fd5b600160a060020a0381161515610d4357600080fd5b60028054600160a060020a031916600160a060020a0392909216919091179055565b600080600080610d7361108c565b600160a060020a031633600160a060020a0316141515610d9257600080fd5b6014861015610da057600080fd5b623b53808610610daf57600080fd5b861515610dbb57600080fd5b600160a060020a0385161515610dd057600080fd5b610dda8786611616565b610de442876116a8565b6000888152600860205260409020549094509250821515610f44576040805160a08101825242815260208082018781526000838501818152600160a060020a038b81166060870190815260808701848152600a805460018101825590865297517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a860048a029081019190915595517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a987015592517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2aa860155517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ab90940180549251600160a060020a0319909316949091169390931774ff0000000000000000000000000000000000000000191660a060020a91151591909102179091558a8152600882528381208390558281526009909152919091208890559150610fcd565b600a805484908110610f5257fe5b906000526020600020906004020190508060030160149054906101000a900460ff16151560011515141515610f8657600080fd5b4281556001810184905560038101805460006002840155600160a060020a031916600160a060020a0387161774ff0000000000000000000000000000000000000000191690555b6040805188815260208101889052600160a060020a0387168183015290517f9f73aaf9708695add4256f1c2d3a7806702de1d16fe47ffbe80cb5df9f6d8d209181900360600190a150505050505050565b60035460a060020a900460ff1681565b600160a060020a033316600081815260208190526040808220805490839055905190929183156108fc02918491818181858888f19350505050151561108957600160a060020a03331660009081526020819052604090208190555b50565b600b54600160a060020a031690565b6000806000806000806110ac61181d565b8715156110b857600080fd5b600088815260086020526040902054600a805490919081106110d657fe5b60009182526020918290206040805160a08101825260049390930290910180548352600181015493830193909352600283015490820152600390910154600160a060020a0381166060830181905260a060020a90910460ff1615156080830152909150156101745780516020820151606083015160408401516080909401519a9b929a9199509750919550909350915050565b60035433600160a060020a0390811691161480611194575060015433600160a060020a039081169116145b806111ad575060025433600160a060020a039081169116145b15156111b857600080fd5b60035460a060020a900460ff16156111cf57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a179055565b60065490565b60035433600160a060020a0390811691161480611226575060015433600160a060020a039081169116145b8061123f575060025433600160a060020a039081169116145b151561124a57600080fd5b600655565b60096020526000908152604090205481565b600061126b61181d565b600083151561127957600080fd5b600a80548590811061128757fe5b60009182526020918290206040805160a0810182526004909302909101805483526001810154938301939093526002830154908201819052600390920154600160a060020a038116606083015260ff60a060020a9091041615156080820152925015156112f8576006549250611317565b50600554604082015160649182010204611311816116be565b90508092505b5050919050565b600354600160a060020a031681565b600081151561133b57600080fd5b600a80548390811061134957fe5b60009182526020909120600490910201600381015490915060a060020a900460ff161561137557600080fd5b6001810154421161138557600080fd5b60038101805474ff0000000000000000000000000000000000000000191660a060020a1790819055600b546000848152600960205260408082205481517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03958616600482015260248101919091529051939092169263a9059cbb92604480820193929182900301818387803b15801561142757600080fd5b505af115801561143b573d6000803e3d6000fd5b505050600382015460408051600160a060020a0390921682526020820185905280517fe7eeb8e436693c5fbdcae05aba48eec69ea26a181e7b04c1a3ace5b1e474dcdd9350918290030190a15050565b606080606080606080600080600080600a805490506040519080825280602002602001820160405280156114c9578160200160208202803883390190505b50600a5460408051828152602080840282010190915291985080156114f8578160200160208202803883390190505b50600a546040805182815260208084028201019091529197508015611527578160200160208202803883390190505b50945060009350600192505b600a548310156115b657600083815260096020526040902054915061155783611261565b905081878581518110151561156857fe5b602090810290910101528551839087908690811061158257fe5b602090810290910101528451819086908690811061159c57fe5b602090810290910101526001938401939290920191611533565b509498939750919550919350505050565b600b54600160a060020a031681565b60006020819052908152604090205481565b6103e8818302048083036115ff85826159d86117d0565b151561160f5761160f85826117fb565b5050505050565b600b54604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a038481166004830152308116602483015260448201869052915191909216916323b872dd91606480830192600092919082900301818387803b15801561168c57600080fd5b505af11580156116a0573d6000803e3d6000fd5b505050505050565b6000828201838110156116b757fe5b9392505050565b600066038d7ea4c680008210156116d65750806117cb565b662386f26fc100008210156116f657506509184e72a000808204026117cb565b67016345785d8a00008210156117175750655af3107a4000808204026117cb565b670de0b6b3a7640000821015611739575066038d7ea4c68000808204026117cb565b678ac7230489e8000082101561175b5750662386f26fc10000808204026117cb565b68056bc75e2d6310000082101561177f575067016345785d8a0000808204026117cb565b683635c9adc5dea000008210156117a35750670de0b6b3a7640000808204026117cb565b69021e19e0c9bab24000008210156117c85750678ac7230489e80000808204026117cb565b50805b919050565b600083600160a060020a0316838390604051600060405180830381858888f198975050505050505050565b600160a060020a03909116600090815260208190526040902080549091019055565b60a0604051908101604052806000815260200160008152602001600081526020016000600160a060020a0316815260200160001515815250905600a165627a7a72305820981aa259f89476e5b23de5972eff17849f4896f2f7e718d63cce4632f29d484e0029

Deployed Bytecode

0x6080604052600436106101745763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630519ce79811461017957806305f8b0cf146101aa57806309c38bc8146101cd5780630a0f8168146101f657806312065fe01461020b5780631bfd2fe71461023257806327d7874c1461024a5780632ba73c151461026b5780632bce21941461028c5780632dee466d146102da5780632e1a7d4d146104575780633f4ba83a1461046f578063454a2ab3146104845780634e0a33791461048f57806354279bdd146104b05780635c975abb146104d75780636103d70b146104ec5780636c456d0f1461050157806378bd7935146105165780638456cb591461056b57806384acdae714610580578063885b63da146105955780639a26aec2146105ad5780639dbc041c146105c5578063b047fb50146105dd578063b9a2de3a146105f2578063cbd2bdfd1461060a578063dd1b7a0f146106fd578063e2982c2114610712575b600080fd5b34801561018557600080fd5b5061018e610733565b60408051600160a060020a039092168252519081900360200190f35b3480156101b657600080fd5b506101cb600160a060020a0360043516610742565b005b3480156101d957600080fd5b506101e2610783565b604080519115158252519081900360200190f35b34801561020257600080fd5b5061018e6107a5565b34801561021757600080fd5b506102206107b4565b60408051918252519081900360200190f35b34801561023e57600080fd5b506102206004356107c2565b34801561025657600080fd5b506101cb600160a060020a03600435166107d4565b34801561027757600080fd5b506101cb600160a060020a0360043516610826565b34801561029857600080fd5b506102a4600435610878565b60408051958652602086019490945284840192909252600160a060020a0316606084015215156080830152519081900360a00190f35b3480156102e657600080fd5b506102ef6108c5565b60405180806020018060200180602001806020018060200186810386528b818151815260200191508051906020019060200280838360005b8381101561033f578181015183820152602001610327565b5050505090500186810385528a818151815260200191508051906020019060200280838360005b8381101561037e578181015183820152602001610366565b50505050905001868103845289818151815260200191508051906020019060200280838360005b838110156103bd5781810151838201526020016103a5565b50505050905001868103835288818151815260200191508051906020019060200280838360005b838110156103fc5781810151838201526020016103e4565b50505050905001868103825287818151815260200191508051906020019060200280838360005b8381101561043b578181015183820152602001610423565b505050509050019a505050505050505050505060405180910390f35b34801561046357600080fd5b506101cb600435610b33565b34801561047b57600080fd5b506101cb610ba2565b6101cb600435610bf5565b34801561049b57600080fd5b506101cb600160a060020a0360043516610d13565b3480156104bc57600080fd5b506101cb600435602435600160a060020a0360443516610d65565b3480156104e357600080fd5b506101e261101e565b3480156104f857600080fd5b506101cb61102e565b34801561050d57600080fd5b5061018e61108c565b34801561052257600080fd5b5061052e60043561109b565b60408051968752602087019590955285850193909352600160a060020a0390911660608501526080840152151560a0830152519081900360c00190f35b34801561057757600080fd5b506101cb611169565b34801561058c57600080fd5b506102206111f5565b3480156105a157600080fd5b506101cb6004356111fb565b3480156105b957600080fd5b5061022060043561124f565b3480156105d157600080fd5b50610220600435611261565b3480156105e957600080fd5b5061018e61131e565b3480156105fe57600080fd5b506101cb60043561132d565b34801561061657600080fd5b5061061f61148b565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b8381101561066757818101518382015260200161064f565b50505050905001848103835286818151815260200191508051906020019060200280838360005b838110156106a657818101518382015260200161068e565b50505050905001848103825285818151815260200191508051906020019060200280838360005b838110156106e55781810151838201526020016106cd565b50505050905001965050505050505060405180910390f35b34801561070957600080fd5b5061018e6115c7565b34801561071e57600080fd5b50610220600160a060020a03600435166115d6565b600254600160a060020a031681565b60015460009033600160a060020a0390811691161461076057600080fd5b50600b8054600160a060020a031916600160a060020a0392909216919091179055565b6003547501000000000000000000000000000000000000000000900460ff1681565b600154600160a060020a031681565b600160a060020a0330163190565b60086020526000908152604090205481565b60015433600160a060020a039081169116146107ef57600080fd5b600160a060020a038116151561080457600080fd5b60018054600160a060020a031916600160a060020a0392909216919091179055565b60015433600160a060020a0390811691161461084157600080fd5b600160a060020a038116151561085657600080fd5b60038054600160a060020a031916600160a060020a0392909216919091179055565b600a80548290811061088657fe5b600091825260209091206004909102018054600182015460028301546003909301549193509190600160a060020a0381169060a060020a900460ff1685565b606080606080606080606080606080600080600080600a80549050604051908082528060200260200182016040528015610909578160200160208202803883390190505b50600a54604080518281526020808402820101909152919a508015610938578160200160208202803883390190505b50600a546040805182815260208084028201019091529199508015610967578160200160208202803883390190505b50600a546040805182815260208084028201019091529198508015610996578160200160208202803883390190505b50600a5460408051828152602080840282010190915291975080156109c5578160200160208202803883390190505b50945060009350600192505b600a54831015610b1d5760008381526009602052604090205491506109f583611261565b9050600a83815481101515610a0657fe5b600091825260209091206004909102016003015460a060020a900460ff161515610b1257818985815181101515610a3957fe5b6020908102909101015287518390899086908110610a5357fe5b6020908102909101015286518190889086908110610a6d57fe5b60209081029091010152600a805484908110610a8557fe5b60009182526020909120600360049092020101548651600160a060020a0390911690879086908110610ab357fe5b600160a060020a03909216602092830290910190910152600a805442919085908110610adb57fe5b906000526020600020906004020160010154108585815181101515610afc57fe5b9115156020928302909101909101526001909301925b6001909201916109d1565b50969c959b509399509197509550919350505050565b60025433600160a060020a03908116911614610b4e57600080fd5b600160a060020a033016318110610b6457600080fd5b600254604051600160a060020a039091169082156108fc029083906000818181858888f19350505050158015610b9e573d6000803e3d6000fd5b5050565b60015433600160a060020a03908116911614610bbd57600080fd5b60035460a060020a900460ff161515610bd557600080fd5b6003805474ff000000000000000000000000000000000000000019169055565b60035460009081908190819060a060020a900460ff1615610c1557600080fd5b841515610c2157600080fd5b600a805486908110610c2f57fe5b60009182526020909120600490910201600381015490945060a060020a900460ff1615610c5b57600080fd5b6001840154421115610c6c57600080fd5b610c7585611261565b925034915082821015610c8757600080fd5b50600383018054346002860181905533600160a060020a03908116600160a060020a03198416179093556004549290911691610cc49183916115e8565b60408051600160a060020a033316815234602082015280820187905290517f19421268847f42dd61705778018ddfc43bcdce8517e7a630acb12f122c7094819181900360600190a15050505050565b60015433600160a060020a03908116911614610d2e57600080fd5b600160a060020a0381161515610d4357600080fd5b60028054600160a060020a031916600160a060020a0392909216919091179055565b600080600080610d7361108c565b600160a060020a031633600160a060020a0316141515610d9257600080fd5b6014861015610da057600080fd5b623b53808610610daf57600080fd5b861515610dbb57600080fd5b600160a060020a0385161515610dd057600080fd5b610dda8786611616565b610de442876116a8565b6000888152600860205260409020549094509250821515610f44576040805160a08101825242815260208082018781526000838501818152600160a060020a038b81166060870190815260808701848152600a805460018101825590865297517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a860048a029081019190915595517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a987015592517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2aa860155517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ab90940180549251600160a060020a0319909316949091169390931774ff0000000000000000000000000000000000000000191660a060020a91151591909102179091558a8152600882528381208390558281526009909152919091208890559150610fcd565b600a805484908110610f5257fe5b906000526020600020906004020190508060030160149054906101000a900460ff16151560011515141515610f8657600080fd5b4281556001810184905560038101805460006002840155600160a060020a031916600160a060020a0387161774ff0000000000000000000000000000000000000000191690555b6040805188815260208101889052600160a060020a0387168183015290517f9f73aaf9708695add4256f1c2d3a7806702de1d16fe47ffbe80cb5df9f6d8d209181900360600190a150505050505050565b60035460a060020a900460ff1681565b600160a060020a033316600081815260208190526040808220805490839055905190929183156108fc02918491818181858888f19350505050151561108957600160a060020a03331660009081526020819052604090208190555b50565b600b54600160a060020a031690565b6000806000806000806110ac61181d565b8715156110b857600080fd5b600088815260086020526040902054600a805490919081106110d657fe5b60009182526020918290206040805160a08101825260049390930290910180548352600181015493830193909352600283015490820152600390910154600160a060020a0381166060830181905260a060020a90910460ff1615156080830152909150156101745780516020820151606083015160408401516080909401519a9b929a9199509750919550909350915050565b60035433600160a060020a0390811691161480611194575060015433600160a060020a039081169116145b806111ad575060025433600160a060020a039081169116145b15156111b857600080fd5b60035460a060020a900460ff16156111cf57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a179055565b60065490565b60035433600160a060020a0390811691161480611226575060015433600160a060020a039081169116145b8061123f575060025433600160a060020a039081169116145b151561124a57600080fd5b600655565b60096020526000908152604090205481565b600061126b61181d565b600083151561127957600080fd5b600a80548590811061128757fe5b60009182526020918290206040805160a0810182526004909302909101805483526001810154938301939093526002830154908201819052600390920154600160a060020a038116606083015260ff60a060020a9091041615156080820152925015156112f8576006549250611317565b50600554604082015160649182010204611311816116be565b90508092505b5050919050565b600354600160a060020a031681565b600081151561133b57600080fd5b600a80548390811061134957fe5b60009182526020909120600490910201600381015490915060a060020a900460ff161561137557600080fd5b6001810154421161138557600080fd5b60038101805474ff0000000000000000000000000000000000000000191660a060020a1790819055600b546000848152600960205260408082205481517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03958616600482015260248101919091529051939092169263a9059cbb92604480820193929182900301818387803b15801561142757600080fd5b505af115801561143b573d6000803e3d6000fd5b505050600382015460408051600160a060020a0390921682526020820185905280517fe7eeb8e436693c5fbdcae05aba48eec69ea26a181e7b04c1a3ace5b1e474dcdd9350918290030190a15050565b606080606080606080600080600080600a805490506040519080825280602002602001820160405280156114c9578160200160208202803883390190505b50600a5460408051828152602080840282010190915291985080156114f8578160200160208202803883390190505b50600a546040805182815260208084028201019091529197508015611527578160200160208202803883390190505b50945060009350600192505b600a548310156115b657600083815260096020526040902054915061155783611261565b905081878581518110151561156857fe5b602090810290910101528551839087908690811061158257fe5b602090810290910101528451819086908690811061159c57fe5b602090810290910101526001938401939290920191611533565b509498939750919550919350505050565b600b54600160a060020a031681565b60006020819052908152604090205481565b6103e8818302048083036115ff85826159d86117d0565b151561160f5761160f85826117fb565b5050505050565b600b54604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a038481166004830152308116602483015260448201869052915191909216916323b872dd91606480830192600092919082900301818387803b15801561168c57600080fd5b505af11580156116a0573d6000803e3d6000fd5b505050505050565b6000828201838110156116b757fe5b9392505050565b600066038d7ea4c680008210156116d65750806117cb565b662386f26fc100008210156116f657506509184e72a000808204026117cb565b67016345785d8a00008210156117175750655af3107a4000808204026117cb565b670de0b6b3a7640000821015611739575066038d7ea4c68000808204026117cb565b678ac7230489e8000082101561175b5750662386f26fc10000808204026117cb565b68056bc75e2d6310000082101561177f575067016345785d8a0000808204026117cb565b683635c9adc5dea000008210156117a35750670de0b6b3a7640000808204026117cb565b69021e19e0c9bab24000008210156117c85750678ac7230489e80000808204026117cb565b50805b919050565b600083600160a060020a0316838390604051600060405180830381858888f198975050505050505050565b600160a060020a03909116600090815260208190526040902080549091019055565b60a0604051908101604052806000815260200160008152602001600081526020016000600160a060020a0316815260200160001515815250905600a165627a7a72305820981aa259f89476e5b23de5972eff17849f4896f2f7e718d63cce4632f29d484e0029

Swarm Source

bzzr://981aa259f89476e5b23de5972eff17849f4896f2f7e718d63cce4632f29d484e

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.