Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,157 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw | 5431181 | 2299 days ago | IN | 0 ETH | 0.00015217 | ||||
Purchase Crate | 5194161 | 2339 days ago | IN | 0.2284 ETH | 0.00086412 | ||||
Purchase Crate | 5194161 | 2339 days ago | IN | 0.2284 ETH | 0.00030244 | ||||
Purchase Crate | 5194161 | 2339 days ago | IN | 0.2284 ETH | 0.00030244 | ||||
Purchase Crate | 5194160 | 2339 days ago | IN | 0.2284 ETH | 0.00052927 | ||||
Purchase Crate | 5194064 | 2339 days ago | IN | 0.2284 ETH | 0.00012961 | ||||
Purchase Crate | 5194051 | 2339 days ago | IN | 0.2272 ETH | 0.00043206 | ||||
Purchase Crate | 5042095 | 2364 days ago | IN | 0.2337 ETH | 0.00010507 | ||||
Purchase Crate | 5041796 | 2364 days ago | IN | 0.2336 ETH | 0.00165154 | ||||
Purchase Crate | 5041789 | 2364 days ago | IN | 0.2335 ETH | 0.00165154 | ||||
Purchase Crate | 5041773 | 2364 days ago | IN | 0.2334 ETH | 0.00165154 | ||||
Purchase Crate | 5041752 | 2364 days ago | IN | 0.2333 ETH | 0.0022521 | ||||
Transfer | 5041449 | 2365 days ago | IN | 1.99 ETH | 0.00109228 | ||||
Purchase Crate | 5040326 | 2365 days ago | IN | 0.2332 ETH | 0.0015014 | ||||
Purchase Crate | 5040318 | 2365 days ago | IN | 0.2331 ETH | 0.00045042 | ||||
Purchase Crate | 5038959 | 2365 days ago | IN | 0.2318 ETH | 0.00134734 | ||||
Purchase Crate | 5038861 | 2365 days ago | IN | 0.2329 ETH | 0.0021014 | ||||
Purchase Crate | 5038783 | 2365 days ago | IN | 0.2316 ETH | 0.00134734 | ||||
Purchase Crate | 5038777 | 2365 days ago | IN | 0.2315 ETH | 0.00134734 | ||||
Purchase Crate | 5038759 | 2365 days ago | IN | 0.2314 ETH | 0.00194734 | ||||
Purchase Crate | 5038746 | 2365 days ago | IN | 0.2324 ETH | 0.0067563 | ||||
Purchase Crate | 5038700 | 2365 days ago | IN | 0.2324 ETH | 0.0021014 | ||||
Purchase Crate | 5038558 | 2365 days ago | IN | 0.2323 ETH | 0.0021014 | ||||
Purchase Crate | 5038266 | 2365 days ago | IN | 0.2322 ETH | 0.00037535 | ||||
Purchase Crate | 5037549 | 2365 days ago | IN | 0.2321 ETH | 0.00247731 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
5431181 | 2299 days ago | 157.8971 ETH | ||||
5418355 | 2301 days ago | 0 ETH | ||||
5042095 | 2364 days ago | 0.0012 ETH | ||||
5041796 | 2364 days ago | 0.0012 ETH | ||||
5041789 | 2364 days ago | 0.0012 ETH | ||||
5041773 | 2364 days ago | 0.0012 ETH | ||||
5041752 | 2364 days ago | 0.0012 ETH | ||||
5040326 | 2365 days ago | 0.0012 ETH | ||||
5040318 | 2365 days ago | 0.0012 ETH | ||||
5038861 | 2365 days ago | 0.0012 ETH | ||||
5038746 | 2365 days ago | 0.0011 ETH | ||||
5038700 | 2365 days ago | 0.0012 ETH | ||||
5038558 | 2365 days ago | 0.0012 ETH | ||||
5038266 | 2365 days ago | 0.0012 ETH | ||||
5037549 | 2365 days ago | 0.0012 ETH | ||||
5037531 | 2365 days ago | 0.0012 ETH | ||||
5037513 | 2365 days ago | 0.0012 ETH | ||||
5037510 | 2365 days ago | 0.0012 ETH | ||||
5037502 | 2365 days ago | 0.0012 ETH | ||||
5037494 | 2365 days ago | 0.0012 ETH | ||||
5037476 | 2365 days ago | 0.0012 ETH | ||||
5037457 | 2365 days ago | 0.0012 ETH | ||||
5037381 | 2365 days ago | 0.0012 ETH | ||||
5037374 | 2365 days ago | 0.0012 ETH | ||||
5037369 | 2365 days ago | 0.0012 ETH |
Loading...
Loading
Contract Name:
CratePreSale
Compiler Version
v0.4.18+commit.9cf6e910
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-01-28 */ pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract CratePreSale is Ownable { // ------ STATE ------ uint256 constant public MAX_CRATES_TO_SELL = 3900; // Max no. of robot crates to ever be sold uint256 constant public PRESALE_END_TIMESTAMP = 1518699600; // End date for the presale - no purchases can be made after this date - Midnight 16 Feb 2018 UTC uint256 public appreciationRateWei = 400000000000000; uint256 public currentPrice = appreciationRateWei; // initalise the price to the appreciation rate uint32 public cratesSold; mapping (address => uint32) public userCrateCount; // store how many crates a user has bought mapping (address => uint[]) public userToRobots; // store the DNA/robot information of bought crates // ------ EVENTS ------ event LogCratePurchase( address indexed _from, uint256 _value, uint32 _quantity ); // ------ FUNCTIONS ------ function getPrice() view public returns (uint256) { return currentPrice; } function getRobotsForUser( address _user ) view public returns (uint[]) { return userToRobots[_user]; } function incrementPrice() private { // Decrease the rate of increase of the crate price // as the crates become more expensive // to avoid runaway pricing // (halving rate of increase at 0.1 ETH, 0.2 ETH, 0.3 ETH). if ( currentPrice == 100000000000000000 ) { appreciationRateWei = 200000000000000; } else if ( currentPrice == 200000000000000000) { appreciationRateWei = 100000000000000; } else if (currentPrice == 300000000000000000) { appreciationRateWei = 50000000000000; } currentPrice += appreciationRateWei; } function purchaseCrate() payable public { require(now < PRESALE_END_TIMESTAMP); // Check presale is still ongoing require(cratesSold < MAX_CRATES_TO_SELL); // Check max crates sold is less than hard limit require(msg.value >= currentPrice); // Check buyer sent sufficient funds to purchase if (msg.value > currentPrice) { //overpaid, return excess msg.sender.transfer(msg.value-currentPrice); } userCrateCount[msg.sender] += 1; cratesSold++; incrementPrice(); userToRobots[msg.sender].push(genRandom()); LogCratePurchase(msg.sender, msg.value, 1); } // ROBOT FORMAT // [3 digits - RARITY][2 digits - PART] * 4 (4 parts) // e.g. [140][20][218][04] // Presale exclusives are encoded by extending the range of the part by 1 // ie lamborghini will be the 23rd body. If 23 (or a multiple of it) is generated, a lamborghini will be awarded. //RARITY INFORMATION: //All parts are of equal rarity, except for presale exclusives. //A three-digit modifier precedes each part, denoting whether it is of type //normal, rare shadow, or legendary gold. //Shadow has a 10% chance of applying for the presale (2% in game) //Gold has a 5% chance of applying for the presale (1% in game). function genRandom() private view returns (uint) { uint rand = uint(keccak256(block.blockhash(block.number-1))); return uint(rand % (10 ** 20)); } //owner only withdrawal function for the presale function withdraw() onlyOwner public { owner.transfer(this.balance); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[],"name":"cratesSold","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_user","type":"address"}],"name":"getRobotsForUser","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_CRATES_TO_SELL","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PRESALE_END_TIMESTAMP","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"currentPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"userCrateCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"purchaseCrate","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"userToRobots","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appreciationRateWei","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":false,"name":"_value","type":"uint256"},{"indexed":false,"name":"_quantity","type":"uint32"}],"name":"LogCratePurchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]
Contract Creation Code
606060405266016bcc41e90000600155600154600255336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610aa2806100646000396000f3006060604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063115f6795146100ca5780633ccfd60b146100ff5780637b2bff9d146101145780638da5cb5b146101a257806392d33200146101f757806398d5fdca1461022057806399110d3c146102495780639d1b464a14610272578063a3fe0dc71461029b578063ceb2731a146102f4578063d1776731146102fe578063ef5121b314610354578063f2fde38b1461037d575b600080fd5b34156100d557600080fd5b6100dd6103b6565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561010a57600080fd5b6101126103cc565b005b341561011f57600080fd5b61014b600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506104a1565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561018e578082015181840152602081019050610173565b505050509050019250505060405180910390f35b34156101ad57600080fd5b6101b561053e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561020257600080fd5b61020a610563565b6040518082815260200191505060405180910390f35b341561022b57600080fd5b610233610569565b6040518082815260200191505060405180910390f35b341561025457600080fd5b61025c610573565b6040518082815260200191505060405180910390f35b341561027d57600080fd5b61028561057b565b6040518082815260200191505060405180910390f35b34156102a657600080fd5b6102d2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610581565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b6102fc6105a4565b005b341561030957600080fd5b61033e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107c1565b6040518082815260200191505060405180910390f35b341561035f57600080fd5b6103676107f2565b6040518082815260200191505060405180910390f35b341561038857600080fd5b6103b4600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506107f8565b005b600360009054906101000a900463ffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561042757600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561049f57600080fd5b565b6104a9610a11565b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561053257602002820191906000526020600020905b81548152602001906001019080831161051e575b50505050509050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f3c81565b6000600254905090565b635a85845081565b60025481565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b635a858450421015156105b657600080fd5b610f3c600360009054906101000a900463ffffffff1663ffffffff161015156105de57600080fd5b60025434101515156105ef57600080fd5b60025434111561063e573373ffffffffffffffffffffffffffffffffffffffff166108fc60025434039081150290604051600060405180830381858888f19350505050151561063d57600080fd5b5b6001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff1602179055506003600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff160217905550506106f561094d565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060010182816107469190610a25565b9160005260206000209001600061075b6109cb565b909190915055503373ffffffffffffffffffffffffffffffffffffffff167f17124ed99280636930e376a3b7b93b757632823d49745fe8c68881ec428f9978346001604051808381526020018263ffffffff1681526020019250505060405180910390a2565b6005602052816000526040600020818154811015156107dc57fe5b9060005260206000209001600091509150505481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561085357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561088f57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b67016345785d8a000060025414156109715765b5e620f480006001819055506109b7565b6702c68af0bb140000600254141561099557655af3107a40006001819055506109b6565b670429d069189e000060025414156109b557652d79883d20006001819055505b5b5b600154600260008282540192505081905550565b6000806001430340604051808260001916600019168152602001915050604051809103902060019004905068056bc75e2d6310000081811515610a0a57fe5b0691505090565b602060405190810160405280600081525090565b815481835581811511610a4c57818360005260206000209182019101610a4b9190610a51565b5b505050565b610a7391905b80821115610a6f576000816000905550600101610a57565b5090565b905600a165627a7a72305820d1a1f2796ea04d4f50d4aeb8d3da0173bc2dcea80e9d5c12eae8e17580b4fe900029
Deployed Bytecode
0x6060604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063115f6795146100ca5780633ccfd60b146100ff5780637b2bff9d146101145780638da5cb5b146101a257806392d33200146101f757806398d5fdca1461022057806399110d3c146102495780639d1b464a14610272578063a3fe0dc71461029b578063ceb2731a146102f4578063d1776731146102fe578063ef5121b314610354578063f2fde38b1461037d575b600080fd5b34156100d557600080fd5b6100dd6103b6565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561010a57600080fd5b6101126103cc565b005b341561011f57600080fd5b61014b600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506104a1565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561018e578082015181840152602081019050610173565b505050509050019250505060405180910390f35b34156101ad57600080fd5b6101b561053e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561020257600080fd5b61020a610563565b6040518082815260200191505060405180910390f35b341561022b57600080fd5b610233610569565b6040518082815260200191505060405180910390f35b341561025457600080fd5b61025c610573565b6040518082815260200191505060405180910390f35b341561027d57600080fd5b61028561057b565b6040518082815260200191505060405180910390f35b34156102a657600080fd5b6102d2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610581565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b6102fc6105a4565b005b341561030957600080fd5b61033e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107c1565b6040518082815260200191505060405180910390f35b341561035f57600080fd5b6103676107f2565b6040518082815260200191505060405180910390f35b341561038857600080fd5b6103b4600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506107f8565b005b600360009054906101000a900463ffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561042757600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561049f57600080fd5b565b6104a9610a11565b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561053257602002820191906000526020600020905b81548152602001906001019080831161051e575b50505050509050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f3c81565b6000600254905090565b635a85845081565b60025481565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b635a858450421015156105b657600080fd5b610f3c600360009054906101000a900463ffffffff1663ffffffff161015156105de57600080fd5b60025434101515156105ef57600080fd5b60025434111561063e573373ffffffffffffffffffffffffffffffffffffffff166108fc60025434039081150290604051600060405180830381858888f19350505050151561063d57600080fd5b5b6001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff1602179055506003600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff160217905550506106f561094d565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060010182816107469190610a25565b9160005260206000209001600061075b6109cb565b909190915055503373ffffffffffffffffffffffffffffffffffffffff167f17124ed99280636930e376a3b7b93b757632823d49745fe8c68881ec428f9978346001604051808381526020018263ffffffff1681526020019250505060405180910390a2565b6005602052816000526040600020818154811015156107dc57fe5b9060005260206000209001600091509150505481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561085357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561088f57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b67016345785d8a000060025414156109715765b5e620f480006001819055506109b7565b6702c68af0bb140000600254141561099557655af3107a40006001819055506109b6565b670429d069189e000060025414156109b557652d79883d20006001819055505b5b5b600154600260008282540192505081905550565b6000806001430340604051808260001916600019168152602001915050604051809103902060019004905068056bc75e2d6310000081811515610a0a57fe5b0691505090565b602060405190810160405280600081525090565b815481835581811511610a4c57818360005260206000209182019101610a4b9190610a51565b5b505050565b610a7391905b80821115610a6f576000816000905550600101610a57565b5090565b905600a165627a7a72305820d1a1f2796ea04d4f50d4aeb8d3da0173bc2dcea80e9d5c12eae8e17580b4fe900029
Swarm Source
bzzr://d1a1f2796ea04d4f50d4aeb8d3da0173bc2dcea80e9d5c12eae8e17580b4fe90
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 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.