Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 276 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Buy Omega Egg | 5212700 | 2475 days ago | IN | 0.00001 ETH | 0.0000642 | ||||
Buy Omega Egg | 5212676 | 2475 days ago | IN | 0.00001 ETH | 0.0000642 | ||||
Transfer | 5126469 | 2490 days ago | IN | 0 ETH | 0.00021046 | ||||
Transfer | 5126467 | 2490 days ago | IN | 0 ETH | 0.00008418 | ||||
Transfer | 5119039 | 2491 days ago | IN | 0 ETH | 0.00008418 | ||||
Withdraw | 5106585 | 2493 days ago | IN | 0 ETH | 0.00002992 | ||||
Buy Omega Egg | 5106282 | 2493 days ago | IN | 0.09 ETH | 0.00064326 | ||||
Buy Omega Egg | 5106268 | 2493 days ago | IN | 0.09 ETH | 0.00098964 | ||||
Buy Omega Egg | 5105540 | 2493 days ago | IN | 0.09 ETH | 0.00202876 | ||||
Buy Omega Egg | 5105426 | 2493 days ago | IN | 0.09 ETH | 0.00202876 | ||||
Buy Omega Egg | 5104391 | 2493 days ago | IN | 0.09 ETH | 0.00202876 | ||||
Buy Omega Egg | 5103243 | 2494 days ago | IN | 0.09 ETH | 0.00202876 | ||||
Buy Omega Egg | 5103192 | 2494 days ago | IN | 0.09 ETH | 0.000902 | ||||
Buy Omega Egg | 5103149 | 2494 days ago | IN | 0.09 ETH | 0.00202876 | ||||
Buy Omega Egg | 5103130 | 2494 days ago | IN | 0.09 ETH | 0.00049482 | ||||
Buy Omega Egg | 5103077 | 2494 days ago | IN | 0.09 ETH | 0.00024741 | ||||
Buy Omega Egg | 5102960 | 2494 days ago | IN | 0.09 ETH | 0.00206892 | ||||
Buy Omega Egg | 5102864 | 2494 days ago | IN | 0.09 ETH | 0.00069274 | ||||
Buy Omega Egg | 5102822 | 2494 days ago | IN | 0.09 ETH | 0.00123705 | ||||
Buy Omega Egg | 5102791 | 2494 days ago | IN | 0.09 ETH | 0.00202876 | ||||
Buy Omega Egg | 5102742 | 2494 days ago | IN | 0.09 ETH | 0.00103912 | ||||
Buy Omega Egg | 5102736 | 2494 days ago | IN | 0.09 ETH | 0.00202876 | ||||
Buy Omega Egg | 5102728 | 2494 days ago | IN | 0.09 ETH | 0.00202876 | ||||
Buy Omega Egg | 5102623 | 2494 days ago | IN | 0.09 ETH | 0.00202876 | ||||
Buy Omega Egg | 5102569 | 2494 days ago | IN | 0.09 ETH | 0.00024741 |
Loading...
Loading
Contract Name:
OmegaEggSale
Compiler Version
v0.4.19+commit.c4cbbb05
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *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
- No Contract Security Audit Submitted- Submit Audit Here
[{"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"}]
Contract Creation Code
6060604052341561000f57600080fd5b60008054600160a060020a03191633600160a060020a03161781556206978090603c905b8160ff168160ff1610156100675760ff81166000908152600160208190526040909120805460ff1916600a17905501610033565b505050610319806100796000396000f3006060604052600436106100615763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631b385f3481146100665780633ccfd60b146100705780634bdb736914610083578063cf0e4be5146100b6575b600080fd5b61006e6100e5565b005b341561007b57600080fd5b61006e61023a565b341561008e57600080fd5b6100a2600160a060020a03600435166102a1565b604051901515815260200160405180910390f35b34156100c157600080fd5b6100cf60ff600435166102c4565b60405160ff909116815260200160405180910390f35b600067013fbe85edc900003410156100fc57600080fd5b42635a8181c0111580156101135750635a88194042105b151561011e57600080fd5b600160a060020a03331660009081526002602052604090205460ff161561014457600080fd5b61014d426102dc565b60ff80821660009081526001602052604081205492935091161161017057600080fd5b60ff808216600090815260016020818152604080842080546000198188160190961660ff19968716179055600160a060020a03331680855260029092529283902080549094169091179092554291907fe1b92b217616ca0c171bde453cbfc625cdf98b3a09fa7643b026771746c90c8e905160405180910390a367013fbe85edc9000034111561023757600160a060020a03331667013fbe85edc8ffff19340180156108fc0290604051600060405180830381858888f19350505050151561023757600080fd5b50565b60005433600160a060020a0390811691161461025557600080fd5b635a88194042101561026657600080fd5b600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561029f57600080fd5b565b600160a060020a031660009081526002602052604090205460ff16151560011490565b60ff9081166000908152600160205260409020541690565b611c20635a8181bf199190910104905600a165627a7a7230582066a4cd53722dc9366e1822e1a1f43f08302dadfb741b0a0acf7d1948fc2841390029
Deployed Bytecode
0x6060604052600436106100615763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631b385f3481146100665780633ccfd60b146100705780634bdb736914610083578063cf0e4be5146100b6575b600080fd5b61006e6100e5565b005b341561007b57600080fd5b61006e61023a565b341561008e57600080fd5b6100a2600160a060020a03600435166102a1565b604051901515815260200160405180910390f35b34156100c157600080fd5b6100cf60ff600435166102c4565b60405160ff909116815260200160405180910390f35b600067013fbe85edc900003410156100fc57600080fd5b42635a8181c0111580156101135750635a88194042105b151561011e57600080fd5b600160a060020a03331660009081526002602052604090205460ff161561014457600080fd5b61014d426102dc565b60ff80821660009081526001602052604081205492935091161161017057600080fd5b60ff808216600090815260016020818152604080842080546000198188160190961660ff19968716179055600160a060020a03331680855260029092529283902080549094169091179092554291907fe1b92b217616ca0c171bde453cbfc625cdf98b3a09fa7643b026771746c90c8e905160405180910390a367013fbe85edc9000034111561023757600160a060020a03331667013fbe85edc8ffff19340180156108fc0290604051600060405180830381858888f19350505050151561023757600080fd5b50565b60005433600160a060020a0390811691161461025557600080fd5b635a88194042101561026657600080fd5b600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561029f57600080fd5b565b600160a060020a031660009081526002602052604090205460ff16151560011490565b60ff9081166000908152600160205260409020541690565b611c20635a8181bf199190910104905600a165627a7a7230582066a4cd53722dc9366e1822e1a1f43f08302dadfb741b0a0acf7d1948fc2841390029
Swarm Source
bzzr://66a4cd53722dc9366e1822e1a1f43f08302dadfb741b0a0acf7d1948fc284139
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.