ETH Price: $2,722.24 (+4.19%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0xaa07cf8b99b8bcb6bb252e5279143deaf2a6dd3494184fd47d1c619a24835a4d Deposit WETH(pending)2025-02-04 9:06:171 hr ago1738659977IN
Aevo: L1 Deposit Helper
0.0000152612 ETH(Pending)(Pending)
0xff9562095367395cbdf8872a280d6d26c0d1d6c0b50d62e120995f6a1050457f Deposit WETH(pending)2025-02-03 5:37:1728 hrs ago1738561037IN
Aevo: L1 Deposit Helper
0.045 ETH(Pending)(Pending)
Deposit WETH217712212025-02-04 6:02:474 hrs ago1738648967IN
Aevo: L1 Deposit Helper
0.25 ETH0.001193652.08988564
Deposit WETH217666062025-02-03 14:34:2319 hrs ago1738593263IN
Aevo: L1 Deposit Helper
0.3 ETH0.0075304335.32214211
Deposit WETH217666042025-02-03 14:33:5919 hrs ago1738593239IN
Aevo: L1 Deposit Helper
6 ETH0.0069955932.86629791
Deposit ERC20Wit...217645792025-02-03 7:45:4726 hrs ago1738568747IN
Aevo: L1 Deposit Helper
0 ETH0.0038759318.71471617
Deposit WETH217645702025-02-03 7:43:5926 hrs ago1738568639IN
Aevo: L1 Deposit Helper
20 ETH0.0042163218.35300433
Deposit WETH217645062025-02-03 7:31:1126 hrs ago1738567871IN
Aevo: L1 Deposit Helper
60 ETH0.003546614.92385133
Deposit WETH217643142025-02-03 6:52:4727 hrs ago1738565567IN
Aevo: L1 Deposit Helper
0.4 ETH0.0040143817.48707267
Deposit WETH217638692025-02-03 5:23:2328 hrs ago1738560203IN
Aevo: L1 Deposit Helper
1.75 ETH0.0058012627.21132461
Deposit ERC20Wit...217638532025-02-03 5:20:1128 hrs ago1738560011IN
Aevo: L1 Deposit Helper
0 ETH0.0055462628.66284538
Deposit WETH217638062025-02-03 5:10:4728 hrs ago1738559447IN
Aevo: L1 Deposit Helper
0.11 ETH0.0061761628.96983449
Deposit WETH217637692025-02-03 5:03:2329 hrs ago1738559003IN
Aevo: L1 Deposit Helper
0.4 ETH0.0083332939.08801183
Deposit WETH217636492025-02-03 4:39:1129 hrs ago1738557551IN
Aevo: L1 Deposit Helper
3 ETH0.0097132545.56087576
Deposit ERC20Wit...217634352025-02-03 3:56:1130 hrs ago1738554971IN
Aevo: L1 Deposit Helper
0 ETH0.0111532957.63379339
Deposit WETH217633392025-02-03 3:36:4730 hrs ago1738553807IN
Aevo: L1 Deposit Helper
0.7 ETH0.0187036587.73111351
Deposit WETH217632842025-02-03 3:25:4730 hrs ago1738553147IN
Aevo: L1 Deposit Helper
0.22 ETH0.0189117988.85034783
Deposit WETH217626992025-02-03 1:27:4732 hrs ago1738546067IN
Aevo: L1 Deposit Helper
0.8 ETH0.0035954315.08564367
Deposit WETH217623982025-02-03 0:26:5933 hrs ago1738542419IN
Aevo: L1 Deposit Helper
0.7 ETH0.0035727614.56991132
Deposit ERC20Wit...217622462025-02-02 23:56:2334 hrs ago1738540583IN
Aevo: L1 Deposit Helper
0 ETH0.0033937515.6436235
Deposit ERC20Wit...217620332025-02-02 23:13:4734 hrs ago1738538027IN
Aevo: L1 Deposit Helper
0 ETH0.0041602920.90031376
Deposit WETH217619492025-02-02 22:56:5935 hrs ago1738537019IN
Aevo: L1 Deposit Helper
0.5 ETH0.005217624.13914531
Deposit WETH217617762025-02-02 22:22:2335 hrs ago1738534943IN
Aevo: L1 Deposit Helper
2 ETH0.00243758.52336285
Deposit WETH217615972025-02-02 21:45:5936 hrs ago1738532759IN
Aevo: L1 Deposit Helper
1.2 ETH0.002494228.79575152
Deposit WETH217612012025-02-02 20:26:2337 hrs ago1738527983IN
Aevo: L1 Deposit Helper
1 ETH0.0034137114.06933723
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
217712212025-02-04 6:02:474 hrs ago1738648967
Aevo: L1 Deposit Helper
0.25 ETH
217666062025-02-03 14:34:2319 hrs ago1738593263
Aevo: L1 Deposit Helper
0.3 ETH
217666042025-02-03 14:33:5919 hrs ago1738593239
Aevo: L1 Deposit Helper
6 ETH
217645702025-02-03 7:43:5926 hrs ago1738568639
Aevo: L1 Deposit Helper
20 ETH
217645062025-02-03 7:31:1126 hrs ago1738567871
Aevo: L1 Deposit Helper
60 ETH
217643142025-02-03 6:52:4727 hrs ago1738565567
Aevo: L1 Deposit Helper
0.4 ETH
217638692025-02-03 5:23:2328 hrs ago1738560203
Aevo: L1 Deposit Helper
1.75 ETH
217638062025-02-03 5:10:4728 hrs ago1738559447
Aevo: L1 Deposit Helper
0.11 ETH
217637692025-02-03 5:03:2329 hrs ago1738559003
Aevo: L1 Deposit Helper
0.4 ETH
217636492025-02-03 4:39:1129 hrs ago1738557551
Aevo: L1 Deposit Helper
3 ETH
217633392025-02-03 3:36:4730 hrs ago1738553807
Aevo: L1 Deposit Helper
0.7 ETH
217632842025-02-03 3:25:4730 hrs ago1738553147
Aevo: L1 Deposit Helper
0.22 ETH
217626992025-02-03 1:27:4732 hrs ago1738546067
Aevo: L1 Deposit Helper
0.8 ETH
217623982025-02-03 0:26:5933 hrs ago1738542419
Aevo: L1 Deposit Helper
0.7 ETH
217619492025-02-02 22:56:5935 hrs ago1738537019
Aevo: L1 Deposit Helper
0.5 ETH
217617762025-02-02 22:22:2335 hrs ago1738534943
Aevo: L1 Deposit Helper
2 ETH
217615972025-02-02 21:45:5936 hrs ago1738532759
Aevo: L1 Deposit Helper
1.2 ETH
217612012025-02-02 20:26:2337 hrs ago1738527983
Aevo: L1 Deposit Helper
1 ETH
217611942025-02-02 20:24:5937 hrs ago1738527899
Aevo: L1 Deposit Helper
2 ETH
217610052025-02-02 19:46:4738 hrs ago1738525607
Aevo: L1 Deposit Helper
2.62 ETH
217603692025-02-02 17:39:1140 hrs ago1738517951
Aevo: L1 Deposit Helper
0.3 ETH
217602202025-02-02 17:09:2341 hrs ago1738516163
Aevo: L1 Deposit Helper
0.25 ETH
217600132025-02-02 16:27:1141 hrs ago1738513631
Aevo: L1 Deposit Helper
0.45 ETH
217566792025-02-02 5:14:592 days ago1738473299
Aevo: L1 Deposit Helper
28 ETH
217564292025-02-02 4:24:352 days ago1738470275
Aevo: L1 Deposit Helper
1.2 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
L1DepositHelper

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 5 : L1DepositHelper.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.15;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {WETHInterface} from "../interfaces/WETHInterface.sol";
import {IL1ERC20Bridge} from "./interfaces/IL1ERC20Bridge.sol";
import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";

/// @title L1DepositHelper
/// @notice The L1 deposit helper for depositing tokens to L2 with a permit message
contract L1DepositHelper {
    using SafeTransferLib for ERC20;

    /*//////////////////////////////////////////////////////////////
                               IMMUTABLES
    //////////////////////////////////////////////////////////////*/

    /// @notice The L1 bridge contract
    IL1ERC20Bridge public immutable l1Bridge;

    /// @notice The WETH address
    address public immutable weth;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    /// @notice Constructor
    /// @param _l1Bridge The L1 bridge
    /// @param _weth The WETH address
    constructor(address _l1Bridge, address _weth) {
        l1Bridge = IL1ERC20Bridge(_l1Bridge);
        weth = _weth;

        // Max approve WETH to the L1 bridge
        ERC20(_weth).safeApprove(_l1Bridge, type(uint256).max);
    }

    /*//////////////////////////////////////////////////////////////
                             DEPOSIT LOGIC
    //////////////////////////////////////////////////////////////*/

    /// @notice Deposit an amount of the ERC20 to the senders balance on L2 using an EIP-2612 permit signature
    /// @param l1Token Address of the L1 ERC20 we are depositing
    /// @param l2Token Address of the L1 respective L2 ERC20
    /// @param amount Amount of the ERC20 to deposit
    /// @param l2Gas Gas limit required to complete the deposit on L2
    /// @param data Optional data to forward to L2
    /// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp
    /// @param v Must produce valid secp256k1 signature from the holder along with r and s
    /// @param r Must produce valid secp256k1 signature from the holder along with v and s
    /// @param s Must produce valid secp256k1 signature from the holder along with r and v
    function depositERC20WithPermit(
        address l1Token,
        address l2Token,
        uint256 amount,
        uint32 l2Gas,
        bytes calldata data,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external {
        // Approve the tokens from the sender to this contract
        ERC20(l1Token).permit(msg.sender, address(this), amount, deadline, v, r, s);

        // Transfer the tokens from the sender to this contract
        ERC20(l1Token).safeTransferFrom(msg.sender, address(this), amount);

        // Approve the tokens from this contract to the L1 bridge
        ERC20(l1Token).safeApprove(address(l1Bridge), amount);

        // Deposit the tokens to the senders balance on L2
        l1Bridge.depositERC20To(l1Token, l2Token, msg.sender, amount, l2Gas, data);
    }

    /// @notice Deposit an amount of ERC20 to a recipients balance on L2 using an EIP-2612 permit signature
    /// @param l1Token Address of the L1 ERC20 we are depositing
    /// @param l2Token Address of the L1 respective L2 ERC20
    /// @param to The recipient address on L2
    /// @param amount Amount of the ERC20 to deposit
    /// @param l2Gas Gas limit required to complete the deposit on L2
    /// @param data Optional data to forward to L2
    /// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp
    /// @param v Must produce valid secp256k1 signature from the holder along with r and s
    /// @param r Must produce valid secp256k1 signature from the holder along with v and s
    /// @param s Must produce valid secp256k1 signature from the holder along with r and v
    function depositERC20ToWithPermit(
        address l1Token,
        address l2Token,
        address to,
        uint256 amount,
        uint32 l2Gas,
        bytes calldata data,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external {
        // Approve the tokens from the sender to this contract
        ERC20(l1Token).permit(msg.sender, address(this), amount, deadline, v, r, s);

        // Transfer the tokens from the sender to this contract
        ERC20(l1Token).safeTransferFrom(msg.sender, address(this), amount);

        // Approve the tokens from this contract to the L1 bridge
        ERC20(l1Token).safeApprove(address(l1Bridge), amount);

        // Deposit the tokens to the recipients balance on L2
        l1Bridge.depositERC20To(l1Token, l2Token, to, amount, l2Gas, data);
    }

    /// @notice Deposit an amount of ETH as WETH to the senders balance on L2
    /// @param l2Token Address of the L1 respective L2 ERC20
    /// @param l2Gas Gas limit required to complete the deposit on L2
    /// @param data Optional data to forward to L2
    function depositWETH(address l2Token, uint32 l2Gas, bytes calldata data) external payable {
        // Mint WETH
        WETHInterface(weth).deposit{value: msg.value}();

        // Deposit the tokens to the senders balance on L2
        l1Bridge.depositERC20To(weth, l2Token, msg.sender, msg.value, l2Gas, data);
    }

    /// @notice Deposit an amount of ETH as WETH to the senders balance on L2
    /// @param l2Token Address of the L1 respective L2 ERC20
    /// @param to The recipient address on L2
    /// @param l2Gas Gas limit required to complete the deposit on L2
    /// @param data Optional data to forward to L2
    function depositWETHTo(address l2Token, address to, uint32 l2Gas, bytes calldata data) external payable {
        // Mint WETH
        WETHInterface(weth).deposit{value: msg.value}();

        // Deposit the tokens to the recipients balance on L2
        l1Bridge.depositERC20To(weth, l2Token, to, msg.value, l2Gas, data);
    }
}

File 2 of 5 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                            METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*//////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                            EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*//////////////////////////////////////////////////////////////
                               ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*//////////////////////////////////////////////////////////////
                             EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
                                ),
                                owner,
                                spender,
                                value,
                                nonces[owner]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

File 3 of 5 : WETHInterface.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.15;

/// @title Interface for WETH9
interface WETHInterface {
    /// @notice Deposit ether to get wrapped ether
    function deposit() external payable;

    /// @notice Withdraw wrapped ether to get ether
    function withdraw(uint256) external;
}

File 4 of 5 : IL1ERC20Bridge.sol
// SPDX-License-Identifier: MIT
pragma solidity >0.5.0 <0.9.0;

/**
 * @title IL1ERC20Bridge
 */
interface IL1ERC20Bridge {
    /**
     *
     * Events *
     *
     */

    event ERC20DepositInitiated(
        address indexed _l1Token,
        address indexed _l2Token,
        address indexed _from,
        address _to,
        uint256 _amount,
        bytes _data
    );

    event ERC20WithdrawalFinalized(
        address indexed _l1Token,
        address indexed _l2Token,
        address indexed _from,
        address _to,
        uint256 _amount,
        bytes _data
    );

    /**
     *
     * Public Functions *
     *
     */

    /**
     * @dev get the address of the corresponding L2 bridge contract.
     * @return Address of the corresponding L2 bridge contract.
     */
    function l2TokenBridge() external returns (address);

    /**
     * @dev deposit an amount of the ERC20 to the caller's balance on L2.
     * @param _l1Token Address of the L1 ERC20 we are depositing
     * @param _l2Token Address of the L1 respective L2 ERC20
     * @param _amount Amount of the ERC20 to deposit
     * @param _l2Gas Gas limit required to complete the deposit on L2.
     * @param _data Optional data to forward to L2. This data is provided
     *        solely as a convenience for external contracts. Aside from enforcing a maximum
     *        length, these contracts provide no guarantees about its content.
     */
    function depositERC20(address _l1Token, address _l2Token, uint256 _amount, uint32 _l2Gas, bytes calldata _data)
        external;

    /**
     * @dev deposit an amount of ERC20 to a recipient's balance on L2.
     * @param _l1Token Address of the L1 ERC20 we are depositing
     * @param _l2Token Address of the L1 respective L2 ERC20
     * @param _to L2 address to credit the withdrawal to.
     * @param _amount Amount of the ERC20 to deposit.
     * @param _l2Gas Gas limit required to complete the deposit on L2.
     * @param _data Optional data to forward to L2. This data is provided
     *        solely as a convenience for external contracts. Aside from enforcing a maximum
     *        length, these contracts provide no guarantees about its content.
     */
    function depositERC20To(
        address _l1Token,
        address _l2Token,
        address _to,
        uint256 _amount,
        uint32 _l2Gas,
        bytes calldata _data
    ) external;

    /**
     *
     * Cross-chain Functions *
     *
     */

    /**
     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the
     * L1 ERC20 token.
     * This call will fail if the initialized withdrawal from L2 has not been finalized.
     *
     * @param _l1Token Address of L1 token to finalizeWithdrawal for.
     * @param _l2Token Address of L2 token where withdrawal was initiated.
     * @param _from L2 address initiating the transfer.
     * @param _to L1 address to credit the withdrawal to.
     * @param _amount Amount of the ERC20 to deposit.
     * @param _data Data provided by the sender on L2. This data is provided
     *   solely as a convenience for external contracts. Aside from enforcing a maximum
     *   length, these contracts provide no guarantees about its content.
     */
    function finalizeERC20Withdrawal(
        address _l1Token,
        address _l2Token,
        address _from,
        address _to,
        uint256 _amount,
        bytes calldata _data
    ) external;
}

File 5 of 5 : SafeTransferLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {ERC20} from "../tokens/ERC20.sol";

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
    /*//////////////////////////////////////////////////////////////
                             ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferETH(address to, uint256 amount) internal {
        bool success;

        assembly {
            // Transfer the ETH and store if it succeeded or not.
            success := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(success, "ETH_TRANSFER_FAILED");
    }

    /*//////////////////////////////////////////////////////////////
                            ERC20 OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), from) // Append the "from" argument.
            mstore(add(freeMemoryPointer, 36), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
            )
        }

        require(success, "TRANSFER_FROM_FAILED");
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "TRANSFER_FAILED");
    }

    function safeApprove(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "APPROVE_FAILED");
    }
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    "solmate/=lib/solmate/src/",
    "lib/forge-std:ds-test/=lib/forge-std/lib/ds-test/src/",
    "lib/solmate:ds-test/=lib/solmate/lib/ds-test/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "none"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_l1Bridge","type":"address"},{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"l1Token","type":"address"},{"internalType":"address","name":"l2Token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint32","name":"l2Gas","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"depositERC20ToWithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"l1Token","type":"address"},{"internalType":"address","name":"l2Token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint32","name":"l2Gas","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"depositERC20WithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"l2Token","type":"address"},{"internalType":"uint32","name":"l2Gas","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"depositWETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"l2Token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint32","name":"l2Gas","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"depositWETHTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"l1Bridge","outputs":[{"internalType":"contract IL1ERC20Bridge","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60c060405234801561001057600080fd5b50604051610c51380380610c5183398101604081905261002f91610100565b6001600160a01b03828116608052811660a081905261005c9083600019610063602090811b61062417901c565b5050610133565b600060405163095ea7b360e01b8152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806100de5760405162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b604482015260640160405180910390fd5b50505050565b80516001600160a01b03811681146100fb57600080fd5b919050565b6000806040838503121561011357600080fd5b61011c836100e4565b915061012a602084016100e4565b90509250929050565b60805160a051610ab561019c60003960008181608e01528181610293015281816103490152818161050101526105b701526000818160f1015281816101d50152818161021101528181610319015281816104440152818161048001526105870152610ab56000f3fe6080604052600436106100555760003560e01c80630e47e9e31461005a5780633fc8cef31461007c5780637ac5d5a9146100cc578063969b53da146100df578063b4b6260914610113578063f469f82414610133575b600080fd5b34801561006657600080fd5b5061007a6100753660046107ba565b610146565b005b34801561008857600080fd5b506100b07f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b61007a6100da366004610879565b610291565b3480156100eb57600080fd5b506100b07f000000000000000000000000000000000000000000000000000000000000000081565b34801561011f57600080fd5b5061007a61012e3660046108da565b6103b5565b61007a610141366004610987565b6104ff565b60405163d505accf60e01b81526001600160a01b038c169063d505accf9061017e90339030908d908a908a908a908a906004016109fd565b600060405180830381600087803b15801561019857600080fd5b505af11580156101ac573d6000803e3d6000fd5b506101c6925050506001600160a01b038c1633308b6106a6565b6101fa6001600160a01b038c167f00000000000000000000000000000000000000000000000000000000000000008a610624565b60405163041c592960e51b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063838b252090610252908e908e908e908e908e908e908e90600401610a3e565b600060405180830381600087803b15801561026c57600080fd5b505af1158015610280573d6000803e3d6000fd5b505050505050505050505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156102ec57600080fd5b505af1158015610300573d6000803e3d6000fd5b505060405163041c592960e51b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016935063838b2520925061037d91507f0000000000000000000000000000000000000000000000000000000000000000908890339034908a908a908a90600401610a3e565b600060405180830381600087803b15801561039757600080fd5b505af11580156103ab573d6000803e3d6000fd5b5050505050505050565b60405163d505accf60e01b81526001600160a01b038b169063d505accf906103ed90339030908d908a908a908a908a906004016109fd565b600060405180830381600087803b15801561040757600080fd5b505af115801561041b573d6000803e3d6000fd5b50610435925050506001600160a01b038b1633308b6106a6565b6104696001600160a01b038b167f00000000000000000000000000000000000000000000000000000000000000008a610624565b60405163041c592960e51b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063838b2520906104c1908d908d9033908e908e908e908e90600401610a3e565b600060405180830381600087803b1580156104db57600080fd5b505af11580156104ef573d6000803e3d6000fd5b5050505050505050505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561055a57600080fd5b505af115801561056e573d6000803e3d6000fd5b505060405163041c592960e51b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016935063838b252092506105eb91507f0000000000000000000000000000000000000000000000000000000000000000908990899034908a908a908a90600401610a3e565b600060405180830381600087803b15801561060557600080fd5b505af1158015610619573d6000803e3d6000fd5b505050505050505050565b600060405163095ea7b360e01b8152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806106a05760405162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b60448201526064015b60405180910390fd5b50505050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806107295760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b6044820152606401610697565b5050505050565b80356001600160a01b038116811461074757600080fd5b919050565b803563ffffffff8116811461074757600080fd5b60008083601f84011261077257600080fd5b50813567ffffffffffffffff81111561078a57600080fd5b6020830191508360208285010111156107a257600080fd5b9250929050565b803560ff8116811461074757600080fd5b60008060008060008060008060008060006101408c8e0312156107dc57600080fd5b6107e58c610730565b9a506107f360208d01610730565b995061080160408d01610730565b985060608c0135975061081660808d0161074c565b965060a08c013567ffffffffffffffff81111561083257600080fd5b61083e8e828f01610760565b90975095505060c08c0135935061085760e08d016107a9565b92506101008c013591506101208c013590509295989b509295989b9093969950565b6000806000806060858703121561088f57600080fd5b61089885610730565b93506108a66020860161074c565b9250604085013567ffffffffffffffff8111156108c257600080fd5b6108ce87828801610760565b95989497509550505050565b6000806000806000806000806000806101208b8d0312156108fa57600080fd5b6109038b610730565b995061091160208c01610730565b985060408b0135975061092660608c0161074c565b965060808b013567ffffffffffffffff81111561094257600080fd5b61094e8d828e01610760565b90975095505060a08b0135935061096760c08c016107a9565b925060e08b013591506101008b013590509295989b9194979a5092959850565b60008060008060006080868803121561099f57600080fd5b6109a886610730565b94506109b660208701610730565b93506109c46040870161074c565b9250606086013567ffffffffffffffff8111156109e057600080fd5b6109ec88828901610760565b969995985093965092949392505050565b6001600160a01b0397881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6001600160a01b0388811682528781166020830152861660408201526060810185905263ffffffff8416608082015260c060a0820181905281018290526000828460e0840137600060e0848401015260e0601f19601f85011683010190509897505050505050505056fea164736f6c634300080f000a0000000000000000000000004082c9647c098a6493fb499eae63b5ce3259c574000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

Deployed Bytecode

0x6080604052600436106100555760003560e01c80630e47e9e31461005a5780633fc8cef31461007c5780637ac5d5a9146100cc578063969b53da146100df578063b4b6260914610113578063f469f82414610133575b600080fd5b34801561006657600080fd5b5061007a6100753660046107ba565b610146565b005b34801561008857600080fd5b506100b07f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6040516001600160a01b03909116815260200160405180910390f35b61007a6100da366004610879565b610291565b3480156100eb57600080fd5b506100b07f0000000000000000000000004082c9647c098a6493fb499eae63b5ce3259c57481565b34801561011f57600080fd5b5061007a61012e3660046108da565b6103b5565b61007a610141366004610987565b6104ff565b60405163d505accf60e01b81526001600160a01b038c169063d505accf9061017e90339030908d908a908a908a908a906004016109fd565b600060405180830381600087803b15801561019857600080fd5b505af11580156101ac573d6000803e3d6000fd5b506101c6925050506001600160a01b038c1633308b6106a6565b6101fa6001600160a01b038c167f0000000000000000000000004082c9647c098a6493fb499eae63b5ce3259c5748a610624565b60405163041c592960e51b81526001600160a01b037f0000000000000000000000004082c9647c098a6493fb499eae63b5ce3259c574169063838b252090610252908e908e908e908e908e908e908e90600401610a3e565b600060405180830381600087803b15801561026c57600080fd5b505af1158015610280573d6000803e3d6000fd5b505050505050505050505050505050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156102ec57600080fd5b505af1158015610300573d6000803e3d6000fd5b505060405163041c592960e51b81526001600160a01b037f0000000000000000000000004082c9647c098a6493fb499eae63b5ce3259c57416935063838b2520925061037d91507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2908890339034908a908a908a90600401610a3e565b600060405180830381600087803b15801561039757600080fd5b505af11580156103ab573d6000803e3d6000fd5b5050505050505050565b60405163d505accf60e01b81526001600160a01b038b169063d505accf906103ed90339030908d908a908a908a908a906004016109fd565b600060405180830381600087803b15801561040757600080fd5b505af115801561041b573d6000803e3d6000fd5b50610435925050506001600160a01b038b1633308b6106a6565b6104696001600160a01b038b167f0000000000000000000000004082c9647c098a6493fb499eae63b5ce3259c5748a610624565b60405163041c592960e51b81526001600160a01b037f0000000000000000000000004082c9647c098a6493fb499eae63b5ce3259c574169063838b2520906104c1908d908d9033908e908e908e908e90600401610a3e565b600060405180830381600087803b1580156104db57600080fd5b505af11580156104ef573d6000803e3d6000fd5b5050505050505050505050505050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561055a57600080fd5b505af115801561056e573d6000803e3d6000fd5b505060405163041c592960e51b81526001600160a01b037f0000000000000000000000004082c9647c098a6493fb499eae63b5ce3259c57416935063838b252092506105eb91507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2908990899034908a908a908a90600401610a3e565b600060405180830381600087803b15801561060557600080fd5b505af1158015610619573d6000803e3d6000fd5b505050505050505050565b600060405163095ea7b360e01b8152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806106a05760405162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b60448201526064015b60405180910390fd5b50505050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806107295760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b6044820152606401610697565b5050505050565b80356001600160a01b038116811461074757600080fd5b919050565b803563ffffffff8116811461074757600080fd5b60008083601f84011261077257600080fd5b50813567ffffffffffffffff81111561078a57600080fd5b6020830191508360208285010111156107a257600080fd5b9250929050565b803560ff8116811461074757600080fd5b60008060008060008060008060008060006101408c8e0312156107dc57600080fd5b6107e58c610730565b9a506107f360208d01610730565b995061080160408d01610730565b985060608c0135975061081660808d0161074c565b965060a08c013567ffffffffffffffff81111561083257600080fd5b61083e8e828f01610760565b90975095505060c08c0135935061085760e08d016107a9565b92506101008c013591506101208c013590509295989b509295989b9093969950565b6000806000806060858703121561088f57600080fd5b61089885610730565b93506108a66020860161074c565b9250604085013567ffffffffffffffff8111156108c257600080fd5b6108ce87828801610760565b95989497509550505050565b6000806000806000806000806000806101208b8d0312156108fa57600080fd5b6109038b610730565b995061091160208c01610730565b985060408b0135975061092660608c0161074c565b965060808b013567ffffffffffffffff81111561094257600080fd5b61094e8d828e01610760565b90975095505060a08b0135935061096760c08c016107a9565b925060e08b013591506101008b013590509295989b9194979a5092959850565b60008060008060006080868803121561099f57600080fd5b6109a886610730565b94506109b660208701610730565b93506109c46040870161074c565b9250606086013567ffffffffffffffff8111156109e057600080fd5b6109ec88828901610760565b969995985093965092949392505050565b6001600160a01b0397881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6001600160a01b0388811682528781166020830152861660408201526060810185905263ffffffff8416608082015260c060a0820181905281018290526000828460e0840137600060e0848401015260e0601f19601f85011683010190509897505050505050505056fea164736f6c634300080f000a

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000004082c9647c098a6493fb499eae63b5ce3259c574000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

-----Decoded View---------------
Arg [0] : _l1Bridge (address): 0x4082C9647c098a6493fb499EaE63b5ce3259c574
Arg [1] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000004082c9647c098a6493fb499eae63b5ce3259c574
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.