ETH Price: $3,489.20 (+2.19%)
Gas: 2 Gwei

Contract

0x18267aAd62E1E81dD26Bd97661AF4A76ea18Ff3f
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Send To Aptos201433602024-06-21 23:25:3528 days ago1719012335IN
0x18267aAd...6ea18Ff3f
0.00034274 ETH0.000854642.906936
Send To Aptos201416452024-06-21 17:39:3528 days ago1718991575IN
0x18267aAd...6ea18Ff3f
0.00034274 ETH0.002808219.39821189
Send To Aptos201188902024-06-18 13:18:4731 days ago1718716727IN
0x18267aAd...6ea18Ff3f
0.00034274 ETH0.002756929.37720895
Send To Aptos201003852024-06-15 23:11:2334 days ago1718493083IN
0x18267aAd...6ea18Ff3f
0.00040678 ETH0.001275344.33804084
Send To Aptos201003682024-06-15 23:07:5934 days ago1718492879IN
0x18267aAd...6ea18Ff3f
0.00040678 ETH0.001237694.14232932
Send To Aptos200960432024-06-15 8:36:5934 days ago1718440619IN
0x18267aAd...6ea18Ff3f
0.00040678 ETH0.001361254.70692552
Send To Aptos200915462024-06-14 17:29:3535 days ago1718386175IN
0x18267aAd...6ea18Ff3f
0.00040678 ETH0.0045654515.5285875
Send To Aptos200890502024-06-14 9:08:3535 days ago1718356115IN
0x18267aAd...6ea18Ff3f
0.00040678 ETH0.001969616.81077924
Send To Aptos200816792024-06-13 8:21:4736 days ago1718266907IN
0x18267aAd...6ea18Ff3f
0.00040678 ETH0.002740879.47734943
Send To Aptos200781312024-06-12 20:27:4737 days ago1718224067IN
0x18267aAd...6ea18Ff3f
0.00040678 ETH0.0045615415.51593144
Send To Aptos200682032024-06-11 11:11:4738 days ago1718104307IN
0x18267aAd...6ea18Ff3f
0.00038372 ETH0.0036145812.29437461
Send To Aptos200665222024-06-11 5:33:2338 days ago1718084003IN
0x18267aAd...6ea18Ff3f
0.00038372 ETH0.001358414.62042167
Send To Aptos200488312024-06-08 18:14:4741 days ago1717870487IN
0x18267aAd...6ea18Ff3f
0.00033696 ETH0.0038045212.94095877
Send To Aptos200402472024-06-07 13:27:3542 days ago1717766855IN
0x18267aAd...6ea18Ff3f
0.00033696 ETH0.004431515.07359832
Send To Aptos200401832024-06-07 13:14:3542 days ago1717766075IN
0x18267aAd...6ea18Ff3f
0.00033696 ETH0.0039792813.5348553
Send To Aptos200388472024-06-07 8:46:2342 days ago1717749983IN
0x18267aAd...6ea18Ff3f
0.00033696 ETH0.0049442116.81825427
Send To Aptos200381132024-06-07 6:19:1142 days ago1717741151IN
0x18267aAd...6ea18Ff3f
0.00033696 ETH0.002626038.93273162
Send To Aptos200361362024-06-06 23:41:4743 days ago1717717307IN
0x18267aAd...6ea18Ff3f
0.00033696 ETH0.0043602614.83128246
Send To Aptos200201722024-06-04 18:12:4745 days ago1717524767IN
0x18267aAd...6ea18Ff3f
0.00033696 ETH0.0045769715.31770371
Send To Aptos200198862024-06-04 17:15:3545 days ago1717521335IN
0x18267aAd...6ea18Ff3f
0.00033696 ETH0.0042772414.54829931
Send To Aptos200193522024-06-04 15:28:1145 days ago1717514891IN
0x18267aAd...6ea18Ff3f
0.00033696 ETH0.0041047913.96231773
Send To Aptos200037142024-06-02 11:03:4747 days ago1717326227IN
0x18267aAd...6ea18Ff3f
0.00033696 ETH0.002200647.60935643
Send To Aptos199722612024-05-29 1:32:2352 days ago1716946343IN
0x18267aAd...6ea18Ff3f
0.00033696 ETH0.002819849.59122714
Send To Aptos199699302024-05-28 17:42:5952 days ago1716918179IN
0x18267aAd...6ea18Ff3f
0.00033696 ETH0.0049382616.52814934
Send To Aptos199652462024-05-28 2:01:1152 days ago1716861671IN
0x18267aAd...6ea18Ff3f
0.00033696 ETH0.0032895811.37466269
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
201433602024-06-21 23:25:3528 days ago1719012335
0x18267aAd...6ea18Ff3f
0.00034274 ETH
201416452024-06-21 17:39:3528 days ago1718991575
0x18267aAd...6ea18Ff3f
0.00034274 ETH
201188902024-06-18 13:18:4731 days ago1718716727
0x18267aAd...6ea18Ff3f
0.00034274 ETH
201003852024-06-15 23:11:2334 days ago1718493083
0x18267aAd...6ea18Ff3f
0.00040678 ETH
201003682024-06-15 23:07:5934 days ago1718492879
0x18267aAd...6ea18Ff3f
0.00040678 ETH
200960432024-06-15 8:36:5934 days ago1718440619
0x18267aAd...6ea18Ff3f
0.00040678 ETH
200915462024-06-14 17:29:3535 days ago1718386175
0x18267aAd...6ea18Ff3f
0.00040678 ETH
200890502024-06-14 9:08:3535 days ago1718356115
0x18267aAd...6ea18Ff3f
0.00040678 ETH
200816792024-06-13 8:21:4736 days ago1718266907
0x18267aAd...6ea18Ff3f
0.00040678 ETH
200781312024-06-12 20:27:4737 days ago1718224067
0x18267aAd...6ea18Ff3f
0.00040678 ETH
200682032024-06-11 11:11:4738 days ago1718104307
0x18267aAd...6ea18Ff3f
0.00038372 ETH
200665222024-06-11 5:33:2338 days ago1718084003
0x18267aAd...6ea18Ff3f
0.00038372 ETH
200488312024-06-08 18:14:4741 days ago1717870487
0x18267aAd...6ea18Ff3f
0.00033696 ETH
200402472024-06-07 13:27:3542 days ago1717766855
0x18267aAd...6ea18Ff3f
0.00033696 ETH
200401832024-06-07 13:14:3542 days ago1717766075
0x18267aAd...6ea18Ff3f
0.00033696 ETH
200388472024-06-07 8:46:2342 days ago1717749983
0x18267aAd...6ea18Ff3f
0.00033696 ETH
200381132024-06-07 6:19:1142 days ago1717741151
0x18267aAd...6ea18Ff3f
0.00033696 ETH
200361362024-06-06 23:41:4743 days ago1717717307
0x18267aAd...6ea18Ff3f
0.00033696 ETH
200201722024-06-04 18:12:4745 days ago1717524767
0x18267aAd...6ea18Ff3f
0.00033696 ETH
200198862024-06-04 17:15:3545 days ago1717521335
0x18267aAd...6ea18Ff3f
0.00033696 ETH
200193522024-06-04 15:28:1145 days ago1717514891
0x18267aAd...6ea18Ff3f
0.00033696 ETH
200037142024-06-02 11:03:4747 days ago1717326227
0x18267aAd...6ea18Ff3f
0.00033696 ETH
199722612024-05-29 1:32:2352 days ago1716946343
0x18267aAd...6ea18Ff3f
0.00033696 ETH
199699302024-05-28 17:42:5952 days ago1716918179
0x18267aAd...6ea18Ff3f
0.00033696 ETH
199652462024-05-28 2:01:1152 days ago1716861671
0x18267aAd...6ea18Ff3f
0.00033696 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SwapBridge

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 11 : SwapBridge.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {ITokenBridge} from "LayerZero-Aptos-Contract/apps/bridge-evm/contracts/interfaces/ITokenBridge.sol";
import {LzLib} from "@layerzerolabs/solidity-examples/contracts/libraries/LzLib.sol";

