More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 4,402 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw Tokens | 5932299 | 2362 days ago | IN | 0 ETH | 0.00248562 | ||||
Transfer | 4816117 | 2554 days ago | IN | 0.330927 ETH | 0.008 | ||||
Transfer | 4815374 | 2554 days ago | IN | 0.2 ETH | 0.0063 | ||||
0x414d4c54 | 4725561 | 2570 days ago | IN | 0 ETH | 0.0094 | ||||
0x414d4c54 | 4725508 | 2570 days ago | IN | 0 ETH | 0.0094 | ||||
Transfer | 4267423 | 2661 days ago | IN | 0.80445539 ETH | 0.0072 | ||||
Withdraw Tokens | 4262228 | 2663 days ago | IN | 0 ETH | 0.0005637 | ||||
Transfer | 4260999 | 2663 days ago | IN | 0.306 ETH | 0.00368738 | ||||
Transfer | 4259561 | 2663 days ago | IN | 0.12 ETH | 0.0032202 | ||||
Transfer | 4259554 | 2663 days ago | IN | 0.13 ETH | 0.000441 | ||||
Transfer | 4259055 | 2663 days ago | IN | 0.007821 ETH | 0.00403466 | ||||
Transfer | 4258397 | 2664 days ago | IN | 0.17 ETH | 0.00404738 | ||||
Transfer | 4257576 | 2664 days ago | IN | 0.00786 ETH | 0.00216025 | ||||
Transfer | 4257541 | 2664 days ago | IN | 7.25 ETH | 0.00768455 | ||||
Transfer | 4257030 | 2664 days ago | IN | 0.02225566 ETH | 0.0035449 | ||||
Transfer | 4256583 | 2664 days ago | IN | 0.13 ETH | 0.00368858 | ||||
Transfer | 4256521 | 2664 days ago | IN | 0.605 ETH | 0.00768455 | ||||
Transfer | 4255921 | 2664 days ago | IN | 1 ETH | 0.00322507 | ||||
Transfer | 4255694 | 2664 days ago | IN | 0.014 ETH | 0.00321776 | ||||
Transfer | 4255664 | 2664 days ago | IN | 0.01 ETH | 0.00354007 | ||||
Transfer | 4254618 | 2665 days ago | IN | 39.651 ETH | 0.00369852 | ||||
Transfer | 4254515 | 2665 days ago | IN | 0.252256 ETH | 0.00367744 | ||||
Transfer | 4254083 | 2665 days ago | IN | 0.21192736 ETH | 0.00322646 | ||||
Transfer | 4253887 | 2665 days ago | IN | 0.03908998 ETH | 0.00597162 | ||||
Transfer | 4253799 | 2665 days ago | IN | 2.14370232 ETH | 0.0036846 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
4816117 | 2554 days ago | 0.330927 ETH | ||||
4815374 | 2554 days ago | 0.2 ETH | ||||
4267423 | 2661 days ago | 0.80445539 ETH | ||||
4260999 | 2663 days ago | 0.306 ETH | ||||
4259561 | 2663 days ago | 0.12 ETH | ||||
4259055 | 2663 days ago | 0.007821 ETH | ||||
4258397 | 2664 days ago | 0.17 ETH | ||||
4257576 | 2664 days ago | 0.00786 ETH | ||||
4257541 | 2664 days ago | 7.25 ETH | ||||
4257030 | 2664 days ago | 0.02225566 ETH | ||||
4256583 | 2664 days ago | 0.13 ETH | ||||
4256521 | 2664 days ago | 0.605 ETH | ||||
4255921 | 2664 days ago | 1 ETH | ||||
4255694 | 2664 days ago | 0.014 ETH | ||||
4255664 | 2664 days ago | 0.01 ETH | ||||
4254618 | 2665 days ago | 39.651 ETH | ||||
4254515 | 2665 days ago | 0.252256 ETH | ||||
4254083 | 2665 days ago | 0.21192736 ETH | ||||
4253887 | 2665 days ago | 0.03908998 ETH | ||||
4253799 | 2665 days ago | 2.14370232 ETH | ||||
4253550 | 2665 days ago | 0.2 ETH | ||||
4253264 | 2665 days ago | 2.102 ETH | ||||
4253148 | 2665 days ago | 69.514 ETH | ||||
4252605 | 2665 days ago | 0.5 ETH | ||||
4252594 | 2665 days ago | 0.5 ETH |
Loading...
Loading
Contract Name:
BancorBuyer
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-06-22 */ pragma solidity ^0.4.11; /* Owned contract interface */ contract IOwned { // this function isn't abstract since the compiler emits automatically generated getter functions as external function owner() public constant returns (address owner) { owner; } function transferOwnership(address _newOwner) public; function acceptOwnership() public; } /* Provides support and utilities for contract ownership */ contract Owned is IOwned { address public owner; address public newOwner; event OwnerUpdate(address _prevOwner, address _newOwner); /** @dev constructor */ function Owned() { owner = msg.sender; } // allows execution by the owner only modifier ownerOnly { assert(msg.sender == owner); _; } /** @dev allows transferring the contract ownership the new owner still need to accept the transfer can only be called by the contract owner @param _newOwner new contract owner */ function transferOwnership(address _newOwner) public ownerOnly { require(_newOwner != owner); newOwner = _newOwner; } /** @dev used by a new owner to accept an ownership transfer */ function acceptOwnership() public { require(msg.sender == newOwner); OwnerUpdate(owner, newOwner); owner = newOwner; newOwner = 0x0; } } /* ERC20 Standard Token interface */ contract IERC20Token { // these functions aren't abstract since the compiler emits automatically generated getter functions as external function name() public constant returns (string name) { name; } function symbol() public constant returns (string symbol) { symbol; } function decimals() public constant returns (uint8 decimals) { decimals; } function totalSupply() public constant returns (uint256 totalSupply) { totalSupply; } function balanceOf(address _owner) public constant returns (uint256 balance) { _owner; balance; } function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { _owner; _spender; remaining; } function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); } /* Token Holder interface */ contract ITokenHolder is IOwned { function withdrawTokens(IERC20Token _token, address _to, uint256 _amount) public; } /* We consider every contract to be a 'token holder' since it's currently not possible for a contract to deny receiving tokens. The TokenHolder's contract sole purpose is to provide a safety mechanism that allows the owner to send tokens that were sent to the contract by mistake back to their sender. */ contract TokenHolder is ITokenHolder, Owned { /** @dev constructor */ function TokenHolder() { } // validates an address - currently only checks that it isn't null modifier validAddress(address _address) { require(_address != 0x0); _; } // verifies that the address is different than this contract address modifier notThis(address _address) { require(_address != address(this)); _; } /** @dev withdraws tokens held by the contract and sends them to an account can only be called by the owner @param _token ERC20 token contract address @param _to account to receive the new amount @param _amount amount to withdraw */ function withdrawTokens(IERC20Token _token, address _to, uint256 _amount) public ownerOnly validAddress(_token) validAddress(_to) notThis(_to) { assert(_token.transfer(_to, _amount)); } } /* EIP228 Token Changer interface */ contract ITokenChanger { function changeableTokenCount() public constant returns (uint16 count); function changeableToken(uint16 _tokenIndex) public constant returns (address tokenAddress); function getReturn(IERC20Token _fromToken, IERC20Token _toToken, uint256 _amount) public constant returns (uint256 amount); function change(IERC20Token _fromToken, IERC20Token _toToken, uint256 _amount, uint256 _minReturn) public returns (uint256 amount); } /* Smart Token interface */ contract ISmartToken is ITokenHolder, IERC20Token { function disableTransfers(bool _disable) public; function issue(address _to, uint256 _amount) public; function destroy(address _from, uint256 _amount) public; } /* Bancor Changer interface */ contract IBancorChanger is ITokenChanger { function token() public constant returns (ISmartToken _token) { _token; } function getReserveBalance(IERC20Token _reserveToken) public constant returns (uint256 balance); } /* Ether Token interface */ contract IEtherToken is ITokenHolder, IERC20Token { function deposit() public payable; function withdraw(uint256 _amount) public; } /* BancorBuyer v0.1 The bancor buyer contract is a simple bancor changer wrapper that allows buying smart tokens with ETH WARNING: the contract will make the purchase using the current price at transaction mining time */ contract BancorBuyer is TokenHolder { string public version = '0.1'; IBancorChanger public tokenChanger; // bancor ETH <-> smart token changer IEtherToken public etherToken; // ether token /** @dev constructor @param _changer bancor token changer that actually does the purchase @param _etherToken ether token used as a reserve in the token changer */ function BancorBuyer(IBancorChanger _changer, IEtherToken _etherToken) validAddress(_changer) validAddress(_etherToken) { tokenChanger = _changer; etherToken = _etherToken; // ensure that the ether token is used as one of the changer's reserves tokenChanger.getReserveBalance(etherToken); } /** @dev buys the smart token with ETH note that the purchase will use the price at the time of the purchase @return tokens issued in return */ function buy() public payable returns (uint256 amount) { etherToken.deposit.value(msg.value)(); // deposit ETH in the reserve assert(etherToken.approve(tokenChanger, 0)); // need to reset the allowance to 0 before setting a new one assert(etherToken.approve(tokenChanger, msg.value)); // approve the changer to use the ETH amount for the purchase ISmartToken smartToken = tokenChanger.token(); uint256 returnAmount = tokenChanger.change(etherToken, smartToken, msg.value, 1); // do the actual change using the current price assert(smartToken.transfer(msg.sender, returnAmount)); // transfer the tokens to the sender return returnAmount; } // fallback function() payable { buy(); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[],"name":"tokenChanger","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"withdrawTokens","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"buy","outputs":[{"name":"amount","type":"uint256"}],"payable":true,"type":"function"},{"constant":true,"inputs":[],"name":"etherToken","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"type":"function"},{"inputs":[{"name":"_changer","type":"address"},{"name":"_etherToken","type":"address"}],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_prevOwner","type":"address"},{"indexed":false,"name":"_newOwner","type":"address"}],"name":"OwnerUpdate","type":"event"}]
Contract Creation Code
60a0604052600360608190527f302e310000000000000000000000000000000000000000000000000000000000608090815261003e916002919061015d565b50341561004757fe5b604051604080610a7c8339810160405280516020909101515b5b5b60008054600160a060020a03191633600160a060020a03161790555b5b81600160a060020a03811615156100965760006000fd5b81600160a060020a03811615156100ad5760006000fd5b60038054600160a060020a03808716600160a060020a0319928316179283905560048054878316931692909217808355604080516000602091820181905282517f15226b5400000000000000000000000000000000000000000000000000000000815293851695840195909552905194909216936315226b5493602480840194938390030190829087803b151561014057fe5b6102c65a03f1151561014e57fe5b5050505b5b505b5050506101fd565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061019e57805160ff19168380011785556101cb565b828001600101855582156101cb579182015b828111156101cb5782518255916020019190600101906101b0565b5b506101d89291506101dc565b5090565b6101fa91905b808211156101d857600081556001016101e2565b5090565b90565b6108708061020c6000396000f3006060604052361561007d5763ffffffff60e060020a600035041663387a76ce811461008f57806354fd4d50146100bb5780635e35359e1461014b57806379ba5097146101725780638da5cb5b14610184578063a6f2ae3a146101b0578063b8066bcb146101ca578063d4ee1d90146101f6578063f2fde38b14610222575b61008d5b610089610240565b505b565b005b341561009757fe5b61009f610583565b60408051600160a060020a039092168252519081900360200190f35b34156100c357fe5b6100cb610592565b604080516020808252835181830152835191928392908301918501908083838215610111575b80518252602083111561011157601f1990920191602091820191016100f1565b505050905090810190601f16801561013d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015357fe5b61008d600160a060020a036004358116906024351660443561061d565b005b341561017a57fe5b61008d610719565b005b341561018c57fe5b61009f6107b6565b60408051600160a060020a039092168252519081900360200190f35b6101b8610240565b60408051918252519081900360200190f35b34156101d257fe5b61009f6107c5565b60408051600160a060020a039092168252519081900360200190f35b34156101fe57fe5b61009f6107d4565b60408051600160a060020a039092168252519081900360200190f35b341561022a57fe5b61008d600160a060020a03600435166107e3565b005b600060006000600460009054906101000a9004600160a060020a0316600160a060020a031663d0e30db0346040518263ffffffff1660e060020a0281526004018090506000604051808303818588803b151561029857fe5b6125ee5a03f115156102a657fe5b505060048054600354604080516000602091820181905282517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a039485169681019690965260248601819052915192909316955063095ea7b394506044808501948390030190829087803b151561032257fe5b6102c65a03f1151561033057fe5b5050604051511515905061034057fe5b60048054600354604080516000602091820181905282517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a03948516968101969096523460248701529151929093169363095ea7b393604480830194919391928390030190829087803b15156103bb57fe5b6102c65a03f115156103c957fe5b505060405151151590506103d957fe5b600354604080516000602091820181905282517ffc0c546a0000000000000000000000000000000000000000000000000000000081529251600160a060020a039094169363fc0c546a9360048082019493918390030190829087803b151561043d57fe5b6102c65a03f1151561044b57fe5b5050604080518051600354600480546000602095860181905286517f5e5144eb000000000000000000000000000000000000000000000000000000008152600160a060020a039283169381019390935281851660248401523460448401526001606484015295519398509091169450635e5144eb9360848083019493928390030190829087803b15156104da57fe5b6102c65a03f115156104e857fe5b50505060405180519050905081600160a060020a031663a9059cbb33836000604051602001526040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b151561055c57fe5b6102c65a03f1151561056a57fe5b5050604051511515905061057a57fe5b8092505b505090565b600354600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156106155780601f106105ea57610100808354040283529160200191610615565b820191906000526020600020905b8154815290600101906020018083116105f857829003601f168201915b505050505081565b60005433600160a060020a0390811691161461063557fe5b82600160a060020a038116151561064c5760006000fd5b82600160a060020a03811615156106635760006000fd5b8330600160a060020a031681600160a060020a0316141515156106865760006000fd5b85600160a060020a031663a9059cbb86866000604051602001526040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15156106ee57fe5b6102c65a03f115156106fc57fe5b5050604051511515905061070c57fe5b5b5b505b505b505b505050565b60015433600160a060020a039081169116146107355760006000fd5b60005460015460408051600160a060020a03938416815292909116602083015280517f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a9281900390910190a1600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038416179091551690555b565b600054600160a060020a031681565b600454600160a060020a031681565b600154600160a060020a031681565b60005433600160a060020a039081169116146107fb57fe5b600054600160a060020a03828116911614156108175760006000fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b505600a165627a7a72305820e262a4a9bc7142e2a9eb8bd325f08d6904cd097557e6078c54604288e2b6d83e0029000000000000000000000000ca83bd8c4c7b1c0409b25fbd7e70b1ef57629ff4000000000000000000000000d76b5c2a23ef78368d8e34288b5b65d616b746ae
Deployed Bytecode
0x6060604052361561007d5763ffffffff60e060020a600035041663387a76ce811461008f57806354fd4d50146100bb5780635e35359e1461014b57806379ba5097146101725780638da5cb5b14610184578063a6f2ae3a146101b0578063b8066bcb146101ca578063d4ee1d90146101f6578063f2fde38b14610222575b61008d5b610089610240565b505b565b005b341561009757fe5b61009f610583565b60408051600160a060020a039092168252519081900360200190f35b34156100c357fe5b6100cb610592565b604080516020808252835181830152835191928392908301918501908083838215610111575b80518252602083111561011157601f1990920191602091820191016100f1565b505050905090810190601f16801561013d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015357fe5b61008d600160a060020a036004358116906024351660443561061d565b005b341561017a57fe5b61008d610719565b005b341561018c57fe5b61009f6107b6565b60408051600160a060020a039092168252519081900360200190f35b6101b8610240565b60408051918252519081900360200190f35b34156101d257fe5b61009f6107c5565b60408051600160a060020a039092168252519081900360200190f35b34156101fe57fe5b61009f6107d4565b60408051600160a060020a039092168252519081900360200190f35b341561022a57fe5b61008d600160a060020a03600435166107e3565b005b600060006000600460009054906101000a9004600160a060020a0316600160a060020a031663d0e30db0346040518263ffffffff1660e060020a0281526004018090506000604051808303818588803b151561029857fe5b6125ee5a03f115156102a657fe5b505060048054600354604080516000602091820181905282517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a039485169681019690965260248601819052915192909316955063095ea7b394506044808501948390030190829087803b151561032257fe5b6102c65a03f1151561033057fe5b5050604051511515905061034057fe5b60048054600354604080516000602091820181905282517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a03948516968101969096523460248701529151929093169363095ea7b393604480830194919391928390030190829087803b15156103bb57fe5b6102c65a03f115156103c957fe5b505060405151151590506103d957fe5b600354604080516000602091820181905282517ffc0c546a0000000000000000000000000000000000000000000000000000000081529251600160a060020a039094169363fc0c546a9360048082019493918390030190829087803b151561043d57fe5b6102c65a03f1151561044b57fe5b5050604080518051600354600480546000602095860181905286517f5e5144eb000000000000000000000000000000000000000000000000000000008152600160a060020a039283169381019390935281851660248401523460448401526001606484015295519398509091169450635e5144eb9360848083019493928390030190829087803b15156104da57fe5b6102c65a03f115156104e857fe5b50505060405180519050905081600160a060020a031663a9059cbb33836000604051602001526040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b151561055c57fe5b6102c65a03f1151561056a57fe5b5050604051511515905061057a57fe5b8092505b505090565b600354600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156106155780601f106105ea57610100808354040283529160200191610615565b820191906000526020600020905b8154815290600101906020018083116105f857829003601f168201915b505050505081565b60005433600160a060020a0390811691161461063557fe5b82600160a060020a038116151561064c5760006000fd5b82600160a060020a03811615156106635760006000fd5b8330600160a060020a031681600160a060020a0316141515156106865760006000fd5b85600160a060020a031663a9059cbb86866000604051602001526040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15156106ee57fe5b6102c65a03f115156106fc57fe5b5050604051511515905061070c57fe5b5b5b505b505b505b505050565b60015433600160a060020a039081169116146107355760006000fd5b60005460015460408051600160a060020a03938416815292909116602083015280517f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a9281900390910190a1600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038416179091551690555b565b600054600160a060020a031681565b600454600160a060020a031681565b600154600160a060020a031681565b60005433600160a060020a039081169116146107fb57fe5b600054600160a060020a03828116911614156108175760006000fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b505600a165627a7a72305820e262a4a9bc7142e2a9eb8bd325f08d6904cd097557e6078c54604288e2b6d83e0029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ca83bd8c4c7b1c0409b25fbd7e70b1ef57629ff4000000000000000000000000d76b5c2a23ef78368d8e34288b5b65d616b746ae
-----Decoded View---------------
Arg [0] : _changer (address): 0xCA83bD8c4C7B1c0409B25FbD7e70B1ef57629fF4
Arg [1] : _etherToken (address): 0xD76b5c2A23ef78368d8E34288B5b65D616B746aE
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000ca83bd8c4c7b1c0409b25fbd7e70b1ef57629ff4
Arg [1] : 000000000000000000000000d76b5c2a23ef78368d8e34288b5b65d616b746ae
Swarm Source
bzzr://e262a4a9bc7142e2a9eb8bd325f08d6904cd097557e6078c54604288e2b6d83e
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.