Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
9181966 | 1798 days ago | 0.00167025 ETH | ||||
9181966 | 1798 days ago | 0.00167025 ETH | ||||
9181966 | 1798 days ago | 0.01628185 ETH | ||||
9181966 | 1798 days ago | 0.01628185 ETH | ||||
9165544 | 1801 days ago | 0.00805664 ETH | ||||
9165544 | 1801 days ago | 0.00805664 ETH | ||||
9165544 | 1801 days ago | 0.0858997 ETH | ||||
9165544 | 1801 days ago | 0.0858997 ETH | ||||
9165449 | 1801 days ago | 0.00746407 ETH | ||||
9165449 | 1801 days ago | 0.00746407 ETH | ||||
9165449 | 1801 days ago | 0.07938135 ETH | ||||
9165449 | 1801 days ago | 0.07938135 ETH | ||||
9165392 | 1801 days ago | 0.00731049 ETH | ||||
9165392 | 1801 days ago | 0.00731049 ETH | ||||
9165392 | 1801 days ago | 0.08451852 ETH | ||||
9165392 | 1801 days ago | 0.08451852 ETH | ||||
9150203 | 1804 days ago | 0.00562583 ETH | ||||
9150203 | 1804 days ago | 0.00562583 ETH | ||||
9150203 | 1804 days ago | 0.07845126 ETH | ||||
9150203 | 1804 days ago | 0.07845126 ETH | ||||
9150108 | 1804 days ago | 0.00655183 ETH | ||||
9150108 | 1804 days ago | 0.07844512 ETH | ||||
9150108 | 1804 days ago | 0.07844512 ETH | ||||
9123496 | 1810 days ago | 0.00063838 ETH | ||||
9123496 | 1810 days ago | 0.00063838 ETH |
Loading...
Loading
Contract Name:
InstaKyber
Compiler Version
v0.4.24+commit.e67f0147
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-11-26 */ pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "Assertion Failed"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "Assertion Failed"); uint256 c = a / b; return c; } } interface IERC20 { function balanceOf(address who) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); } interface AddressRegistry { function getAddr(string name) external view returns(address); } interface Kyber { function trade( address src, uint srcAmount, address dest, address destAddress, uint maxDestAmount, uint minConversionRate, address walletId ) external payable returns (uint); function getExpectedRate( address src, address dest, uint srcQty ) external view returns (uint, uint); } contract Registry { address public addressRegistry; modifier onlyAdmin() { require( msg.sender == getAddress("admin"), "Permission Denied" ); _; } function getAddress(string name) internal view returns(address) { AddressRegistry addrReg = AddressRegistry(addressRegistry); return addrReg.getAddr(name); } } contract Trade is Registry { using SafeMath for uint; using SafeMath for uint256; event KyberTrade( address src, uint srcAmt, address dest, uint destAmt, address beneficiary, uint minConversionRate, address affiliate ); function getExpectedPrice( address src, address dest, uint srcAmt ) public view returns (uint, uint) { Kyber kyberFunctions = Kyber(getAddress("kyber")); return kyberFunctions.getExpectedRate( src, dest, srcAmt ); } function approveKyber(address[] tokenArr) public { address kyberProxy = getAddress("kyber"); for (uint i = 0; i < tokenArr.length; i++) { IERC20 tokenFunctions = IERC20(tokenArr[i]); tokenFunctions.approve(kyberProxy, 2**256 - 1); } } function executeTrade( address src, // token to sell address dest, // token to buy uint srcAmt, // amount of token for sell uint minConversionRate, // minimum slippage rate uint maxDestAmt // max amount of dest token ) public payable returns (uint destAmt) { address eth = getAddress("eth"); uint ethQty = getToken( msg.sender, src, srcAmt, eth ); // Interacting with Kyber Proxy Contract Kyber kyberFunctions = Kyber(getAddress("kyber")); destAmt = kyberFunctions.trade.value(ethQty)( src, srcAmt, dest, msg.sender, maxDestAmt, minConversionRate, getAddress("admin") ); // maxDestAmt usecase implementated if (src == eth && address(this).balance > 0) { msg.sender.transfer(address(this).balance); } else if (src != eth) { // as there is no balanceOf of eth IERC20 srcTkn = IERC20(src); uint srcBal = srcTkn.balanceOf(address(this)); if (srcBal > 0) { srcTkn.transfer(msg.sender, srcBal); } } emit KyberTrade( src, srcAmt, dest, destAmt, msg.sender, minConversionRate, getAddress("admin") ); } function getToken( address trader, address src, uint srcAmt, address eth ) internal returns (uint ethQty) { if (src == eth) { require(msg.value == srcAmt, "Invalid Operation"); ethQty = srcAmt; } else { IERC20 tokenFunctions = IERC20(src); tokenFunctions.transferFrom(trader, address(this), srcAmt); ethQty = 0; } } } contract InstaKyber is Trade { constructor(address rAddr) public { addressRegistry = rAddr; } function () public payable {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[{"name":"src","type":"address"},{"name":"dest","type":"address"},{"name":"srcAmt","type":"uint256"}],"name":"getExpectedPrice","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"src","type":"address"},{"name":"dest","type":"address"},{"name":"srcAmt","type":"uint256"},{"name":"minConversionRate","type":"uint256"},{"name":"maxDestAmt","type":"uint256"}],"name":"executeTrade","outputs":[{"name":"destAmt","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"tokenArr","type":"address[]"}],"name":"approveKyber","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"addressRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"rAddr","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"src","type":"address"},{"indexed":false,"name":"srcAmt","type":"uint256"},{"indexed":false,"name":"dest","type":"address"},{"indexed":false,"name":"destAmt","type":"uint256"},{"indexed":false,"name":"beneficiary","type":"address"},{"indexed":false,"name":"minConversionRate","type":"uint256"},{"indexed":false,"name":"affiliate","type":"address"}],"name":"KyberTrade","type":"event"}]
Contract Creation Code
608060405234801561001057600080fd5b50604051602080610a26833981016040525160008054600160a060020a03909216600160a060020a03199092169190911790556109d4806100526000396000f3006080604052600436106100615763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166332ffe44281146100635780633e23ee7e146100a65780634fbea8ea146100db578063f3ad65f414610130575b005b34801561006f57600080fd5b5061008d600160a060020a0360043581169060243516604435610161565b6040805192835260208301919091528051918290030190f35b6100c9600160a060020a0360043581169060243516604435606435608435610257565b60408051918252519081900360200190f35b3480156100e757600080fd5b50604080516020600480358082013583810280860185019096528085526100619536959394602494938501929182918501908490808284375094975061064e9650505050505050565b34801561013c57600080fd5b50610145610761565b60408051600160a060020a039092168252519081900360200190f35b60008060006101a46040805190810160405280600581526020017f6b79626572000000000000000000000000000000000000000000000000000000815250610770565b604080517f809a9e55000000000000000000000000000000000000000000000000000000008152600160a060020a038981166004830152888116602483015260448201889052825193945084169263809a9e55926064808401939192918290030181600087803b15801561021757600080fd5b505af115801561022b573d6000803e3d6000fd5b505050506040513d604081101561024157600080fd5b5080516020909101519097909650945050505050565b60008060008060008061029e6040805190810160405280600381526020017f6574680000000000000000000000000000000000000000000000000000000000815250610770565b94506102ac338c8b88610868565b93506102ec6040805190810160405280600581526020017f6b79626572000000000000000000000000000000000000000000000000000000815250610770565b925082600160a060020a031663cb3c28c7858d8c8e338d8f6103426040805190810160405280600581526020017f61646d696e000000000000000000000000000000000000000000000000000000815250610770565b604080517c010000000000000000000000000000000000000000000000000000000063ffffffff8c16028152600160a060020a039889166004820152602481019790975294871660448701529286166064860152608485019190915260a484015290921660c4820152905160e480830192602092919082900301818588803b1580156103cd57600080fd5b505af11580156103e1573d6000803e3d6000fd5b50505050506040513d60208110156103f857600080fd5b50519550600160a060020a038b8116908616148015610418575060003031115b15610450576040513390303180156108fc02916000818181858888f1935050505015801561044a573d6000803e3d6000fd5b50610593565b600160a060020a038b81169086161461059357604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290518c9350600160a060020a038416916370a082319160248083019260209291908290030181600087803b1580156104c757600080fd5b505af11580156104db573d6000803e3d6000fd5b505050506040513d60208110156104f157600080fd5b50519050600081111561059357604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390529051600160a060020a0384169163a9059cbb9160448083019260209291908290030181600087803b15801561056657600080fd5b505af115801561057a573d6000803e3d6000fd5b505050506040513d602081101561059057600080fd5b50505b7faf95114641285cac53dca41a5a81b1d27d822a892a3611d8d8b82d406539ed408b8a8c89338d6105f86040805190810160405280600581526020017f61646d696e000000000000000000000000000000000000000000000000000000815250610770565b60408051600160a060020a0398891681526020810197909752948716868601526060860193909352908516608085015260a084015290921660c082015290519081900360e00190a1505050505095945050505050565b60008060006106916040805190810160405280600581526020017f6b79626572000000000000000000000000000000000000000000000000000000815250610770565b9250600091505b835182101561075b5783828151811015156106af57fe5b6020908102909101810151604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a038781166004830152600019602483015291519294509084169263095ea7b3926044808401938290030181600087803b15801561072457600080fd5b505af1158015610738573d6000803e3d6000fd5b505050506040513d602081101561074e57600080fd5b5050600190910190610698565b50505050565b600054600160a060020a031681565b600080546040517fd502db97000000000000000000000000000000000000000000000000000000008152602060048201818152855160248401528551600160a060020a0390941693849363d502db97938893928392604401918501908083838c5b838110156107e95781810151838201526020016107d1565b50505050905090810190601f1680156108165780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15801561083557600080fd5b505af1158015610849573d6000803e3d6000fd5b505050506040513d602081101561085f57600080fd5b50519392505050565b60008082600160a060020a031685600160a060020a031614156108fb573484146108f357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c6964204f7065726174696f6e000000000000000000000000000000604482015290519081900360640190fd5b83915061099f565b50604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a03878116600483015230602483015260448201869052915186928316916323b872dd9160648083019260209291908290030181600087803b15801561096e57600080fd5b505af1158015610982573d6000803e3d6000fd5b505050506040513d602081101561099857600080fd5b5060009250505b509493505050505600a165627a7a72305820821b95f50433164a0c1d43983567705271b3b7d61a59250b6856bccc154ac7a00029000000000000000000000000e16d035b8e76303237b9660b3c9c94c1a86aab47
Deployed Bytecode
0x6080604052600436106100615763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166332ffe44281146100635780633e23ee7e146100a65780634fbea8ea146100db578063f3ad65f414610130575b005b34801561006f57600080fd5b5061008d600160a060020a0360043581169060243516604435610161565b6040805192835260208301919091528051918290030190f35b6100c9600160a060020a0360043581169060243516604435606435608435610257565b60408051918252519081900360200190f35b3480156100e757600080fd5b50604080516020600480358082013583810280860185019096528085526100619536959394602494938501929182918501908490808284375094975061064e9650505050505050565b34801561013c57600080fd5b50610145610761565b60408051600160a060020a039092168252519081900360200190f35b60008060006101a46040805190810160405280600581526020017f6b79626572000000000000000000000000000000000000000000000000000000815250610770565b604080517f809a9e55000000000000000000000000000000000000000000000000000000008152600160a060020a038981166004830152888116602483015260448201889052825193945084169263809a9e55926064808401939192918290030181600087803b15801561021757600080fd5b505af115801561022b573d6000803e3d6000fd5b505050506040513d604081101561024157600080fd5b5080516020909101519097909650945050505050565b60008060008060008061029e6040805190810160405280600381526020017f6574680000000000000000000000000000000000000000000000000000000000815250610770565b94506102ac338c8b88610868565b93506102ec6040805190810160405280600581526020017f6b79626572000000000000000000000000000000000000000000000000000000815250610770565b925082600160a060020a031663cb3c28c7858d8c8e338d8f6103426040805190810160405280600581526020017f61646d696e000000000000000000000000000000000000000000000000000000815250610770565b604080517c010000000000000000000000000000000000000000000000000000000063ffffffff8c16028152600160a060020a039889166004820152602481019790975294871660448701529286166064860152608485019190915260a484015290921660c4820152905160e480830192602092919082900301818588803b1580156103cd57600080fd5b505af11580156103e1573d6000803e3d6000fd5b50505050506040513d60208110156103f857600080fd5b50519550600160a060020a038b8116908616148015610418575060003031115b15610450576040513390303180156108fc02916000818181858888f1935050505015801561044a573d6000803e3d6000fd5b50610593565b600160a060020a038b81169086161461059357604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290518c9350600160a060020a038416916370a082319160248083019260209291908290030181600087803b1580156104c757600080fd5b505af11580156104db573d6000803e3d6000fd5b505050506040513d60208110156104f157600080fd5b50519050600081111561059357604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390529051600160a060020a0384169163a9059cbb9160448083019260209291908290030181600087803b15801561056657600080fd5b505af115801561057a573d6000803e3d6000fd5b505050506040513d602081101561059057600080fd5b50505b7faf95114641285cac53dca41a5a81b1d27d822a892a3611d8d8b82d406539ed408b8a8c89338d6105f86040805190810160405280600581526020017f61646d696e000000000000000000000000000000000000000000000000000000815250610770565b60408051600160a060020a0398891681526020810197909752948716868601526060860193909352908516608085015260a084015290921660c082015290519081900360e00190a1505050505095945050505050565b60008060006106916040805190810160405280600581526020017f6b79626572000000000000000000000000000000000000000000000000000000815250610770565b9250600091505b835182101561075b5783828151811015156106af57fe5b6020908102909101810151604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a038781166004830152600019602483015291519294509084169263095ea7b3926044808401938290030181600087803b15801561072457600080fd5b505af1158015610738573d6000803e3d6000fd5b505050506040513d602081101561074e57600080fd5b5050600190910190610698565b50505050565b600054600160a060020a031681565b600080546040517fd502db97000000000000000000000000000000000000000000000000000000008152602060048201818152855160248401528551600160a060020a0390941693849363d502db97938893928392604401918501908083838c5b838110156107e95781810151838201526020016107d1565b50505050905090810190601f1680156108165780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15801561083557600080fd5b505af1158015610849573d6000803e3d6000fd5b505050506040513d602081101561085f57600080fd5b50519392505050565b60008082600160a060020a031685600160a060020a031614156108fb573484146108f357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c6964204f7065726174696f6e000000000000000000000000000000604482015290519081900360640190fd5b83915061099f565b50604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a03878116600483015230602483015260448201869052915186928316916323b872dd9160648083019260209291908290030181600087803b15801561096e57600080fd5b505af1158015610982573d6000803e3d6000fd5b505050506040513d602081101561099857600080fd5b5060009250505b509493505050505600a165627a7a72305820821b95f50433164a0c1d43983567705271b3b7d61a59250b6856bccc154ac7a00029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000e16d035b8e76303237b9660b3c9c94c1a86aab47
-----Decoded View---------------
Arg [0] : rAddr (address): 0xE16D035B8E76303237b9660b3c9C94c1a86AAB47
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000e16d035b8e76303237b9660b3c9c94c1a86aab47
Swarm Source
bzzr://821b95f50433164a0c1d43983567705271b3b7d61a59250b6856bccc154ac7a0
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.001366 | 178 | $0.2431 |
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.