More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 26 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Escape Hatch | 9020176 | 1693 days ago | IN | 0 ETH | 0.00003245 | ||||
Change Owner | 5268901 | 2315 days ago | IN | 0 ETH | 0.000943 | ||||
Owner | 4378769 | 2465 days ago | IN | 0 ETH | 0.00021886 | ||||
Owned | 4336054 | 2478 days ago | IN | 0 ETH | 0.00035803 | ||||
0xf898f8ab | 4336029 | 2478 days ago | IN | 0 ETH | 0.00075795 | ||||
Transfer | 3755990 | 2612 days ago | IN | 0.001 ETH | 0.00230262 | ||||
Transfer | 3755639 | 2612 days ago | IN | 0.001 ETH | 0.00023026 | ||||
Transfer | 3743855 | 2614 days ago | IN | 0.07 ETH | 0.00241234 | ||||
Transfer | 3743700 | 2614 days ago | IN | 0.007 ETH | 0.00241234 | ||||
Transfer | 3743678 | 2614 days ago | IN | 0.007 ETH | 0.00241234 | ||||
Transfer | 3743674 | 2614 days ago | IN | 0.007 ETH | 0.00241234 | ||||
Transfer | 3743671 | 2614 days ago | IN | 0.007 ETH | 0.00232352 | ||||
Transfer | 3743670 | 2614 days ago | IN | 0.007 ETH | 0.00241234 | ||||
Transfer | 3743668 | 2614 days ago | IN | 0.007 ETH | 0.00241234 | ||||
Transfer | 3743664 | 2614 days ago | IN | 0.007 ETH | 0.00241234 | ||||
Transfer | 3743659 | 2614 days ago | IN | 0.01 ETH | 0.00241234 | ||||
Transfer | 3740722 | 2615 days ago | IN | 0.01 ETH | 0.00267519 | ||||
Deposit ETH | 3731233 | 2617 days ago | IN | 299.95 ETH | 0.00053001 | ||||
Deposit ETH | 3731227 | 2617 days ago | IN | 0.05 ETH | 0.00053001 | ||||
Transfer | 3729617 | 2617 days ago | IN | 0.001 ETH | 0.00265328 | ||||
Transfer | 3729578 | 2617 days ago | IN | 0.07 ETH | 0.00265328 | ||||
Transfer | 3729540 | 2617 days ago | IN | 0.05 ETH | 0.00264801 | ||||
Deposit ETH | 3729537 | 2617 days ago | IN | 0.1 ETH | 0.00053001 | ||||
Escape Hatch | 3729297 | 2617 days ago | IN | 0 ETH | 0.00074646 | ||||
Deposit ETH | 3729293 | 2617 days ago | IN | 0.1 ETH | 0.00053001 |
Latest 17 internal transactions
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
9020176 | 1693 days ago | 299.866 ETH | ||||
3755990 | 2612 days ago | 0.002 ETH | ||||
3755639 | 2612 days ago | 0.002 ETH | ||||
3743855 | 2614 days ago | 0.14 ETH | ||||
3743700 | 2614 days ago | 0.014 ETH | ||||
3743678 | 2614 days ago | 0.014 ETH | ||||
3743674 | 2614 days ago | 0.014 ETH | ||||
3743671 | 2614 days ago | 0.014 ETH | ||||
3743670 | 2614 days ago | 0.014 ETH | ||||
3743668 | 2614 days ago | 0.014 ETH | ||||
3743664 | 2614 days ago | 0.014 ETH | ||||
3743659 | 2614 days ago | 0.02 ETH | ||||
3740722 | 2615 days ago | 0.02 ETH | ||||
3729617 | 2617 days ago | 0.001 ETH | ||||
3729578 | 2617 days ago | 0.12 ETH | ||||
3729540 | 2617 days ago | 0.1 ETH | ||||
3729297 | 2617 days ago | 0.1 ETH |
Loading...
Loading
Contract Name:
DonationDoubler
Compiler Version
v0.4.11+commit.68ef5810
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2017-05-18 */ pragma solidity ^0.4.6; /* Copyright 2017, Vojtech Simetka This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /// @title Donation Doubler /// @authors Vojtech Simetka, Jordi Baylina, Dani Philia /// @notice This contract is used to double a donation to a Giveth Campaign as /// long as there is enough ether in this contract to do it. If not, the /// donated value is just sent directly to designated Campaign with any ether /// that may still be in this contract. The `msg.sender` doubling their /// donation will receive twice the expected Campaign tokens and the Donor that /// deposited the inital funds will not receive any donation tokens. /// WARNING: This contract only works for ether. A token based contract will be /// developed in the future. Any tokens sent to this contract will be lost. /// Next Version: Upgrade the EscapeHatch to be able to remove tokens. /// @dev `Owned` is a base level contract that assigns an `owner` that can be /// later changed // Copyright (C) 2015, 2016, 2017 DappHub, LLC // Licensed under the Apache License, Version 2.0 (the "License"). // You may not use this file except in compliance with the License. // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND (express or implied). // // Thank you to @zandy and the Dappsys team for writing this beautiful library // Their math.sol was modified to remove and rename functions and add many // comments for clarification. // See their original library here: https://github.com/dapphub/ds-math // // Also the OpenZepplin team deserves gratitude and recognition for making // their own beautiful library which has been very well utilized in solidity // contracts across the Ethereum ecosystem and we used their max64(), min64(), // multiply(), and divide() functions. See their library here: // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/SafeMath.sol pragma solidity ^0.4.6; contract SafeMath { // ensure that the result of adding x and y is accurate function add(uint x, uint y) internal constant returns (uint z) { assert( (z = x + y) >= x); } // ensure that the result of subtracting y from x is accurate function subtract(uint x, uint y) internal constant returns (uint z) { assert( (z = x - y) <= x); } // ensure that the result of multiplying x and y is accurate function multiply(uint x, uint y) internal constant returns (uint z) { z = x * y; assert(x == 0 || z / x == y); return z; } // ensure that the result of dividing x and y is accurate // note: Solidity now throws on division by zero, so a check is not needed function divide(uint x, uint y) internal constant returns (uint z) { z = x / y; assert(x == ( (y * z) + (x % y) )); return z; } // return the lowest of two 64 bit integers function min64(uint64 x, uint64 y) internal constant returns (uint64) { return x < y ? x: y; } // return the largest of two 64 bit integers function max64(uint64 x, uint64 y) internal constant returns (uint64) { return x >= y ? x : y; } // return the lowest of two values function min(uint x, uint y) internal constant returns (uint) { return (x <= y) ? x : y; } // return the largest of two values function max(uint x, uint y) internal constant returns (uint) { return (x >= y) ? x : y; } function assert(bool assertion) internal { if (!assertion) { throw; } } } contract Owned { /// @dev `owner` is the only address that can call a function with this /// modifier; the function body is inserted where the special symbol /// "_;" in the definition of a modifier appears. modifier onlyOwner { if (msg.sender != owner) throw; _; } address public owner; /// @notice The Constructor assigns the message sender to be `owner` function Owned() { owner = msg.sender;} /// @notice `owner` can step down and assign some other address to this role /// @param _newOwner The address of the new owner. 0x0 can be used to create /// an unowned neutral vault, however that cannot be undone function changeOwner(address _newOwner) onlyOwner { owner = _newOwner; NewOwner(msg.sender, _newOwner); } /// @dev Events make it easier to see that something has happend on the /// blockchain event NewOwner(address indexed oldOwner, address indexed newOwner); } /// @dev `Escapable` is a base level contract built off of the `Owned` /// contract that creates an escape hatch function to send its ether to /// `escapeHatchDestination` when called by the `escapeHatchCaller` in the case /// that something unexpected happens contract Escapable is Owned { address public escapeHatchCaller; address public escapeHatchDestination; /// @notice The Constructor assigns the `escapeHatchDestination` and the /// `escapeHatchCaller` /// @param _escapeHatchDestination The address of a safe location (usu a /// Multisig) to send the ether held in this contract /// @param _escapeHatchCaller The address of a trusted account or contract to /// call `escapeHatch()` to send the ether in this contract to the /// `escapeHatchDestination` it would be ideal that `escapeHatchCaller` cannot /// move funds out of `escapeHatchDestination` function Escapable(address _escapeHatchCaller, address _escapeHatchDestination) { escapeHatchCaller = _escapeHatchCaller; escapeHatchDestination = _escapeHatchDestination; } /// @dev The addresses preassigned the `escapeHatchCaller` role /// is the only addresses that can call a function with this modifier modifier onlyEscapeHatchCallerOrOwner { if ((msg.sender != escapeHatchCaller)&&(msg.sender != owner)) throw; _; } /// @notice The `escapeHatch()` should only be called as a last resort if a /// security issue is uncovered or something unexpected happened function escapeHatch() onlyEscapeHatchCallerOrOwner { uint total = this.balance; // Send the total balance of this contract to the `escapeHatchDestination` if (!escapeHatchDestination.send(total)) { throw; } EscapeHatchCalled(total); } /// @notice Changes the address assigned to call `escapeHatch()` /// @param _newEscapeHatchCaller The address of a trusted account or contract to /// call `escapeHatch()` to send the ether in this contract to the /// `escapeHatchDestination` it would be ideal that `escapeHatchCaller` cannot /// move funds out of `escapeHatchDestination` function changeEscapeCaller(address _newEscapeHatchCaller) onlyEscapeHatchCallerOrOwner { escapeHatchCaller = _newEscapeHatchCaller; } event EscapeHatchCalled(uint amount); } /// @dev This is an empty contract to declare `proxyPayment()` to comply with /// Giveth Campaigns so that tokens will be generated when donations are sent contract Campaign { /// @notice `proxyPayment()` allows the caller to send ether to the Campaign and /// have the tokens created in an address of their choosing /// @param _owner The address that will hold the newly created tokens function proxyPayment(address _owner) payable returns(bool); } /// @dev Finally! The main contract which doubles the amount donated. contract DonationDoubler is Escapable, SafeMath { Campaign public beneficiary; // expected to be a Giveth campaign /// @notice The Constructor assigns the `beneficiary`, the /// `escapeHatchDestination` and the `escapeHatchCaller` as well as deploys /// the contract to the blockchain (obviously) /// @param _beneficiary The address of the CAMPAIGN CONTROLLER for the Campaign /// that is to receive donations /// @param _escapeHatchDestination The address of a safe location (usually a /// Multisig) to send the ether held in this contract /// @param _escapeHatchCaller The address of a trusted account or contract /// to call `escapeHatch()` to send the ether in this contract to the /// `escapeHatchDestination` it would be ideal that `escapeHatchCaller` /// cannot move funds out of `escapeHatchDestination` function DonationDoubler( Campaign _beneficiary, // person or legal entity that receives money or other benefits from a benefactor address _escapeHatchCaller, address _escapeHatchDestination ) Escapable(_escapeHatchCaller, _escapeHatchDestination) { beneficiary = _beneficiary; } /// @notice Simple function to deposit more ETH to Double Donations function depositETH() payable { DonationDeposited4Doubling(msg.sender, msg.value); } /// @notice Donate ETH to the `beneficiary`, and if there is enough in the /// contract double it. The `msg.sender` is rewarded with Campaign tokens // depending on how one calls into this fallback function, i.e. with .send ( hard limit of 2300 gas ) vs .value (provides fallback with all the available gas of the caller), it may throw function () payable { uint amount; // When there is enough ETH in the contract to double the ETH sent if (this.balance >= multiply(msg.value, 2)){ amount = multiply(msg.value, 2); // do it two it! // Send the ETH to the beneficiary so that they receive Campaign tokens if (!beneficiary.proxyPayment.value(amount)(msg.sender)) throw; DonationDoubled(msg.sender, amount); } else { amount = this.balance; // Send the ETH to the beneficiary so that they receive Campaign tokens if (!beneficiary.proxyPayment.value(amount)(msg.sender)) throw; DonationSentButNotDoubled(msg.sender, amount); } } event DonationDeposited4Doubling(address indexed sender, uint amount); event DonationDoubled(address indexed sender, uint amount); event DonationSentButNotDoubled(address indexed sender, uint amount); }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":false,"inputs":[],"name":"escapeHatch","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"escapeHatchCaller","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"beneficiary","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newEscapeHatchCaller","type":"address"}],"name":"changeEscapeCaller","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"escapeHatchDestination","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"depositETH","outputs":[],"payable":true,"type":"function"},{"inputs":[{"name":"_beneficiary","type":"address"},{"name":"_escapeHatchCaller","type":"address"},{"name":"_escapeHatchDestination","type":"address"}],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"sender","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"DonationDeposited4Doubling","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"sender","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"DonationDoubled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"sender","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"DonationSentButNotDoubled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"EscapeHatchCalled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"oldOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"NewOwner","type":"event"}]
Contract Creation Code
6060604052341561000c57fe5b60405160608061068e8339810160409081528151602083015191909201515b81815b5b60008054600160a060020a03191633600160a060020a03161790555b60018054600160a060020a03808516600160a060020a03199283161790925560028054928416929091169190911790555b505060038054600160a060020a031916600160a060020a0385161790555b5050505b6105e1806100ad6000396000f3006060604052361561008b5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631554611f81146102685780631f6eb6e71461027a57806338af3eed146102a6578063681617c7146102d25780638da5cb5b146102f0578063a6f9dae11461031c578063f5b612301461033a578063f6326fb314610366575b6102665b600061009c346002610370565b600160a060020a033016311061018d576100b7346002610370565b60035460408051600060209182015281517ff48c3054000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301529251949550919092169263f48c30549285926024808201939182900301818588803b151561012557fe5b6125ee5a03f1151561013357fe5b5050604051511515915061014990505760006000fd5b604080518281529051600160a060020a033316917fa1bba310323fde59a4fc1e712f584fdf564fbb10a4fa92fb0b53ea5e371e2cc0919081900360200190a2610262565b5060035460408051600060209182015281517ff48c305400000000000000000000000000000000000000000000000000000000815233600160a060020a039081166004830152925130841631949093169263f48c30549285926024808201939182900301818588803b15156101fe57fe5b6125ee5a03f1151561020c57fe5b5050604051511515915061022290505760006000fd5b604080518281529051600160a060020a033316917f43a6e68065f63b1a6e80d3889b3ebeb923c72e1c39e169fa33d4f235914ec842919081900360200190a25b5b50565b005b341561027057fe5b610266610399565b005b341561028257fe5b61028a610446565b60408051600160a060020a039092168252519081900360200190f35b34156102ae57fe5b61028a610455565b60408051600160a060020a039092168252519081900360200190f35b34156102da57fe5b610266600160a060020a0360043516610464565b005b34156102f857fe5b61028a6104ca565b60408051600160a060020a039092168252519081900360200190f35b341561032457fe5b610266600160a060020a03600435166104d9565b005b341561034257fe5b61028a610553565b60408051600160a060020a039092168252519081900360200190f35b610266610562565b005b81810261039283158061038d575082848381151561038a57fe5b04145b6105a4565b5b92915050565b60015460009033600160a060020a039081169116148015906103ca575060005433600160a060020a03908116911614155b156103d55760006000fd5b50600254604051600160a060020a033081163192169082156108fc029083906000818181858888f19350505050151561040e5760006000fd5b6040805182815290517f3a7a1ba90aaa86fa9f6b921c3d600a5c870f8ebd05e7fbd30f93930f3caa5db59181900360200190a15b5b50565b600154600160a060020a031681565b600354600160a060020a031681565b60015433600160a060020a03908116911614801590610492575060005433600160a060020a03908116911614155b1561049d5760006000fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600054600160a060020a031681565b60005433600160a060020a039081169116146104f55760006000fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169182178355604051919233909116917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b23649190a35b5b50565b600254600160a060020a031681565b604080513481529051600160a060020a033316917f19682b09e0d83a0331367825237544d1b042e612caf43450a308aa41d0120fec919081900360200190a25b565b8015156102625760006000fd5b5b505600a165627a7a7230582096c0071e1b638965813639bb4ddea36b1bf04302942c01d86506b36a0e63920d0029000000000000000000000000ef3d92e868f7c9a022118f5f48cb99f4c75bf8cb000000000000000000000000839395e20bbb182fa440d08f850e6c7a8f6f078000000000000000000000000032bacc8b241fb172fee18bda32527126c6f3c5f7
Deployed Bytecode
0x6060604052361561008b5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631554611f81146102685780631f6eb6e71461027a57806338af3eed146102a6578063681617c7146102d25780638da5cb5b146102f0578063a6f9dae11461031c578063f5b612301461033a578063f6326fb314610366575b6102665b600061009c346002610370565b600160a060020a033016311061018d576100b7346002610370565b60035460408051600060209182015281517ff48c3054000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301529251949550919092169263f48c30549285926024808201939182900301818588803b151561012557fe5b6125ee5a03f1151561013357fe5b5050604051511515915061014990505760006000fd5b604080518281529051600160a060020a033316917fa1bba310323fde59a4fc1e712f584fdf564fbb10a4fa92fb0b53ea5e371e2cc0919081900360200190a2610262565b5060035460408051600060209182015281517ff48c305400000000000000000000000000000000000000000000000000000000815233600160a060020a039081166004830152925130841631949093169263f48c30549285926024808201939182900301818588803b15156101fe57fe5b6125ee5a03f1151561020c57fe5b5050604051511515915061022290505760006000fd5b604080518281529051600160a060020a033316917f43a6e68065f63b1a6e80d3889b3ebeb923c72e1c39e169fa33d4f235914ec842919081900360200190a25b5b50565b005b341561027057fe5b610266610399565b005b341561028257fe5b61028a610446565b60408051600160a060020a039092168252519081900360200190f35b34156102ae57fe5b61028a610455565b60408051600160a060020a039092168252519081900360200190f35b34156102da57fe5b610266600160a060020a0360043516610464565b005b34156102f857fe5b61028a6104ca565b60408051600160a060020a039092168252519081900360200190f35b341561032457fe5b610266600160a060020a03600435166104d9565b005b341561034257fe5b61028a610553565b60408051600160a060020a039092168252519081900360200190f35b610266610562565b005b81810261039283158061038d575082848381151561038a57fe5b04145b6105a4565b5b92915050565b60015460009033600160a060020a039081169116148015906103ca575060005433600160a060020a03908116911614155b156103d55760006000fd5b50600254604051600160a060020a033081163192169082156108fc029083906000818181858888f19350505050151561040e5760006000fd5b6040805182815290517f3a7a1ba90aaa86fa9f6b921c3d600a5c870f8ebd05e7fbd30f93930f3caa5db59181900360200190a15b5b50565b600154600160a060020a031681565b600354600160a060020a031681565b60015433600160a060020a03908116911614801590610492575060005433600160a060020a03908116911614155b1561049d5760006000fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600054600160a060020a031681565b60005433600160a060020a039081169116146104f55760006000fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169182178355604051919233909116917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b23649190a35b5b50565b600254600160a060020a031681565b604080513481529051600160a060020a033316917f19682b09e0d83a0331367825237544d1b042e612caf43450a308aa41d0120fec919081900360200190a25b565b8015156102625760006000fd5b5b505600a165627a7a7230582096c0071e1b638965813639bb4ddea36b1bf04302942c01d86506b36a0e63920d0029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ef3d92e868f7c9a022118f5f48cb99f4c75bf8cb000000000000000000000000839395e20bbb182fa440d08f850e6c7a8f6f078000000000000000000000000032bacc8b241fb172fee18bda32527126c6f3c5f7
-----Decoded View---------------
Arg [0] : _beneficiary (address): 0xef3d92E868F7C9A022118f5f48cB99F4c75Bf8Cb
Arg [1] : _escapeHatchCaller (address): 0x839395e20bbB182fa440d08F850E6c7A8f6F0780
Arg [2] : _escapeHatchDestination (address): 0x32bacc8B241FB172fEE18bDa32527126c6f3c5f7
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000ef3d92e868f7c9a022118f5f48cb99f4c75bf8cb
Arg [1] : 000000000000000000000000839395e20bbb182fa440d08f850e6c7a8f6f0780
Arg [2] : 00000000000000000000000032bacc8b241fb172fee18bda32527126c6f3c5f7
Swarm Source
bzzr://96c0071e1b638965813639bb4ddea36b1bf04302942c01d86506b36a0e63920d
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.286578 | 22.5878 | $6.47 |
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.