CELO Price: $0.11 (-5.95%)
Gas: 25 GWei

Contract

0x151214D7998626249f029979cF2d47C2c9F46162

Overview

CELO Balance

Celo Mainnet LogoCelo Mainnet LogoCelo Mainnet Logo0 CELO

CELO Value

$0.00

More Info

Private Name Tags

Multichain Info

Transaction Hash
Block
From
To

There are no matching entries

1 Internal Transaction and > 10 Token Transfers found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
560808182026-01-09 17:59:3616 days ago1767981576  Contract Creation0 CELO

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DaimoPayHopBridger

Compiler Version
v0.8.26+commit.8a97fa7a

Optimization Enabled:
Yes with 999999 runs

Other Settings:
london EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.12;

import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";

import "./interfaces/IDaimoPayBridger.sol";
import "../vendor/cctp/v1/ITokenMinter.sol";
import "../vendor/cctp/v1/ICCTPTokenMessenger.sol";

/// @author Daimo, Inc
/// @custom:security-contact [email protected]
/// @notice Bridges assets to a destination chain via a hop chain.
/// @dev    Hop bridger must ONLY be used with intent address destinations.
///         It ignores bridgeTokenOutOptions, and relies on the intent address
///         on the hop chain to perform the correct swap + final bridge.
contract DaimoPayHopBridger is IDaimoPayBridger {
    using SafeERC20 for IERC20;

    /// Hop chain ID, eg Arbitrum.
    uint256 public immutable hopChainId;
    /// Hop coin must be a stablecoin, with 1:1 conversion to finalChainCoins.
    address public immutable hopCoinAddr; // eg Arb axlUSDC
    /// Decimals of the hop coin.
    uint256 public immutable hopCoinDecimals;
    /// Bridger used to get from current chain to hop chain, eg AxelarBriger.
    IDaimoPayBridger public immutable hopBridger;
    /// For each final dest chain, we require a specific stablecoin to be on the
    /// bridgeTokenOutOptions list. We convert that amount to the correct hop-
    /// coin amount at 1:1, accounting for decimals.
    mapping(uint256 chainId => FinalChainCoin chainCoin) public finalChainCoins;

    /// Stablecoin required on the final chain.
    struct FinalChainCoin {
        uint256 finalChainId;
        address coinAddr;
        uint256 coinDecimals;
    }

    constructor(
        uint256 _hopChainId,
        address _hopCoinAddr,
        uint256 _hopCoinDecimals,
        IDaimoPayBridger _hopBridger,
        FinalChainCoin[] memory _finalChainCoins
    ) {
        hopChainId = _hopChainId;
        hopCoinAddr = _hopCoinAddr;
        hopCoinDecimals = _hopCoinDecimals;
        hopBridger = _hopBridger;
        for (uint256 i = 0; i < _finalChainCoins.length; i++) {
            finalChainCoins[
                _finalChainCoins[i].finalChainId
            ] = _finalChainCoins[i];
        }
    }

    /// Determine the input token and amount required for bridging to
    /// another chain.
    function getBridgeTokenIn(
        uint256 toChainId,
        TokenAmount[] calldata bridgeTokenOutOptions
    ) external view returns (address bridgeTokenIn, uint256 inAmount) {
        TokenAmount[] memory hopAssetOpts = _getHopAsset({
            toChainId: toChainId,
            tokenOpts: bridgeTokenOutOptions
        });

        (bridgeTokenIn, inAmount) = hopBridger.getBridgeTokenIn({
            toChainId: hopChainId,
            bridgeTokenOutOptions: hopAssetOpts
        });
    }

    /// Initiate a bridge to a destination chain via a hop chain.
    function sendToChain(
        uint256 toChainId,
        address toAddress,
        TokenAmount[] calldata bridgeTokenOutOptions,
        address refundAddress,
        bytes calldata extraData
    ) public {
        require(toChainId != block.chainid, "DPHB: same chain");

        TokenAmount[] memory hopAssetOpts = _getHopAsset({
            toChainId: toChainId,
            tokenOpts: bridgeTokenOutOptions
        });

        (address inToken, uint256 inAmount) = hopBridger.getBridgeTokenIn({
            toChainId: hopChainId,
            bridgeTokenOutOptions: hopAssetOpts
        });

        IERC20(inToken).safeTransferFrom({
            from: msg.sender,
            to: address(this),
            value: inAmount
        });
        IERC20(inToken).forceApprove({
            spender: address(hopBridger),
            value: inAmount
        });

        hopBridger.sendToChain({
            toChainId: hopChainId,
            toAddress: toAddress,
            bridgeTokenOutOptions: hopAssetOpts,
            refundAddress: refundAddress,
            extraData: extraData
        });
    }

    /// Convert stablecoin amount between decimals with 1:1 value.
    /// Rounds up when decreasing precision.
    function _convertStableAmount(
        uint256 amount,
        uint256 fromDecimals,
        uint256 toDecimals
    ) internal pure returns (uint256) {
        if (toDecimals >= fromDecimals) {
            uint256 diff = toDecimals - fromDecimals;
            return amount * (10 ** diff);
        } else {
            uint256 diff = fromDecimals - toDecimals;
            uint256 divisor = 10 ** diff;
            return (amount + divisor - 1) / divisor; // round up
        }
    }

    /// Build the hop-asset option expected by the hop bridger.
    /// Returns exactly one TokenAmount with the hop coin and amount converted
    /// 1:1 by decimals from the required final-chain stablecoin. Rounds up when
    /// reducing precision to avoid underfunding.
    function _getHopAsset(
        uint256 toChainId,
        TokenAmount[] calldata tokenOpts
    ) internal view returns (TokenAmount[] memory) {
        FinalChainCoin memory finalCoin = finalChainCoins[toChainId];
        require(
            finalCoin.coinAddr != address(0),
            "DPHB: unsupported dest chain"
        );

        uint256 finalAmount = 0;
        uint256 n = tokenOpts.length;
        for (uint256 i = 0; i < n; ++i) {
            if (address(tokenOpts[i].token) == finalCoin.coinAddr) {
                finalAmount = tokenOpts[i].amount;
                break;
            }
        }
        require(finalAmount > 0, "DPHB: required token missing");

        uint256 convertedAmount = _convertStableAmount({
            amount: finalAmount,
            fromDecimals: finalCoin.coinDecimals,
            toDecimals: hopCoinDecimals
        });

        TokenAmount[] memory opts = new TokenAmount[](1);
        opts[0] = TokenAmount({
            token: IERC20(hopCoinAddr),
            amount: convertedAmount
        });
        return opts;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
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);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 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 {
    /**
     * @dev An operation with an ERC-20 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 Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
        return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
        return _callOptionalReturnBool(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.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    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.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    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.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    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 Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            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 {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            // bubble errors
            if iszero(success) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
            returnSize := returndatasize()
            returnValue := mload(0)
        }

        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
            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 silently catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0)
        }
        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
    }
}

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.12;

import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";

import "../TokenUtils.sol";

/// @author Daimo, Inc
/// @custom:security-contact [email protected]
/// @notice Bridges assets. Specifically, it lets any relayer initiate a bridge
/// transaction to another chain.
interface IDaimoPayBridger {
    /// Emitted when a bridge transaction is initiated
    event BridgeInitiated(
        address fromAddress,
        address fromToken,
        uint256 fromAmount,
        uint256 toChainId,
        address toAddress,
        address toToken,
        uint256 toAmount,
        address refundAddress
    );

    /// Determine the input token and amount required to achieve one of the
    /// given output options on a given chain.
    function getBridgeTokenIn(
        uint256 toChainId,
        TokenAmount[] memory bridgeTokenOutOptions
    ) external view returns (address bridgeTokenIn, uint256 inAmount);

    /// Initiate a bridge. Guarantee that one of the bridge token options
    /// (bridgeTokenOut, outAmount) shows up at toAddress on toChainId.
    /// Otherwise, revert.
    function sendToChain(
        uint256 toChainId,
        address toAddress,
        TokenAmount[] calldata bridgeTokenOutOptions,
        address refundAddress,
        bytes calldata extraData
    ) external;
}

/*
 * Copyright (c) 2022, Circle Internet Financial Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
pragma solidity ^0.8.12;

/**
 * @title ITokenMinter
 * @notice interface for minter of tokens that are mintable, burnable, and interchangeable
 * across domains.
 */
interface ITokenMinter {
    /**
     * @notice Mints `amount` of local tokens corresponding to the
     * given (`sourceDomain`, `burnToken`) pair, to `to` address.
     * @dev reverts if the (`sourceDomain`, `burnToken`) pair does not
     * map to a nonzero local token address. This mapping can be queried using
     * getLocalToken().
     * @param sourceDomain Source domain where `burnToken` was burned.
     * @param burnToken Burned token address as bytes32.
     * @param to Address to receive minted tokens, corresponding to `burnToken`,
     * on this domain.
     * @param amount Amount of tokens to mint. Must be less than or equal
     * to the minterAllowance of this TokenMinter for given `_mintToken`.
     * @return mintToken token minted.
     */
    function mint(
        uint32 sourceDomain,
        bytes32 burnToken,
        address to,
        uint256 amount
    ) external returns (address mintToken);

    /**
     * @notice Burn tokens owned by this ITokenMinter.
     * @param burnToken burnable token.
     * @param amount amount of tokens to burn. Must be less than or equal to this ITokenMinter's
     * account balance of the given `_burnToken`.
     */
    function burn(address burnToken, uint256 amount) external;

    /**
     * @notice Get the local token associated with the given remote domain and token.
     * @param remoteDomain Remote domain
     * @param remoteToken Remote token
     * @return local token address
     */
    function getLocalToken(
        uint32 remoteDomain,
        bytes32 remoteToken
    ) external view returns (address);

    /**
     * @notice Set the token controller of this ITokenMinter. Token controller
     * is responsible for mapping local tokens to remote tokens, and managing
     * token-specific limits
     * @param newTokenController new token controller address
     */
    function setTokenController(address newTokenController) external;
}

File 6 of 11 : ICCTPTokenMessenger.sol
/*
 * Copyright (c) 2022, Circle Internet Financial Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
pragma solidity ^0.8.12;

/**
 * @title ICCTPTokenMessenger
 * @notice Initiates CCTP transfers. Interface derived from TokenMessenger.sol.
 */
interface ICCTPTokenMessenger {
  /**
   * @notice Deposits and burns tokens from sender to be minted on destination domain.
   * Emits a `DepositForBurn` event.
   * @dev reverts if:
   * - given burnToken is not supported
   * - given destinationDomain has no TokenMessenger registered
   * - transferFrom() reverts. For example, if sender's burnToken balance or approved allowance
   * to this contract is less than `amount`.
   * - burn() reverts. For example, if `amount` is 0.
   * - MessageTransmitter returns false or reverts.
   * @param amount amount of tokens to burn
   * @param destinationDomain destination domain
   * @param mintRecipient address of mint recipient on destination domain
   * @param burnToken address of contract to burn deposited tokens, on local domain
   * @return _nonce unique nonce reserved by message
   */
  function depositForBurn(
    uint256 amount,
    uint32 destinationDomain,
    bytes32 mintRecipient,
    address burnToken
  ) external returns (uint64 _nonce);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.12;

import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";

/// Asset amount, e.g. $100 USDC or 0.1 ETH
struct TokenAmount {
    /// Zero address = native asset, e.g. ETH
    IERC20 token;
    uint256 amount;
}

/// Event emitted when native tokens (ETH, etc.) are transferred
event NativeTransfer(address indexed from, address indexed to, uint256 value);

/// Utility functions that work for both ERC20 and native tokens.
library TokenUtils {
    using SafeERC20 for IERC20;

    /// Returns ERC20 or ETH balance.
    function getBalanceOf(
        IERC20 token,
        address addr
    ) internal view returns (uint256) {
        if (address(token) == address(0)) {
            return addr.balance;
        } else {
            return token.balanceOf(addr);
        }
    }

    /// Approves a token transfer.
    function approve(IERC20 token, address spender, uint256 amount) internal {
        if (address(token) != address(0)) {
            token.forceApprove({spender: spender, value: amount});
        } // Do nothing for native token.
    }

    /// Sends an ERC20 or ETH transfer. For ETH, verify call success.
    function transfer(
        IERC20 token,
        address payable recipient,
        uint256 amount
    ) internal {
        if (address(token) != address(0)) {
            token.safeTransfer({to: recipient, value: amount});
        } else {
            // Native token transfer
            (bool success, ) = recipient.call{value: amount}("");
            require(success, "TokenUtils: ETH transfer failed");
        }
    }

    /// Sends an ERC20 or ETH transfer. Returns true if successful.
    function tryTransfer(
        IERC20 token,
        address payable recipient,
        uint256 amount
    ) internal returns (bool) {
        if (address(token) != address(0)) {
            return token.trySafeTransfer({to: recipient, value: amount});
        } else {
            (bool success, ) = recipient.call{value: amount}("");
            return success;
        }
    }

    /// Sends an ERC20 transfer.
    function transferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        require(
            address(token) != address(0),
            "TokenUtils: ETH transferFrom must be caller"
        );
        token.safeTransferFrom({from: from, to: to, value: amount});
    }

    /// Sends any token balance in the contract to the recipient.
    function transferBalance(
        IERC20 token,
        address payable recipient
    ) internal returns (uint256) {
        uint256 balance = getBalanceOf({token: token, addr: address(this)});
        if (balance > 0) {
            transfer({token: token, recipient: recipient, amount: balance});
        }
        return balance;
    }

    /// Check that the address has enough of at least one of the tokenAmounts.
    /// Returns the index of the first token that has sufficient balance, or
    /// the length of the tokenAmounts array if no token has sufficient balance.
    function checkBalance(
        TokenAmount[] calldata tokenAmounts
    ) internal view returns (uint256) {
        uint256 n = tokenAmounts.length;
        for (uint256 i = 0; i < n; ++i) {
            TokenAmount calldata tokenAmount = tokenAmounts[i];
            uint256 balance = getBalanceOf({
                token: tokenAmount.token,
                addr: address(this)
            });
            if (balance >= tokenAmount.amount) {
                return i;
            }
        }
        return n;
    }

    /// @notice Converts a token amount between different decimal representations.
    /// @param amount The token amount in the source decimal format.
    /// @param fromDecimals Decimals of the source token (e.g., 6 for USDC).
    /// @param toDecimals Decimals of the destination token (e.g., 18 for DAI).
    /// @param roundUp If true, rounds up when scaling down (losing precision).
    ///        Use true when calculating required input amounts (user pays more).
    ///        Use false when calculating output amounts (user receives less).
    /// @return The converted amount in the destination decimal format.
    function convertTokenAmountDecimals(
        uint256 amount,
        uint256 fromDecimals,
        uint256 toDecimals,
        bool roundUp
    ) internal pure returns (uint256) {
        if (toDecimals == fromDecimals) {
            return amount;
        } else if (toDecimals > fromDecimals) {
            return amount * 10 ** (toDecimals - fromDecimals);
        } else {
            uint256 decimalDiff = fromDecimals - toDecimals;
            uint256 divisor = 10 ** decimalDiff;
            if (roundUp) {
                return (amount + divisor - 1) / divisor;
            } else {
                return amount / divisor;
            }
        }
    }
}

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

pragma solidity ^0.8.20;

import {IERC20} from "../token/ERC20/IERC20.sol";

File 10 of 11 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../utils/introspection/IERC165.sol";

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "remappings": [
    "@axelar-network/=lib/axelar-gmp-sdk-solidity/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
    "@layerzerolabs/oft-evm/=lib/devtools/packages/oft-evm/",
    "@layerzerolabs/oapp-evm/=lib/devtools/packages/oapp-evm/",
    "@layerzerolabs/lz-evm-protocol-v2/=lib/LayerZero-v2/packages/layerzero-v2/evm/protocol/",
    "@layerzerolabs/lz-evm-messagelib-v2/=lib/LayerZero-v2/packages/layerzero-v2/evm/messagelib/",
    "@layerzerolabs/lz-evm-oapp-v2/=lib/LayerZero-v2/packages/layerzero-v2/evm/oapp/",
    "@stargatefinance/stg-evm-v2/=lib/stargate-v2/packages/stg-evm-v2/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "LayerZero-v2/=lib/LayerZero-v2/",
    "axelar-gmp-sdk-solidity/=lib/axelar-gmp-sdk-solidity/contracts/",
    "devtools/=lib/devtools/packages/toolbox-foundry/src/",
    "ds-test/=lib/solmate/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "solmate/=lib/solmate/src/",
    "stargate-v2/=lib/stargate-v2/packages/stg-evm-v2/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 999999
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "viaIR": true
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"uint256","name":"_hopChainId","type":"uint256"},{"internalType":"address","name":"_hopCoinAddr","type":"address"},{"internalType":"uint256","name":"_hopCoinDecimals","type":"uint256"},{"internalType":"contract IDaimoPayBridger","name":"_hopBridger","type":"address"},{"components":[{"internalType":"uint256","name":"finalChainId","type":"uint256"},{"internalType":"address","name":"coinAddr","type":"address"},{"internalType":"uint256","name":"coinDecimals","type":"uint256"}],"internalType":"struct DaimoPayHopBridger.FinalChainCoin[]","name":"_finalChainCoins","type":"tuple[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":false,"internalType":"address","name":"fromToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toChainId","type":"uint256"},{"indexed":false,"internalType":"address","name":"toAddress","type":"address"},{"indexed":false,"internalType":"address","name":"toToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"refundAddress","type":"address"}],"name":"BridgeInitiated","type":"event"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"}],"name":"finalChainCoins","outputs":[{"internalType":"uint256","name":"finalChainId","type":"uint256"},{"internalType":"address","name":"coinAddr","type":"address"},{"internalType":"uint256","name":"coinDecimals","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"toChainId","type":"uint256"},{"components":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenAmount[]","name":"bridgeTokenOutOptions","type":"tuple[]"}],"name":"getBridgeTokenIn","outputs":[{"internalType":"address","name":"bridgeTokenIn","type":"address"},{"internalType":"uint256","name":"inAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hopBridger","outputs":[{"internalType":"contract IDaimoPayBridger","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hopChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hopCoinAddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hopCoinDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"toChainId","type":"uint256"},{"internalType":"address","name":"toAddress","type":"address"},{"components":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenAmount[]","name":"bridgeTokenOutOptions","type":"tuple[]"},{"internalType":"address","name":"refundAddress","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"name":"sendToChain","outputs":[],"stateMutability":"nonpayable","type":"function"}]

610100604052346101f4576110f18038038061001a816101f9565b92833981019060a0818303126101f45780516100386020830161021e565b60408301516060840151939092906001600160a01b03851685036101f4576080810151906001600160401b0382116101f4570185601f820112156101f4578051906001600160401b0382116101de5761009660208360051b016101f9565b9660206060818a868152019402830101918183116101f457602001925b828410610188575050505060805260a05260c05260e05260005b815181101561012c57806100e360019284610232565b516100ee8285610232565b5151600052600060205260026040806000209280518455858401868060a01b03602083015116878060a01b03198254161790550151910155016100cd565b604051610e94908161025d823960805181818161016c01528181610348015261048f015260a05181818160b80152610b4c015260c0518181816102ef0152610ac2015260e0518181816101ad01528181610295015261046c0152f35b6060848303126101f4576040519060608201906001600160401b038211838310176101de57606092602092604052865181526101c583880161021e565b83820152604087015160408201528152019301926100b3565b634e487b7160e01b600052604160045260246000fd5b600080fd5b6040519190601f01601f191682016001600160401b038111838210176101de57604052565b51906001600160a01b03821682036101f457565b80518210156102465760209160051b010190565b634e487b7160e01b600052603260045260246000fdfe608080604052600436101561001357600080fd5b600090813560e01c9081630300471d1461081d5750806315506fdd1461036b57806327d2a91b1461031257806333d9468a146102b9578063ded855581461024a578063f80e0a42146100df5763fceaf6a21461006e57600080fd5b346100dc57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100dc57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b80fd5b50346100dc5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100dc5760243567ffffffffffffffff81116102465790604061014161013861019494369060040161088f565b90600435610a41565b8151809481927ff80e0a420000000000000000000000000000000000000000000000000000000083527f0000000000000000000000000000000000000000000000000000000000000000600484016109db565b038173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa918215610239578192610207575b506040805173ffffffffffffffffffffffffffffffffffffffff9290921682526020820192909252f35b905061022b915060403d604011610232575b6102238183610910565b810190610951565b90386101dd565b503d610219565b50604051903d90823e3d90fd5b5080fd5b50346100dc57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100dc57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346100dc57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100dc5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346100dc57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100dc5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346100dc5760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100dc5760043560243573ffffffffffffffffffffffffffffffffffffffff81168091036108195760443567ffffffffffffffff8111610815576103df90369060040161088f565b90916064359173ffffffffffffffffffffffffffffffffffffffff8316809303610811576084359467ffffffffffffffff86116106f157366023870112156106f15785600401359167ffffffffffffffff831161080d57366024848901011161080d574682146107af57879561045492610a41565b9173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016917f00000000000000000000000000000000000000000000000000000000000000006040517ff80e0a42000000000000000000000000000000000000000000000000000000008152604081806104e68986600484016109db565b0381885afa9081156107a4578890899261076e575b5073ffffffffffffffffffffffffffffffffffffffff16906105666040517f23b872dd00000000000000000000000000000000000000000000000000000000602082015233602482015230604482015282606482015260648152610560608482610910565b83610dc7565b602089604051926105f4846105c8858201937f095ea7b30000000000000000000000000000000000000000000000000000000085528c602484016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101865285610910565b83519082865af189513d82610752575b5050156106f5575b5050833b156106f15786958287936040519a8b98899788967f15506fdd000000000000000000000000000000000000000000000000000000008852600488015260248701526044860160a0905260a4860161066691610985565b9360648601528484037ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc01608486015281845260240160208401378381830160200152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160103602001925af18015610239576106e35780f35b6106ec91610910565b388180f35b8680fd5b61074b916107466040517f095ea7b30000000000000000000000000000000000000000000000000000000060208201528860248201528b604482015260448152610740606482610910565b82610dc7565b610dc7565b388061060c565b9091506107665750813b15155b3880610604565b60011461075f565b73ffffffffffffffffffffffffffffffffffffffff925061079e915060403d604011610232576102238183610910565b916104fb565b6040513d8a823e3d90fd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f445048423a2073616d6520636861696e000000000000000000000000000000006044820152fd5b8780fd5b8580fd5b8380fd5b8280fd5b9050346102465760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261024657604060609260043581528060205220805490600273ffffffffffffffffffffffffffffffffffffffff60018301541691015491835260208301526040820152f35b9181601f840112156108c05782359167ffffffffffffffff83116108c0576020808501948460061b0101116108c057565b600080fd5b6040810190811067ffffffffffffffff8211176108e157604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176108e157604052565b91908260409103126108c057815173ffffffffffffffffffffffffffffffffffffffff811681036108c05760209092015190565b906020808351928381520192019060005b8181106109a35750505090565b8251805173ffffffffffffffffffffffffffffffffffffffff1685526020908101518186015260409094019390920191600101610996565b6040906109f2939281528160208201520190610985565b90565b9190811015610a055760061b0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b805115610a055760200190565b60005260006020526040600020604051926060840184811067ffffffffffffffff8211176108e1576040528154845273ffffffffffffffffffffffffffffffffffffffff6001830154166040600260208701948386520154950194855215610c765760009260005b828110610c0c575b505050508015610bae57610ae791517f000000000000000000000000000000000000000000000000000000000000000091610d1e565b604090815191610af78184610910565b600183527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810160005b818110610b8a5750505190610b35826108c5565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001682526020820152610b7c82610a34565b52610b8681610a34565b5090565b6020908351610b98816108c5565b6000815260008382015282828801015201610b21565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f445048423a20726571756972656420746f6b656e206d697373696e67000000006044820152fd5b610c178184846109f5565b3573ffffffffffffffffffffffffffffffffffffffff81168091036108c05773ffffffffffffffffffffffffffffffffffffffff85511614610c5b57600101610aa9565b919060209450610c6b93506109f5565b013538808080610ab1565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f445048423a20756e737570706f72746564206465737420636861696e000000006044820152fd5b91908203918211610ce157565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b604d8111610ce157600a0a90565b91818110610d4c57610d3891610d3391610cd4565b610d10565b90818102918183041490151715610ce15790565b610d3390610d5992610cd4565b90818101809111610ce1577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908111610ce1578115610d98570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b906000602091828151910182855af115610e52576000513d610e49575073ffffffffffffffffffffffffffffffffffffffff81163b155b610e055750565b73ffffffffffffffffffffffffffffffffffffffff907f5274afe7000000000000000000000000000000000000000000000000000000006000521660045260246000fd5b60011415610dfe565b6040513d6000823e3d90fdfea264697066735822122008b9748360bdf92193eb99d36c64a4c410667dd7e2347fc2076bfb842f7ffdad64736f6c634300081a0033000000000000000000000000000000000000000000000000000000000000a4b1000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90000000000000000000000000000000000000000000000000000000000000006000000000000000000000000129349fc07e0ef7cd536d1764db3a0f1457721b300000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff85000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000380000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000640000000000000000000000002a22f9c3b484c3629090feed35f17ff8f88f76f0000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000890000000000000000000000003c499c542cef5e3811e1192ce70d8cc03d5c33590000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000008f000000000000000000000000754704bc059f8c67012fed69bc8a327a5aafb603000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000001e000000000000000000000000079a02482a880bce3f13e09da970dc34db4cd24d1000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000003e7000000000000000000000000b88339cb7199b77e23db6e890353e22632ba630f00000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000002105000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000e708000000000000000000000000176211869ca2b568f2a7d4ee941e073a821ee1ff0000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000008275000000000000000000000000006efdbff2a14a7c8e15944d1f4a48f9f95f663a40000000000000000000000000000000000000000000000000000000000000006

Deployed Bytecode

0x608080604052600436101561001357600080fd5b600090813560e01c9081630300471d1461081d5750806315506fdd1461036b57806327d2a91b1461031257806333d9468a146102b9578063ded855581461024a578063f80e0a42146100df5763fceaf6a21461006e57600080fd5b346100dc57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100dc57602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9168152f35b80fd5b50346100dc5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100dc5760243567ffffffffffffffff81116102465790604061014161013861019494369060040161088f565b90600435610a41565b8151809481927ff80e0a420000000000000000000000000000000000000000000000000000000083527f000000000000000000000000000000000000000000000000000000000000a4b1600484016109db565b038173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000129349fc07e0ef7cd536d1764db3a0f1457721b3165afa918215610239578192610207575b506040805173ffffffffffffffffffffffffffffffffffffffff9290921682526020820192909252f35b905061022b915060403d604011610232575b6102238183610910565b810190610951565b90386101dd565b503d610219565b50604051903d90823e3d90fd5b5080fd5b50346100dc57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100dc57602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000129349fc07e0ef7cd536d1764db3a0f1457721b3168152f35b50346100dc57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100dc5760206040517f00000000000000000000000000000000000000000000000000000000000000068152f35b50346100dc57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100dc5760206040517f000000000000000000000000000000000000000000000000000000000000a4b18152f35b50346100dc5760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100dc5760043560243573ffffffffffffffffffffffffffffffffffffffff81168091036108195760443567ffffffffffffffff8111610815576103df90369060040161088f565b90916064359173ffffffffffffffffffffffffffffffffffffffff8316809303610811576084359467ffffffffffffffff86116106f157366023870112156106f15785600401359167ffffffffffffffff831161080d57366024848901011161080d574682146107af57879561045492610a41565b9173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000129349fc07e0ef7cd536d1764db3a0f1457721b316917f000000000000000000000000000000000000000000000000000000000000a4b16040517ff80e0a42000000000000000000000000000000000000000000000000000000008152604081806104e68986600484016109db565b0381885afa9081156107a4578890899261076e575b5073ffffffffffffffffffffffffffffffffffffffff16906105666040517f23b872dd00000000000000000000000000000000000000000000000000000000602082015233602482015230604482015282606482015260648152610560608482610910565b83610dc7565b602089604051926105f4846105c8858201937f095ea7b30000000000000000000000000000000000000000000000000000000085528c602484016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101865285610910565b83519082865af189513d82610752575b5050156106f5575b5050833b156106f15786958287936040519a8b98899788967f15506fdd000000000000000000000000000000000000000000000000000000008852600488015260248701526044860160a0905260a4860161066691610985565b9360648601528484037ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc01608486015281845260240160208401378381830160200152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160103602001925af18015610239576106e35780f35b6106ec91610910565b388180f35b8680fd5b61074b916107466040517f095ea7b30000000000000000000000000000000000000000000000000000000060208201528860248201528b604482015260448152610740606482610910565b82610dc7565b610dc7565b388061060c565b9091506107665750813b15155b3880610604565b60011461075f565b73ffffffffffffffffffffffffffffffffffffffff925061079e915060403d604011610232576102238183610910565b916104fb565b6040513d8a823e3d90fd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f445048423a2073616d6520636861696e000000000000000000000000000000006044820152fd5b8780fd5b8580fd5b8380fd5b8280fd5b9050346102465760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261024657604060609260043581528060205220805490600273ffffffffffffffffffffffffffffffffffffffff60018301541691015491835260208301526040820152f35b9181601f840112156108c05782359167ffffffffffffffff83116108c0576020808501948460061b0101116108c057565b600080fd5b6040810190811067ffffffffffffffff8211176108e157604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176108e157604052565b91908260409103126108c057815173ffffffffffffffffffffffffffffffffffffffff811681036108c05760209092015190565b906020808351928381520192019060005b8181106109a35750505090565b8251805173ffffffffffffffffffffffffffffffffffffffff1685526020908101518186015260409094019390920191600101610996565b6040906109f2939281528160208201520190610985565b90565b9190811015610a055760061b0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b805115610a055760200190565b60005260006020526040600020604051926060840184811067ffffffffffffffff8211176108e1576040528154845273ffffffffffffffffffffffffffffffffffffffff6001830154166040600260208701948386520154950194855215610c765760009260005b828110610c0c575b505050508015610bae57610ae791517f000000000000000000000000000000000000000000000000000000000000000691610d1e565b604090815191610af78184610910565b600183527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810160005b818110610b8a5750505190610b35826108c5565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb91682526020820152610b7c82610a34565b52610b8681610a34565b5090565b6020908351610b98816108c5565b6000815260008382015282828801015201610b21565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f445048423a20726571756972656420746f6b656e206d697373696e67000000006044820152fd5b610c178184846109f5565b3573ffffffffffffffffffffffffffffffffffffffff81168091036108c05773ffffffffffffffffffffffffffffffffffffffff85511614610c5b57600101610aa9565b919060209450610c6b93506109f5565b013538808080610ab1565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f445048423a20756e737570706f72746564206465737420636861696e000000006044820152fd5b91908203918211610ce157565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b604d8111610ce157600a0a90565b91818110610d4c57610d3891610d3391610cd4565b610d10565b90818102918183041490151715610ce15790565b610d3390610d5992610cd4565b90818101809111610ce1577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908111610ce1578115610d98570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b906000602091828151910182855af115610e52576000513d610e49575073ffffffffffffffffffffffffffffffffffffffff81163b155b610e055750565b73ffffffffffffffffffffffffffffffffffffffff907f5274afe7000000000000000000000000000000000000000000000000000000006000521660045260246000fd5b60011415610dfe565b6040513d6000823e3d90fdfea264697066735822122008b9748360bdf92193eb99d36c64a4c410667dd7e2347fc2076bfb842f7ffdad64736f6c634300081a0033

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

000000000000000000000000000000000000000000000000000000000000a4b1000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90000000000000000000000000000000000000000000000000000000000000006000000000000000000000000129349fc07e0ef7cd536d1764db3a0f1457721b300000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff85000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000380000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000640000000000000000000000002a22f9c3b484c3629090feed35f17ff8f88f76f0000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000890000000000000000000000003c499c542cef5e3811e1192ce70d8cc03d5c33590000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000008f000000000000000000000000754704bc059f8c67012fed69bc8a327a5aafb603000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000001e000000000000000000000000079a02482a880bce3f13e09da970dc34db4cd24d1000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000003e7000000000000000000000000b88339cb7199b77e23db6e890353e22632ba630f00000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000002105000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000e708000000000000000000000000176211869ca2b568f2a7d4ee941e073a821ee1ff0000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000008275000000000000000000000000006efdbff2a14a7c8e15944d1f4a48f9f95f663a40000000000000000000000000000000000000000000000000000000000000006

-----Decoded View---------------
Arg [0] : _hopChainId (uint256): 42161
Arg [1] : _hopCoinAddr (address): 0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9
Arg [2] : _hopCoinDecimals (uint256): 6
Arg [3] : _hopBridger (address): 0x129349fC07E0ef7CD536d1764db3A0F1457721B3
Arg [4] : _finalChainCoins (tuple[]):
Arg [1] : finalChainId (uint256): 10
Arg [2] : coinAddr (address): 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
Arg [3] : coinDecimals (uint256): 6

Arg [1] : finalChainId (uint256): 56
Arg [2] : coinAddr (address): 0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d
Arg [3] : coinDecimals (uint256): 18

Arg [1] : finalChainId (uint256): 100
Arg [2] : coinAddr (address): 0x2a22f9c3b484c3629090FeED35F17Ff8F88f76F0
Arg [3] : coinDecimals (uint256): 6

Arg [1] : finalChainId (uint256): 137
Arg [2] : coinAddr (address): 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359
Arg [3] : coinDecimals (uint256): 6

Arg [1] : finalChainId (uint256): 143
Arg [2] : coinAddr (address): 0x754704Bc059F8C67012fEd69BC8A327a5aafb603
Arg [3] : coinDecimals (uint256): 6

Arg [1] : finalChainId (uint256): 480
Arg [2] : coinAddr (address): 0x79A02482A880bCE3F13e09Da970dC34db4CD24d1
Arg [3] : coinDecimals (uint256): 6

Arg [1] : finalChainId (uint256): 999
Arg [2] : coinAddr (address): 0xb88339CB7199b77E23DB6E890353E22632Ba630f
Arg [3] : coinDecimals (uint256): 6

Arg [1] : finalChainId (uint256): 8453
Arg [2] : coinAddr (address): 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Arg [3] : coinDecimals (uint256): 6

Arg [1] : finalChainId (uint256): 59144
Arg [2] : coinAddr (address): 0x176211869cA2b568f2A7D4EE941E073a821EE1ff
Arg [3] : coinDecimals (uint256): 6

Arg [1] : finalChainId (uint256): 534352
Arg [2] : coinAddr (address): 0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4
Arg [3] : coinDecimals (uint256): 6


-----Encoded View---------------
36 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000000a4b1
Arg [1] : 000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [3] : 000000000000000000000000129349fc07e0ef7cd536d1764db3a0f1457721b3
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [5] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [6] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [7] : 0000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff85
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000038
Arg [10] : 0000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [13] : 0000000000000000000000002a22f9c3b484c3629090feed35f17ff8f88f76f0
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [15] : 0000000000000000000000000000000000000000000000000000000000000089
Arg [16] : 0000000000000000000000003c499c542cef5e3811e1192ce70d8cc03d5c3359
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [18] : 000000000000000000000000000000000000000000000000000000000000008f
Arg [19] : 000000000000000000000000754704bc059f8c67012fed69bc8a327a5aafb603
Arg [20] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [21] : 00000000000000000000000000000000000000000000000000000000000001e0
Arg [22] : 00000000000000000000000079a02482a880bce3f13e09da970dc34db4cd24d1
Arg [23] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [24] : 00000000000000000000000000000000000000000000000000000000000003e7
Arg [25] : 000000000000000000000000b88339cb7199b77e23db6e890353e22632ba630f
Arg [26] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [27] : 0000000000000000000000000000000000000000000000000000000000002105
Arg [28] : 000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913
Arg [29] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [30] : 000000000000000000000000000000000000000000000000000000000000e708
Arg [31] : 000000000000000000000000176211869ca2b568f2a7d4ee941e073a821ee1ff
Arg [32] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [33] : 0000000000000000000000000000000000000000000000000000000000082750
Arg [34] : 00000000000000000000000006efdbff2a14a7c8e15944d1f4a48f9f95f663a4
Arg [35] : 0000000000000000000000000000000000000000000000000000000000000006


Block Transaction Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
0x151214D7998626249f029979cF2d47C2c9F46162
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.