Contract 0x035d029839D7cdc1F111dCfB6303D763459A46dC 2

 
Txn Hash
Method
Block
From
To
Value
0x4391231dbdc428ca462668e9e25a652b895f8ee679036fd86ce60cf79bd67e88Buy Egg77095372019-05-06 20:51:051200 days 3 hrs ago0x591a13a752a65a3107ebde51a3d7d6816ca8a5bb IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍072 Ether0.‍0006014810
0xb981d3f5d6ae4ffc25ac33ece58839fa8955257635c09ff1a89e9f2ed673ada9Buy Egg65016942018-10-12 14:29:081406 days 9 hrs ago0x4d18fba24e45cff12021c9e1334a395885484013 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍136 Ether0.‍0006014810
0x452793263e234d762dead334d27fb36b1e9a471c2fc4663895fa3d98e5312c88Buy Egg64284732018-09-30 16:59:041418 days 6 hrs ago0xf65ceeea840204c4d3f675ab20c0da47618caf8e IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍074 Ether0.‍000481188
0x74c4fe4b4516d2cc9a6dc863d103997013e6b93f8e05ca8a1d2270e363bced0aBuy Egg63876572018-09-24 0:16:021424 days 23 hrs ago0xbd888d69c53c1358c443ce4343d77f2ce6da88f2 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍076 Ether0.‍0006014810
0x8da5c4af1f3af3f56826b84e7ba85a810a9aebf1b4b58320f404b37d642023aeBuy Egg63876542018-09-24 0:15:461424 days 23 hrs ago0xbd888d69c53c1358c443ce4343d77f2ce6da88f2 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍07 Ether0.‍0006014810
0x68cf78fa73aaeba1b209b6f5d8688d29a022594061553241a67f80e15111469cBuy Egg63873492018-09-23 23:02:381425 days 52 mins ago0xbd888d69c53c1358c443ce4343d77f2ce6da88f2 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍133 Ether0.‍0006014810
0x543ace65b8ec52835b4aeed70c8948e51115803e90170aaa6780ce08bf01b572Buy Egg62676862018-09-04 1:57:591444 days 21 hrs ago0x4c55ab8ea03908ff8c06d6c8ebc2611e36be2cba IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍074 Ether0.‍0006014810
0xfe5bf9476b5993b7e51b5ca68606f9558373cdfb2637517bf3a9d0429b264365Buy Egg62578562018-09-02 10:23:271446 days 13 hrs ago0x0096593dac3a4c7f1e3bc6707141200eb02a56ed IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍1195 Ether0.‍0006014810
0xf5c26a01727e8abe75440b2bcaed32a7eb409dcfdf22515cce587cdf9a1b7166Buy Egg62578532018-09-02 10:22:371446 days 13 hrs ago0x0096593dac3a4c7f1e3bc6707141200eb02a56ed IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍1315 Ether0.‍0006014810
0x52369e1455a2d78a72e8d1194724b6186c03ecee9cdfab7ef5dce5de13c61b08Buy Egg59887082018-07-18 22:09:271492 days 1 hr ago0xd08be000d9223c5c22c05bca9bbb99bd73bf6097 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍118 Ether0.‍0006014810
0x5718402ea2848a1a733431a02b39b3a267753c7e3f7c14043c535efba2c018d2Buy Egg59823912018-07-17 20:02:371493 days 3 hrs ago0xc21096f0ad0227ec3e8bd94923456bd8672728b2 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍1165 Ether0.‍0006014810
0xe4837ed86c7ba59b708ecb2b308e0fd1d54ceb8bec7cbf92e90c24e0a4e1811bBuy Egg59823822018-07-17 20:00:361493 days 3 hrs ago0xc21096f0ad0227ec3e8bd94923456bd8672728b2 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍14 Ether0.‍0006014810
0x82273c6d42e8a28537a84689acbe4eae8cbe9ae6c630a530d20879876dcb6674Buy Egg59742092018-07-16 10:24:551494 days 13 hrs agoENS Name elpollo.eth IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍068 Ether0.‍0009022215
0x8cb0c6b0892faa31140a223127ba9c25e6ceeed74197b0833c5b0bc1ef32cf86Buy Egg59705202018-07-15 19:30:181495 days 4 hrs ago0x0c3c04ef4c0dc48099b9775b3ff30c48dc0d22f0 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍14 Ether0.‍0006014810
0x458f00022f76e5d6a4236f35165d1067162e969ca718a3f336b5da0ef3e94228Buy Egg59705052018-07-15 19:27:351495 days 4 hrs ago0x0c3c04ef4c0dc48099b9775b3ff30c48dc0d22f0 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍13 Ether0.‍000467920
0xb2dc3906ea6e36289c4b81f8b005b3c41c297c16a0baa624fe6d620c0bc5b60cBuy Egg59705052018-07-15 19:27:351495 days 4 hrs ago0x0c3c04ef4c0dc48099b9775b3ff30c48dc0d22f0 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍13 Ether0.‍000467920
0x1c20458bf9bb7916e1b64501a7f85fb6e8fe9e1c5628348c8d0bb94ffb212f03Buy Egg59705052018-07-15 19:27:351495 days 4 hrs ago0x0c3c04ef4c0dc48099b9775b3ff30c48dc0d22f0 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍13 Ether0.‍0023395100
0x78ecb66d9ce16d37154043e8cbfd1a4b6ec529cacecbd6bfbc7e953df9c16741Buy Egg59705052018-07-15 19:27:351495 days 4 hrs ago0x0c3c04ef4c0dc48099b9775b3ff30c48dc0d22f0 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍13 Ether0.‍001403760
0xbdc44a741f7859797e3a9237d2297ea339b8c1eca72a56c91d7d2e5083755996Buy Egg59705052018-07-15 19:27:351495 days 4 hrs ago0x0c3c04ef4c0dc48099b9775b3ff30c48dc0d22f0 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍13 Ether0.‍0011697550
0x2a9bde55663b93240a5f4eb11cb1340254c259336ee7bfeb9fcf1d372a1f3c96Buy Egg59705052018-07-15 19:27:351495 days 4 hrs ago0x0c3c04ef4c0dc48099b9775b3ff30c48dc0d22f0 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍13 Ether0.‍000935840
0xd3e1b7b76eb6e18b29faffb59a43ac1394d6635a6173760448e492244b90d7b6Buy Egg59705052018-07-15 19:27:351495 days 4 hrs ago0x0c3c04ef4c0dc48099b9775b3ff30c48dc0d22f0 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍13 Ether0.‍000935840
0x7a3f2545b69cb64f6ec27b8e1fa4136166a9803ec70c7d311be07d84374fb93eBuy Egg59705052018-07-15 19:27:351495 days 4 hrs ago0x0c3c04ef4c0dc48099b9775b3ff30c48dc0d22f0 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍13 Ether0.‍0005848725
0xb585e46786b2eb6ab8d2e807c42b74ca2b55f4e20f1fbe620471c468a8030251Buy Egg59705052018-07-15 19:27:351495 days 4 hrs ago0x0c3c04ef4c0dc48099b9775b3ff30c48dc0d22f0 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍13 Ether0.‍000467920
0x73866c95cd191735384ab0e6a9239fa9751daa21fe062f06eb0c2e830d568cc5Buy Egg59705042018-07-15 19:26:501495 days 4 hrs ago0x0c3c04ef4c0dc48099b9775b3ff30c48dc0d22f0 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍13 Ether0.‍0002339510
0xe86c3faad07a6493f0cc43bde176521662f993774c286fe7a13b70a755806436Buy Egg59272482018-07-08 12:09:201502 days 11 hrs ago0x0c3c04ef4c0dc48099b9775b3ff30c48dc0d22f0 IN  0x035d029839d7cdc1f111dcfb6303d763459a46dc0.‍13 Ether0.‍0006014810
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x4391231dbdc428ca462668e9e25a652b895f8ee679036fd86ce60cf79bd67e8877095372019-05-06 20:51:051200 days 3 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍072 Ether
0xb981d3f5d6ae4ffc25ac33ece58839fa8955257635c09ff1a89e9f2ed673ada965016942018-10-12 14:29:081406 days 9 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍136 Ether
0x452793263e234d762dead334d27fb36b1e9a471c2fc4663895fa3d98e5312c8864284732018-09-30 16:59:041418 days 6 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍074 Ether
0x74c4fe4b4516d2cc9a6dc863d103997013e6b93f8e05ca8a1d2270e363bced0a63876572018-09-24 0:16:021424 days 23 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍076 Ether
0x8da5c4af1f3af3f56826b84e7ba85a810a9aebf1b4b58320f404b37d642023ae63876542018-09-24 0:15:461424 days 23 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍07 Ether
0x68cf78fa73aaeba1b209b6f5d8688d29a022594061553241a67f80e15111469c63873492018-09-23 23:02:381425 days 52 mins ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍133 Ether
0x543ace65b8ec52835b4aeed70c8948e51115803e90170aaa6780ce08bf01b57262676862018-09-04 1:57:591444 days 21 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍074 Ether
0xfe5bf9476b5993b7e51b5ca68606f9558373cdfb2637517bf3a9d0429b26436562578562018-09-02 10:23:271446 days 13 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍1195 Ether
0xf5c26a01727e8abe75440b2bcaed32a7eb409dcfdf22515cce587cdf9a1b716662578532018-09-02 10:22:371446 days 13 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍1315 Ether
0x52369e1455a2d78a72e8d1194724b6186c03ecee9cdfab7ef5dce5de13c61b0859887082018-07-18 22:09:271492 days 1 hr ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍118 Ether
0x5718402ea2848a1a733431a02b39b3a267753c7e3f7c14043c535efba2c018d259823912018-07-17 20:02:371493 days 3 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍1165 Ether
0xe4837ed86c7ba59b708ecb2b308e0fd1d54ceb8bec7cbf92e90c24e0a4e1811b59823822018-07-17 20:00:361493 days 3 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍14 Ether
0x82273c6d42e8a28537a84689acbe4eae8cbe9ae6c630a530d20879876dcb667459742092018-07-16 10:24:551494 days 13 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍068 Ether
0x8cb0c6b0892faa31140a223127ba9c25e6ceeed74197b0833c5b0bc1ef32cf8659705202018-07-15 19:30:181495 days 4 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍14 Ether
0xe86c3faad07a6493f0cc43bde176521662f993774c286fe7a13b70a75580643659272482018-07-08 12:09:201502 days 11 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍13 Ether
0xad0eaa9cc86a99fb6863dec77f43c5d21f966cb042dda85fe8ecb7bdaf73443b58835522018-07-01 0:14:331509 days 23 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍115 Ether
0xa540fc8f6bc340994be68e174115a289b31a25034ab55d9959ececc51ac9ad4658645092018-06-27 17:43:581513 days 6 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍1285 Ether
0x67860d4b429cf3786286b1af545b5be716efd4835f515c39aa716c58e42d039458644842018-06-27 17:37:431513 days 6 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍132 Ether
0x6d3d3054deac7300d36dc55a0f5ded79307aadfef747a81566266616ec52429c58549662018-06-26 2:03:251514 days 21 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍128 Ether
0xe22160c067e39f120db2f759c9afd8d2dd40fb7754f35c74cfcc54dbda252f2658537812018-06-25 20:47:421515 days 3 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍062 Ether
0xc85a7e8e55993199b07264a74c951a7ba192d9c402882cd6171102600b0be2c558465712018-06-24 14:53:121516 days 9 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍068 Ether
0xcc87e3ca89a9c837ddaf5ad69c6bc504a2fe46a47269f85af6b99ba49e768db657941002018-06-15 16:18:231525 days 7 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍066 Ether
0x83dcf3e60caa1eb86829a6571ef8e627590f90211d0fbd8caf614fb2aa809c5b57940932018-06-15 16:15:401525 days 7 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍066 Ether
0xeb4e7d749a5b8bdd2b960ba1b898caa215f4bffca8f61255b59019ed2556aef057940882018-06-15 16:14:411525 days 7 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍06 Ether
0xfad1bccf637979b0437cda6122ff65320d9cfd9452aec7577a710f20ea7b63eb57940792018-06-15 16:12:471525 days 7 hrs ago 0x035d029839d7cdc1f111dcfb6303d763459a46dc 0x6186153850a5afc9384c33b565bdddcc70e6a5ae0.‍064 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EggFactory