contract SwapBridge is Ownable2Step, Pausable {
    uint256 private constant APT_AIRDROP_AMOUNT = 9904; // signature for event collection on the Aptos side

    bool private isInit;
    ITokenBridge private tokenBridge;
    address private swapTarget;

    event SwapAndSendToAptos(
        address fromToken,
        address toToken,
        uint256 fromAmount,
        uint256 minToAmount,
        uint256 toAmount,
        bytes32 aptosAddress
    );

    event SendToAptos(uint256 amount, bytes32 aptosAddress);

    error AlreadyInitialized();
    error InsufficientOutputAmount();
    error NothingToRescue();

    constructor(address _owner) Ownable(_owner) {}

    function initialize(address _tokenBridgeAddress, address _swapTarget) external onlyOwner {
        if (isInit) revert AlreadyInitialized();
        isInit = true;
        tokenBridge = ITokenBridge(_tokenBridgeAddress);
        swapTarget = _swapTarget;
    }

    function approveMax(IERC20 _token, address _spender) external whenNotPaused {
        SafeERC20.forceApprove(_token, _spender, type(uint256).max);
    }

    function _lzParams(bytes32 _aptosAddress)
        private
        view
        returns (LzLib.CallParams memory callParams, bytes memory adapterParams)
    {
        callParams = LzLib.CallParams({refundAddress: payable(msg.sender), zroPaymentAddress: address(0x0)});
        adapterParams = LzLib.buildAirdropAdapterParams(
            10000, // uaGas
            LzLib.AirdropParams({airdropAmount: APT_AIRDROP_AMOUNT, airdropAddress: _aptosAddress})
        );
    }

    function quoteForSend() external view returns (uint256 nativeFee, uint256 zroFee) {
        (LzLib.CallParams memory callParams, bytes memory adapterParams) = _lzParams(hex"01");
        (nativeFee, zroFee) = tokenBridge.quoteForSend(callParams, adapterParams);
    }

    function swapAndSendToAptos(
        IERC20 _fromToken,
        uint256 _fromAmount,
        IERC20 _toToken,
        uint256 _minToAmount,
        bytes32 _aptosAddress,
        bytes calldata _swapBytes
    ) external payable whenNotPaused {
        uint256 fromTokenOrgBalance = _fromToken.balanceOf(address(this));
        uint256 toTokenOrgBalance = _toToken.balanceOf(address(this));

        SafeERC20.safeTransferFrom(_fromToken, msg.sender, address(this), _fromAmount);

        Address.functionCall(swapTarget, _swapBytes);

        uint256 toAmount = _toToken.balanceOf(address(this)) - toTokenOrgBalance;
        if (toAmount < _minToAmount) revert InsufficientOutputAmount();

        uint256 residue = _fromToken.balanceOf(address(this)) - fromTokenOrgBalance;
        if (residue > 0) {
            SafeERC20.safeTransfer(_fromToken, msg.sender, residue);
        }

        _sendToAptos(address(_toToken), toAmount, _aptosAddress);

        if (_toToken.balanceOf(address(this)) > toTokenOrgBalance) {
            SafeERC20.safeTransfer(_toToken, msg.sender, _toToken.balanceOf(address(this)) - toTokenOrgBalance);
        }

        emit SwapAndSendToAptos(address(_fromToken), address(_toToken), _fromAmount, _minToAmount, toAmount, _aptosAddress);
    }

    function sendToAptos(IERC20 _token, uint256 _amount, bytes32 _aptosAddress) external payable whenNotPaused {
        uint256 tokenOrgBalance = _token.balanceOf(address(this));

        SafeERC20.safeTransferFrom(_token, msg.sender, address(this), _amount);

        _sendToAptos(address(_token), _amount, _aptosAddress);

        if (_token.balanceOf(address(this)) > tokenOrgBalance) {
            SafeERC20.safeTransfer(_token, msg.sender, _token.balanceOf(address(this)) - tokenOrgBalance);
        }

        emit SendToAptos(_amount, _aptosAddress);
    }

    function _sendToAptos(address _tokenAddress, uint256 _amount, bytes32 _aptosAddress) private {
        (LzLib.CallParams memory callParams, bytes memory adapterParams) = _lzParams(_aptosAddress);
        tokenBridge.sendToAptos{value: msg.value}(_tokenAddress, _aptosAddress, _amount, callParams, adapterParams);
    }

    function rescueToken(IERC20 _token, address _recipient) external onlyOwner {
        uint256 tokenBalance = _token.balanceOf(address(this));
        if (tokenBalance == 0) revert NothingToRescue();
        SafeERC20.safeTransfer(_token, _recipient, tokenBalance);
    }

    function pause() external onlyOwner {
        _pause();
    }

    function unpause() external onlyOwner {
        _unpause();
    }
}

