ETH Price: $2,381.98 (-11.87%)

Contract

0x138cB41ff56D9CD289433f615D529B4dc75Ad33d

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xed316582...1366C1F48
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
CrossChainSender

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {IRouterClient} from "@chainlink/contracts-ccip/src/v0.8/ccip/interfaces/IRouterClient.sol";
import {Client} from "@chainlink/contracts-ccip/src/v0.8/ccip/libraries/Client.sol";
import {IERC20} from "@chainlink/contracts-ccip/src/v0.8/vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@chainlink/contracts-ccip/src/v0.8/vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol";
import {LinkTokenInterface} from "@chainlink/contracts/src/v0.8/shared/interfaces/LinkTokenInterface.sol";
import {OwnerIsCreator} from "@chainlink/contracts-ccip/src/v0.8/shared/access/OwnerIsCreator.sol";

contract CrossChainSender is OwnerIsCreator {
    using SafeERC20 for IERC20;

    mapping(address onBehalfOf => uint256 ccipLnMAmount)
        public liquidTokensAmount;

    enum PayFeesIn {
        Native,
        LINK
    }

    enum CrossChainAction {
        Deposit,
        Withdraw,
        withdrawAll
    }

    struct CrossChainData {
        CrossChainAction action;
        address onBehalfOf;
        uint256 amount;
    }

    IRouterClient immutable i_ccipRouter;
    LinkTokenInterface immutable i_link;
    IERC20 immutable i_stakingToken;
    uint256 public minTransferAmount = 10 * 10**18;

    // Mapping to keep track of allowlisted destination chains.
    mapping(uint64 chainSelector => bool isAllowlisted) public allowlistedDestinationChains;
    // Mapping to keep track of allowlisted receivers.
    mapping(address receiver => bool isAllowlisted) public allowlistedReceivers;

    error DestinationChainNotAllowlisted(uint64 destinationChainSelector); // Used when the destination chain has not been allowlisted by the contract owner.
    error ReceiverNotAllowed(address receiver); // Used when the receiver has not been allowlisted by the contract owner.
    error NotEnoughBalanceForFees(
        uint256 currentBalance,
        uint256 calculatedFees
    ); // Used to make sure contract has enough balance to cover the fees.
    error NothingToWithdraw(); // Used when trying to withdraw Ether but there's nothing to withdraw.
    error FailedToWithdrawEth(address owner, address target, uint256 value); // Used when the withdrawal of Ether fails.
    error InsufficientAmount(uint256 amount); // Used when transfering amount is insufficient

    event MessageSent(
        bytes32 indexed messageId,
        uint64 destinationChainSelector,
        address receiver,
        address indexed to,
        address token,
        uint256 amount,
        CrossChainAction indexed action,
        PayFeesIn payFeesIn,
        uint256 fees
    );

    constructor(
        address ccipRouterAddress,
        address linkAddress,
        address stakingTokenAddress
    ) {
        i_ccipRouter = IRouterClient(ccipRouterAddress);
        i_link = LinkTokenInterface(linkAddress);
        i_stakingToken = IERC20(stakingTokenAddress);
    }

    receive() external payable {}

    /// @dev Modifier that checks if the amount is sufficient for the specified action.
    /// @param _amount The amount being transferred.
    /// @param action The type of cross-chain action being performed.
    modifier sufficientAmount(uint256 _amount, CrossChainAction action) {
        if ((action == CrossChainAction.Deposit || action == CrossChainAction.Withdraw) &&
            _amount < minTransferAmount
        ) revert InsufficientAmount(_amount);
        _;
    }

    /// @dev Modifier that checks if the chain with the given destinationChainSelector is allowlisted and if the reciver is allowlisted.
    /// @param _destinationChainSelector The selector of the destination chain.
    /// @param _receiver The address of ccip receiver
    modifier onlyAllowlisted(uint64 _destinationChainSelector, address _receiver) {
        if (!allowlistedDestinationChains[_destinationChainSelector])
            revert DestinationChainNotAllowlisted(_destinationChainSelector);
        if (!allowlistedReceivers[_receiver]) revert ReceiverNotAllowed(_receiver);
        _;
    }

    /// @dev Sets the minimum transfer amount that is required for transactions.
    /// @param _minTransferAmount The new minimum transfer amount to be set.
    function setMinimumAmount(uint256 _minTransferAmount) external onlyOwner {
        minTransferAmount = _minTransferAmount;
    }

    /// @dev Updates the allowlist status of a destination chain for transactions.
    /// @notice This function can only be called by the owner.
    /// @param _destinationChainSelector The selector of the destination chain to be updated.
    /// @param allowed The allowlist status to be set for the destination chain.
    function allowlistDestinationChain(
        uint64 _destinationChainSelector,
        bool allowed
    ) external onlyOwner {
        allowlistedDestinationChains[_destinationChainSelector] = allowed;
    }

    /// @dev Updates the allowlist status of a sender for transactions.
    /// @notice This function can only be called by the owner.
    /// @param _receiver The address of the sender to be updated.
    /// @param allowed The allowlist status to be set for the sender.
    function allowlistReceiver(address _receiver, bool allowed) external onlyOwner {
        allowlistedReceivers[_receiver] = allowed;
    }

    function transfer(
        uint64 _destinationChainSelector,
        address _receiver,
        uint256 _amount,
        CrossChainAction _action,
        PayFeesIn _payFeesIn,
        uint256 _gasLimit
    )
        external
        payable
        onlyAllowlisted(_destinationChainSelector, _receiver)
        sufficientAmount(_amount, _action)
        returns (bytes32 messageId)
    {
        // Set the token amounts
        Client.EVMTokenAmount[] memory tokenAmounts = _action == CrossChainAction.Deposit
            ? new Client.EVMTokenAmount[](1)
            : new Client.EVMTokenAmount[](0);

        if (_action == CrossChainAction.Deposit) {
            Client.EVMTokenAmount memory tokenAmount = Client.EVMTokenAmount({
                token: address(i_stakingToken),
                amount: _amount
            });
            tokenAmounts[0] = tokenAmount;
        }
        
        // Set transfer data
        CrossChainData memory data = CrossChainData({
            action: _action,
            onBehalfOf: msg.sender,
            amount: _amount
        });

        Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({
            receiver: abi.encode(_receiver), // ABI-encoded receiver address
            data: abi.encode(data), // ABI-encoded string
            tokenAmounts: tokenAmounts, // The amount and type of token being transferred
            extraArgs: Client._argsToBytes(
                // Additional arguments, setting gas limit and non-strict sequencing mode
                Client.EVMExtraArgsV1({gasLimit: _gasLimit})
            ),
            // Set the feeToken, address(linkToken) means fees are paid in LINK, address(0) means fees are paid in native gas
            feeToken: _payFeesIn == PayFeesIn.LINK
                ? address(i_link)
                : address(0)
        });

        // Get the fee required to send the CCIP message
        uint256 fees = i_ccipRouter.getFee(_destinationChainSelector, message);

        if (_payFeesIn == PayFeesIn.LINK) {
            // User pays fees in LINK, so they must have approved the contract for at least 'fees' LINK tokens
            if (fees > i_link.allowance(msg.sender, address(this)))
                revert NotEnoughBalanceForFees(
                    i_link.allowance(msg.sender, address(this)),
                    fees
                );
            
            // Transfer LINK fees from the user to the contract
            i_link.transferFrom(msg.sender, address(this), fees);

            // Approve the Router to transfer LINK tokens from contract's balance
            i_link.approve(address(i_ccipRouter), fees);

            if (_action == CrossChainAction.Deposit) {
                // Transfer staking token amount from user to the contract
                i_stakingToken.safeTransferFrom(msg.sender, address(this), _amount);
                i_stakingToken.approve(address(i_ccipRouter), _amount);
            }

            // Send the message through the router and store the returned message ID
            messageId = i_ccipRouter.ccipSend(
                _destinationChainSelector,
                message
            );
        } else {
            // User pays fees in native currency (ETH), check if sent value is enough
            if (fees > msg.value) {
                revert NotEnoughBalanceForFees(msg.value, fees);
            }

            if (_action == CrossChainAction.Deposit) {
                // Transfer staking token amount from user to the contract
                i_stakingToken.safeTransferFrom(msg.sender, address(this), _amount);
                i_stakingToken.approve(address(i_ccipRouter), _amount);
            }

            // Send the message through the router and store the returned message ID
            messageId = i_ccipRouter.ccipSend{value: fees}(
                _destinationChainSelector,
                message
            );

            // Refund any excess ETH sent
            if (msg.value > fees) {
                payable(msg.sender).transfer(msg.value - fees);
            }
        }

        emit MessageSent(
            messageId,
            _destinationChainSelector,
            _receiver,
            msg.sender,
            address(i_stakingToken),
            _amount,
            _action,
            _payFeesIn,
            fees
        );

        // Return the message ID
        return messageId;
    }

    /// @notice Allows the contract owner to withdraw the entire balance of Ether from the contract.
    /// @dev This function reverts if there are no funds to withdraw or if the transfer fails.
    /// It should only be callable by the owner of the contract.
    /// @param _beneficiary The address to which the Ether should be sent.
    function withdraw(address _beneficiary) external onlyOwner {
        // Retrieve the balance of this contract
        uint256 amount = address(this).balance;

        // Revert if there is nothing to withdraw
        if (amount == 0) revert NothingToWithdraw();

        // Attempt to send the funds, capturing the success status and discarding any return data
        (bool sent, ) = _beneficiary.call{value: amount}("");

        // Revert if the send failed, with information about the attempted transfer
        if (!sent) revert FailedToWithdrawEth(msg.sender, _beneficiary, amount);
    }

    /// @notice Allows the owner of the contract to withdraw all tokens of a specific ERC20 token.
    /// @dev This function reverts with a 'NothingToWithdraw' error if there are no tokens to withdraw.
    /// @param _beneficiary The address to which the tokens will be sent.
    /// @param _token The contract address of the ERC20 token to be withdrawn.
    function withdrawToken(
        address _beneficiary,
        address _token
    ) external onlyOwner {
        // Retrieve the balance of this contract
        uint256 amount = IERC20(_token).balanceOf(address(this));

        // Revert if there is nothing to withdraw
        if (amount == 0) revert NothingToWithdraw();

        IERC20(_token).transfer(_beneficiary, amount);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Client} from "../libraries/Client.sol";

interface IRouterClient {
  error UnsupportedDestinationChain(uint64 destChainSelector);
  error InsufficientFeeTokenAmount();
  error InvalidMsgValue();

  /// @notice Checks if the given chain ID is supported for sending/receiving.
  /// @param chainSelector The chain to check.
  /// @return supported is true if it is supported, false if not.
  function isChainSupported(uint64 chainSelector) external view returns (bool supported);

  /// @notice Gets a list of all supported tokens which can be sent or received
  /// to/from a given chain id.
  /// @param chainSelector The chainSelector.
  /// @return tokens The addresses of all tokens that are supported.
  function getSupportedTokens(uint64 chainSelector) external view returns (address[] memory tokens);

  /// @param destinationChainSelector The destination chainSelector
  /// @param message The cross-chain CCIP message including data and/or tokens
  /// @return fee returns execution fee for the message
  /// delivery to destination chain, denominated in the feeToken specified in the message.
  /// @dev Reverts with appropriate reason upon invalid message.
  function getFee(
    uint64 destinationChainSelector,
    Client.EVM2AnyMessage memory message
  ) external view returns (uint256 fee);

  /// @notice Request a message to be sent to the destination chain
  /// @param destinationChainSelector The destination chain ID
  /// @param message The cross-chain CCIP message including data and/or tokens
  /// @return messageId The message ID
  /// @dev Note if msg.value is larger than the required fee (from getFee) we accept
  /// the overpayment with no refund.
  /// @dev Reverts with appropriate reason upon invalid message.
  function ccipSend(
    uint64 destinationChainSelector,
    Client.EVM2AnyMessage calldata message
  ) external payable returns (bytes32);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// End consumer library.
library Client {
  /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers.
  struct EVMTokenAmount {
    address token; // token address on the local chain.
    uint256 amount; // Amount of tokens.
  }

  struct Any2EVMMessage {
    bytes32 messageId; // MessageId corresponding to ccipSend on source.
    uint64 sourceChainSelector; // Source chain selector.
    bytes sender; // abi.decode(sender) if coming from an EVM chain.
    bytes data; // payload sent in original message.
    EVMTokenAmount[] destTokenAmounts; // Tokens and their amounts in their destination chain representation.
  }

  // If extraArgs is empty bytes, the default is 200k gas limit.
  struct EVM2AnyMessage {
    bytes receiver; // abi.encode(receiver address) for dest EVM chains
    bytes data; // Data payload
    EVMTokenAmount[] tokenAmounts; // Token transfers
    address feeToken; // Address of feeToken. address(0) means you will send msg.value.
    bytes extraArgs; // Populate this with _argsToBytes(EVMExtraArgsV1)
  }

  // bytes4(keccak256("CCIP EVMExtraArgsV1"));
  bytes4 public constant EVM_EXTRA_ARGS_V1_TAG = 0x97a657c9;
  struct EVMExtraArgsV1 {
    uint256 gasLimit;
  }

  function _argsToBytes(EVMExtraArgsV1 memory extraArgs) internal pure returns (bytes memory bts) {
    return abi.encodeWithSelector(EVM_EXTRA_ARGS_V1_TAG, extraArgs);
  }
}

File 4 of 12 : ConfirmedOwner.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

/// @title The ConfirmedOwner contract
/// @notice A contract with helpers for basic contract ownership.
contract ConfirmedOwner is ConfirmedOwnerWithProposal {
  constructor(address newOwner) ConfirmedOwnerWithProposal(newOwner, address(0)) {}
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IOwnable} from "../interfaces/IOwnable.sol";

/// @title The ConfirmedOwner contract
/// @notice A contract with helpers for basic contract ownership.
contract ConfirmedOwnerWithProposal is IOwnable {
  address private s_owner;
  address private s_pendingOwner;

  event OwnershipTransferRequested(address indexed from, address indexed to);
  event OwnershipTransferred(address indexed from, address indexed to);

  constructor(address newOwner, address pendingOwner) {
    // solhint-disable-next-line custom-errors
    require(newOwner != address(0), "Cannot set owner to zero");

    s_owner = newOwner;
    if (pendingOwner != address(0)) {
      _transferOwnership(pendingOwner);
    }
  }

  /// @notice Allows an owner to begin transferring ownership to a new address.
  function transferOwnership(address to) public override onlyOwner {
    _transferOwnership(to);
  }

  /// @notice Allows an ownership transfer to be completed by the recipient.
  function acceptOwnership() external override {
    // solhint-disable-next-line custom-errors
    require(msg.sender == s_pendingOwner, "Must be proposed owner");

    address oldOwner = s_owner;
    s_owner = msg.sender;
    s_pendingOwner = address(0);

    emit OwnershipTransferred(oldOwner, msg.sender);
  }

  /// @notice Get the current owner
  function owner() public view override returns (address) {
    return s_owner;
  }

  /// @notice validate, transfer ownership, and emit relevant events
  function _transferOwnership(address to) private {
    // solhint-disable-next-line custom-errors
    require(to != msg.sender, "Cannot transfer to self");

    s_pendingOwner = to;

    emit OwnershipTransferRequested(s_owner, to);
  }

  /// @notice validate access
  function _validateOwnership() internal view {
    // solhint-disable-next-line custom-errors
    require(msg.sender == s_owner, "Only callable by owner");
  }

  /// @notice Reverts if called by anyone other than the contract owner.
  modifier onlyOwner() {
    _validateOwnership();
    _;
  }
}

File 6 of 12 : OwnerIsCreator.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

/// @title The OwnerIsCreator contract
/// @notice A contract with helpers for basic contract ownership.
contract OwnerIsCreator is ConfirmedOwner {
  constructor() ConfirmedOwner(msg.sender) {}
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IOwnable {
  function owner() external returns (address);

  function transferOwnership(address recipient) external;

  function acceptOwnership() external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @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.
 */
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].
   */
  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);
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
  /**
   * @dev Emitted when `value` tokens are moved from one account (`from`) to
   * another (`to`).
   *
   * Note that `value` may be zero.
   */
  event Transfer(address indexed from, address indexed to, uint256 value);

  /**
   * @dev Emitted when the allowance of a `spender` for an `owner` is set by
   * a call to {approve}. `value` is the new allowance.
   */
  event Approval(address indexed owner, address indexed spender, uint256 value);

  /**
   * @dev Returns the amount of tokens in existence.
   */
  function totalSupply() external view returns (uint256);

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

  /**
   * @dev Moves `amount` tokens from the caller's account to `to`.
   *
   * Returns a boolean value indicating whether the operation succeeded.
   *
   * Emits a {Transfer} event.
   */
  function transfer(address to, uint256 amount) external returns (bool);

  /**
   * @dev Returns the remaining number of tokens that `spender` will be
   * allowed to spend on behalf of `owner` through {transferFrom}. This is
   * zero by default.
   *
   * This value changes when {approve} or {transferFrom} are called.
   */
  function allowance(address owner, address spender) external view returns (uint256);

  /**
   * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
   *
   * Returns a boolean value indicating whether the operation succeeded.
   *
   * IMPORTANT: Beware that changing an allowance with this method brings the risk
   * that someone may use both the old and the new allowance by unfortunate
   * transaction ordering. One possible solution to mitigate this race
   * condition is to first reduce the spender's allowance to 0 and set the
   * desired value afterwards:
   * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
   *
   * Emits an {Approval} event.
   */
  function approve(address spender, uint256 amount) external returns (bool);

  /**
   * @dev Moves `amount` tokens from `from` to `to` using the
   * allowance mechanism. `amount` is then deducted from the caller's
   * allowance.
   *
   * Returns a boolean value indicating whether the operation succeeded.
   *
   * Emits a {Transfer} event.
   */
  function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

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

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../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;

  function safeTransfer(IERC20 token, address to, uint256 value) internal {
    _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
  }

  function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
    _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
  }

  /**
   * @dev Deprecated. This function has issues similar to the ones found in
   * {IERC20-approve}, and its usage is discouraged.
   *
   * Whenever possible, use {safeIncreaseAllowance} and
   * {safeDecreaseAllowance} instead.
   */
  function safeApprove(IERC20 token, address spender, uint256 value) internal {
    // safeApprove should only be called when setting an initial allowance,
    // or when resetting it to zero. To increase and decrease it, use
    // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
    require(
      (value == 0) || (token.allowance(address(this), spender) == 0),
      "SafeERC20: approve from non-zero to non-zero allowance"
    );
    _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
  }

  function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
    uint256 newAllowance = token.allowance(address(this), spender) + value;
    _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
  }

  function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
    unchecked {
      uint256 oldAllowance = token.allowance(address(this), spender);
      require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
      uint256 newAllowance = oldAllowance - value;
      _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }
  }

  function safePermit(
    IERC20Permit token,
    address owner,
    address spender,
    uint256 value,
    uint256 deadline,
    uint8 v,
    bytes32 r,
    bytes32 s
  ) internal {
    uint256 nonceBefore = token.nonces(owner);
    token.permit(owner, spender, value, deadline, v, r, s);
    uint256 nonceAfter = token.nonces(owner);
    require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
  }

  /**
   * @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, "SafeERC20: low-level call failed");
    if (returndata.length > 0) {
      // Return data is optional
      require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }
  }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
  /**
   * @dev Returns true if `account` is a contract.
   *
   * [IMPORTANT]
   * ====
   * It is unsafe to assume that an address for which this function returns
   * false is an externally-owned account (EOA) and not a contract.
   *
   * Among others, `isContract` will return false for the following
   * types of addresses:
   *
   *  - an externally-owned account
   *  - a contract in construction
   *  - an address where a contract will be created
   *  - an address where a contract lived, but was destroyed
   * ====
   *
   * [IMPORTANT]
   * ====
   * You shouldn't rely on `isContract` to protect against flash loan attacks!
   *
   * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
   * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
   * constructor.
   * ====
   */
  function isContract(address account) internal view returns (bool) {
    // This method relies on extcodesize/address.code.length, which returns 0
    // for contracts in construction, since the code is only stored at the end
    // of the constructor execution.

    return account.code.length > 0;
  }

  /**
   * @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://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
   */
  function sendValue(address payable recipient, uint256 amount) internal {
    require(address(this).balance >= amount, "Address: insufficient balance");

    (bool success, ) = recipient.call{value: amount}("");
    require(success, "Address: unable to send value, recipient may have reverted");
  }

  /**
   * @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, it is bubbled up by this
   * function (like regular Solidity function calls).
   *
   * 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.
   *
   * _Available since v3.1._
   */
  function functionCall(address target, bytes memory data) internal returns (bytes memory) {
    return functionCallWithValue(target, data, 0, "Address: low-level call failed");
  }

  /**
   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
   * `errorMessage` as a fallback revert reason when `target` reverts.
   *
   * _Available since v3.1._
   */
  function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
    return functionCallWithValue(target, data, 0, errorMessage);
  }

  /**
   * @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`.
   *
   * _Available since v3.1._
   */
  function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
    return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
  }

  /**
   * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
   * with `errorMessage` as a fallback revert reason when `target` reverts.
   *
   * _Available since v3.1._
   */
  function functionCallWithValue(
    address target,
    bytes memory data,
    uint256 value,
    string memory errorMessage
  ) internal returns (bytes memory) {
    require(address(this).balance >= value, "Address: insufficient balance for call");
    (bool success, bytes memory returndata) = target.call{value: value}(data);
    return verifyCallResultFromTarget(target, success, returndata, errorMessage);
  }

  /**
   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
   * but performing a static call.
   *
   * _Available since v3.3._
   */
  function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
    return functionStaticCall(target, data, "Address: low-level static call failed");
  }

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

  /**
   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
   * but performing a delegate call.
   *
   * _Available since v3.4._
   */
  function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
    return functionDelegateCall(target, data, "Address: low-level delegate call failed");
  }

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

  /**
   * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
   * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
   *
   * _Available since v4.8._
   */
  function verifyCallResultFromTarget(
    address target,
    bool success,
    bytes memory returndata,
    string memory errorMessage
  ) internal view returns (bytes memory) {
    if (success) {
      if (returndata.length == 0) {
        // only check isContract if the call was successful and the return data is empty
        // otherwise we already know that it was a contract
        require(isContract(target), "Address: call to non-contract");
      }
      return returndata;
    } else {
      _revert(returndata, errorMessage);
    }
  }

  /**
   * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
   * revert reason or using the provided one.
   *
   * _Available since v4.3._
   */
  function verifyCallResult(
    bool success,
    bytes memory returndata,
    string memory errorMessage
  ) internal pure returns (bytes memory) {
    if (success) {
      return returndata;
    } else {
      _revert(returndata, errorMessage);
    }
  }

  function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage);
    }
  }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface LinkTokenInterface {
  function allowance(address owner, address spender) external view returns (uint256 remaining);

  function approve(address spender, uint256 value) external returns (bool success);

  function balanceOf(address owner) external view returns (uint256 balance);

  function decimals() external view returns (uint8 decimalPlaces);

  function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);

  function increaseApproval(address spender, uint256 subtractedValue) external;

  function name() external view returns (string memory tokenName);

  function symbol() external view returns (string memory tokenSymbol);

  function totalSupply() external view returns (uint256 totalTokensIssued);

  function transfer(address to, uint256 value) external returns (bool success);

  function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool success);

  function transferFrom(address from, address to, uint256 value) external returns (bool success);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200,
    "details": {
      "yulDetails": {
        "optimizerSteps": "u"
      }
    }
  },
  "viaIR": true,
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"ccipRouterAddress","type":"address"},{"internalType":"address","name":"linkAddress","type":"address"},{"internalType":"address","name":"stakingTokenAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint64","name":"destinationChainSelector","type":"uint64"}],"name":"DestinationChainNotAllowlisted","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"FailedToWithdrawEth","type":"error"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"InsufficientAmount","type":"error"},{"inputs":[{"internalType":"uint256","name":"currentBalance","type":"uint256"},{"internalType":"uint256","name":"calculatedFees","type":"uint256"}],"name":"NotEnoughBalanceForFees","type":"error"},{"inputs":[],"name":"NothingToWithdraw","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ReceiverNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"messageId","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"destinationChainSelector","type":"uint64"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"enum CrossChainSender.CrossChainAction","name":"action","type":"uint8"},{"indexed":false,"internalType":"enum CrossChainSender.PayFeesIn","name":"payFeesIn","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"fees","type":"uint256"}],"name":"MessageSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_destinationChainSelector","type":"uint64"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"allowlistDestinationChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"allowlistReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainSelector","type":"uint64"}],"name":"allowlistedDestinationChains","outputs":[{"internalType":"bool","name":"isAllowlisted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"allowlistedReceivers","outputs":[{"internalType":"bool","name":"isAllowlisted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"onBehalfOf","type":"address"}],"name":"liquidTokensAmount","outputs":[{"internalType":"uint256","name":"ccipLnMAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minTransferAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minTransferAmount","type":"uint256"}],"name":"setMinimumAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_destinationChainSelector","type":"uint64"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"enum CrossChainSender.CrossChainAction","name":"_action","type":"uint8"},{"internalType":"enum CrossChainSender.PayFeesIn","name":"_payFeesIn","type":"uint8"},{"internalType":"uint256","name":"_gasLimit","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bytes32","name":"messageId","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"address","name":"_token","type":"address"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

0x60e06040523462000068576200001f620000186200012b565b91620001bf565b604051611b9b620003fb823960805181610fa3015260a051818181610f430152611025015260c05181818161119b015281816112540152818161149f01526115830152611b9b90f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b03821117620000a557604052565b6200006d565b90620000c2620000ba60405190565b928362000083565b565b6001600160a01b031690565b90565b6001600160a01b038116036200006857565b90505190620000c282620000d3565b90916060828403126200006857620000d0620001118484620000e5565b93620001218160208601620000e5565b93604001620000e5565b6200014e62001f96803803806200014281620000ab565b928339810190620000f4565b909192565b90600019905b9181191691161790565b620000d0620000d0620000d09290565b9062000187620000d06200018f9262000163565b825462000153565b9055565b620000d090620000c4906001600160a01b031682565b620000d09062000193565b620000d090620001a9565b620002059291620001f3620001fc92620001d86200020a565b620001ed678ac7230489e80000600362000173565b620001b4565b608052620001b4565b60a052620001b4565b60c052565b620000c23362000230565b620000c4620000d0620000d09290565b620000d09062000215565b620000c29062000241600062000225565b90620002c1565b156200025057565b60405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f00000000000000006044820152606490fd5b906001600160a01b039062000159565b90620002b9620000d06200018f92620001b4565b825462000295565b620002ff90620000c4600091620002d88362000225565b92620002f96001600160a01b0385166001600160a01b038416141562000248565b620002a5565b6001600160a01b03821603620003125750565b620000c29062000381565b156200032557565b60405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606490fd5b620000d090620000c4565b620000d090546200036a565b62000398336001600160a01b03831614156200031d565b620003a5816001620002a5565b620003b1600062000375565b90620003e9620003e27fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127893620001b4565b91620001b4565b91620003f460405190565b600090a356fe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806331bf2cb9146100eb5780633aeac4e1146100e657806351cff8d9146100e15780635497ce42146100dc57806368841431146100d757806375c67c66146100d257806379ba5097146100cd5780638b1b1992146100c85780638cc5f5c9146100c35780638da5cb5b146100be57806396d3b83d146100b9578063eeb4a9c8146100b45763f2fde38b0361000e57610501565b6104e9565b6104bc565b61046d565b610452565b610427565b6103d7565b6103aa565b61031c565b6102ea565b610267565b610235565b6101e1565b67ffffffffffffffff81165b0361010357565b600080fd5b90503590610115826100f0565b565b6001600160a01b031690565b90565b6001600160a01b0381166100fc565b9050359061011582610126565b806100fc565b9050359061011582610142565b6003111561010357565b9050359061011582610155565b6002111561010357565b905035906101158261016c565b909160c082840312610103576101998383610108565b926101a78160208501610135565b926101b58260408301610148565b926101236101c6846060850161015f565b936101d48160808601610176565b9360a001610148565b9052565b61020e6101fe6101f2366004610183565b9493909392919261160b565b6040519182918290815260200190565b0390f35b9190604083820312610103576101239061022c8185610135565b93602001610135565b346101035761024e610248366004610212565b90611b5b565b604051005b906020828203126101035761012391610135565b346101035761024e61027a366004610253565b611a61565b61012390610117906001600160a01b031682565b6101239061027f565b61012390610293565b906102af9061029c565b600052602052604060002090565b610123916008021c81565b9061012391546102bd565b610123906102e56002916000926102a5565b6102c8565b346101035761020e6101fe610300366004610253565b6102d3565b600091031261010357565b610123600060036102c8565b346101035761032c366004610305565b61020e6101fe610310565b906020828203126101035761012391610108565b6103626101236101239267ffffffffffffffff1690565b67ffffffffffffffff1690565b906102af9061034b565b610123916008021c5b60ff1690565b906101239154610379565b610123906103a560049160009261036f565b610388565b346101035761020e6103c56103c0366004610337565b610393565b60405191829182901515815260200190565b34610103576103e7366004610305565b61024e6105dd565b8015156100fc565b90503590610115826103ef565b9190604083820312610103576101239061041e8185610135565b936020016103f7565b346101035761024e61043a366004610404565b90610844565b610123906103a56005916000926102a5565b346101035761020e6103c5610468366004610253565b610440565b346101035761047d366004610305565b61020e61048861066b565b604051918291826001600160a01b03909116815260200190565b9190604083820312610103576101239061041e8185610108565b346101035761024e6104cf3660046104a2565b9061081e565b906020828203126101035761012391610148565b346101035761024e6104fc3660046104d5565b6107cf565b346101035761024e610514366004610253565b61052e565b6101159061052561075e565b610115906106c1565b61011590610519565b61012390610117565b6101239054610537565b0190565b1561055557565b60405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b6044820152606490fd5b0390fd5b906001600160a01b03905b9181191691161790565b906105bc6101236105c39261029c565b8254610597565b9055565b6101176101236101239290565b610123906105c7565b336105fe6105ee6101176001610540565b6001600160a01b0383161461054e565b6106086000610540565b906106148160006105ac565b61062861062160006105d4565b60016105ac565b61065b6106557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361029c565b9161029c565b9161066560405190565b600090a3565b6101236000610540565b1561067c57565b60405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606490fd5b6106d6336001600160a01b0383161415610675565b6106e18160016105ac565b6106eb6000610540565b9061065b6106557fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789361029c565b1561072057565b60405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b6044820152606490fd5b6101153361077f6107726101176000610540565b916001600160a01b031690565b14610719565b6101159061079161075e565b6107c4565b90600019906105a2565b6101236101236101239290565b906107bd6101236105c3926107a0565b8254610796565b6101159060036107ad565b61011590610785565b90610115916107e561075e565b61080a565b9060ff906105a2565b906108036101236105c392151590565b82546107ea565b9061081961011592600461036f565b6107f3565b90610115916107d8565b906101159161083561075e565b906108196101159260056102a5565b9061011591610828565b61012390610382565b610123905461084e565b96959493929190600461088361087f61087a848461036f565b610857565b1590565b6108d75761089861087f61087a8560056102a5565b6108a757506101239697610946565b90506105936108b560405190565b630542d32760e21b815292839283016001600160a01b03909116815260200190565b6105936108e360405190565b630a503cdb60e01b8152928392830167ffffffffffffffff909116815260200190565b634e487b7160e01b600052602160045260246000fd5b6003111561092657565b610906565b906101158261091c565b6101239081565b6101239054610935565b96959493929190610957600061092b565b6109608561092b565b1480156109b8575b806109a3575b61097c576101239697610e32565b6105938361098960405190565b6377b8dde360e01b81529182916004830190815260200190565b506109b1610123600361093c565b831061096e565b506109c3600161092b565b6109cc8561092b565b14610968565b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff821117610a0a57604052565b6109d2565b90610115610a1c60405190565b92836109e8565b67ffffffffffffffff8111610a0a5760208091020190565b90610a4d610a4883610a23565b610a0f565b918252565b6101236040610a0f565b610a64610a52565b906000825260006020830152565b610123610a5c565b60005b828110610a8957505050565b602090610a94610a72565b8184015201610a7d565b90610115610ab4610aae84610a3b565b93610a23565b601f190160208401610a7a565b634e487b7160e01b600052603260045260246000fd5b90610ae0825190565b811015610af1576020809102010190565b610ac1565b6101236060610a0f565b906101dd9061092b565b6101239061092b565b6101dd90610b0a565b9060408061011593610b3660008201516000860190610b13565b6020818101516001600160a01b0316908501525b0151910152565b6060810192916101159190610b1c565b6101236020610a0f565b6002111561092657565b9061011582610b6b565b61012360a0610a0f565b9050519061011582610142565b906020828203126101035761012391610b89565b60005b838110610bbd5750506000910152565b8181015183820152602001610bad565b610bee610bf760209361054a93610be2815190565b80835293849260200190565b95869101610baa565b601f01601f191690565b80516001600160a01b0316825261011591906020908190610b4a565b9061054a81604093610c01565b90610c4a610c43610c39845190565b8084529260200190565b9260200190565b9060005b818110610c5b5750505090565b909192610c75610c6e6001928651610c1d565b9460200190565b929101610c4e565b610123916080610cc6610cb4610ca260a0850160008701518682036000880152610bcd565b60208601518582036020870152610bcd565b60408501518482036040860152610c2a565b6060808501516001600160a01b031690840152920151906080818403910152610bcd565b67ffffffffffffffff90911681526101239160408201916020818403910152610c7d565b6040513d6000823e3d90fd5b9081526040810192916101159160200152565b0152565b90505190610115826103ef565b906020828203126101035761012391610d31565b6001600160a01b0390911681526040810192916101159160200152565b634e487b7160e01b600052601160045260246000fd5b91908203918211610d9257565b610d6f565b6001600160a01b039182168152911660208201526060810192916101159160400152565b61012390610b75565b6101dd90610dbb565b9194610e28610d2d92989795610e2160a096610e116101159a610e0160c08a019e60008b019067ffffffffffffffff169052565b6001600160a01b03166020890152565b6001600160a01b03166040870152565b6060850152565b6080830190610dc4565b50949390610e40600061092b565b610e498561092b565b600091036115f95750610e64610e5f60016107a0565b610a9e565b945b610e70600061092b565b610e798661092b565b1461157e575b610f9e610e8a610af6565b610e948782610b00565b336020820152610ea5866040830152565b610f97610f19610eb460405190565b94610ee18660208101610ed58a826001600160a01b03909116815260200190565b908103825203876109e8565b610f09610eed60405190565b8095610efd602083019182610b51565b908103825203856109e8565b610f14610a4d610b61565b611660565b91610f8760019a610f298c610b75565b610f328a610b75565b6000910361156c5750610f80610f677f000000000000000000000000000000000000000000000000000000000000000061029c565b935b610f79610f74610b7f565b998a52565b6020890152565b6040870152565b6001600160a01b03166060850152565b6080830152565b610fc77f000000000000000000000000000000000000000000000000000000000000000061029c565b6320487ded96610fe0610fd960405190565b9860e01b90565b885260208880610ff4868d60048401610cea565b0381855afa97881561123d57600098611548575b5061101290610b75565b61101b85610b75565b036113c3576110497f000000000000000000000000000000000000000000000000000000000000000061029c565b63dd62ed3e916110583061029c565b9261106260405190565b61106c8260e01b90565b81523360048201526001600160a01b0385166024820152602081604481875afa801561123d576110a1916000916113ab575090565b8a1161131857506323b872dd916110c16110ba60405190565b9360e01b90565b8352602083806110d68d883360048501610d97565b03816000855af192831561123d576000936112fc575b50602061111e63095ea7b3928c61110260405190565b9687809481936111128960e01b90565b83528960048401610d52565b03925af192831561123d578b936112e0575b5061113b600061092b565b6111448a61092b565b14611242575b506020925061117260006396f4e9f961117d61116560405190565b9788968795869460e01b90565b845260048401610cea565b03925af190811561123d5760009161120f575b50955b6112096111bf7f000000000000000000000000000000000000000000000000000000000000000061029c565b967fc21cd668f345f3676a5cb88a5715ee97eb2b3504e0f874fee18650d2c7d823679489966111f66111f03361029c565b99610b0a565b9961120060405190565b96879687610dcd565b0390a490565b611230915060203d8111611236575b61122881836109e8565b810190610b96565b38611190565b503d61121e565b610d0e565b602091925061128061128c9461127b8a7f00000000000000000000000000000000000000000000000000000000000000009233846116b6565b61029c565b60405194859260e01b90565b8252816000816112a08c8860048401610d52565b03925af190811561123d576020928a921561114a576112d490843d81116112d9575b6112cc81836109e8565b810190610d3e565b61114a565b503d6112c2565b6112f79060203d81116112d9576112cc81836109e8565b611130565b6113139060203d81116112d9576112cc81836109e8565b6110ec565b6113576020858561133a8e9561132d60405190565b9586948593849360e01b90565b83523360048401526001600160a01b031660248301526044820190565b03915afa90811561123d5760009161138d575b5061059361137760405190565b6328fdcaa160e01b815292839260048401610d1a565b6113a5915060203d81116112365761122881836109e8565b8261136a565b610123915060203d81116112365761122881836109e8565b3497919088881161153a576113d8600061092b565b6113e18861092b565b14611494575b6114199160209161140d8a6396f4e9f961140060405190565b9687958694859360e01b90565b83528960048401610cea565b03925af190811561123d57600091611476575b509686811161143c575b50611193565b6000808080936114588b61145261127b3361029c565b92610d85565b9082821561146d575bf11561123d5738611436565b506108fc611461565b61148e915060203d81116112365761122881836109e8565b3861142c565b6114ea9160206114d27f000000000000000000000000000000000000000000000000000000000000000061127b8a6114cb3061029c565b33846116b6565b63095ea7b3906114e160405190565b95869260e01b90565b8252816000816114fe8d8960048401610d52565b03925af191821561123d576114199360209361151f575b50915091506113e7565b61153590843d81116112d9576112cc81836109e8565b611515565b878961059361137760405190565b6110129198506115659060203d81116112365761122881836109e8565b9790611008565b611578610f80916105d4565b93610f69565b6115a77f000000000000000000000000000000000000000000000000000000000000000061029c565b6115c16115b2610a52565b6001600160a01b039092168252565b6115cc856020830152565b6115df6115d960006107a0565b88610ad7565b526115f36115ed60006107a0565b87610ad7565b50610e7f565b610e5f611605916107a0565b94610e66565b6101239594939291906000610861565b61162e6116286101239290565b60e01b90565b6001600160e01b03191690565b6101236397a657c961161b565b516101159152565b6020810192916101159190611648565b61012360049161166e606090565b5061169461167a61163b565b9161168460405190565b9485936020850190815201611650565b602082018103825203826109e8565b61162e6116286101239263ffffffff1690565b906116fb906116ec610115956004956116d26323b872dd6116a3565b936116dc60405190565b9788956020870190815201610d97565b602082018103825203836109e8565b6117c4565b67ffffffffffffffff8111610a0a57602090601f01601f19160190565b90610a4d610a4883611700565b611734602061171d565b7f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564602082015290565b61012361172a565b1561176c57565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b906117d16117e09261029c565b906117da61175d565b9161181c565b80516117f36117ef60006107a0565b9190565b116117fb5750565b61181781602061180c610115945190565b818301019101610d3e565b611765565b610123929161182b60006107a0565b916118ab565b1561183857565b60405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608490fd5b3d156118a65761189b3d61171d565b903d6000602084013e565b606090565b906000610123949381926118bd606090565b506118d46118ca3061029c565b8390311015611831565b60208101905191855af16118e661188c565b91611938565b156118f357565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b9192901561196a575081516119506117ef60006107a0565b14611959575090565b61196561012391611970565b6118ec565b82611993565b3b61197e6117ef60006107a0565b1190565b602080825261012392910190610bcd565b9061199c825190565b6119a96117ef60006107a0565b11156119b85750805190602001fd5b610593906119c560405190565b62461bcd60e51b815291829160048301611982565b610115906119e661075e565b6119ef3061029c565b3160006119fb816107a0565b8214611a4f5780611a2391611a0f60405190565b60009085875af1611a1e61188c565b501590565b611a2b575050565b6105933391611a3960405190565b639d11f56360e01b815293849360048501610d97565b604051630686827b60e51b8152600490fd5b610115906119da565b9061011591611a7761075e565b9061127b611a849161029c565b6370a08231916020611ab0611a983061029c565b94611ac7611aa560405190565b968793849360e01b90565b83526001600160a01b031660048301526024820190565b0381855afa92831561123d57600093611b3b575b50600091611ae8836107a0565b8414611a4f57611b0560209363a9059cbb611b1061116560405190565b845260048401610d52565b03925af1801561123d57611b215750565b611b389060203d81116112d9576112cc81836109e8565b50565b611b5491935060203d81116112365761122881836109e8565b9138611adb565b9061011591611a6a56fea2646970667358221220183b6f57abd4e80076b807f74a53eceddec2748e30b2cd9b941d6abe19629a9a64736f6c63430008130033000000000000000000000000141fa059441e0ca23ce184b6a78bafd2a517dde8000000000000000000000000f97f4df75117a78c1a5a0dbb814af92458539fb400000000000000000000000027bc2757fab0b8ab406016d1f71d8123452095d3

Deployed Bytecode

0x6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806331bf2cb9146100eb5780633aeac4e1146100e657806351cff8d9146100e15780635497ce42146100dc57806368841431146100d757806375c67c66146100d257806379ba5097146100cd5780638b1b1992146100c85780638cc5f5c9146100c35780638da5cb5b146100be57806396d3b83d146100b9578063eeb4a9c8146100b45763f2fde38b0361000e57610501565b6104e9565b6104bc565b61046d565b610452565b610427565b6103d7565b6103aa565b61031c565b6102ea565b610267565b610235565b6101e1565b67ffffffffffffffff81165b0361010357565b600080fd5b90503590610115826100f0565b565b6001600160a01b031690565b90565b6001600160a01b0381166100fc565b9050359061011582610126565b806100fc565b9050359061011582610142565b6003111561010357565b9050359061011582610155565b6002111561010357565b905035906101158261016c565b909160c082840312610103576101998383610108565b926101a78160208501610135565b926101b58260408301610148565b926101236101c6846060850161015f565b936101d48160808601610176565b9360a001610148565b9052565b61020e6101fe6101f2366004610183565b9493909392919261160b565b6040519182918290815260200190565b0390f35b9190604083820312610103576101239061022c8185610135565b93602001610135565b346101035761024e610248366004610212565b90611b5b565b604051005b906020828203126101035761012391610135565b346101035761024e61027a366004610253565b611a61565b61012390610117906001600160a01b031682565b6101239061027f565b61012390610293565b906102af9061029c565b600052602052604060002090565b610123916008021c81565b9061012391546102bd565b610123906102e56002916000926102a5565b6102c8565b346101035761020e6101fe610300366004610253565b6102d3565b600091031261010357565b610123600060036102c8565b346101035761032c366004610305565b61020e6101fe610310565b906020828203126101035761012391610108565b6103626101236101239267ffffffffffffffff1690565b67ffffffffffffffff1690565b906102af9061034b565b610123916008021c5b60ff1690565b906101239154610379565b610123906103a560049160009261036f565b610388565b346101035761020e6103c56103c0366004610337565b610393565b60405191829182901515815260200190565b34610103576103e7366004610305565b61024e6105dd565b8015156100fc565b90503590610115826103ef565b9190604083820312610103576101239061041e8185610135565b936020016103f7565b346101035761024e61043a366004610404565b90610844565b610123906103a56005916000926102a5565b346101035761020e6103c5610468366004610253565b610440565b346101035761047d366004610305565b61020e61048861066b565b604051918291826001600160a01b03909116815260200190565b9190604083820312610103576101239061041e8185610108565b346101035761024e6104cf3660046104a2565b9061081e565b906020828203126101035761012391610148565b346101035761024e6104fc3660046104d5565b6107cf565b346101035761024e610514366004610253565b61052e565b6101159061052561075e565b610115906106c1565b61011590610519565b61012390610117565b6101239054610537565b0190565b1561055557565b60405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b6044820152606490fd5b0390fd5b906001600160a01b03905b9181191691161790565b906105bc6101236105c39261029c565b8254610597565b9055565b6101176101236101239290565b610123906105c7565b336105fe6105ee6101176001610540565b6001600160a01b0383161461054e565b6106086000610540565b906106148160006105ac565b61062861062160006105d4565b60016105ac565b61065b6106557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361029c565b9161029c565b9161066560405190565b600090a3565b6101236000610540565b1561067c57565b60405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606490fd5b6106d6336001600160a01b0383161415610675565b6106e18160016105ac565b6106eb6000610540565b9061065b6106557fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789361029c565b1561072057565b60405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b6044820152606490fd5b6101153361077f6107726101176000610540565b916001600160a01b031690565b14610719565b6101159061079161075e565b6107c4565b90600019906105a2565b6101236101236101239290565b906107bd6101236105c3926107a0565b8254610796565b6101159060036107ad565b61011590610785565b90610115916107e561075e565b61080a565b9060ff906105a2565b906108036101236105c392151590565b82546107ea565b9061081961011592600461036f565b6107f3565b90610115916107d8565b906101159161083561075e565b906108196101159260056102a5565b9061011591610828565b61012390610382565b610123905461084e565b96959493929190600461088361087f61087a848461036f565b610857565b1590565b6108d75761089861087f61087a8560056102a5565b6108a757506101239697610946565b90506105936108b560405190565b630542d32760e21b815292839283016001600160a01b03909116815260200190565b6105936108e360405190565b630a503cdb60e01b8152928392830167ffffffffffffffff909116815260200190565b634e487b7160e01b600052602160045260246000fd5b6003111561092657565b610906565b906101158261091c565b6101239081565b6101239054610935565b96959493929190610957600061092b565b6109608561092b565b1480156109b8575b806109a3575b61097c576101239697610e32565b6105938361098960405190565b6377b8dde360e01b81529182916004830190815260200190565b506109b1610123600361093c565b831061096e565b506109c3600161092b565b6109cc8561092b565b14610968565b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff821117610a0a57604052565b6109d2565b90610115610a1c60405190565b92836109e8565b67ffffffffffffffff8111610a0a5760208091020190565b90610a4d610a4883610a23565b610a0f565b918252565b6101236040610a0f565b610a64610a52565b906000825260006020830152565b610123610a5c565b60005b828110610a8957505050565b602090610a94610a72565b8184015201610a7d565b90610115610ab4610aae84610a3b565b93610a23565b601f190160208401610a7a565b634e487b7160e01b600052603260045260246000fd5b90610ae0825190565b811015610af1576020809102010190565b610ac1565b6101236060610a0f565b906101dd9061092b565b6101239061092b565b6101dd90610b0a565b9060408061011593610b3660008201516000860190610b13565b6020818101516001600160a01b0316908501525b0151910152565b6060810192916101159190610b1c565b6101236020610a0f565b6002111561092657565b9061011582610b6b565b61012360a0610a0f565b9050519061011582610142565b906020828203126101035761012391610b89565b60005b838110610bbd5750506000910152565b8181015183820152602001610bad565b610bee610bf760209361054a93610be2815190565b80835293849260200190565b95869101610baa565b601f01601f191690565b80516001600160a01b0316825261011591906020908190610b4a565b9061054a81604093610c01565b90610c4a610c43610c39845190565b8084529260200190565b9260200190565b9060005b818110610c5b5750505090565b909192610c75610c6e6001928651610c1d565b9460200190565b929101610c4e565b610123916080610cc6610cb4610ca260a0850160008701518682036000880152610bcd565b60208601518582036020870152610bcd565b60408501518482036040860152610c2a565b6060808501516001600160a01b031690840152920151906080818403910152610bcd565b67ffffffffffffffff90911681526101239160408201916020818403910152610c7d565b6040513d6000823e3d90fd5b9081526040810192916101159160200152565b0152565b90505190610115826103ef565b906020828203126101035761012391610d31565b6001600160a01b0390911681526040810192916101159160200152565b634e487b7160e01b600052601160045260246000fd5b91908203918211610d9257565b610d6f565b6001600160a01b039182168152911660208201526060810192916101159160400152565b61012390610b75565b6101dd90610dbb565b9194610e28610d2d92989795610e2160a096610e116101159a610e0160c08a019e60008b019067ffffffffffffffff169052565b6001600160a01b03166020890152565b6001600160a01b03166040870152565b6060850152565b6080830190610dc4565b50949390610e40600061092b565b610e498561092b565b600091036115f95750610e64610e5f60016107a0565b610a9e565b945b610e70600061092b565b610e798661092b565b1461157e575b610f9e610e8a610af6565b610e948782610b00565b336020820152610ea5866040830152565b610f97610f19610eb460405190565b94610ee18660208101610ed58a826001600160a01b03909116815260200190565b908103825203876109e8565b610f09610eed60405190565b8095610efd602083019182610b51565b908103825203856109e8565b610f14610a4d610b61565b611660565b91610f8760019a610f298c610b75565b610f328a610b75565b6000910361156c5750610f80610f677f000000000000000000000000f97f4df75117a78c1a5a0dbb814af92458539fb461029c565b935b610f79610f74610b7f565b998a52565b6020890152565b6040870152565b6001600160a01b03166060850152565b6080830152565b610fc77f000000000000000000000000141fa059441e0ca23ce184b6a78bafd2a517dde861029c565b6320487ded96610fe0610fd960405190565b9860e01b90565b885260208880610ff4868d60048401610cea565b0381855afa97881561123d57600098611548575b5061101290610b75565b61101b85610b75565b036113c3576110497f000000000000000000000000f97f4df75117a78c1a5a0dbb814af92458539fb461029c565b63dd62ed3e916110583061029c565b9261106260405190565b61106c8260e01b90565b81523360048201526001600160a01b0385166024820152602081604481875afa801561123d576110a1916000916113ab575090565b8a1161131857506323b872dd916110c16110ba60405190565b9360e01b90565b8352602083806110d68d883360048501610d97565b03816000855af192831561123d576000936112fc575b50602061111e63095ea7b3928c61110260405190565b9687809481936111128960e01b90565b83528960048401610d52565b03925af192831561123d578b936112e0575b5061113b600061092b565b6111448a61092b565b14611242575b506020925061117260006396f4e9f961117d61116560405190565b9788968795869460e01b90565b845260048401610cea565b03925af190811561123d5760009161120f575b50955b6112096111bf7f00000000000000000000000027bc2757fab0b8ab406016d1f71d8123452095d361029c565b967fc21cd668f345f3676a5cb88a5715ee97eb2b3504e0f874fee18650d2c7d823679489966111f66111f03361029c565b99610b0a565b9961120060405190565b96879687610dcd565b0390a490565b611230915060203d8111611236575b61122881836109e8565b810190610b96565b38611190565b503d61121e565b610d0e565b602091925061128061128c9461127b8a7f00000000000000000000000027bc2757fab0b8ab406016d1f71d8123452095d39233846116b6565b61029c565b60405194859260e01b90565b8252816000816112a08c8860048401610d52565b03925af190811561123d576020928a921561114a576112d490843d81116112d9575b6112cc81836109e8565b810190610d3e565b61114a565b503d6112c2565b6112f79060203d81116112d9576112cc81836109e8565b611130565b6113139060203d81116112d9576112cc81836109e8565b6110ec565b6113576020858561133a8e9561132d60405190565b9586948593849360e01b90565b83523360048401526001600160a01b031660248301526044820190565b03915afa90811561123d5760009161138d575b5061059361137760405190565b6328fdcaa160e01b815292839260048401610d1a565b6113a5915060203d81116112365761122881836109e8565b8261136a565b610123915060203d81116112365761122881836109e8565b3497919088881161153a576113d8600061092b565b6113e18861092b565b14611494575b6114199160209161140d8a6396f4e9f961140060405190565b9687958694859360e01b90565b83528960048401610cea565b03925af190811561123d57600091611476575b509686811161143c575b50611193565b6000808080936114588b61145261127b3361029c565b92610d85565b9082821561146d575bf11561123d5738611436565b506108fc611461565b61148e915060203d81116112365761122881836109e8565b3861142c565b6114ea9160206114d27f00000000000000000000000027bc2757fab0b8ab406016d1f71d8123452095d361127b8a6114cb3061029c565b33846116b6565b63095ea7b3906114e160405190565b95869260e01b90565b8252816000816114fe8d8960048401610d52565b03925af191821561123d576114199360209361151f575b50915091506113e7565b61153590843d81116112d9576112cc81836109e8565b611515565b878961059361137760405190565b6110129198506115659060203d81116112365761122881836109e8565b9790611008565b611578610f80916105d4565b93610f69565b6115a77f00000000000000000000000027bc2757fab0b8ab406016d1f71d8123452095d361029c565b6115c16115b2610a52565b6001600160a01b039092168252565b6115cc856020830152565b6115df6115d960006107a0565b88610ad7565b526115f36115ed60006107a0565b87610ad7565b50610e7f565b610e5f611605916107a0565b94610e66565b6101239594939291906000610861565b61162e6116286101239290565b60e01b90565b6001600160e01b03191690565b6101236397a657c961161b565b516101159152565b6020810192916101159190611648565b61012360049161166e606090565b5061169461167a61163b565b9161168460405190565b9485936020850190815201611650565b602082018103825203826109e8565b61162e6116286101239263ffffffff1690565b906116fb906116ec610115956004956116d26323b872dd6116a3565b936116dc60405190565b9788956020870190815201610d97565b602082018103825203836109e8565b6117c4565b67ffffffffffffffff8111610a0a57602090601f01601f19160190565b90610a4d610a4883611700565b611734602061171d565b7f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564602082015290565b61012361172a565b1561176c57565b60405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b906117d16117e09261029c565b906117da61175d565b9161181c565b80516117f36117ef60006107a0565b9190565b116117fb5750565b61181781602061180c610115945190565b818301019101610d3e565b611765565b610123929161182b60006107a0565b916118ab565b1561183857565b60405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608490fd5b3d156118a65761189b3d61171d565b903d6000602084013e565b606090565b906000610123949381926118bd606090565b506118d46118ca3061029c565b8390311015611831565b60208101905191855af16118e661188c565b91611938565b156118f357565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b9192901561196a575081516119506117ef60006107a0565b14611959575090565b61196561012391611970565b6118ec565b82611993565b3b61197e6117ef60006107a0565b1190565b602080825261012392910190610bcd565b9061199c825190565b6119a96117ef60006107a0565b11156119b85750805190602001fd5b610593906119c560405190565b62461bcd60e51b815291829160048301611982565b610115906119e661075e565b6119ef3061029c565b3160006119fb816107a0565b8214611a4f5780611a2391611a0f60405190565b60009085875af1611a1e61188c565b501590565b611a2b575050565b6105933391611a3960405190565b639d11f56360e01b815293849360048501610d97565b604051630686827b60e51b8152600490fd5b610115906119da565b9061011591611a7761075e565b9061127b611a849161029c565b6370a08231916020611ab0611a983061029c565b94611ac7611aa560405190565b968793849360e01b90565b83526001600160a01b031660048301526024820190565b0381855afa92831561123d57600093611b3b575b50600091611ae8836107a0565b8414611a4f57611b0560209363a9059cbb611b1061116560405190565b845260048401610d52565b03925af1801561123d57611b215750565b611b389060203d81116112d9576112cc81836109e8565b50565b611b5491935060203d81116112365761122881836109e8565b9138611adb565b9061011591611a6a56fea2646970667358221220183b6f57abd4e80076b807f74a53eceddec2748e30b2cd9b941d6abe19629a9a64736f6c63430008130033

Block Transaction Difficulty 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
Loading...
Loading

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.