Compiler Version
v0.4.23+commit.124ca40d

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-05-21
*/

pragma solidity ^0.4.18;

/// @title manages special access privileges.
/// @author Axiom Zen (https://www.axiomzen.co)
/// @dev See KittyAccessControl

contract AccessControl {
      /// @dev Emited when contract is upgraded - See README.md for updgrade plan
    event ContractUpgrade(address newContract);

    // The addresses of the accounts (or contracts) that can execute actions within each roles.
    address public ceoAddress;
    address public cfoAddress;
    address public cooAddress;

    // @dev Keeps track whether the contract is paused. When that is true, most actions are blocked
    bool public paused = false;

    /// @dev Access modifier for CEO-only functionality
    modifier onlyCEO() {
        require(msg.sender == ceoAddress);
        _;
    }

    /// @dev Access modifier for CFO-only functionality
    modifier onlyCFO() {
        require(msg.sender == cfoAddress);
        _;
    }

    /// @dev Access modifier for COO-only functionality
    modifier onlyCOO() {
        require(msg.sender == cooAddress);
        _;
    }

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

    /// @dev Assigns a new address to act as the CEO. Only available to the current CEO.
    /// @param _newCEO The address of the new CEO
    function setCEO(address _newCEO) external onlyCEO {
        require(_newCEO != address(0));

        ceoAddress = _newCEO;
    }

    /// @dev Assigns a new address to act as the CFO. Only available to the current CEO.
    /// @param _newCFO The address of the new CFO
    function setCFO(address _newCFO) external onlyCEO {
        require(_newCFO != address(0));

        cfoAddress = _newCFO;
    }

    /// @dev Assigns a new address to act as the COO. Only available to the current CEO.
    /// @param _newCOO The address of the new COO
    function setCOO(address _newCOO) external onlyCEO {
        require(_newCOO != address(0));

        cooAddress = _newCOO;
    }

    /*** Pausable functionality adapted from OpenZeppelin ***/

    /// @dev Modifier to allow actions only when the contract IS NOT paused
    modifier whenNotPaused() {
        require(!paused);
        _;
    }

    /// @dev Modifier to allow actions only when the contract IS paused
    modifier whenPaused {
        require(paused);
        _;
    }

    /// @dev Called by any "C-level" role to pause the contract. Used only when
    ///  a bug or exploit is detected and we need to limit damage.
    function pause() external onlyCLevel whenNotPaused {
        paused = true;
    }

    /// @dev Unpauses the smart contract. Can only be called by the CEO, since
    ///  one reason we may pause the contract is when CFO or COO accounts are
    ///  compromised.
    /// @notice This is public rather than external so it can be called by
    ///  derived contracts.
    function unpause() public onlyCEO whenPaused {
        // can't unpause if contract was upgraded
        paused = false;
    }
}