File 2 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @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 value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}

File 3 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 4 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 11 : Ownable2Step.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.20;

import {Ownable} from "./Ownable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is specified at deployment time in the constructor for `Ownable`. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Returns the address of the pending owner.
     */
    function pendingOwner() public view virtual returns (address) {
        return _pendingOwner;
    }

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        if (pendingOwner() != sender) {
            revert OwnableUnauthorizedAccount(sender);
        }
        _transferOwnership(sender);
    }
}

File 6 of 11 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    bool private _paused;

    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 7 of 11 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert FailedInnerCall();
        }
    }
}

File 8 of 11 : ITokenBridge.sol
// SPDX-License-Identifier: BUSL-1.1

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;

import "@layerzerolabs/solidity-examples/contracts/libraries/LzLib.sol";

interface ITokenBridge {
    enum PacketType {
        SEND_TO_APTOS,
        RECEIVE_FROM_APTOS
    }

    function sendToAptos(
        address _token,
        bytes32 _toAddress,
        uint _amountLD,
        LzLib.CallParams calldata _callParams,
        bytes calldata _adapterParams
    ) external payable;

    function sendETHToAptos(
        bytes32 _toAddress,
        uint _amountLD,
        LzLib.CallParams calldata _callParams,
        bytes calldata _adapterParams
    ) external payable;

    function quoteForSend(LzLib.CallParams calldata _callParams, bytes calldata _adapterParams)
        external
        view
        returns (uint nativeFee, uint zroFee);

