ETH Price: $3,983.00 (+2.42%)

Contract

0x5C6554F85c23773fd991163cFd804ec78591eF0E
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Buy Omega Egg52127002018-03-07 13:01:112475 days ago1520427671IN
AethiaOmegaEggSale
0.00001 ETH0.00006423
Buy Omega Egg52126762018-03-07 12:55:342475 days ago1520427334IN
AethiaOmegaEggSale
0.00001 ETH0.00006423
Transfer51264692018-02-20 21:01:212490 days ago1519160481IN
AethiaOmegaEggSale
0 ETH0.0002104610
Transfer51264672018-02-20 21:00:492490 days ago1519160449IN
AethiaOmegaEggSale
0 ETH0.000084184
Transfer51190392018-02-19 14:23:312491 days ago1519050211IN
AethiaOmegaEggSale
0 ETH0.000084184
Withdraw51065852018-02-17 12:13:002493 days ago1518869580IN
AethiaOmegaEggSale
0 ETH0.000029921
Buy Omega Egg51062822018-02-17 11:03:472493 days ago1518865427IN
AethiaOmegaEggSale
0.09 ETH0.0006432613
Buy Omega Egg51062682018-02-17 11:00:512493 days ago1518865251IN
AethiaOmegaEggSale
0.09 ETH0.0009896420
Buy Omega Egg51055402018-02-17 8:12:102493 days ago1518855130IN
AethiaOmegaEggSale
0.09 ETH0.0020287641
Buy Omega Egg51054262018-02-17 7:45:182493 days ago1518853518IN
AethiaOmegaEggSale
0.09 ETH0.0020287641
Buy Omega Egg51043912018-02-17 3:39:492493 days ago1518838789IN
AethiaOmegaEggSale
0.09 ETH0.0020287641
Buy Omega Egg51032432018-02-16 23:05:242494 days ago1518822324IN
AethiaOmegaEggSale
0.09 ETH0.0020287641
Buy Omega Egg51031922018-02-16 22:53:142494 days ago1518821594IN
AethiaOmegaEggSale
0.09 ETH0.00090241
Buy Omega Egg51031492018-02-16 22:43:322494 days ago1518821012IN
AethiaOmegaEggSale
0.09 ETH0.0020287641
Buy Omega Egg51031302018-02-16 22:39:092494 days ago1518820749IN
AethiaOmegaEggSale
0.09 ETH0.0004948210
Buy Omega Egg51030772018-02-16 22:22:192494 days ago1518819739IN
AethiaOmegaEggSale
0.09 ETH0.000247415
Buy Omega Egg51029602018-02-16 21:53:292494 days ago1518818009IN
AethiaOmegaEggSale
0.09 ETH0.0020689260
Buy Omega Egg51028642018-02-16 21:29:512494 days ago1518816591IN
AethiaOmegaEggSale
0.09 ETH0.0006927414
Buy Omega Egg51028222018-02-16 21:18:302494 days ago1518815910IN
AethiaOmegaEggSale
0.09 ETH0.0012370525
Buy Omega Egg51027912018-02-16 21:10:242494 days ago1518815424IN
AethiaOmegaEggSale
0.09 ETH0.0020287641
Buy Omega Egg51027422018-02-16 20:56:432494 days ago1518814603IN
AethiaOmegaEggSale
0.09 ETH0.0010391221
Buy Omega Egg51027362018-02-16 20:54:572494 days ago1518814497IN
AethiaOmegaEggSale
0.09 ETH0.0020287641
Buy Omega Egg51027282018-02-16 20:52:442494 days ago1518814364IN
AethiaOmegaEggSale
0.09 ETH0.0020287641
Buy Omega Egg51026232018-02-16 20:26:482494 days ago1518812808IN
AethiaOmegaEggSale
0.09 ETH0.0020287641
Buy Omega Egg51025692018-02-16 20:12:492494 days ago1518811969IN
AethiaOmegaEggSale
0.09 ETH0.000247415
View all transactions

Latest 2 internal transactions