pragma solidity ^0.4.18;

contract EggFactory is AccessControl{
    
    event EggOpened(address eggOwner, uint256 eggId, uint256 amount);
    event EggBought(address eggOwner, uint256 eggId, uint256 amount);
    
    // @dev Sanity check that allows us to ensure that we are pointing to the
    //  right auction in our setEggFactoryAddress() call.
    bool public isEggFactory = true;

    address public vaultAddress;

    // @dev Scheme of egg
    struct EggScheme{
        uint256 id;
        uint256 stock; // max available eggs. zero for unlimited
        uint256 purchased; // purchased eggs
        uint256 customGene; // custom gene for future beast
        uint256 maxAllowedToBuy; // max amount allowed to buy on single transaction. zero for unnlimited
        
        uint256 increase; // price increase. zero for no increase
        uint256 price; // base price of the egg
        
        bool active; // is the egg active to be bought
        bool open; // is the egg active to be opened 
        bool isEggScheme;
    }

    // Mapping of existing eggs 
    // @dev: uint256 is the ID of the egg scheme
    mapping (uint256 => EggScheme) public eggs;
    uint256[] public eggsIndexes;
    
    uint256[] public activeEggs;
    mapping (uint256 => uint256) indexesActiveEggs;

    // Mapping of eggs owned by an address
    // @dev: owner => ( eggId => eggsAmount )
    mapping ( address => mapping ( uint256 => uint256 ) ) public eggsOwned;
    

    // Extend constructor
    function EggFactory(address _vaultAddress) public {
        vaultAddress = _vaultAddress;
        ceoAddress = msg.sender;
    }

    // Verify existence of id to avoid collision
    function eggExists( uint _eggId) internal view returns(bool) {
        return eggs[_eggId].isEggScheme;
    }

    function listEggsIds() external view returns(uint256[]){
        return eggsIndexes;
    }
    
    function listActiveEggs() external view returns(uint256[]){
        return activeEggs;
    }

    // Get the amount of purchased eggs of a struct
    function getPurchased(uint256 _eggId) external view returns(uint256){
        return eggs[_eggId].purchased;
    }

    // Set a new address for vault contract
    function setVaultAddress(address _vaultAddress) public onlyCEO returns (bool) {
        require( _vaultAddress != address(0x0) );
        vaultAddress = _vaultAddress;
    }
    
    function setActiveStatusEgg( uint256 _eggId, bool state ) public onlyCEO returns (bool){
        require(eggExists(_eggId));
        eggs[_eggId].active = state;

        if(state) {
            uint newIndex = activeEggs.push(_eggId);
            indexesActiveEggs[_eggId] = uint256(newIndex-1);
        }
        else {
            indexesActiveEggs[activeEggs[activeEggs.length-1]] = indexesActiveEggs[_eggId];
            activeEggs[indexesActiveEggs[_eggId]] = activeEggs[activeEggs.length-1]; 
            delete activeEggs[activeEggs.length-1];
            activeEggs.length--;
        }
        
        return true;
    }
    
    function setOpenStatusEgg( uint256 _eggId, bool state ) public onlyCEO returns (bool){
        require(eggExists(_eggId));
        eggs[_eggId].open = state;
        return true;
    }

    // Add modifier of onlyCOO
    function createEggScheme( uint256 _eggId, uint256 _stock, uint256 _maxAllowedToBuy, uint256 _customGene, uint256 _price, uint256 _increase, bool _active, bool _open ) public onlyCEO returns (bool){
        require(!eggExists(_eggId));
        
        eggs[_eggId].isEggScheme = true;
        
        eggs[_eggId].id = _eggId;
        eggs[_eggId].stock = _stock;
        eggs[_eggId].maxAllowedToBuy = _maxAllowedToBuy;
        eggs[_eggId].purchased = 0;
        eggs[_eggId].customGene = _customGene;
        eggs[_eggId].price = _price;
        eggs[_eggId].increase = _increase;
        
        setActiveStatusEgg(_eggId,_active);
        setOpenStatusEgg(_eggId,_open);
        
        eggsIndexes.push(_eggId);
        return true;
    }

    function buyEgg(uint256 _eggId, uint256 _amount) public payable returns(bool){
        require(eggs[_eggId].active == true);
        require((currentEggPrice(_eggId)*_amount) == msg.value);
        require(eggs[_eggId].maxAllowedToBuy == 0 || _amount<=eggs[_eggId].maxAllowedToBuy);
        require(eggs[_eggId].stock == 0 || eggs[_eggId].purchased+_amount<=eggs[_eggId].stock); // until max
        
        vaultAddress.transfer(msg.value); // transfer the amount to vault
        
        eggs[_eggId].purchased += _amount;
        eggsOwned[msg.sender][_eggId] += _amount;

        emit EggBought(msg.sender, _eggId, _amount);
    } 
    
    function currentEggPrice( uint256 _eggId ) public view returns (uint256) {
        return eggs[_eggId].price + (eggs[_eggId].purchased * eggs[_eggId].increase);
    }
    
    function openEgg(uint256 _eggId, uint256 _amount) external {
        require(eggs[_eggId].open == true);
        require(eggsOwned[msg.sender][_eggId] >= _amount);
        
        eggsOwned[msg.sender][_eggId] -= _amount;
        emit EggOpened(msg.sender, _eggId, _amount);
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"cfoAddress","outputs":[{"name":"","type":"address"}],"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":"listEggsIds","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_eggId","type":"uint256"},{"name":"state","type":"bool"}],"name":"setOpenStatusEgg","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newCEO","type":"address"}],"name":"setCEO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_eggId","type":"uint256"},{"name":"state","type":"bool"}],"name":"setActiveStatusEgg","outputs":[{"name":"","type":"bool"}],"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":"_eggId","type":"uint256"}],"name":"currentEggPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vaultAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newCFO","type":"address"}],"name":"setCFO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_eggId","type":"uint256"},{"name":"_amount","type":"uint256"}],"name":"buyEgg","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"activeEggs","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_vaultAddress","type":"address"}],"name":"setVaultAddress","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isEggFactory","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"eggsIndexes","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_eggId","type":"uint256"},{"name":"_amount","type":"uint256"}],"name":"openEgg","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"eggsOwned","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cooAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_eggId","type":"uint256"}],"name":"getPurchased","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"eggs","outputs":[{"name":"id","type":"uint256"},{"name":"stock","type":"uint256"},{"name":"purchased","type":"uint256"},{"name":"customGene","type":"uint256"},{"name":"maxAllowedToBuy","type":"uint256"},{"name":"increase","type":"uint256"},{"name":"price","type":"uint256"},{"name":"active","type":"bool"},{"name":"open","type":"bool"},{"name":"isEggScheme","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_eggId","type":"uint256"},{"name":"_stock","type":"uint256"},{"name":"_maxAllowedToBuy","type":"uint256"},{"name":"_customGene","type":"uint256"},{"name":"_price","type":"uint256"},{"name":"_increase","type":"uint256"},{"name":"_active","type":"bool"},{"name":"_open","type":"bool"}],"name":"createEggScheme","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"listActiveEggs","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_vaultAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"eggOwner","type":"address"},{"indexed":false,"name":"eggId","type":"uint256"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"EggOpened","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"eggOwner","type":"address"},{"indexed":false,"name":"eggId","type":"uint256"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"EggBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newContract","type":"address"}],"name":"ContractUpgrade","type":"event"}]

60806040526000600260146101000a81548160ff0219169083151502179055506001600260156101000a81548160ff02191690831515021790555034801561004657600080fd5b50604051602080611a6e8339810180604052810190808051906020019092919050505080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050611974806100fa6000396000f300608060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630519ce791461014e5780630a0f8168146101a55780631a9c4571146101fc57806327a1f35a1461026857806327d7874c146102b95780632a3966ff146102fc5780632ba73c151461034d57806334758cb3146103905780633f4ba83a146103d1578063430bf08a146103e85780634e0a33791461043f5780635333ee4d146104825780635c975abb146104c457806368c95d75146104f35780638456cb591461053457806385535cc51461054b57806399d1c413146105a6578063a1fb5fd2146105d5578063a5007da714610616578063ab00d0861461064d578063b047fb50146106ae578063bafc143714610705578063bb654efa14610746578063cb29881c146107d2578063cd76faf514610861575b600080fd5b34801561015a57600080fd5b506101636108cd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101b157600080fd5b506101ba6108f3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561020857600080fd5b50610211610918565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610254578082015181840152602081019050610239565b505050509050019250505060405180910390f35b34801561027457600080fd5b5061029f60048036038101908080359060200190929190803515159060200190929190505050610970565b604051808215151515815260200191505060405180910390f35b3480156102c557600080fd5b506102fa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a19565b005b34801561030857600080fd5b5061033360048036038101908080359060200190929190803515159060200190929190505050610af3565b604051808215151515815260200191505060405180910390f35b34801561035957600080fd5b5061038e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ccb565b005b34801561039c57600080fd5b506103bb60048036038101908080359060200190929190505050610da6565b6040518082815260200191505060405180910390f35b3480156103dd57600080fd5b506103e6610df6565b005b3480156103f457600080fd5b506103fd610e89565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561044b57600080fd5b50610480600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eaf565b005b6104aa6004803603810190808035906020019092919080359060200190929190505050610f8a565b604051808215151515815260200191505060405180910390f35b3480156104d057600080fd5b506104d96111e2565b604051808215151515815260200191505060405180910390f35b3480156104ff57600080fd5b5061051e600480360381019080803590602001909291905050506111f5565b6040518082815260200191505060405180910390f35b34801561054057600080fd5b50610549611218565b005b34801561055757600080fd5b5061058c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061135c565b604051808215151515815260200191505060405180910390f35b3480156105b257600080fd5b506105bb61143b565b604051808215151515815260200191505060405180910390f35b3480156105e157600080fd5b506106006004803603810190808035906020019092919050505061144e565b6040518082815260200191505060405180910390f35b34801561062257600080fd5b5061064b6004803603810190808035906020019092919080359060200190929190505050611471565b005b34801561065957600080fd5b50610698600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115db565b6040518082815260200191505060405180910390f35b3480156106ba57600080fd5b506106c3611600565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561071157600080fd5b5061073060048036038101908080359060200190929190505050611626565b6040518082815260200191505060405180910390f35b34801561075257600080fd5b5061077160048036038101908080359060200190929190505050611646565b604051808b81526020018a81526020018981526020018881526020018781526020018681526020018581526020018415151515815260200183151515158152602001821515151581526020019a505050505050505050505060405180910390f35b3480156107de57600080fd5b506108476004803603810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035151590602001909291908035151590602001909291905050506116c1565b604051808215151515815260200191505060405180910390f35b34801561086d57600080fd5b50610876611872565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156108b957808201518184015260208101905061089e565b505050509050019250505060405180910390f35b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060600580548060200260200160405190810160405280929190818152602001828054801561096657602002820191906000526020600020905b815481526020019060010190808311610952575b5050505050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109cd57600080fd5b6109d6836118ca565b15156109e157600080fd5b816004600085815260200190815260200160002060070160016101000a81548160ff0219169083151502179055506001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a7457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ab057600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b5157600080fd5b610b5a846118ca565b1515610b6557600080fd5b826004600086815260200190815260200160002060070160006101000a81548160ff0219169083151502179055508215610be657600684908060018154018082558091505090600182039060005260206000200160009091929091909150559050600181036007600086815260200190815260200160002081905550610cc0565b6007600085815260200190815260200160002054600760006006600160068054905003815481101515610c1557fe5b90600052602060002001548152602001908152602001600020819055506006600160068054905003815481101515610c4957fe5b906000526020600020015460066007600087815260200190815260200160002054815481101515610c7657fe5b90600052602060002001819055506006600160068054905003815481101515610c9b57fe5b90600052602060002001600090556006805480919060019003610cbe91906118f7565b505b600191505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d2657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610d6257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600060046000838152602001908152602001600020600501546004600084815260200190815260200160002060020154026004600084815260200190815260200160002060060154019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5157600080fd5b600260149054906101000a900460ff161515610e6c57600080fd5b6000600260146101000a81548160ff021916908315150217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f4657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600115156004600085815260200190815260200160002060070160009054906101000a900460ff161515141515610fc257600080fd5b3482610fcd85610da6565b02141515610fda57600080fd5b600060046000858152602001908152602001600020600401541480611015575060046000848152602001908152602001600020600401548211155b151561102057600080fd5b600060046000858152602001908152602001600020600101541480611073575060046000848152602001908152602001600020600101548260046000868152602001908152602001600020600201540111155b151561107e57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156110e6573d6000803e3d6000fd5b5081600460008581526020019081526020016000206002016000828254019250508190555081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020600082825401925050819055507fecf6e0dfbbc2f7493d6254378d8ceee52ce7d4408dcc744f57b70ff90cc11456338484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a192915050565b600260149054906101000a900460ff1681565b60068181548110151561120457fe5b906000526020600020016000915090505481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806112c057506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806113185750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561132357600080fd5b600260149054906101000a900460ff1615151561133f57600080fd5b6001600260146101000a81548160ff021916908315150217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113b957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156113f557600080fd5b81600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b600260159054906101000a900460ff1681565b60058181548110151561145d57fe5b906000526020600020016000915090505481565b600115156004600084815260200190815260200160002060070160019054906101000a900460ff1615151415156114a757600080fd5b80600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020541015151561150657600080fd5b80600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600082825403925050819055507f2aa333a2d3f3f0464aec49758bb3f85811caec0fb4918d3249f7de82f79f15cf338383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a15050565b6008602052816000526040600020602052806000526040600020600091509150505481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060046000838152602001908152602001600020600201549050919050565b60046020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154908060050154908060060154908060070160009054906101000a900460ff16908060070160019054906101000a900460ff16908060070160029054906101000a900460ff1690508a565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561171e57600080fd5b611727896118ca565b15151561173357600080fd5b6001600460008b815260200190815260200160002060070160026101000a81548160ff02191690831515021790555088600460008b81526020019081526020016000206000018190555087600460008b81526020019081526020016000206001018190555086600460008b8152602001908152602001600020600401819055506000600460008b81526020019081526020016000206002018190555085600460008b81526020019081526020016000206003018190555084600460008b81526020019081526020016000206006018190555083600460008b81526020019081526020016000206005018190555061182a8984610af3565b506118358983610970565b5060058990806001815401808255809150509060018203906000526020600020016000909192909190915055506001905098975050505050505050565b606060068054806020026020016040519081016040528092919081815260200182805480156118c057602002820191906000526020600020905b8154815260200190600101908083116118ac575b5050505050905090565b60006004600083815260200190815260200160002060070160029054906101000a900460ff169050919050565b81548183558181111561191e5781836000526020600020918201910161191d9190611923565b5b505050565b61194591905b80821115611941576000816000905550600101611929565b5090565b905600a165627a7a723058207782e19a9999de81da5dc744934e45ef614a1e81ea41e3f2e04312ebbb0524bf002900000000000000000000000096c35ce071cfdb641445f905386f1fd99d453de9

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

00000000000000000000000096c35ce071cfdb641445f905386f1fd99d453de9

-----Decoded View---------------
Arg [0] : _vaultAddress (address): 0x96c35ce071cfdb641445f905386f1fd99d453de9

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000096c35ce071cfdb641445f905386f1fd99d453de9


Swarm Source

bzzr://7782e19a9999de81da5dc744934e45ef614a1e81ea41e3f2e04312ebbb0524bf
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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.