    event Send(address indexed token, address indexed from, bytes32 indexed to, uint amountLD);
    event Receive(address indexed token, address indexed to, uint amountLD);
    event RegisterToken(address token);
    event SetBridgeBP(uint bridgeFeeBP);
    event SetWETH(address weth);
    event SetGlobalPause(bool paused);
    event SetTokenPause(address token, bool paused);
    event SetLocalChainId(uint16 localChainId);
    event SetAptosChainId(uint16 aptosChainId);
    event SetUseCustomAdapterParams(bool useCustomAdapterParams);
    event WithdrawFee(address indexed token, address to, uint amountLD);
    event WithdrawTVL(address indexed token, address to, uint amountLD);
    event EnableEmergencyWithdraw(bool enabled, uint unlockTime);
}

File 9 of 11 : LzLib.sol
// SPDX-License-Identifier: BUSL-1.1

pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;

library LzLib {
    // LayerZero communication
    struct CallParams {
        address payable refundAddress;
        address zroPaymentAddress;
    }

    //---------------------------------------------------------------------------
    // Address type handling

    struct AirdropParams {
        uint airdropAmount;
        bytes32 airdropAddress;
    }

    function buildAdapterParams(LzLib.AirdropParams memory _airdropParams, uint _uaGasLimit) internal pure returns (bytes memory adapterParams) {
        if (_airdropParams.airdropAmount == 0 && _airdropParams.airdropAddress == bytes32(0x0)) {
            adapterParams = buildDefaultAdapterParams(_uaGasLimit);
        } else {
            adapterParams = buildAirdropAdapterParams(_uaGasLimit, _airdropParams);
        }
    }

    // Build Adapter Params
    function buildDefaultAdapterParams(uint _uaGas) internal pure returns (bytes memory) {
        // txType 1
        // bytes  [2       32      ]
        // fields [txType  extraGas]
        return abi.encodePacked(uint16(1), _uaGas);
    }

    function buildAirdropAdapterParams(uint _uaGas, AirdropParams memory _params) internal pure returns (bytes memory) {
        require(_params.airdropAmount > 0, "Airdrop amount must be greater than 0");
        require(_params.airdropAddress != bytes32(0x0), "Airdrop address must be set");

        // txType 2
        // bytes  [2       32        32            bytes[]         ]
        // fields [txType  extraGas  dstNativeAmt  dstNativeAddress]
        return abi.encodePacked(uint16(2), _uaGas, _params.airdropAmount, _params.airdropAddress);
    }

    function getGasLimit(bytes memory _adapterParams) internal pure returns (uint gasLimit) {
        require(_adapterParams.length == 34 || _adapterParams.length > 66, "Invalid adapterParams");
        assembly {
            gasLimit := mload(add(_adapterParams, 34))
        }
    }

    // Decode Adapter Params
    function decodeAdapterParams(bytes memory _adapterParams)
        internal
        pure
        returns (
            uint16 txType,
            uint uaGas,
            uint airdropAmount,
            address payable airdropAddress
        )
    {
        require(_adapterParams.length == 34 || _adapterParams.length > 66, "Invalid adapterParams");
        assembly {
            txType := mload(add(_adapterParams, 2))
            uaGas := mload(add(_adapterParams, 34))
        }
        require(txType == 1 || txType == 2, "Unsupported txType");
        require(uaGas > 0, "Gas too low");

        if (txType == 2) {
            assembly {
                airdropAmount := mload(add(_adapterParams, 66))
                airdropAddress := mload(add(_adapterParams, 86))
            }
        }
    }

    //---------------------------------------------------------------------------
    // Address type handling
    function bytes32ToAddress(bytes32 _bytes32Address) internal pure returns (address _address) {
        return address(uint160(uint(_bytes32Address)));
    }

    function addressToBytes32(address _address) internal pure returns (bytes32 _bytes32Address) {
        return bytes32(uint(uint160(_address)));
    }
}

File 10 of 11 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 11 of 11 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