Advanced mode:
Parent Transaction Hash Block
From
To
51065852018-02-17 12:13:002493 days ago1518869580
AethiaOmegaEggSale
18.45 ETH
50951252018-02-15 14:30:362495 days ago1518705036
AethiaOmegaEggSale
0.001 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OmegaEggSale

Compiler Version
v0.4.19+commit.c4cbbb05

Optimization Enabled:
Yes with 200 runs

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

pragma solidity 0.4.19;

/**
 * Owned Contract
 * 
 * This is a contract trait to inherit from. Contracts that inherit from Owned 
 * are able to modify functions to be only callable by the owner of the
 * contract.
 * 
 * By default it is impossible to change the owner of the contract.
 */
contract Owned {
    /**
     * Contract owner.
     * 
     * This value is set at contract creation time.
     */
    address owner;

    /**
     * Contract constructor.
     * 
     * This sets the owner of the Owned contract at the time of contract
     * creation.
     */
    function Owned() public {
        owner = msg.sender;
    }

    /**
     * Modify method to only allow the owner to call it.
     */
    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }
}

/**
 * Aethia Omega Egg Sale Contract.
 * 
 * Every day, for a period of five (5) days, starting February 12th 12:00:00 
 * UTC, this contract is allowed to sell a maximum of one-hundred-and-twenty
 * (120) omega Ethergotchi eggs, for a total of six-hundred (600) eggs.
 *
 * These one-hundred-and-twenty eggs are divided over the twelve (12) time slots
 * of two (2) hours that make up each day. Every two hours, ten (10) omega
 * Ethergotchi eggs are available for 0.09 ether (excluding the gas cost of a 
 * transaction).
 *
 * Any omega eggs that remain at the end of a time slot are not transferred to
 * the next time slot.
 */
