Overview
ETH Balance
4.36269779200003195 ETH
Eth Value
$13,411.79 (@ $3,074.20/ETH)Token Holdings
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 83 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Transfer | 5614141 | 2379 days ago | IN | 0 ETH | 0.00015168 | ||||
Transfer | 5435802 | 2410 days ago | IN | 0.00898829 ETH | 0.00085835 | ||||
Transfer | 5435778 | 2410 days ago | IN | 0.0001 ETH | 0.00085835 | ||||
Buy | 5202296 | 2449 days ago | IN | 0 ETH | 0.00022542 | ||||
Transfer | 5071455 | 2471 days ago | IN | 0.002 ETH | 0.00005587 | ||||
Create Trade Con... | 4644823 | 2545 days ago | IN | 0 ETH | 0.00005638 | ||||
Transfer | 4644797 | 2545 days ago | IN | 0.001 ETH | 0.00011174 | ||||
Transfer | 4644782 | 2545 days ago | IN | 0.001 ETH | 0.00005056 | ||||
Transfer | 4589032 | 2554 days ago | IN | 0.0001 ETH | 0.00027937 | ||||
Transfer | 4589026 | 2554 days ago | IN | 0.0001 ETH | 0.00025 | ||||
Transfer | 4589013 | 2554 days ago | IN | 0.0001 ETH | 0.00050562 | ||||
Transfer | 4082067 | 2670 days ago | IN | 0.05 ETH | 0.00117335 | ||||
Transfer | 4072889 | 2672 days ago | IN | 0.01 ETH | 0.00117335 | ||||
Transfer | 4065990 | 2674 days ago | IN | 0.3 ETH | 0.00085835 | ||||
Transfer | 4065813 | 2674 days ago | IN | 0.4 ETH | 0.00085835 | ||||
Transfer | 4065806 | 2674 days ago | IN | 0.0219 ETH | 0.00085835 | ||||
Transfer | 4060677 | 2675 days ago | IN | 0.002 ETH | 0.00111748 | ||||
Transfer | 4060484 | 2675 days ago | IN | 0.001 ETH | 0.00042 | ||||
Transfer | 4056311 | 2676 days ago | IN | 0.1035 ETH | 0.00085835 | ||||
Transfer | 4054741 | 2676 days ago | IN | 0.001982 ETH | 0.00117335 | ||||
Transfer | 4053817 | 2676 days ago | IN | 0.225 ETH | 0.00100573 | ||||
Transfer | 4053780 | 2676 days ago | IN | 0.1 ETH | 0.000378 | ||||
Transfer | 4053458 | 2676 days ago | IN | 0.518 ETH | 0.00117335 | ||||
Transfer | 4052592 | 2677 days ago | IN | 0.15 ETH | 0.00085835 | ||||
Transfer | 4052585 | 2677 days ago | IN | 0.15 ETH | 0.000441 |
Latest 7 internal transactions
Advanced mode:
Loading...
Loading
Contract Name:
TokenTrader
Compiler Version
v0.4.0+commit.acd334c9
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2017-02-28 */ pragma solidity ^0.4.0; //https://github.com/nexusdev/erc20/blob/master/contracts/erc20.sol contract ERC20Constant { function balanceOf( address who ) constant returns (uint value); } contract ERC20Stateful { function transfer( address to, uint value) returns (bool ok); } contract ERC20Events { event Transfer(address indexed from, address indexed to, uint value); } contract ERC20 is ERC20Constant, ERC20Stateful, ERC20Events {} contract owned { address public owner; function owned() { owner = msg.sender; } modifier onlyOwner { if (msg.sender != owner) throw; _; } function transferOwnership(address newOwner) onlyOwner { owner = newOwner; } } // contract can sell tokens for ETH // prices are in amount of wei per batch of token units contract TokenTrader is owned { address public asset; // address of token uint256 public sellPrice; // contract sells lots of tokens at this price uint256 public units; // lot size (token-wei) bool public sellsTokens; // is contract selling event ActivatedEvent(bool sells); event UpdateEvent(); function TokenTrader ( address _asset, uint256 _sellPrice, uint256 _units, bool _sellsTokens ) { asset = _asset; sellPrice = _sellPrice; units = _units; sellsTokens = _sellsTokens; ActivatedEvent(sellsTokens); } // modify trading behavior function activate ( bool _sellsTokens ) onlyOwner { sellsTokens = _sellsTokens; ActivatedEvent(sellsTokens); } // allow owner to remove trade token function withdrawAsset(uint256 _value) onlyOwner returns (bool ok) { return ERC20(asset).transfer(owner,_value); UpdateEvent(); } // allow owner to remove arbitrary tokens // included just in case contract receives wrong token function withdrawToken(address _token, uint256 _value) onlyOwner returns (bool ok) { return ERC20(_token).transfer(owner,_value); UpdateEvent(); } // allow owner to remove ETH function withdraw(uint256 _value) onlyOwner returns (bool ok) { if(this.balance >= _value) { return owner.send(_value); } UpdateEvent(); } //user buys token with ETH function buy() payable { if(sellsTokens || msg.sender == owner) { uint order = msg.value / sellPrice; uint can_sell = ERC20(asset).balanceOf(address(this)) / units; if(order > can_sell) { uint256 change = msg.value - (can_sell * sellPrice); order = can_sell; if(!msg.sender.send(change)) throw; } if(order > 0) { if(!ERC20(asset).transfer(msg.sender,order * units)) throw; } UpdateEvent(); } else if(!msg.sender.send(msg.value)) throw; // return user funds if the contract is not selling } // sending ETH to contract sells GNT to user function () payable { buy(); } } // This contract deploys TokenTrader contracts and logs the event // trade pairs are identified with sha3(asset,units) contract TokenTraderFactory { event TradeListing(bytes32 bookid, address owner, address addr); event NewBook(bytes32 bookid, address asset, uint256 units); mapping( address => bool ) _verify; mapping( bytes32 => bool ) pairExits; function verify(address tradeContract) constant returns ( bool valid, address asset, uint256 sellPrice, uint256 units, bool sellsTokens ) { valid = _verify[tradeContract]; if(valid) { TokenTrader t = TokenTrader(tradeContract); asset = t.asset(); sellPrice = t.sellPrice(); units = t.units(); sellsTokens = t.sellsTokens(); } } function createTradeContract( address _asset, uint256 _sellPrice, uint256 _units, bool _sellsTokens ) returns (address) { if(_units == 0) throw; // can't sell zero units address trader = new TokenTrader ( _asset, _sellPrice, _units, _sellsTokens); var bookid = sha3(_asset,_units); _verify[trader] = true; // record that this factory created the trader TokenTrader(trader).transferOwnership(msg.sender); // set the owner to whoever called the function if(pairExits[bookid] == false) { pairExits[bookid] = true; NewBook(bookid, _asset, _units); } TradeListing(bookid,msg.sender,trader); } function () { throw; // Prevents accidental sending of ether to the factory } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"withdraw","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"asset","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"sellPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"sellsTokens","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"withdrawAsset","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"units","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_value","type":"uint256"}],"name":"withdrawToken","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"buy","outputs":[],"payable":true,"type":"function"},{"constant":false,"inputs":[{"name":"_sellsTokens","type":"bool"}],"name":"activate","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"type":"function"},{"inputs":[{"name":"_asset","type":"address"},{"name":"_sellPrice","type":"uint256"},{"name":"_units","type":"uint256"},{"name":"_sellsTokens","type":"bool"}],"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"sells","type":"bool"}],"name":"ActivatedEvent","type":"event"},{"anonymous":false,"inputs":[],"name":"UpdateEvent","type":"event"}]
Contract Creation Code
6060604052604051608080610c47833981016040528080519060200190919080519060200190919080519060200190919080519060200190919050505b5b33600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b83600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690830217905550826002600050819055508160036000508190555080600460006101000a81548160ff021916908302179055507fce78b7525a161aee9986871a8dcad7e2783f9a4d66383783243cf14ec7086f85600460009054906101000a900460ff1660405180821515815260200191505060405180910390a15b50505050610b2c8061011b6000396000f3606060405236156100ab576000357c0100000000000000000000000000000000000000000000000000000000900480632e1a7d4d146100bc57806338d52e0f146100ef5780634b7503341461012d5780634ca50f59146101555780638d92fdf31461017f5780638da5cb5b146101b2578063976a8435146101f05780639e281a9814610218578063a6f2ae3a14610254578063ce5e84a314610263578063f2fde38b14610280576100ab565b6100ba5b6100b761029d565b5b565b005b34610002576100d76004808035906020019091905050610590565b60405180821515815260200191505060405180910390f35b346100025761010160048050506106a5565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b346100025761013f60048050506106cb565b6040518082815260200191505060405180910390f35b346100025761016760048050506106d4565b60405180821515815260200191505060405180910390f35b346100025761019a60048080359060200190919050506106e7565b60405180821515815260200191505060405180910390f35b34610002576101c4600480505061085c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34610002576102026004805050610882565b6040518082815260200191505060405180910390f35b346100025761023c600480803590602001909190803590602001909190505061088b565b60405180821515815260200191505060405180910390f35b610261600480505061029d565b005b346100025761027e60048080359060200190919050506109df565b005b346100025761029b6004808035906020019091905050610aa0565b005b600060006000600460009054906101000a900460ff168061030b5750600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b156105465760026000505434811561000257049250600360005054600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a0823130604051827c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b156100025760325a03f11561000257505050604051805190602001508115610002570491508183111561043d5760026000505482023403905081925082503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051809050600060405180830381858888f19350505050151561043c57610002565b5b600083111561051257600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336003600050548602604051837c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b156100025760325a03f1156100025750505060405180519060200150151561051157610002565b5b7f36ff37f436d9a671f4776bd73e3be89800c29518da3abc0618ef2b18c707481f60405180905060405180910390a161058a565b3373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051809050600060405180830381858888f19350505050151561058957610002565b5b5b505050565b6000600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105ee57610002565b813073ffffffffffffffffffffffffffffffffffffffff163110151561066f57600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051809050600060405180830381858888f19350505050905061069f565b7f36ff37f436d9a671f4776bd73e3be89800c29518da3abc0618ef2b18c707481f60405180905060405180910390a15b5b919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026000505481565b600460009054906101000a900460ff1681565b6000600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561074557610002565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684604051837c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b156100025760325a03f11561000257505050604051805190602001509050610856567f36ff37f436d9a671f4776bd73e3be89800c29518da3abc0618ef2b18c707481f60405180905060405180910390a15b5b919050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60036000505481565b6000600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108e957610002565b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684604051837c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b156100025760325a03f115610002575050506040518051906020015090506109d8567f36ff37f436d9a671f4776bd73e3be89800c29518da3abc0618ef2b18c707481f60405180905060405180910390a15b5b92915050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a3b57610002565b80600460006101000a81548160ff021916908302179055507fce78b7525a161aee9986871a8dcad7e2783f9a4d66383783243cf14ec7086f85600460009054906101000a900460ff1660405180821515815260200191505060405180910390a15b5b50565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610afc57610002565b80600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b5b5056000000000000000000000000a74476443119a942de498590fe1f2454d7d4ac0d00000000000000000000000000000000000000000000000000000000000007be00000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x606060405236156100ab576000357c0100000000000000000000000000000000000000000000000000000000900480632e1a7d4d146100bc57806338d52e0f146100ef5780634b7503341461012d5780634ca50f59146101555780638d92fdf31461017f5780638da5cb5b146101b2578063976a8435146101f05780639e281a9814610218578063a6f2ae3a14610254578063ce5e84a314610263578063f2fde38b14610280576100ab565b6100ba5b6100b761029d565b5b565b005b34610002576100d76004808035906020019091905050610590565b60405180821515815260200191505060405180910390f35b346100025761010160048050506106a5565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b346100025761013f60048050506106cb565b6040518082815260200191505060405180910390f35b346100025761016760048050506106d4565b60405180821515815260200191505060405180910390f35b346100025761019a60048080359060200190919050506106e7565b60405180821515815260200191505060405180910390f35b34610002576101c4600480505061085c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34610002576102026004805050610882565b6040518082815260200191505060405180910390f35b346100025761023c600480803590602001909190803590602001909190505061088b565b60405180821515815260200191505060405180910390f35b610261600480505061029d565b005b346100025761027e60048080359060200190919050506109df565b005b346100025761029b6004808035906020019091905050610aa0565b005b600060006000600460009054906101000a900460ff168061030b5750600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b156105465760026000505434811561000257049250600360005054600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a0823130604051827c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b156100025760325a03f11561000257505050604051805190602001508115610002570491508183111561043d5760026000505482023403905081925082503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051809050600060405180830381858888f19350505050151561043c57610002565b5b600083111561051257600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336003600050548602604051837c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b156100025760325a03f1156100025750505060405180519060200150151561051157610002565b5b7f36ff37f436d9a671f4776bd73e3be89800c29518da3abc0618ef2b18c707481f60405180905060405180910390a161058a565b3373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051809050600060405180830381858888f19350505050151561058957610002565b5b5b505050565b6000600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105ee57610002565b813073ffffffffffffffffffffffffffffffffffffffff163110151561066f57600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051809050600060405180830381858888f19350505050905061069f565b7f36ff37f436d9a671f4776bd73e3be89800c29518da3abc0618ef2b18c707481f60405180905060405180910390a15b5b919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026000505481565b600460009054906101000a900460ff1681565b6000600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561074557610002565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684604051837c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b156100025760325a03f11561000257505050604051805190602001509050610856567f36ff37f436d9a671f4776bd73e3be89800c29518da3abc0618ef2b18c707481f60405180905060405180910390a15b5b919050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60036000505481565b6000600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108e957610002565b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684604051837c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b156100025760325a03f115610002575050506040518051906020015090506109d8567f36ff37f436d9a671f4776bd73e3be89800c29518da3abc0618ef2b18c707481f60405180905060405180910390a15b5b92915050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a3b57610002565b80600460006101000a81548160ff021916908302179055507fce78b7525a161aee9986871a8dcad7e2783f9a4d66383783243cf14ec7086f85600460009054906101000a900460ff1660405180821515815260200191505060405180910390a15b5b50565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610afc57610002565b80600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b5b5056
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a74476443119a942de498590fe1f2454d7d4ac0d00000000000000000000000000000000000000000000000000000000000007be00000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : _asset (address): 0xa74476443119A942dE498590Fe1f2454d7D4aC0d
Arg [1] : _sellPrice (uint256): 1982
Arg [2] : _units (uint256): 1000000
Arg [3] : _sellsTokens (bool): True
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000a74476443119a942de498590fe1f2454d7d4ac0d
Arg [1] : 00000000000000000000000000000000000000000000000000000000000007be
Arg [2] : 00000000000000000000000000000000000000000000000000000000000f4240
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000001
Loading...
Loading
Loading...
Loading
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.