Settings
{
  "remappings": [
    "forge-std/=lib/forge-std/src/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "LayerZero-Aptos-Contract/=lib/LayerZero-Aptos-Contract/",
    "@layerzerolabs/solidity-examples/contracts/libraries/=lib/solidity-examples/contracts/lzApp/libs/",
    "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solidity-examples/=lib/solidity-examples/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InsufficientOutputAmount","type":"error"},{"inputs":[],"name":"NothingToRescue","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"aptosAddress","type":"bytes32"}],"name":"SendToAptos","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"fromToken","type":"address"},{"indexed":false,"internalType":"address","name":"toToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minToAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"aptosAddress","type":"bytes32"}],"name":"SwapAndSendToAptos","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_spender","type":"address"}],"name":"approveMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenBridgeAddress","type":"address"},{"internalType":"address","name":"_swapTarget","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quoteForSend","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"rescueToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes32","name":"_aptosAddress","type":"bytes32"}],"name":"sendToAptos","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_fromToken","type":"address"},{"internalType":"uint256","name":"_fromAmount","type":"uint256"},{"internalType":"contract IERC20","name":"_toToken","type":"address"},{"internalType":"uint256","name":"_minToAmount","type":"uint256"},{"internalType":"bytes32","name":"_aptosAddress","type":"bytes32"},{"internalType":"bytes","name":"_swapBytes","type":"bytes"}],"name":"swapAndSendToAptos","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5060405161157438038061157483398101604081905261002f916100e7565b806001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161007b565b50506001805460ff60a01b19169055610117565b600180546001600160a01b031916905561009481610097565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100f957600080fd5b81516001600160a01b038116811461011057600080fd5b9392505050565b61144e806101266000396000f3fe6080604052600436106100dd5760003560e01c806379ba50971161007f5780639064aa17116100595780639064aa1714610216578063aec42a1714610229578063e30c397814610249578063f2fde38b1461026757600080fd5b806379ba5097146101ba5780638456cb59146101cf5780638da5cb5b146101e457600080fd5b8063485cc955116100bb578063485cc9551461012c5780635c975abb1461014c5780636bc5f1611461017b578063715018a6146101a557600080fd5b80630a3a1c68146100e25780633f4ba83a146100f75780634707d0001461010c575b600080fd5b6100f56100f036600461115f565b610287565b005b34801561010357600080fd5b506100f561064f565b34801561011857600080fd5b506100f5610127366004611214565b610661565b34801561013857600080fd5b506100f5610147366004611214565b610706565b34801561015857600080fd5b50600154600160a01b900460ff1660405190151581526020015b60405180910390f35b34801561018757600080fd5b50610190610779565b60408051928352602083019190915201610172565b3480156101b157600080fd5b506100f561080d565b3480156101c657600080fd5b506100f561081f565b3480156101db57600080fd5b506100f5610868565b3480156101f057600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610172565b6100f561022436600461124d565b610878565b34801561023557600080fd5b506100f5610244366004611214565b6109e9565b34801561025557600080fd5b506001546001600160a01b03166101fe565b34801561027357600080fd5b506100f5610282366004611282565b610a02565b61028f610a73565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa1580156102d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102fa919061129f565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038816906370a0823190602401602060405180830381865afa158015610344573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610368919061129f565b90506103768933308b610a9e565b600354604080516020601f87018190048102820181019092528581526103c0926001600160a01b0316918790879081908401838280828437600092019190915250610b0b92505050565b506040516370a0823160e01b815230600482015260009082906001600160a01b038a16906370a0823190602401602060405180830381865afa15801561040a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042e919061129f565b61043891906112b8565b90508681101561045b576040516342301c2360e01b815260040160405180910390fd5b6040516370a0823160e01b815230600482015260009084906001600160a01b038d16906370a0823190602401602060405180830381865afa1580156104a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c8919061129f565b6104d291906112b8565b905080156104e5576104e58b3383610b22565b6104f0898389610b53565b6040516370a0823160e01b815230600482015283906001600160a01b038b16906370a0823190602401602060405180830381865afa158015610536573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055a919061129f565b11156105e2576040516370a0823160e01b81523060048201526105e2908a90339086906001600160a01b038416906370a08231906024015b602060405180830381865afa1580156105af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d3919061129f565b6105dd91906112b8565b610b22565b604080516001600160a01b03808e1682528b1660208201529081018b9052606081018990526080810183905260a081018890527fc1eea98a13fec71774f9ff3181e94360e4ff6752d006c9402e4d20d63ede02699060c00160405180910390a15050505050505050505050565b610657610bd6565b61065f610c03565b565b610669610bd6565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156106b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d4919061129f565b9050806000036106f657604051620f6b2160e41b815260040160405180910390fd5b610701838383610b22565b505050565b61070e610bd6565b600154600160a81b900460ff16156107385760405162dc149f60e41b815260040160405180910390fd5b6001805460ff60a81b1916600160a81b179055600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b60008060008061078c600160f81b610c58565b6002546040516308d172cd60e31b81529294509092506001600160a01b03169063468b9668906107c29085908590600401611329565b6040805180830381865afa1580156107de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108029190611367565b909590945092505050565b610815610bd6565b61065f6000610cc1565b60015433906001600160a01b0316811461085c5760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b61086581610cc1565b50565b610870610bd6565b61065f610cda565b610880610a73565b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a0823190602401602060405180830381865afa1580156108c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108eb919061129f565b90506108f984333086610a9e565b610904848484610b53565b6040516370a0823160e01b815230600482015281906001600160a01b038616906370a0823190602401602060405180830381865afa15801561094a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096e919061129f565b11156109aa576040516370a0823160e01b81523060048201526109aa908590339084906001600160a01b038416906370a0823190602401610592565b60408051848152602081018490527fbd9d18d054b827ec99624bb9865ac958951510ada7d3600b496e5533ee069d4c910160405180910390a150505050565b6109f1610a73565b6109fe8282600019610d1d565b5050565b610a0a610bd6565b600180546001600160a01b0383166001600160a01b03199091168117909155610a3b6000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600154600160a01b900460ff161561065f5760405163d93c066560e01b815260040160405180910390fd5b6040516001600160a01b038481166024830152838116604483015260648201839052610b059186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050610da9565b50505050565b6060610b1983836000610e0c565b90505b92915050565b6040516001600160a01b0383811660248301526044820183905261070191859182169063a9059cbb90606401610ad3565b600080610b5f83610c58565b600254604051633b5484cd60e11b81529294509092506001600160a01b0316906376a9099a903490610b9d90899088908a908990899060040161138b565b6000604051808303818588803b158015610bb657600080fd5b505af1158015610bca573d6000803e3d6000fd5b50505050505050505050565b6000546001600160a01b0316331461065f5760405163118cdaa760e01b8152336004820152602401610853565b610c0b610eab565b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b604080518082019091526000808252602082015260606040518060400160405280336001600160a01b0316815260200160006001600160a01b03168152509150610cba61271060405180604001604052806126b0815260200186815250610ed5565b9050915091565b600180546001600160a01b031916905561086581610fcd565b610ce2610a73565b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610c3b3390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052610d6e848261101d565b610b05576040516001600160a01b03848116602483015260006044830152610da391869182169063095ea7b390606401610ad3565b610b0584825b6000610dbe6001600160a01b03841683610b0b565b90508051600014158015610de3575080806020019051810190610de191906113da565b155b1561070157604051635274afe760e01b81526001600160a01b0384166004820152602401610853565b606081471015610e315760405163cd78605960e01b8152306004820152602401610853565b600080856001600160a01b03168486604051610e4d91906113fc565b60006040518083038185875af1925050503d8060008114610e8a576040519150601f19603f3d011682016040523d82523d6000602084013e610e8f565b606091505b5091509150610e9f8683836110c5565b925050505b9392505050565b600154600160a01b900460ff1661065f57604051638dfc202b60e01b815260040160405180910390fd5b8051606090610f345760405162461bcd60e51b815260206004820152602560248201527f41697264726f7020616d6f756e74206d75737420626520677265617465722074604482015264068616e20360dc1b6064820152608401610853565b6020820151610f855760405162461bcd60e51b815260206004820152601b60248201527f41697264726f702061646472657373206d7573742062652073657400000000006044820152606401610853565b8151602080840151604051600160f11b928101929092526022820186905260428201929092526062810191909152608201604051602081830303815290604052905092915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000846001600160a01b03168460405161103a91906113fc565b6000604051808303816000865af19150503d8060008114611077576040519150601f19603f3d011682016040523d82523d6000602084013e61107c565b606091505b50915091508180156110a65750805115806110a65750808060200190518101906110a691906113da565b80156110bc57506000856001600160a01b03163b115b95945050505050565b6060826110da576110d582611121565b610ea4565b81511580156110f157506001600160a01b0384163b155b1561111a57604051639996b31560e01b81526001600160a01b0385166004820152602401610853565b5080610ea4565b8051156111315780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160a01b038116811461086557600080fd5b600080600080600080600060c0888a03121561117a57600080fd5b87356111858161114a565b965060208801359550604088013561119c8161114a565b9450606088013593506080880135925060a088013567ffffffffffffffff808211156111c757600080fd5b818a0191508a601f8301126111db57600080fd5b8135818111156111ea57600080fd5b8b60208285010111156111fc57600080fd5b60208301945080935050505092959891949750929550565b6000806040838503121561122757600080fd5b82356112328161114a565b915060208301356112428161114a565b809150509250929050565b60008060006060848603121561126257600080fd5b833561126d8161114a565b95602085013595506040909401359392505050565b60006020828403121561129457600080fd5b8135610ea48161114a565b6000602082840312156112b157600080fd5b5051919050565b81810381811115610b1c57634e487b7160e01b600052601160045260246000fd5b60005b838110156112f45781810151838201526020016112dc565b50506000910152565b600081518084526113158160208601602086016112d9565b601f01601f19169290920160200192915050565b611349818480516001600160a01b03908116835260209182015116910152565b60606040820152600061135f60608301846112fd565b949350505050565b6000806040838503121561137a57600080fd5b505080516020909101519092909150565b6001600160a01b03868116825260208083018790526040830186905284518216606084015284015116608082015260c060a082015260006113cf60c08301846112fd565b979650505050505050565b6000602082840312156113ec57600080fd5b81518015158114610ea457600080fd5b6000825161140e8184602087016112d9565b919091019291505056fea2646970667358221220115dee6282b7aa28e5a0144c4c9802468eaed683dab7bc8d3cc1ec6ac68c980c64736f6c63430008190033000000000000000000000000e0d2d6956c1d9fa49c29a69f2e49f5f176aa27fd