contract OmegaEggSale is Owned {

    /**
     * The start date of the omega egg sale in seconds since the UNIX epoch.
     * 
     * This value is equivalent to February 12th, 12:00:00 UTC, on a 24 hour
     * clock.
     */
    uint256 constant START_DATE = 1518436800;

    /**
     * The end date of the omega egg sale in seconds since the UNIX epoch.
     * 
     * This value is equivalent to February 17th, 12:00:00 UTC, on a 24 hour
     * clock.
     */
    uint256 constant END_DATE = 1518868800;

    /**
     * The amount of seconds within a single time slot.
     *
     * This is set to a total of two hours:
     *      2 x 60 x 60 = 7200 seconds
     */
    uint16 constant SLOT_DURATION_IN_SECONDS = 7200;

    /**
     * The number of remaining eggs in each time slot.
     * 
     * This is initially set to ten for each time slot.
     */
    mapping (uint8 => uint8) remainingEggs;
    
    /**
     * Omega egg owners.
     *
     * This is a mapping containing all owners of omega eggs. While this does
     * not prevent people from using multiple addresses to buy multiple omega
     * eggs, it does increase the difficulty slightly.
     */
    mapping (address => bool) eggOwners;

    /**
     * Omega egg sale event.
     * 
     * For audit and logging purposes, all omega egg sales are logged by 
     * acquirer and acquisition date.
     */
    event LogOmegaEggSale(address indexed _acquirer, uint256 indexed _date);

    /**
     * Contract constructor
     * 
     * This generates all omega egg time slots and the amount of available
     * omega eggs within each time slot. The generation is done by calculating
     * the total amount of seconds within the sale period together with the 
     * amount of seconds within each time slot, and dividing the former by the
     * latter for the number of time slots.
     * 
     * Each time slot is then assigned ten omega eggs.
     */
    function OmegaEggSale() Owned() public {
        uint256 secondsInSalePeriod = END_DATE - START_DATE;
        uint8 timeSlotCount = uint8(
            secondsInSalePeriod / SLOT_DURATION_IN_SECONDS
        );

        for (uint8 i = 0; i < timeSlotCount; i++) {
            remainingEggs[i] = 10;
        }
    }

    /**
     * Buy omega egg from the OmegaEggSale contract.
     * 
     * The cost of an omega egg is 0.09 ether. This contract accepts any amount
     * equal or above 0.09 ether to buy an omega egg. In the case of higher
     * amounts being sent, the contract will refund the difference.
     * 
     * To successully buy an omega egg, five conditions have to be met:
     *  1. The `buyOmegaEgg` method must be called.
     *  2. A value of 0.09 or more ether must accompany the transaction.
     *  3. The transaction occurs in between February 12th 12:00:00 UTC and
     *     February 17th 12:00:00 UTC.
     *  4. The time slot in which the transaction occurs has omega eggs
     *     available.
     *  5. The sender must not already have bought an omega egg.
     */
    function buyOmegaEgg() payable external {
        require(msg.value >= 0.09 ether);
        require(START_DATE <= now && now < END_DATE);
        require(eggOwners[msg.sender] == false);

        uint8 currentTimeSlot = getTimeSlot(now);

        require(remainingEggs[currentTimeSlot] > 0);

        remainingEggs[currentTimeSlot] -= 1;
        eggOwners[msg.sender] = true;

        LogOmegaEggSale(msg.sender, now);
        
        // Send back any remaining value
        if (msg.value > 0.09 ether) {
            msg.sender.transfer(msg.value - 0.09 ether);
        }
    }

    /**
     * Fallback payable method.
     *
     * This is in the case someone calls the contract without specifying the
     * correct method to call. This method will ensure the failure of a
     * transaction that was wrongfully executed.
     */
    function () payable external {
        revert();
    }
    
    /**
     * Return number of eggs remaining in given time slot.
     * 
     * If the time slot is not valid (e.g. the time slot does not exist
     * according to the this contract), the number of remaining eggs will
     * default to zero (0).
     * 
     * This method is intended for external viewing purposes.
     * 
     * Parameters
     * ----------
     * _timeSlot : uint8
     *     The time slot to return the number of remaining eggs for.
     * 
     * Returns
     * -------
     * uint8
     *     The number of eggs still available within the contract for given
     *     time slot.
     */
    function eggsInTimeSlot(uint8 _timeSlot) view external returns (uint8) {
        return remainingEggs[_timeSlot];
    }
    
    /**
     * Return true if `_buyer` has bought an omega egg, otherwise false.
     * 
     * This method is intended for external viewing purposes.
     * 
     * Parameters
     * ----------
     * _buyer : address
     *     The Ethereum wallet address of the buyer.
     * 
     * Returns
     * -------
     * bool
     *     True if `_buyer` has bought an egg, otherwise false.
     */
    function hasBoughtEgg(address _buyer) view external returns (bool) {
        return eggOwners[_buyer] == true;
    }
    
    /**
     * Withdraw all funds from contract.
     * 
     * This method can only be called after the OmegaEggSale contract has run
     * its course.
     */
    function withdraw() onlyOwner external {
        require(now >= END_DATE);

        owner.transfer(this.balance);
    }

    /**
     * Calculate the time slot corresponding to the given UNIX timestamp.
     *
     * The time slot is calculated by subtracting the current date and time in
     * seconds from the contract's starting date and time in seconds. The result
     * is then divided by the number of seconds within a time slot, and rounded
     * down to get the correct time slot.
     *
     * Parameters
     * ----------
     * _timestamp : uint256
     *     The timestamp to calculate a timeslot for. This is the amount of
     *     seconds elapsed since the UNIX epoch.
     *
     * Returns
     * -------
     * uint8
     *     The OmegaEggSale time slot corresponding to the given timestamp.
     *     This can be a non-existent time slot, if the timestamp is further
     *     in the future than `END_DATE`.
     */
    function getTimeSlot(uint256 _timestamp) private pure returns (uint8) {
        uint256 secondsSinceSaleStart = _timestamp - START_DATE;
        
        return uint8(secondsSinceSaleStart / SLOT_DURATION_IN_SECONDS);
    }
}

Contract Security Audit

Contract ABI

