Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 5 from a total of 5 transactions
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
4420930 | 2567 days ago | 150 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x53a54c44...2f3c004B7 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
Preallocation
Compiler Version
v0.4.11+commit.68ef5810
Optimization Enabled:
Yes with 0 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2017-10-02 */ pragma solidity ^0.4.11; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant 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 constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Crowdsale { function buyTokens(address _recipient) payable; } contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { 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) onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } contract Preallocation is Ownable { using SafeMath for uint; address public investor; uint public maxBalance; enum States { Pending, Success, Fail } States public state = States.Pending; event InvestorChanged(address from, address to); event FundsLoaded(uint value, address from); event FundsRefunded(uint balance); event InvestmentSucceeded(uint value); event InvestmentFailed(); function Preallocation(address _investor, uint _maxBalance) { investor = _investor; maxBalance = _maxBalance; } function () payable { if (this.balance > maxBalance) { throw; } FundsLoaded(msg.value, msg.sender); } function withdraw() onlyOwner notState(States.Success) { uint bal = this.balance; if (!investor.send(bal)) { throw; } FundsRefunded(bal); } function setInvestor(address _investor) onlyOwner { InvestorChanged(investor, _investor); investor = _investor; } function buyTokens(Crowdsale crowdsale) onlyOwner { uint bal = Math.min256(this.balance, maxBalance); crowdsale.buyTokens.value(bal)(investor); state = States.Success; InvestmentSucceeded(bal); } function setFailed() onlyOwner { state = States.Fail; InvestmentFailed(); } function stateIs(States _state) constant returns (bool) { return state == _state; } modifier onlyState(States _state) { require (state == _state); _; } modifier notState(States _state) { require (state != _state); _; } } library Math { function max64(uint64 a, uint64 b) internal constant returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal constant returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal constant returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal constant returns (uint256) { return a < b ? a : b; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":false,"inputs":[],"name":"setFailed","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"investor","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_state","type":"uint8"}],"name":"stateIs","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"maxBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_investor","type":"address"}],"name":"setInvestor","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"state","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"crowdsale","type":"address"}],"name":"buyTokens","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"type":"function"},{"inputs":[{"name":"_investor","type":"address"},{"name":"_maxBalance","type":"uint256"}],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"from","type":"address"},{"indexed":false,"name":"to","type":"address"}],"name":"InvestorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"from","type":"address"}],"name":"FundsLoaded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"balance","type":"uint256"}],"name":"FundsRefunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"value","type":"uint256"}],"name":"InvestmentSucceeded","type":"event"},{"anonymous":false,"inputs":[],"name":"InvestmentFailed","type":"event"}]
Deployed Bytecode
0x606060405236156100885763ffffffff60e060020a600035041663146901db81146100ee5780631e0018d6146101005780633ccfd60b1461012c57806364ae44511461013e57806373ad468a14610168578063773041ce1461018a5780638da5cb5b146101a8578063c19d93fb146101d4578063ec8ac4d814610208578063f2fde38b14610226575b6100ec5b60025430600160a060020a03163111156100a65760006000fd5b60408051348152600160a060020a033316602082015281517f33e36c5037a4834b94e805648de1a58578badec436cfbd0679b82ca91603f40d929181900390910190a15b565b005b34156100f657fe5b6100ec610244565b005b341561010857fe5b6101106102a2565b60408051600160a060020a039092168252519081900360200190f35b341561013457fe5b6100ec6102b1565b005b341561014657fe5b61015460ff60043516610365565b604080519115158252519081900360200190f35b341561017057fe5b61017861038d565b60408051918252519081900360200190f35b341561019257fe5b6100ec600160a060020a0360043516610393565b005b34156101b057fe5b610110610417565b60408051600160a060020a039092168252519081900360200190f35b34156101dc57fe5b6101e4610426565b604051808260028111156101f457fe5b60ff16815260200191505060405180910390f35b341561021057fe5b6100ec600160a060020a036004351661042f565b005b341561022e57fe5b6100ec600160a060020a0360043516610513565b005b60005433600160a060020a039081169116146102605760006000fd5b600380546002919060ff19166001835b02179055506040517f1b0ba14d0d88ac936babe67c6ed402959bc2a548d8521436f4f27a29be3f619a90600090a15b5b565b600154600160a060020a031681565b6000805433600160a060020a039081169116146102ce5760006000fd5b6001805b60035460ff1660028111156102e357fe5b14156102ef5760006000fd5b600154604051600160a060020a03308116319450919091169083156108fc029084906000818181858888f19350505050151561032b5760006000fd5b6040805183815290517fca4bd5135a11e3fc146ac22d75f0d2eae9b6c61b6fa3eb6724a456b311ad72d39181900360200190a15b5b505b50565b600081600281111561037357fe5b60035460ff16600281111561038457fe5b1490505b919050565b60025481565b60005433600160a060020a039081169116146103af5760006000fd5b60015460408051600160a060020a039283168152918316602083015280517fc204b28865760f18aa0ef147ee25573d2dba9f208385c8aa65fb79150978fb6d9281900390910190a160018054600160a060020a031916600160a060020a0383161790555b5b50565b600054600160a060020a031681565b60035460ff1681565b6000805433600160a060020a0390811691161461044c5760006000fd5b61046230600160a060020a03163160025461055f565b6001546040805160e360020a631d91589b028152600160a060020a03928316600482015290519293509084169163ec8ac4d8918491602480830192600092919082900301818588803b15156104b357fe5b6125ee5a03f115156104c157fe5b5050600380546001935090915060ff191682805b02179055506040805182815290517f9237e61b939e9e5141705f9a758c9804d596ad248ce04d74983b3b76b27a61569181900360200190a15b5b5050565b60005433600160a060020a0390811691161461052f5760006000fd5b600160a060020a038116156103625760008054600160a060020a031916600160a060020a0383161790555b5b5b50565b600081831061056e5781610570565b825b90505b929150505600a165627a7a7230582032ec3b9985462f4cac10e51fe1a9b9cb7c1471afd1f26bf20dd104fc261c0b9d0029
Swarm Source
bzzr://32ec3b9985462f4cac10e51fe1a9b9cb7c1471afd1f26bf20dd104fc261c0b9d
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.