Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 441 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Swap | 19945430 | 64 days ago | IN | 0 ETH | 0.00022606 | ||||
Swap | 19895490 | 71 days ago | IN | 0 ETH | 0.00016502 | ||||
Swap | 19741467 | 93 days ago | IN | 0 ETH | 0.00595884 | ||||
Swap | 19588190 | 114 days ago | IN | 0 ETH | 0.00103663 | ||||
Swap | 19371478 | 145 days ago | IN | 0 ETH | 0.0059238 | ||||
Swap | 19348498 | 148 days ago | IN | 0 ETH | 0.00910375 | ||||
Swap | 19219867 | 166 days ago | IN | 0 ETH | 0.01758233 | ||||
Swap | 19041601 | 191 days ago | IN | 0 ETH | 0.05630758 | ||||
Swap | 19006124 | 196 days ago | IN | 0 ETH | 0.01714928 | ||||
Swap | 19005789 | 196 days ago | IN | 0 ETH | 0.01995487 | ||||
Swap | 18983719 | 199 days ago | IN | 0 ETH | 0.13287461 | ||||
Swap | 18920386 | 208 days ago | IN | 0 ETH | 0.03139729 | ||||
Swap | 18910935 | 209 days ago | IN | 0 ETH | 0.00074134 | ||||
Swap | 18820564 | 222 days ago | IN | 0 ETH | 0.13070917 | ||||
Swap | 18783670 | 227 days ago | IN | 0 ETH | 0.00313718 | ||||
Swap | 18729233 | 235 days ago | IN | 0 ETH | 0.0048576 | ||||
Swap | 18729045 | 235 days ago | IN | 0 ETH | 0.00477288 | ||||
Swap | 18728973 | 235 days ago | IN | 0 ETH | 0.00447219 | ||||
Swap | 18728928 | 235 days ago | IN | 0 ETH | 0.0065417 | ||||
Swap | 18683315 | 241 days ago | IN | 0 ETH | 0.0020025 | ||||
Swap | 18679076 | 242 days ago | IN | 0 ETH | 0.00349786 | ||||
Swap | 18674033 | 243 days ago | IN | 0 ETH | 0.00687296 | ||||
Swap | 18670651 | 243 days ago | IN | 0 ETH | 0.00550496 | ||||
Swap | 18616894 | 251 days ago | IN | 0 ETH | 0.00687296 | ||||
Swap | 18534865 | 262 days ago | IN | 0 ETH | 0.00687296 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
17599075 | 393 days ago | 0.0044673 ETH | ||||
17599075 | 393 days ago | 0.0044673 ETH | ||||
17599075 | 393 days ago | 0.005 ETH | ||||
17581895 | 395 days ago | 0.00448145 ETH | ||||
17581895 | 395 days ago | 0.00448145 ETH | ||||
17581895 | 395 days ago | 0.005 ETH | ||||
17531827 | 403 days ago | 0.00446182 ETH | ||||
17531827 | 403 days ago | 0.00446182 ETH | ||||
17531827 | 403 days ago | 0.005 ETH | ||||
17531720 | 403 days ago | 0.00446238 ETH | ||||
17531720 | 403 days ago | 0.00446238 ETH | ||||
17531720 | 403 days ago | 0.005 ETH | ||||
17518931 | 404 days ago | 0.00446271 ETH | ||||
17518931 | 404 days ago | 0.00446271 ETH | ||||
17518931 | 404 days ago | 0.005 ETH | ||||
17503671 | 406 days ago | 0.00447939 ETH | ||||
17503671 | 406 days ago | 0.00447939 ETH | ||||
17503671 | 406 days ago | 0.005 ETH | ||||
17503537 | 406 days ago | 0.00447888 ETH | ||||
17503537 | 406 days ago | 0.00447888 ETH | ||||
17503537 | 406 days ago | 0.005 ETH | ||||
17458893 | 413 days ago | 0.004472 ETH | ||||
17458893 | 413 days ago | 0.004472 ETH | ||||
17458893 | 413 days ago | 0.005 ETH | ||||
17458890 | 413 days ago | 0.00447783 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
Swap0x
Compiler Version
v0.8.7+commit.e28d00a7
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IMulticall { function multicall(bytes[] calldata data) external payable returns (bytes[] memory results); } abstract contract Multicall is IMulticall { function _getRevertMsg(bytes memory _returnData) internal pure returns (string memory) { // If the _res length is less than 68, then the transaction failed silently (without a revert message) if (_returnData.length < 68) return "Transaction reverted silently"; assembly { // Slice the sighash. _returnData := add(_returnData, 0x04) } return abi.decode(_returnData, (string)); // All that remains is the revert string } function multicall(bytes[] calldata data) public payable override returns (bytes[] memory results) { results = new bytes[](data.length); for (uint256 i = 0; i < data.length; i++) { (bool success, bytes memory result) = address(this).delegatecall( data[i] ); require(success, _getRevertMsg(result)); results[i] = result; } } } contract Swap0x is Multicall { receive() external payable {} function swap( address sellToken, address buyToken, uint256 sellAmount, address allowanceTarget, address payable swapTarget, bytes calldata swapData ) public payable { if (sellToken != address(0)) { IERC20(sellToken).transferFrom( msg.sender, address(this), sellAmount ); } else { require(msg.value >= sellAmount, "Swap0x: ETH value invalid"); } if (allowanceTarget != address(0) && sellToken != address(0)) { require( IERC20(sellToken).approve(allowanceTarget, type(uint256).max), "Swap0x: allowance failed" ); } uint256 buyTokenBalanceBefore = 0; if (buyToken != address(0)) { buyTokenBalanceBefore = IERC20(buyToken).balanceOf(address(this)); } else { buyTokenBalanceBefore = address(this).balance; } if (sellToken != address(0)) { (bool success, bytes memory retdata) = swapTarget.call(swapData); require(success, _getRevertMsg(retdata)); } else { (bool success, bytes memory retdata) = swapTarget.call{ value: sellAmount }(swapData); require(success, _getRevertMsg(retdata)); } if (buyToken != address(0)) { uint256 buyTokenBalanceAfter = IERC20(buyToken).balanceOf( address(this) ); uint256 boughtAmount = buyTokenBalanceAfter - buyTokenBalanceBefore; IERC20(buyToken).transfer(msg.sender, boughtAmount); } else { uint256 buyTokenBalanceAfter = address(this).balance; uint256 boughtAmount = buyTokenBalanceAfter - buyTokenBalanceBefore; payable(msg.sender).transfer(boughtAmount); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"address","name":"buyToken","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"address","name":"allowanceTarget","type":"address"},{"internalType":"address payable","name":"swapTarget","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"}],"name":"swap","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b50610b4d806100206000396000f3fe60806040526004361061002d5760003560e01c8063ac9650d814610039578063e962172a1461006257600080fd5b3661003457005b600080fd5b61004c6100473660046107f8565b610077565b6040516100599190610998565b60405180910390f35b610075610070366004610731565b6101ba565b005b60608167ffffffffffffffff81111561009257610092610ae9565b6040519080825280602002602001820160405280156100c557816020015b60608152602001906001900390816100b05790505b50905060005b828110156101b357600080308686858181106100e9576100e9610ad3565b90506020028101906100fb9190610a0d565b604051610109929190610988565b600060405180830381855af49150503d8060008114610144576040519150601f19603f3d011682016040523d82523d6000602084013e610149565b606091505b509150915081610158826106cc565b9061017f5760405162461bcd60e51b815260040161017691906109fa565b60405180910390fd5b508084848151811061019357610193610ad3565b6020026020010181905250505080806101ab90610aa2565b9150506100cb565b5092915050565b6001600160a01b03871615610255576040516323b872dd60e01b8152336004820152306024820152604481018690526001600160a01b038816906323b872dd90606401602060405180830381600087803b15801561021757600080fd5b505af115801561022b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024f919061086d565b506102a5565b843410156102a55760405162461bcd60e51b815260206004820152601960248201527f5377617030783a204554482076616c756520696e76616c6964000000000000006044820152606401610176565b6001600160a01b038416158015906102c557506001600160a01b03871615155b156103995760405163095ea7b360e01b81526001600160a01b038581166004830152600019602483015288169063095ea7b390604401602060405180830381600087803b15801561031557600080fd5b505af1158015610329573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034d919061086d565b6103995760405162461bcd60e51b815260206004820152601860248201527f5377617030783a20616c6c6f77616e6365206661696c656400000000000000006044820152606401610176565b60006001600160a01b03871615610428576040516370a0823160e01b81523060048201526001600160a01b038816906370a082319060240160206040518083038186803b1580156103e957600080fd5b505afa1580156103fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104219190610943565b905061042b565b50475b6001600160a01b038816156104ce57600080856001600160a01b03168585604051610457929190610988565b6000604051808303816000865af19150503d8060008114610494576040519150601f19603f3d011682016040523d82523d6000602084013e610499565b606091505b5091509150816104a8826106cc565b906104c65760405162461bcd60e51b815260040161017691906109fa565b50505061055f565b600080856001600160a01b03168886866040516104ec929190610988565b60006040518083038185875af1925050503d8060008114610529576040519150601f19603f3d011682016040523d82523d6000602084013e61052e565b606091505b50915091508161053d826106cc565b9061055b5760405162461bcd60e51b815260040161017691906109fa565b5050505b6001600160a01b03871615610681576040516370a0823160e01b81523060048201526000906001600160a01b038916906370a082319060240160206040518083038186803b1580156105b057600080fd5b505afa1580156105c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e89190610943565b905060006105f68383610a5b565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b038a169063a9059cbb90604401602060405180830381600087803b15801561064157600080fd5b505af1158015610655573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610679919061086d565b5050506106c2565b47600061068e8383610a5b565b604051909150339082156108fc029083906000818181858888f193505050501580156106be573d6000803e3d6000fd5b5050505b5050505050505050565b606060448251101561071157505060408051808201909152601d81527f5472616e73616374696f6e2072657665727465642073696c656e746c79000000602082015290565b6004820191508180602001905181019061072b9190610896565b92915050565b600080600080600080600060c0888a03121561074c57600080fd5b873561075781610aff565b9650602088013561076781610aff565b955060408801359450606088013561077e81610aff565b9350608088013561078e81610aff565b925060a088013567ffffffffffffffff808211156107ab57600080fd5b818a0191508a601f8301126107bf57600080fd5b8135818111156107ce57600080fd5b8b60208285010111156107e057600080fd5b60208301945080935050505092959891949750929550565b6000806020838503121561080b57600080fd5b823567ffffffffffffffff8082111561082357600080fd5b818501915085601f83011261083757600080fd5b81358181111561084657600080fd5b8660208260051b850101111561085b57600080fd5b60209290920196919550909350505050565b60006020828403121561087f57600080fd5b8151801515811461088f57600080fd5b9392505050565b6000602082840312156108a857600080fd5b815167ffffffffffffffff808211156108c057600080fd5b818401915084601f8301126108d457600080fd5b8151818111156108e6576108e6610ae9565b604051601f8201601f19908116603f0116810190838211818310171561090e5761090e610ae9565b8160405282815287602084870101111561092757600080fd5b610938836020830160208801610a72565b979650505050505050565b60006020828403121561095557600080fd5b5051919050565b60008151808452610974816020860160208601610a72565b601f01601f19169290920160200192915050565b8183823760009101908152919050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156109ed57603f198886030184526109db85835161095c565b945092850192908501906001016109bf565b5092979650505050505050565b60208152600061088f602083018461095c565b6000808335601e19843603018112610a2457600080fd5b83018035915067ffffffffffffffff821115610a3f57600080fd5b602001915036819003821315610a5457600080fd5b9250929050565b600082821015610a6d57610a6d610abd565b500390565b60005b83811015610a8d578181015183820152602001610a75565b83811115610a9c576000848401525b50505050565b6000600019821415610ab657610ab6610abd565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610b1457600080fd5b5056fea26469706673582212208a9f2296c7211b2378a6902fdd91459c97f33143aa58d49019feb3aa42de7db164736f6c63430008070033
Deployed Bytecode
0x60806040526004361061002d5760003560e01c8063ac9650d814610039578063e962172a1461006257600080fd5b3661003457005b600080fd5b61004c6100473660046107f8565b610077565b6040516100599190610998565b60405180910390f35b610075610070366004610731565b6101ba565b005b60608167ffffffffffffffff81111561009257610092610ae9565b6040519080825280602002602001820160405280156100c557816020015b60608152602001906001900390816100b05790505b50905060005b828110156101b357600080308686858181106100e9576100e9610ad3565b90506020028101906100fb9190610a0d565b604051610109929190610988565b600060405180830381855af49150503d8060008114610144576040519150601f19603f3d011682016040523d82523d6000602084013e610149565b606091505b509150915081610158826106cc565b9061017f5760405162461bcd60e51b815260040161017691906109fa565b60405180910390fd5b508084848151811061019357610193610ad3565b6020026020010181905250505080806101ab90610aa2565b9150506100cb565b5092915050565b6001600160a01b03871615610255576040516323b872dd60e01b8152336004820152306024820152604481018690526001600160a01b038816906323b872dd90606401602060405180830381600087803b15801561021757600080fd5b505af115801561022b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024f919061086d565b506102a5565b843410156102a55760405162461bcd60e51b815260206004820152601960248201527f5377617030783a204554482076616c756520696e76616c6964000000000000006044820152606401610176565b6001600160a01b038416158015906102c557506001600160a01b03871615155b156103995760405163095ea7b360e01b81526001600160a01b038581166004830152600019602483015288169063095ea7b390604401602060405180830381600087803b15801561031557600080fd5b505af1158015610329573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034d919061086d565b6103995760405162461bcd60e51b815260206004820152601860248201527f5377617030783a20616c6c6f77616e6365206661696c656400000000000000006044820152606401610176565b60006001600160a01b03871615610428576040516370a0823160e01b81523060048201526001600160a01b038816906370a082319060240160206040518083038186803b1580156103e957600080fd5b505afa1580156103fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104219190610943565b905061042b565b50475b6001600160a01b038816156104ce57600080856001600160a01b03168585604051610457929190610988565b6000604051808303816000865af19150503d8060008114610494576040519150601f19603f3d011682016040523d82523d6000602084013e610499565b606091505b5091509150816104a8826106cc565b906104c65760405162461bcd60e51b815260040161017691906109fa565b50505061055f565b600080856001600160a01b03168886866040516104ec929190610988565b60006040518083038185875af1925050503d8060008114610529576040519150601f19603f3d011682016040523d82523d6000602084013e61052e565b606091505b50915091508161053d826106cc565b9061055b5760405162461bcd60e51b815260040161017691906109fa565b5050505b6001600160a01b03871615610681576040516370a0823160e01b81523060048201526000906001600160a01b038916906370a082319060240160206040518083038186803b1580156105b057600080fd5b505afa1580156105c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e89190610943565b905060006105f68383610a5b565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b038a169063a9059cbb90604401602060405180830381600087803b15801561064157600080fd5b505af1158015610655573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610679919061086d565b5050506106c2565b47600061068e8383610a5b565b604051909150339082156108fc029083906000818181858888f193505050501580156106be573d6000803e3d6000fd5b5050505b5050505050505050565b606060448251101561071157505060408051808201909152601d81527f5472616e73616374696f6e2072657665727465642073696c656e746c79000000602082015290565b6004820191508180602001905181019061072b9190610896565b92915050565b600080600080600080600060c0888a03121561074c57600080fd5b873561075781610aff565b9650602088013561076781610aff565b955060408801359450606088013561077e81610aff565b9350608088013561078e81610aff565b925060a088013567ffffffffffffffff808211156107ab57600080fd5b818a0191508a601f8301126107bf57600080fd5b8135818111156107ce57600080fd5b8b60208285010111156107e057600080fd5b60208301945080935050505092959891949750929550565b6000806020838503121561080b57600080fd5b823567ffffffffffffffff8082111561082357600080fd5b818501915085601f83011261083757600080fd5b81358181111561084657600080fd5b8660208260051b850101111561085b57600080fd5b60209290920196919550909350505050565b60006020828403121561087f57600080fd5b8151801515811461088f57600080fd5b9392505050565b6000602082840312156108a857600080fd5b815167ffffffffffffffff808211156108c057600080fd5b818401915084601f8301126108d457600080fd5b8151818111156108e6576108e6610ae9565b604051601f8201601f19908116603f0116810190838211818310171561090e5761090e610ae9565b8160405282815287602084870101111561092757600080fd5b610938836020830160208801610a72565b979650505050505050565b60006020828403121561095557600080fd5b5051919050565b60008151808452610974816020860160208601610a72565b601f01601f19169290920160200192915050565b8183823760009101908152919050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156109ed57603f198886030184526109db85835161095c565b945092850192908501906001016109bf565b5092979650505050505050565b60208152600061088f602083018461095c565b6000808335601e19843603018112610a2457600080fd5b83018035915067ffffffffffffffff821115610a3f57600080fd5b602001915036819003821315610a5457600080fd5b9250929050565b600082821015610a6d57610a6d610abd565b500390565b60005b83811015610a8d578181015183820152602001610a75565b83811115610a9c576000848401525b50505050565b6000600019821415610ab657610ab6610abd565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610b1457600080fd5b5056fea26469706673582212208a9f2296c7211b2378a6902fdd91459c97f33143aa58d49019feb3aa42de7db164736f6c63430008070033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 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.