[{"constant":false,"inputs":[],"name":"buyOmegaEgg","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_buyer","type":"address"}],"name":"hasBoughtEgg","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_timeSlot","type":"uint8"}],"name":"eggsInTimeSlot","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_acquirer","type":"address"},{"indexed":true,"name":"_date","type":"uint256"}],"name":"LogOmegaEggSale","type":"event"}]

6060604052341561000f57600080fd5b60008054600160a060020a03191633600160a060020a03161781556206978090603c905b8160ff168160ff1610156100675760ff81166000908152600160208190526040909120805460ff1916600a17905501610033565b505050610319806100796000396000f3006060604052600436106100615763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631b385f3481146100665780633ccfd60b146100705780634bdb736914610083578063cf0e4be5146100b6575b600080fd5b61006e6100e5565b005b341561007b57600080fd5b61006e61023a565b341561008e57600080fd5b6100a2600160a060020a03600435166102a1565b604051901515815260200160405180910390f35b34156100c157600080fd5b6100cf60ff600435166102c4565b60405160ff909116815260200160405180910390f35b600067013fbe85edc900003410156100fc57600080fd5b42635a8181c0111580156101135750635a88194042105b151561011e57600080fd5b600160a060020a03331660009081526002602052604090205460ff161561014457600080fd5b61014d426102dc565b60ff80821660009081526001602052604081205492935091161161017057600080fd5b60ff808216600090815260016020818152604080842080546000198188160190961660ff19968716179055600160a060020a03331680855260029092529283902080549094169091179092554291907fe1b92b217616ca0c171bde453cbfc625cdf98b3a09fa7643b026771746c90c8e905160405180910390a367013fbe85edc9000034111561023757600160a060020a03331667013fbe85edc8ffff19340180156108fc0290604051600060405180830381858888f19350505050151561023757600080fd5b50565b60005433600160a060020a0390811691161461025557600080fd5b635a88194042101561026657600080fd5b600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561029f57600080fd5b565b600160a060020a031660009081526002602052604090205460ff16151560011490565b60ff9081166000908152600160205260409020541690565b611c20635a8181bf199190910104905600a165627a7a7230582066a4cd53722dc9366e1822e1a1f43f08302dadfb741b0a0acf7d1948fc2841390029

Deployed Bytecode

0x6060604052600436106100615763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631b385f3481146100665780633ccfd60b146100705780634bdb736914610083578063cf0e4be5146100b6575b600080fd5b61006e6100e5565b005b341561007b57600080fd5b61006e61023a565b341561008e57600080fd5b6100a2600160a060020a03600435166102a1565b604051901515815260200160405180910390f35b34156100c157600080fd5b6100cf60ff600435166102c4565b60405160ff909116815260200160405180910390f35b600067013fbe85edc900003410156100fc57600080fd5b42635a8181c0111580156101135750635a88194042105b151561011e57600080fd5b600160a060020a03331660009081526002602052604090205460ff161561014457600080fd5b61014d426102dc565b60ff80821660009081526001602052604081205492935091161161017057600080fd5b60ff808216600090815260016020818152604080842080546000198188160190961660ff19968716179055600160a060020a03331680855260029092529283902080549094169091179092554291907fe1b92b217616ca0c171bde453cbfc625cdf98b3a09fa7643b026771746c90c8e905160405180910390a367013fbe85edc9000034111561023757600160a060020a03331667013fbe85edc8ffff19340180156108fc0290604051600060405180830381858888f19350505050151561023757600080fd5b50565b60005433600160a060020a0390811691161461025557600080fd5b635a88194042101561026657600080fd5b600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561029f57600080fd5b565b600160a060020a031660009081526002602052604090205460ff16151560011490565b60ff9081166000908152600160205260409020541690565b611c20635a8181bf199190910104905600a165627a7a7230582066a4cd53722dc9366e1822e1a1f43f08302dadfb741b0a0acf7d1948fc2841390029

Swarm Source

bzzr://66a4cd53722dc9366e1822e1a1f43f08302dadfb741b0a0acf7d1948fc284139

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.