Overview
ETH Balance
0.01 ETH
Eth Value
$15.95 (@ $1,595.41/ETH)More Info
Private Name Tags
ContractCreator
Sponsored
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Doubler
Compiler Version
v0.3.5-2016-07-21-6610add
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2016-08-02 */ contract Doubler { struct Participant { address etherAddress; uint amount; } Participant[] public participants; uint public payoutIdx = 0; uint public collectedFees = 0; uint balance = 0; // only owner modifier address public owner; modifier onlyowner { if (msg.sender == owner) _ } // contract Constructor function Doubler() { owner = msg.sender; } // fallback function function(){ enter(); } function enter(){ // collect fee uint fee = msg.value / 40; // 2.5 % fee collectedFees += fee; // add a new participant uint idx = participants.length; participants.length++; participants[idx].etherAddress = msg.sender; participants[idx].amount = msg.value - fee; // update available balance balance += msg.value - fee; // if there are enough ether on the balance we can pay out to an earlier participant uint txAmount = participants[payoutIdx].amount * 2; if(balance >= txAmount){ if(!participants[payoutIdx].etherAddress.send(txAmount)) throw; balance -= txAmount; payoutIdx++; } } function collectFees() onlyowner { if(collectedFees == 0)return; if(!owner.send(collectedFees))throw; collectedFees = 0; } function setOwner(address _owner) onlyowner { owner = _owner; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"participants","outputs":[{"name":"etherAddress","type":"address"},{"name":"amount","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"collectedFees","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"payoutIdx","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"collectFees","outputs":[],"type":"function"},{"constant":false,"inputs":[],"name":"enter","outputs":[],"type":"function"},{"inputs":[],"type":"constructor"}]
Contract Creation Code
606060405260006001819055600281905560035560048054600160a060020a031916331790556103b1806100336000396000f3606060405236156100615760e060020a600035046313af4035811461006c57806335c1d3491461009f5780638da5cb5b146101125780639003adfe14610124578063a60f35881461012d578063c879657214610136578063e97dcb621461015e575b6101cc61015c610162565b6101cc60043560045433600160a060020a039081169116141561009c5760048054600160a060020a031916821790555b50565b6101ce600435600080548290811015610002575080526002027f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5638101547f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5649190910154600160a060020a03919091169082565b6101f4600454600160a060020a031681565b61021160025481565b61021160015481565b6101cc60045433600160a060020a039081169116141561015c5760025460001415610378575b565b6101cc5b60028054602834049081019091556000805460018101808355909190829082908280158290116102235760020281600202836000526020600020918201910161022391905b8082111561035d578054600160a060020a0319168155600060018201556002016101a7565b005b6040518083600160a060020a031681526020018281526020019250505060405180910390f35b60408051600160a060020a03929092168252519081900360200190f35b60408051918252519081900360200190f35b50505050336000600050838154811015610002578180526002027f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563018054600160a060020a03191690921790915580543485900391908490811015610002576002027f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5640191909155600380543486900301905560015481548110156100025760035460029182027f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5640154909102925082901090506103735760015460008054909190811015610002576002027f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630154604051600160a060020a03919091169190839082818181858883f19350505050151561036157610002565b5090565b60038054829003905560018054810190555b505050565b600454600254604051600160a060020a0392909216916000919082818181858883f1935050505015156103aa57610002565b600060025556
Deployed Bytecode
0x606060405236156100615760e060020a600035046313af4035811461006c57806335c1d3491461009f5780638da5cb5b146101125780639003adfe14610124578063a60f35881461012d578063c879657214610136578063e97dcb621461015e575b6101cc61015c610162565b6101cc60043560045433600160a060020a039081169116141561009c5760048054600160a060020a031916821790555b50565b6101ce600435600080548290811015610002575080526002027f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5638101547f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5649190910154600160a060020a03919091169082565b6101f4600454600160a060020a031681565b61021160025481565b61021160015481565b6101cc60045433600160a060020a039081169116141561015c5760025460001415610378575b565b6101cc5b60028054602834049081019091556000805460018101808355909190829082908280158290116102235760020281600202836000526020600020918201910161022391905b8082111561035d578054600160a060020a0319168155600060018201556002016101a7565b005b6040518083600160a060020a031681526020018281526020019250505060405180910390f35b60408051600160a060020a03929092168252519081900360200190f35b60408051918252519081900360200190f35b50505050336000600050838154811015610002578180526002027f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563018054600160a060020a03191690921790915580543485900391908490811015610002576002027f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5640191909155600380543486900301905560015481548110156100025760035460029182027f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5640154909102925082901090506103735760015460008054909190811015610002576002027f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630154604051600160a060020a03919091169190839082818181858883f19350505050151561036157610002565b5090565b60038054829003905560018054810190555b505050565b600454600254604051600160a060020a0392909216916000919082818181858883f1935050505015156103aa57610002565b600060025556
Loading...
Loading
Loading...
Loading
[ 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.