Deployed Bytecode

0x6080604052600436106100dd5760003560e01c806379ba50971161007f5780639064aa17116100595780639064aa1714610216578063aec42a1714610229578063e30c397814610249578063f2fde38b1461026757600080fd5b806379ba5097146101ba5780638456cb59146101cf5780638da5cb5b146101e457600080fd5b8063485cc955116100bb578063485cc9551461012c5780635c975abb1461014c5780636bc5f1611461017b578063715018a6146101a557600080fd5b80630a3a1c68146100e25780633f4ba83a146100f75780634707d0001461010c575b600080fd5b6100f56100f036600461115f565b610287565b005b34801561010357600080fd5b506100f561064f565b34801561011857600080fd5b506100f5610127366004611214565b610661565b34801561013857600080fd5b506100f5610147366004611214565b610706565b34801561015857600080fd5b50600154600160a01b900460ff1660405190151581526020015b60405180910390f35b34801561018757600080fd5b50610190610779565b60408051928352602083019190915201610172565b3480156101b157600080fd5b506100f561080d565b3480156101c657600080fd5b506100f561081f565b3480156101db57600080fd5b506100f5610868565b3480156101f057600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610172565b6100f561022436600461124d565b610878565b34801561023557600080fd5b506100f5610244366004611214565b6109e9565b34801561025557600080fd5b506001546001600160a01b03166101fe565b34801561027357600080fd5b506100f5610282366004611282565b610a02565b61028f610a73565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa1580156102d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102fa919061129f565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038816906370a0823190602401602060405180830381865afa158015610344573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610368919061129f565b90506103768933308b610a9e565b600354604080516020601f87018190048102820181019092528581526103c0926001600160a01b0316918790879081908401838280828437600092019190915250610b0b92505050565b506040516370a0823160e01b815230600482015260009082906001600160a01b038a16906370a0823190602401602060405180830381865afa15801561040a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042e919061129f565b61043891906112b8565b90508681101561045b576040516342301c2360e01b815260040160405180910390fd5b6040516370a0823160e01b815230600482015260009084906001600160a01b038d16906370a0823190602401602060405180830381865afa1580156104a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c8919061129f565b6104d291906112b8565b905080156104e5576104e58b3383610b22565b6104f0898389610b53565b6040516370a0823160e01b815230600482015283906001600160a01b038b16906370a0823190602401602060405180830381865afa158015610536573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055a919061129f565b11156105e2576040516370a0823160e01b81523060048201526105e2908a90339086906001600160a01b038416906370a08231906024015b602060405180830381865afa1580156105af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d3919061129f565b6105dd91906112b8565b610b22565b604080516001600160a01b03808e1682528b1660208201529081018b9052606081018990526080810183905260a081018890527fc1eea98a13fec71774f9ff3181e94360e4ff6752d006c9402e4d20d63ede02699060c00160405180910390a15050505050505050505050565b610657610bd6565b61065f610c03565b565b610669610bd6565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156106b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d4919061129f565b9050806000036106f657604051620f6b2160e41b815260040160405180910390fd5b610701838383610b22565b505050565b61070e610bd6565b600154600160a81b900460ff16156107385760405162dc149f60e41b815260040160405180910390fd5b6001805460ff60a81b1916600160a81b179055600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b60008060008061078c600160f81b610c58565b6002546040516308d172cd60e31b81529294509092506001600160a01b03169063468b9668906107c29085908590600401611329565b6040805180830381865afa1580156107de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108029190611367565b909590945092505050565b610815610bd6565b61065f6000610cc1565b60015433906001600160a01b0316811461085c5760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b61086581610cc1565b50565b610870610bd6565b61065f610cda565b610880610a73565b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a0823190602401602060405180830381865afa1580156108c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108eb919061129f565b90506108f984333086610a9e565b610904848484610b53565b6040516370a0823160e01b815230600482015281906001600160a01b038616906370a0823190602401602060405180830381865afa15801561094a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096e919061129f565b11156109aa576040516370a0823160e01b81523060048201526109aa908590339084906001600160a01b038416906370a0823190602401610592565b60408051848152602081018490527fbd9d18d054b827ec99624bb9865ac958951510ada7d3600b496e5533ee069d4c910160405180910390a150505050565b6109f1610a73565b6109fe8282600019610d1d565b5050565b610a0a610bd6565b600180546001600160a01b0383166001600160a01b03199091168117909155610a3b6000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600154600160a01b900460ff161561065f5760405163d93c066560e01b815260040160405180910390fd5b6040516001600160a01b038481166024830152838116604483015260648201839052610b059186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050610da9565b50505050565b6060610b1983836000610e0c565b90505b92915050565b6040516001600160a01b0383811660248301526044820183905261070191859182169063a9059cbb90606401610ad3565b600080610b5f83610c58565b600254604051633b5484cd60e11b81529294509092506001600160a01b0316906376a9099a903490610b9d90899088908a908990899060040161138b565b6000604051808303818588803b158015610bb657600080fd5b505af1158015610bca573d6000803e3d6000fd5b50505050505050505050565b6000546001600160a01b0316331461065f5760405163118cdaa760e01b8152336004820152602401610853565b610c0b610eab565b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b604080518082019091526000808252602082015260606040518060400160405280336001600160a01b0316815260200160006001600160a01b03168152509150610cba61271060405180604001604052806126b0815260200186815250610ed5565b9050915091565b600180546001600160a01b031916905561086581610fcd565b610ce2610a73565b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610c3b3390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052610d6e848261101d565b610b05576040516001600160a01b03848116602483015260006044830152610da391869182169063095ea7b390606401610ad3565b610b0584825b6000610dbe6001600160a01b03841683610b0b565b90508051600014158015610de3575080806020019051810190610de191906113da565b155b1561070157604051635274afe760e01b81526001600160a01b0384166004820152602401610853565b606081471015610e315760405163cd78605960e01b8152306004820152602401610853565b600080856001600160a01b03168486604051610e4d91906113fc565b60006040518083038185875af1925050503d8060008114610e8a576040519150601f19603f3d011682016040523d82523d6000602084013e610e8f565b606091505b5091509150610e9f8683836110c5565b925050505b9392505050565b600154600160a01b900460ff1661065f57604051638dfc202b60e01b815260040160405180910390fd5b8051606090610f345760405162461bcd60e51b815260206004820152602560248201527f41697264726f7020616d6f756e74206d75737420626520677265617465722074604482015264068616e20360dc1b6064820152608401610853565b6020820151610f855760405162461bcd60e51b815260206004820152601b60248201527f41697264726f702061646472657373206d7573742062652073657400000000006044820152606401610853565b8151602080840151604051600160f11b928101929092526022820186905260428201929092526062810191909152608201604051602081830303815290604052905092915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000846001600160a01b03168460405161103a91906113fc565b6000604051808303816000865af19150503d8060008114611077576040519150601f19603f3d011682016040523d82523d6000602084013e61107c565b606091505b50915091508180156110a65750805115806110a65750808060200190518101906110a691906113da565b80156110bc57506000856001600160a01b03163b115b95945050505050565b6060826110da576110d582611121565b610ea4565b81511580156110f157506001600160a01b0384163b155b1561111a57604051639996b31560e01b81526001600160a01b0385166004820152602401610853565b5080610ea4565b8051156111315780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160a01b038116811461086557600080fd5b600080600080600080600060c0888a03121561117a57600080fd5b87356111858161114a565b965060208801359550604088013561119c8161114a565b9450606088013593506080880135925060a088013567ffffffffffffffff808211156111c757600080fd5b818a0191508a601f8301126111db57600080fd5b8135818111156111ea57600080fd5b8b60208285010111156111fc57600080fd5b60208301945080935050505092959891949750929550565b6000806040838503121561122757600080fd5b82356112328161114a565b915060208301356112428161114a565b809150509250929050565b60008060006060848603121561126257600080fd5b833561126d8161114a565b95602085013595506040909401359392505050565b60006020828403121561129457600080fd5b8135610ea48161114a565b6000602082840312156112b157600080fd5b5051919050565b81810381811115610b1c57634e487b7160e01b600052601160045260246000fd5b60005b838110156112f45781810151838201526020016112dc565b50506000910152565b600081518084526113158160208601602086016112d9565b601f01601f19169290920160200192915050565b611349818480516001600160a01b03908116835260209182015116910152565b60606040820152600061135f60608301846112fd565b949350505050565b6000806040838503121561137a57600080fd5b505080516020909101519092909150565b6001600160a01b03868116825260208083018790526040830186905284518216606084015284015116608082015260c060a082015260006113cf60c08301846112fd565b979650505050505050565b6000602082840312156113ec57600080fd5b81518015158114610ea457600080fd5b6000825161140e8184602087016112d9565b919091019291505056fea2646970667358221220115dee6282b7aa28e5a0144c4c9802468eaed683dab7bc8d3cc1ec6ac68c980c64736f6c63430008190033

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

000000000000000000000000e0d2d6956c1d9fa49c29a69f2e49f5f176aa27fd

-----Decoded View---------------
Arg [0] : _owner (address): 0xe0D2d6956c1D9fa49c29A69F2E49f5f176aa27fd

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000e0d2d6956c1d9fa49c29a69f2e49f5f176aa27fd


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.