More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 25 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Swap And Send | 20756182 | 31 hrs ago | IN | 0.01273993 ETH | 0.0000021 | ||||
Swap And Send | 20755996 | 31 hrs ago | IN | 0.01317137 ETH | 0.00000314 | ||||
Swap And Send | 20755744 | 32 hrs ago | IN | 0.00676242 ETH | 0.00000276 | ||||
Swap And Send | 20755664 | 32 hrs ago | IN | 0.00621181 ETH | 0.00000263 | ||||
Swap And Send | 20671743 | 4 days ago | IN | 0.0035 ETH | 0.00005469 | ||||
Swap And Send | 20624817 | 6 days ago | IN | 0.01282305 ETH | 0.00000632 | ||||
Swap And Send | 20612139 | 6 days ago | IN | 0.2703264 ETH | 0.0000021 | ||||
Swap And Send | 20544277 | 9 days ago | IN | 0.25 ETH | 0.0000021 | ||||
Swap And Send | 20450305 | 13 days ago | IN | 0.033372 ETH | 0.00000421 | ||||
Swap And Send | 20430957 | 13 days ago | IN | 0.019 ETH | 0.00000632 | ||||
Swap And Send | 20426805 | 13 days ago | IN | 0.0084 ETH | 0.00000221 | ||||
Swap And Send | 20418989 | 14 days ago | IN | 0.01254453 ETH | 0.00001539 | ||||
Swap And Send | 20394400 | 15 days ago | IN | 0.88778704 ETH | 0.00000421 | ||||
Swap And Send | 20368485 | 16 days ago | IN | 0.127 ETH | 0.00008257 | ||||
Swap And Send | 20340629 | 17 days ago | IN | 0.00499539 ETH | 0.00000278 | ||||
Swap And Send | 20329399 | 17 days ago | IN | 0.010095 ETH | 0.0000025 | ||||
Swap And Send | 20320343 | 18 days ago | IN | 0.0196 ETH | 0.00000631 | ||||
Swap And Send | 20314238 | 18 days ago | IN | 0.00552 ETH | 0.00000842 | ||||
Swap And Send | 20305599 | 18 days ago | IN | 0.0104002 ETH | 0.00000415 | ||||
Swap And Send | 20305594 | 18 days ago | IN | 0.01018253 ETH | 0.00000484 | ||||
Swap And Send | 20305590 | 18 days ago | IN | 0.00981435 ETH | 0.00000495 | ||||
Swap And Send | 20305585 | 18 days ago | IN | 0.00848373 ETH | 0.00000497 | ||||
Swap And Send | 20305579 | 18 days ago | IN | 0.01082466 ETH | 0.00000499 | ||||
Swap And Send | 20305575 | 18 days ago | IN | 0.00950656 ETH | 0.00000476 | ||||
Swap And Send | 20305569 | 18 days ago | IN | 0.00956319 ETH | 0.00000451 |
Latest 25 internal transactions (View All)
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
20785824 | 4 hrs ago | 0.027 ETH | ||||
20785824 | 4 hrs ago | 0.027 ETH | ||||
20782229 | 7 hrs ago | 0.01640716 ETH | ||||
20782229 | 7 hrs ago | 0.01640716 ETH | ||||
20779682 | 10 hrs ago | 0.19489257 ETH | ||||
20779682 | 10 hrs ago | 0.19489257 ETH | ||||
20768430 | 20 hrs ago | 0.079 ETH | ||||
20768430 | 20 hrs ago | 0.079 ETH | ||||
20765807 | 22 hrs ago | 0.00228172 ETH | ||||
20765807 | 22 hrs ago | 0.00228172 ETH | ||||
20757972 | 30 hrs ago | 0.00075 ETH | ||||
20757972 | 30 hrs ago | 0.00075 ETH | ||||
20757804 | 30 hrs ago | 0.00346223 ETH | ||||
20757804 | 30 hrs ago | 0.00346223 ETH | ||||
20757663 | 30 hrs ago | 0.00051518 ETH | ||||
20757663 | 30 hrs ago | 0.00051518 ETH | ||||
20756182 | 31 hrs ago | 0.01273993 ETH | ||||
20755996 | 31 hrs ago | 0.01317137 ETH | ||||
20755744 | 32 hrs ago | 0.00676242 ETH | ||||
20755664 | 32 hrs ago | 0.00621181 ETH | ||||
20754323 | 33 hrs ago | 0.05 ETH | ||||
20754323 | 33 hrs ago | 0.05 ETH | ||||
20754192 | 33 hrs ago | 0.00736522 ETH | ||||
20754192 | 33 hrs ago | 0.00736522 ETH | ||||
20752898 | 34 hrs ago | 0.04014646 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xC8A4FB93...28E68a41b The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
L2_AmmWrapper
Compiler Version
v0.7.6+commit.7338295f
Optimization Enabled:
Yes with 50000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../interfaces/IWETH.sol"; interface ISwap { function swap( uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline ) external returns (uint256); } interface IL2_Bridge { function send( uint256 chainId, address recipient, uint256 amount, uint256 bonderFee, uint256 amountOutMin, uint256 deadline ) external; } contract L2_AmmWrapper { IL2_Bridge public immutable bridge; IERC20 public immutable l2CanonicalToken; bool public immutable l2CanonicalTokenIsEth; IERC20 public immutable hToken; ISwap public immutable exchangeAddress; /// @notice When l2CanonicalTokenIsEth is true, l2CanonicalToken should be set to the WETH address constructor( IL2_Bridge _bridge, IERC20 _l2CanonicalToken, bool _l2CanonicalTokenIsEth, IERC20 _hToken, ISwap _exchangeAddress ) public { bridge = _bridge; l2CanonicalToken = _l2CanonicalToken; l2CanonicalTokenIsEth = _l2CanonicalTokenIsEth; hToken = _hToken; exchangeAddress = _exchangeAddress; } receive() external payable {} /// @notice amount is the amount the user wants to send plus the Bonder fee function swapAndSend( uint256 chainId, address recipient, uint256 amount, uint256 bonderFee, uint256 amountOutMin, uint256 deadline, uint256 destinationAmountOutMin, uint256 destinationDeadline ) public payable { require(amount >= bonderFee, "L2_AMM_W: Bonder fee cannot exceed amount"); if (l2CanonicalTokenIsEth) { require(msg.value == amount, "L2_AMM_W: Value does not match amount"); IWETH(address(l2CanonicalToken)).deposit{value: amount}(); } else { require(l2CanonicalToken.transferFrom(msg.sender, address(this), amount), "L2_AMM_W: TransferFrom failed"); } require(l2CanonicalToken.approve(address(exchangeAddress), amount), "L2_AMM_W: Approve failed"); uint256 swapAmount = exchangeAddress.swap( 0, 1, amount, amountOutMin, deadline ); bridge.send(chainId, recipient, swapAmount, bonderFee, destinationAmountOutMin, destinationDeadline); } function attemptSwap( address recipient, uint256 amount, uint256 amountOutMin, uint256 deadline ) external { require(hToken.transferFrom(msg.sender, address(this), amount), "L2_AMM_W: TransferFrom failed"); require(hToken.approve(address(exchangeAddress), amount), "L2_AMM_W: Approve failed"); uint256 amountOut = 0; try exchangeAddress.swap( 1, 0, amount, amountOutMin, deadline ) returns (uint256 _amountOut) { amountOut = _amountOut; } catch {} if (amountOut == 0) { // Transfer hToken to recipient if swap fails require(hToken.transfer(recipient, amount), "L2_AMM_W: Transfer failed"); return; } if (l2CanonicalTokenIsEth) { IWETH(address(l2CanonicalToken)).withdraw(amountOut); (bool success, ) = recipient.call{value: amountOut}(new bytes(0)); require(success, 'L2_AMM_W: ETH transfer failed'); } else { require(l2CanonicalToken.transfer(recipient, amountOut), "L2_AMM_W: Transfer failed"); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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 `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool); /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.12 <=0.7.6; interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function withdraw(uint) external; }
{ "optimizer": { "enabled": true, "runs": 50000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IL2_Bridge","name":"_bridge","type":"address"},{"internalType":"contract IERC20","name":"_l2CanonicalToken","type":"address"},{"internalType":"bool","name":"_l2CanonicalTokenIsEth","type":"bool"},{"internalType":"contract IERC20","name":"_hToken","type":"address"},{"internalType":"contract ISwap","name":"_exchangeAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"attemptSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"bridge","outputs":[{"internalType":"contract IL2_Bridge","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchangeAddress","outputs":[{"internalType":"contract ISwap","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"l2CanonicalToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"l2CanonicalTokenIsEth","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"bonderFee","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"destinationAmountOutMin","type":"uint256"},{"internalType":"uint256","name":"destinationDeadline","type":"uint256"}],"name":"swapAndSend","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Deployed Bytecode
0x6080604052600436106100745760003560e01c80639cd016051161004e5780639cd01605146100ef578063e78cea9214610104578063eea0d7b214610119578063fc6e3b3b1461012c5761007b565b80631ee1bf671461008057806328555125146100ab578063676c5ef6146100cd5761007b565b3661007b57005b600080fd5b34801561008c57600080fd5b50610095610141565b6040516100a29190610ef7565b60405180910390f35b3480156100b757600080fd5b506100c0610165565b6040516100a29190610eec565b3480156100d957600080fd5b506100ed6100e8366004610d86565b610189565b005b3480156100fb57600080fd5b5061009561082c565b34801561011057600080fd5b50610095610850565b6100ed610127366004610dfd565b610874565b34801561013857600080fd5b50610095610d39565b7f0000000000000000000000004f9a0e7fd2bf6067db6994cf12e4495df938e6e981565b7f000000000000000000000000000000000000000000000000000000000000000181565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000652a38fa87f60a122aef360eeefcaf6258eddf6a16906323b872dd906101ff90339030908890600401610e95565b602060405180830381600087803b15801561021957600080fd5b505af115801561022d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102519190610dbe565b610290576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028790610f43565b60405180910390fd5b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000652a38fa87f60a122aef360eeefcaf6258eddf6a169063095ea7b390610324907f0000000000000000000000000a6b1904369fe59e002ad0713ae89d4e3df5a7cf908790600401610ec6565b602060405180830381600087803b15801561033e57600080fd5b505af1158015610352573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103769190610dbe565b6103ac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610287906110a2565b6040517f9169558600000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000a6b1904369fe59e002ad0713ae89d4e3df5a7cf169063916955869061042a906001908590899089908990600401610f18565b602060405180830381600087803b15801561044457600080fd5b505af1925050508015610492575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261048f91810190610de5565b60015b61049b5761049e565b90505b806105a5576040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000652a38fa87f60a122aef360eeefcaf6258eddf6a169063a9059cbb906105179088908890600401610ec6565b602060405180830381600087803b15801561053157600080fd5b505af1158015610545573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105699190610dbe565b61059f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102879061100e565b50610826565b7f000000000000000000000000000000000000000000000000000000000000000115610728576040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004f9a0e7fd2bf6067db6994cf12e4495df938e6e91690632e1a7d4d9061063d9084906004016110d9565b600060405180830381600087803b15801561065757600080fd5b505af115801561066b573d6000803e3d6000fd5b50506040805160008082526020820192839052935073ffffffffffffffffffffffffffffffffffffffff8916925084916106a59190610e5c565b60006040518083038185875af1925050503d80600081146106e2576040519150601f19603f3d011682016040523d82523d6000602084013e6106e7565b606091505b5050905080610722576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028790610f7a565b50610824565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004f9a0e7fd2bf6067db6994cf12e4495df938e6e9169063a9059cbb9061079c9088908590600401610ec6565b602060405180830381600087803b1580156107b657600080fd5b505af11580156107ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ee9190610dbe565b610824576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102879061100e565b505b50505050565b7f0000000000000000000000000a6b1904369fe59e002ad0713ae89d4e3df5a7cf81565b7f0000000000000000000000000ce6c85cf43553de10fc56ceca0aef6ff0dd444d81565b848610156108ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028790611045565b7f0000000000000000000000000000000000000000000000000000000000000001156109935785341461090d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028790610fb1565b7f0000000000000000000000004f9a0e7fd2bf6067db6994cf12e4495df938e6e973ffffffffffffffffffffffffffffffffffffffff1663d0e30db0876040518263ffffffff1660e01b81526004016000604051808303818588803b15801561097557600080fd5b505af1158015610989573d6000803e3d6000fd5b5050505050610a91565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004f9a0e7fd2bf6067db6994cf12e4495df938e6e916906323b872dd90610a0990339030908b90600401610e95565b602060405180830381600087803b158015610a2357600080fd5b505af1158015610a37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5b9190610dbe565b610a91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028790610f43565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004f9a0e7fd2bf6067db6994cf12e4495df938e6e9169063095ea7b390610b25907f0000000000000000000000000a6b1904369fe59e002ad0713ae89d4e3df5a7cf908a90600401610ec6565b602060405180830381600087803b158015610b3f57600080fd5b505af1158015610b53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b779190610dbe565b610bad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610287906110a2565b6040517f9169558600000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000a6b1904369fe59e002ad0713ae89d4e3df5a7cf1690639169558690610c2b9084906001908c908b908b90600401610f18565b602060405180830381600087803b158015610c4557600080fd5b505af1158015610c59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7d9190610de5565b6040517fa6bd1b3300000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000ce6c85cf43553de10fc56ceca0aef6ff0dd444d169063a6bd1b3390610cfc908c908c9086908c908a908a906004016110e2565b600060405180830381600087803b158015610d1657600080fd5b505af1158015610d2a573d6000803e3d6000fd5b50505050505050505050505050565b7f000000000000000000000000652a38fa87f60a122aef360eeefcaf6258eddf6a81565b803573ffffffffffffffffffffffffffffffffffffffff81168114610d8157600080fd5b919050565b60008060008060808587031215610d9b578384fd5b610da485610d5d565b966020860135965060408601359560600135945092505050565b600060208284031215610dcf578081fd5b81518015158114610dde578182fd5b9392505050565b600060208284031215610df6578081fd5b5051919050565b600080600080600080600080610100898b031215610e19578384fd5b88359750610e2960208a01610d5d565b979a9799505050506040860135956060810135956080820135955060a0820135945060c0820135935060e0909101359150565b60008251815b81811015610e7c5760208186018101518583015201610e62565b81811115610e8a5782828501525b509190910192915050565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b901515815260200190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b60ff958616815293909416602084015260408301919091526060820152608081019190915260a00190565b6020808252601d908201527f4c325f414d4d5f573a205472616e7366657246726f6d206661696c6564000000604082015260600190565b6020808252601d908201527f4c325f414d4d5f573a20455448207472616e73666572206661696c6564000000604082015260600190565b60208082526025908201527f4c325f414d4d5f573a2056616c756520646f6573206e6f74206d61746368206160408201527f6d6f756e74000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526019908201527f4c325f414d4d5f573a205472616e73666572206661696c656400000000000000604082015260600190565b60208082526029908201527f4c325f414d4d5f573a20426f6e646572206665652063616e6e6f74206578636560408201527f656420616d6f756e740000000000000000000000000000000000000000000000606082015260800190565b60208082526018908201527f4c325f414d4d5f573a20417070726f7665206661696c65640000000000000000604082015260600190565b90815260200190565b95865273ffffffffffffffffffffffffffffffffffffffff94909416602086015260408501929092526060840152608083015260a082015260c0019056fea26469706673582212205fed1a0b58c665b58ab760e191e8fc20321a1cdeb964a2c4bdf9f9f89e44ee1a64736f6c63430007060033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.