Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Self-destruct was called for this contract at txhash 0x0397ffb59a13ec7bb64176a1d35142b10d988754e8ec2bc6cf659c0cc4bde709. With EIP-6780, all contract storage and onchain code are retained upon self-destruct.
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x826786a7...841019B9C The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
ReversibleDemo
Compiler Version
v0.3.5-2016-08-07-f7af7de
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2016-08-08
*/
// `interface` would make a nice keyword ;)
contract TheDaoHardForkOracle {
// `ran()` manually verified true on both ETH and ETC chains
function forked() constant returns (bool);
}
// demostrates calling own function in a "reversible" manner
/* important lines are marked by multi-line comments */
contract ReversibleDemo {
// counters (all public to simplify inspection)
uint public numcalls;
uint public numcallsinternal;
uint public numfails;
uint public numsuccesses;
address owner;
// needed for "naive" and "oraclized" checks
address constant withdrawdaoaddr = 0xbf4ed7b27f1d666546e30d74d50d173d20bca754;
TheDaoHardForkOracle oracle = TheDaoHardForkOracle(0xe8e506306ddb78ee38c9b0d86c257bd97c2536b3);
event logCall(uint indexed _numcalls,
uint indexed _numfails,
uint indexed _numsuccesses);
modifier onlyOwner { if (msg.sender != owner) throw; _ }
modifier onlyThis { if (msg.sender != address(this)) throw; _ }
// constructor (setting `owner` allows later termination)
function ReversibleDemo() { owner = msg.sender; }
/* external: increments stack height */
/* onlyThis: prevent actual external calling */
function sendIfNotForked() external onlyThis returns (bool) {
numcallsinternal++;
/* naive check for "is this the classic chain" */
// guaranteed `true`: enough has been withdrawn already
// three million ------> 3'000'000
if (withdrawdaoaddr.balance < 3000000 ether) {
/* intentionally not checking return value */
owner.send(42);
}
/* "reverse" if it's actually the HF chain */
if (oracle.forked()) throw;
// not exactly a "success": send() could have failed on classic
return true;
}
// accepts value transfers
function doCall(uint _gas) onlyOwner {
numcalls++;
if (!this.sendIfNotForked.gas(_gas)()) {
numfails++;
}
else {
numsuccesses++;
}
logCall(numcalls, numfails, numsuccesses);
}
function selfDestruct() onlyOwner {
selfdestruct(owner);
}
// accepts value trasfers, but does nothing
function() {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":true,"inputs":[],"name":"numsuccesses","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"numfails","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"numcalls","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"numcallsinternal","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"sendIfNotForked","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":false,"inputs":[],"name":"selfDestruct","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_gas","type":"uint256"}],"name":"doCall","outputs":[],"type":"function"},{"inputs":[],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_numcalls","type":"uint256"},{"indexed":true,"name":"_numfails","type":"uint256"},{"indexed":true,"name":"_numsuccesses","type":"uint256"}],"name":"logCall","type":"event"}]Contract Creation Code
0x608060405234801561001057600080fd5b5060405161035438038061035483398101604081905261002f91610256565b6040516370a0823160e01b8152306004820152737a250d5630b4cf539739df2c5dacb4c659f2488d9082906000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561008e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100b29190610289565b60405163095ea7b360e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d6004820152602481018290529091506001600160a01b0383169063095ea7b3906044016020604051808303816000875af1158015610116573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061013a91906102a2565b506040805160028082526060820183526000926020830190803683370190505090508481600081518110610170576101706102cb565b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2816001815181106101b8576101b86102cb565b6001600160a01b03928316602091820292909201015260405163791ac94760e01b81529085169063791ac947906101fc90859060009086908c9042906004016102e1565b600060405180830381600087803b15801561021657600080fd5b505af115801561022a573d6000803e3d6000fd5b50505050856001600160a01b0316ff5b80516001600160a01b038116811461025157600080fd5b919050565b6000806040838503121561026957600080fd5b6102728361023a565b91506102806020840161023a565b90509250929050565b60006020828403121561029b57600080fd5b5051919050565b6000602082840312156102b457600080fd5b815180151581146102c457600080fd5b9392505050565b634e487b7160e01b600052603260045260246000fd5b600060a0820187835286602084015260a0604084015280865180835260c08501915060208801925060005b818110156103335783516001600160a01b031683526020938401939092019160010161030c565b50506001600160a01b03959095166060840152505060800152939250505056fe000000000000000000000000cf2308fbe81ca603a5fbd92d0adc23aea4e52cd30000000000000000000000009a6a9f92835eecc8431eff2806e0fa475523d266
Deployed Bytecode
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
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.