Sepolia Testnet

Contract

0xD688B04e2238b3F40DB74996Fd6127Cb41966b0E

Overview

ETH Balance

0.001461867457768374 ETH

Token Holdings

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Send To SA53756142024-02-27 18:35:36331 days ago1709058936IN
0xD688B04e...b41966b0E
0.00028611 ETH0.0038789314.2139
Transfer EO Ato ...53543782024-02-24 15:02:24334 days ago1708786944IN
0xD688B04e...b41966b0E
0.03 ETH0.0004911916.03127574
Transfer EO Ato ...53346672024-02-21 14:23:48338 days ago1708525428IN
0xD688B04e...b41966b0E
0.01 ETH0.0007341323.95071514
Transfer EO Ato ...53346612024-02-21 14:22:36338 days ago1708525356IN
0xD688B04e...b41966b0E
0.01 ETH0.0007180723.43600362
Transfer EO Ato ...53346552024-02-21 14:21:24338 days ago1708525284IN
0xD688B04e...b41966b0E
0.01 ETH0.00079826.05470668
Transfer EO Ato ...53289232024-02-20 18:08:00338 days ago1708452480IN
0xD688B04e...b41966b0E
0.03 ETH0.000101663.31797817
Transfer EO Ato ...53289082024-02-20 18:04:48338 days ago1708452288IN
0xD688B04e...b41966b0E
0.09160054 ETH0.000085142.77560718
Send To SA52904162024-02-15 0:11:00344 days ago1707955860IN
0xD688B04e...b41966b0E
0.00027819 ETH0.000204761.50000013
Send To SA52888812024-02-14 19:03:36344 days ago1707937416IN
0xD688B04e...b41966b0E
0.00027819 ETH0.000437821.57502847
Send To SA52820132024-02-13 20:06:36345 days ago1707854796IN
0xD688B04e...b41966b0E
0.00028586 ETH0.0119417342.96066524
Send To SA52794002024-02-13 11:21:48346 days ago1707823308IN
0xD688B04e...b41966b0E
0.00027819 ETH0.0181197466.7263664
Send To SA52792802024-02-13 10:57:48346 days ago1707821868IN
0xD688B04e...b41966b0E
0.00027819 ETH0.0164866460.41077675
Send To SA52782332024-02-13 7:28:24346 days ago1707809304IN
0xD688B04e...b41966b0E
0.00027819 ETH0.0085629230.80265134
Send To SA52782242024-02-13 7:26:36346 days ago1707809196IN
0xD688B04e...b41966b0E
0.00027819 ETH0.0090162428.49454471
Send To SA52775372024-02-13 5:09:12346 days ago1707800952IN
0xD688B04e...b41966b0E
0.00027819 ETH0.0034962412.57943589
Send To SA52771992024-02-13 4:01:36346 days ago1707796896IN
0xD688B04e...b41966b0E
0.00027819 ETH0.0038133513.71861997
Send To SA52771942024-02-13 4:00:36346 days ago1707796836IN
0xD688B04e...b41966b0E
0.00027819 ETH0.0045449614.36484516
Send To SA52771612024-02-13 3:54:00346 days ago1707796440IN
0xD688B04e...b41966b0E
0.00027819 ETH0.0035942412.93038808
Send To SA52765832024-02-13 1:58:24346 days ago1707789504IN
0xD688B04e...b41966b0E
0.00027834 ETH0.0035346612.95351756
Send To SA52761272024-02-13 0:23:36346 days ago1707783816IN
0xD688B04e...b41966b0E
0.00027843 ETH0.002141557.84646365
Send To SA52761232024-02-13 0:22:36346 days ago1707783756IN
0xD688B04e...b41966b0E
0.00027896 ETH0.002218338.12849613
Send To SA52761172024-02-13 0:21:24346 days ago1707783684IN
0xD688B04e...b41966b0E
0.00027896 ETH0.002073117.6349798
Send To SA52761052024-02-13 0:18:48346 days ago1707783528IN
0xD688B04e...b41966b0E
0.00028232 ETH0.001936727.09598886
Send To SA52749432024-02-12 20:24:12346 days ago1707769452IN
0xD688B04e...b41966b0E
0.00027822 ETH0.0044874416.14231022
Send To SA52748502024-02-12 20:05:36346 days ago1707768336IN
0xD688B04e...b41966b0E
0.00027823 ETH0.0071157126.07243334
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
53756142024-02-27 18:35:36331 days ago1709058936
0xD688B04e...b41966b0E
0.00027964 ETH
52888812024-02-14 19:03:36344 days ago1707937416
0xD688B04e...b41966b0E
0.00027819 ETH
52820132024-02-13 20:06:36345 days ago1707854796
0xD688B04e...b41966b0E
0.00028586 ETH
52794002024-02-13 11:21:48346 days ago1707823308
0xD688B04e...b41966b0E
0.00027819 ETH
52792802024-02-13 10:57:48346 days ago1707821868
0xD688B04e...b41966b0E
0.00027819 ETH
52782332024-02-13 7:28:24346 days ago1707809304
0xD688B04e...b41966b0E
0.00027819 ETH
52782242024-02-13 7:26:36346 days ago1707809196
0xD688B04e...b41966b0E
0.00027819 ETH
52775372024-02-13 5:09:12346 days ago1707800952
0xD688B04e...b41966b0E
0.00027819 ETH
52771992024-02-13 4:01:36346 days ago1707796896
0xD688B04e...b41966b0E
0.00027819 ETH
52771942024-02-13 4:00:36346 days ago1707796836
0xD688B04e...b41966b0E
0.00027819 ETH
52771612024-02-13 3:54:00346 days ago1707796440
0xD688B04e...b41966b0E
0.00027819 ETH
52765832024-02-13 1:58:24346 days ago1707789504
0xD688B04e...b41966b0E
0.00027834 ETH
52761272024-02-13 0:23:36346 days ago1707783816
0xD688B04e...b41966b0E
0.00027843 ETH
52761232024-02-13 0:22:36346 days ago1707783756
0xD688B04e...b41966b0E
0.00027843 ETH
52761172024-02-13 0:21:24346 days ago1707783684
0xD688B04e...b41966b0E
0.00027896 ETH
52761052024-02-13 0:18:48346 days ago1707783528
0xD688B04e...b41966b0E
0.00028138 ETH
52749432024-02-12 20:24:12346 days ago1707769452
0xD688B04e...b41966b0E
0.00027822 ETH
52748502024-02-12 20:05:36346 days ago1707768336
0xD688B04e...b41966b0E
0.00027823 ETH
52748462024-02-12 20:04:36346 days ago1707768276
0xD688B04e...b41966b0E
0.00027823 ETH
52748392024-02-12 20:03:12346 days ago1707768192
0xD688B04e...b41966b0E
0.00027832 ETH
52746172024-02-12 19:18:48346 days ago1707765528
0xD688B04e...b41966b0E
0.00027819 ETH
52745972024-02-12 19:14:48346 days ago1707765288
0xD688B04e...b41966b0E
0.00027827 ETH
52745742024-02-12 19:10:12346 days ago1707765012
0xD688B04e...b41966b0E
0.00027836 ETH
52745632024-02-12 19:08:00346 days ago1707764880
0xD688B04e...b41966b0E
0.00027836 ETH
52743442024-02-12 18:23:48346 days ago1707762228
0xD688B04e...b41966b0E
0.00027819 ETH
View All Internal Transactions
Loading...
Loading

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

Contract Name:
SAPBridge

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)

File 1 of 14 : SAPBridge.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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 {Withdraw} from "./utils/Withdraw.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./utils/ISAPHandler.sol";
import "./utils/IBlackList.sol";

contract SAPBridge is Withdraw, ISAPHandler {
    address immutable ccipRouter;
    IBlackList blackList;
    mapping(address => bool) internal exemptList; // Address list of fee exemption
    mapping(uint64 => address) private sapBridgeReceivers;

    struct FeeParameter {
        uint24 rate; // 1feeRate = 1/1,000,000
        uint96 cap;
        uint96 floor;
    }
    mapping(uint64 => mapping(uint256 => mapping(address => FeeParameter))) public feeParam; // feeParam[destinationChainSelector][actionId][tokenAddress] = FeeParameter
    uint256 internal constant ACTION_EOAtoSA = 1;
    uint256 internal constant ACTION_SAtoEOA = 2;
    uint256 internal constant ACTION_SAtoSA = 3;

    event MessageSent(
        bytes32 indexed messageId,
        uint64 indexed destinationChainSelector,
        address sapBridgeReceiver,
        address destination,
        address token,
        uint256 amount,
        uint256 bridgeGas
    );

    error NotSupported();

    constructor(address router, address blackListAddress) {
        ccipRouter = router;
        blackList = IBlackList(blackListAddress);
    }

    function setSapReceiver(uint64 destinationChainSelector, address sapBridgeReceiver) external onlyOwner {
        sapBridgeReceivers[destinationChainSelector] = sapBridgeReceiver;
    }

    function setBlackList(address blackListAddress) external onlyOwner {
        blackList = IBlackList(blackListAddress);
    }

    function approveToken(address token) external onlyOwner {
        IERC20(token).approve(ccipRouter, type(uint256).max);
    }

    function calcBridgeGas(uint64 destinationChainSelector, address saDest, address token, uint256 amount,
    bytes memory keyCipher) external view returns (uint256 bridgeGas) {
        (, bridgeGas) = _calcBridgeGasToSA(destinationChainSelector, saDest, token, amount, keyCipher);
    }

    function _calcBridgeGasToSA(uint64 destinationChainSelector, address saDest, address token, uint256 amount,
    bytes memory keyCipher) internal view returns (Client.EVM2AnyMessage memory message, uint256 bridgeGas) {
        message = _packMessageToSA(destinationChainSelector, saDest, token, amount, keyCipher);
        bridgeGas = IRouterClient(ccipRouter).getFee(destinationChainSelector, message);
    }

    function calcBridgeGasToEOA(uint64 destinationChainSelector, address eoaDest, address token, uint256 amount)
    external view returns (uint256 bridgeGas) {
        (, bridgeGas) = _calcBridgeGasToEOA(destinationChainSelector, eoaDest, token, amount);
    }

    function _calcBridgeGasToEOA(uint64 destinationChainSelector, address eoaDest, address token, uint256 amount)
    internal view returns (Client.EVM2AnyMessage memory message, uint256 bridgeGas) {
        message = _packMessageToEOA(eoaDest, token, amount);
        bridgeGas = IRouterClient(ccipRouter).getFee(destinationChainSelector, message);
    }

    function _calcFee(uint64 destinationChainSelector, uint256 actionId, address tokenAddress,
    uint256 amount) internal view returns (uint256 fee) {
        FeeParameter storage fParam = feeParam[destinationChainSelector][actionId][tokenAddress];
        require(fParam.cap > 0, "Token not allowed");
        fee = (amount * fParam.rate) / 1000000;
        uint96 cap = fParam.cap;
        uint96 floor = fParam.floor;
        if (fee < floor) {
            fee = floor;
        } else if (fee > cap) {
            fee = cap;
        }
    }

    function calcFee(uint64 destinationChainSelector, uint256 actionId, address tokenAddress, uint256 amount)
    external view returns (uint256 fee) {
        return _calcFee(destinationChainSelector, actionId, tokenAddress, amount);
    }

    function getFeeParam(uint64 destinationChainSelector, uint256 actionId, address tokenAddress)
    external view returns (uint24 rate, uint96 cap, uint96 floor) {
        FeeParameter storage fParam = feeParam[destinationChainSelector][actionId][tokenAddress];
        rate = fParam.rate;
        cap = fParam.cap;
        floor = fParam.floor;
    }

    function setFee(uint64 destinationChainSelector, uint256 actionId, address tokenAddress, uint24 rate,
    uint96 cap, uint96 floor) external onlyOwner {
        feeParam[destinationChainSelector][actionId][tokenAddress].rate = rate;
        feeParam[destinationChainSelector][actionId][tokenAddress].cap = cap;
        feeParam[destinationChainSelector][actionId][tokenAddress].floor = floor;
    }

    function setExempt(address exemptAddr, bool isExempt) external onlyOwner {
        exemptList[exemptAddr] = isExempt;
    }

    function _packMessageToSA(uint64 destinationChainSelector, address saDest, address token, uint256 amount,
    bytes memory keyCipher) internal view returns (Client.EVM2AnyMessage memory message) {
        Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1);
        Client.EVMTokenAmount memory tokenAmount = Client.EVMTokenAmount({token: token, amount: amount});
        tokenAmounts[0] = tokenAmount;

        message = Client.EVM2AnyMessage({
            receiver: abi.encode(sapBridgeReceivers[destinationChainSelector]),
            data: abi.encode(saDest, keyCipher),
            tokenAmounts: tokenAmounts,
            extraArgs: "",
            feeToken: address(0)
        });
    }

    function _packMessageToEOA(address eoaDest, address token, uint256 amount) internal pure returns (Client.EVM2AnyMessage memory message) {
        Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1);
        Client.EVMTokenAmount memory tokenAmount = Client.EVMTokenAmount({token: token, amount: amount});
        tokenAmounts[0] = tokenAmount;

        message = Client.EVM2AnyMessage({
            receiver: abi.encode(eoaDest),
            data: "",
            tokenAmounts: tokenAmounts,
            extraArgs: "",
            feeToken: address(0)
        });
    }

    function _sendToSA(uint64 destinationChainSelector, address saDest, address token, uint256 amount,
    bytes memory keyCipher) internal returns (bytes32 messageId) {
        (Client.EVM2AnyMessage memory message, uint256 bridgeGas) = 
        _calcBridgeGasToSA(destinationChainSelector, saDest, token, amount, keyCipher);
        require(msg.value >= bridgeGas, "Not enough bridge gas provided");
        messageId = IRouterClient(ccipRouter).ccipSend{value: bridgeGas}(destinationChainSelector, message);
        emit MessageSent(messageId, destinationChainSelector, sapBridgeReceivers[destinationChainSelector],
        saDest, token, amount, bridgeGas);
        return messageId;
    }

    function _sendToEOA(uint64 destinationChainSelector, address eoaDest, address token, uint256 amount)
    internal returns (bytes32 messageId) {
        (Client.EVM2AnyMessage memory message, uint256 bridgeGas) = _calcBridgeGasToEOA(destinationChainSelector, eoaDest, token, amount);
        require(msg.value >= bridgeGas, "Not enough bridge gas provided");
        messageId = IRouterClient(ccipRouter).ccipSend{value: bridgeGas}(destinationChainSelector, message);
        emit MessageSent(messageId, destinationChainSelector, address(0), eoaDest, token, amount, bridgeGas);
        require(!blackList.isProhibited(eoaDest), "Receiver address prohitbited");
        return messageId;
    }

    function sendToSA(uint64 destinationChainSelector, address saDest, address token, uint256 amount,
    bytes memory keyCipher) external payable returns (bytes32 messageId) {
        uint256 fee = _calcFee(destinationChainSelector, ACTION_EOAtoSA, token, amount);
        uint256 total = amount + fee;
        require(IERC20(token).balanceOf(msg.sender) >= total, "Not enough token in sender wallet");
        SafeERC20.safeTransferFrom(IERC20(token), msg.sender, address(this), total);
        require(!blackList.isProhibited(msg.sender), "Sender address prohitbited");
        return _sendToSA(destinationChainSelector, saDest, token, amount, keyCipher);
    }

    function unpackUint256(uint256 packed) internal pure returns (uint8 a, uint64 b) {
        a = uint8(packed & 0xFF);
        b = uint64(packed >> 8);
    }

    function handle(uint256 actionId, address token, uint224 amount, bytes calldata paramData) external payable {
        require(exemptList[msg.sender], "Not from a exempted contract");
        (uint8 action, uint64 destinationChainSelector) = unpackUint256(actionId);
        if (action == ACTION_SAtoSA) {
            (address saDest, bytes memory keyCipher) = abi.decode(paramData, (address, bytes));
            _sendToSA(destinationChainSelector, saDest, token, amount, keyCipher);
        } else if (action == ACTION_SAtoEOA) {
            (address eoaDest) = abi.decode(paramData, (address));
            _sendToEOA(destinationChainSelector, eoaDest, token, amount);
        } else {
            revert NotSupported();
        }
    }
}

File 2 of 14 : IRouterClient.sol
// 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);
}

File 3 of 14 : Client.sol
// 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 14 : ConfirmedOwner.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./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)) {}
}

File 5 of 14 : ConfirmedOwnerWithProposal.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../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) {
    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,
   * pending.
   */
  function transferOwnership(address to) public override onlyOwner {
    _transferOwnership(to);
  }

  /**
   * @notice Allows an ownership transfer to be completed by the recipient.
   */
  function acceptOwnership() external override {
    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 {
    require(to != msg.sender, "Cannot transfer to self");

    s_pendingOwner = to;

    emit OwnershipTransferRequested(s_owner, to);
  }

  /**
   * @notice validate access
   */
  function _validateOwnership() internal view {
    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 14 : 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) {}
}

File 7 of 14 : IOwnable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

  function transferOwnership(address recipient) external;

  function acceptOwnership() external;
}

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

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

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

File 9 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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);
}

File 10 of 14 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

    /**
     * @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.encodeWithSelector(token.transfer.selector, 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.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));
    }

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

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

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

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

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

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

File 11 of 14 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/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);
        }
    }
}

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

interface IBlackList {
    function isProhibited(address addr) external view returns (bool);
}

File 13 of 14 : ISAPHandler.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ISAPHandler {
    function handle(uint256 actionId, address token, uint224 amount, bytes calldata paramData) external payable;
}

File 14 of 14 : Withdraw.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {OwnerIsCreator} from "@chainlink/contracts-ccip/src/v0.8/shared/access/OwnerIsCreator.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/**
 * THIS IS AN EXAMPLE CONTRACT THAT USES HARDCODED VALUES FOR CLARITY.
 * THIS IS AN EXAMPLE CONTRACT THAT USES UN-AUDITED CODE.
 * DO NOT USE THIS CODE IN PRODUCTION.
 */
contract Withdraw is OwnerIsCreator {
    error FailedToWithdrawEth(address owner, address target, uint256 value);

    function withdraw(address beneficiary) public onlyOwner {
        uint256 amount = address(this).balance;
        (bool sent, ) = beneficiary.call{value: amount}("");
        if (!sent) revert FailedToWithdrawEth(msg.sender, beneficiary, amount);
    }

    function withdrawToken(
        address beneficiary,
        address token
    ) public onlyOwner {
        uint256 amount = IERC20(token).balanceOf(address(this));
        IERC20(token).transfer(beneficiary, amount);
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"blackListAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"FailedToWithdrawEth","type":"error"},{"inputs":[],"name":"NotSupported","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"messageId","type":"bytes32"},{"indexed":true,"internalType":"uint64","name":"destinationChainSelector","type":"uint64"},{"indexed":false,"internalType":"address","name":"sapBridgeReceiver","type":"address"},{"indexed":false,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bridgeGas","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":"address","name":"token","type":"address"}],"name":"approveToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"destinationChainSelector","type":"uint64"},{"internalType":"address","name":"saDest","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"keyCipher","type":"bytes"}],"name":"calcBridgeGas","outputs":[{"internalType":"uint256","name":"bridgeGas","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"destinationChainSelector","type":"uint64"},{"internalType":"address","name":"eoaDest","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calcBridgeGasToEOA","outputs":[{"internalType":"uint256","name":"bridgeGas","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"destinationChainSelector","type":"uint64"},{"internalType":"uint256","name":"actionId","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calcFee","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"","type":"uint64"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"feeParam","outputs":[{"internalType":"uint24","name":"rate","type":"uint24"},{"internalType":"uint96","name":"cap","type":"uint96"},{"internalType":"uint96","name":"floor","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"destinationChainSelector","type":"uint64"},{"internalType":"uint256","name":"actionId","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"getFeeParam","outputs":[{"internalType":"uint24","name":"rate","type":"uint24"},{"internalType":"uint96","name":"cap","type":"uint96"},{"internalType":"uint96","name":"floor","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"actionId","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"bytes","name":"paramData","type":"bytes"}],"name":"handle","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"destinationChainSelector","type":"uint64"},{"internalType":"address","name":"saDest","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"keyCipher","type":"bytes"}],"name":"sendToSA","outputs":[{"internalType":"bytes32","name":"messageId","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"blackListAddress","type":"address"}],"name":"setBlackList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"exemptAddr","type":"address"},{"internalType":"bool","name":"isExempt","type":"bool"}],"name":"setExempt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"destinationChainSelector","type":"uint64"},{"internalType":"uint256","name":"actionId","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint24","name":"rate","type":"uint24"},{"internalType":"uint96","name":"cap","type":"uint96"},{"internalType":"uint96","name":"floor","type":"uint96"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"destinationChainSelector","type":"uint64"},{"internalType":"address","name":"sapBridgeReceiver","type":"address"}],"name":"setSapReceiver","outputs":[],"stateMutability":"nonpayable","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"}]

Deployed Bytecode

0x6080604052600436106100fe5760003560e01c80638da5cb5b11610095578063ac1a37d111610064578063ac1a37d11461027b578063b539c04f14610305578063b8ad2e931461037d578063ef6360d41461039d578063f2fde38b146103bd57600080fd5b80638da5cb5b1461020d57806396063106146102355780639fde54f514610248578063a143886c1461026857600080fd5b806372700241116100d1578063727002411461019857806379ba5097146101b857806380b2edd8146101cd5780638c3c708d146101ed57600080fd5b80633333fb34146101035780633aeac4e1146101365780633c80f74b1461015857806351cff8d914610178575b600080fd5b34801561010f57600080fd5b5061012361011e366004611702565b6103dd565b6040519081526020015b60405180910390f35b34801561014257600080fd5b50610156610151366004611748565b6103f6565b005b34801561016457600080fd5b50610123610173366004611781565b6104e6565b34801561018457600080fd5b506101566101933660046117c0565b6104fe565b3480156101a457600080fd5b506101566101b33660046117c0565b61059c565b3480156101c457600080fd5b506101566105c6565b3480156101d957600080fd5b506101566101e83660046117c0565b610670565b3480156101f957600080fd5b506101566102083660046117fb565b610710565b34801561021957600080fd5b506000546040516001600160a01b03909116815260200161012d565b610156610243366004611874565b6107ae565b34801561025457600080fd5b5061015661026336600461192c565b6108a9565b6101236102763660046119fc565b6108dc565b34801561028757600080fd5b506102da610296366004611a78565b600560209081526000938452604080852082529284528284209052825290205462ffffff8116906001600160601b0363010000008204811691600160781b90041683565b6040805162ffffff90941684526001600160601b03928316602085015291169082015260600161012d565b34801561031157600080fd5b506102da610320366004611a78565b6001600160401b0390921660009081526005602090815260408083209383529281528282206001600160a01b0390941682529290925290205462ffffff8116916001600160601b0363010000008304811692600160781b90041690565b34801561038957600080fd5b50610156610398366004611ab8565b610a9d565b3480156103a957600080fd5b506101236103b83660046119fc565b610ade565b3480156103c957600080fd5b506101566103d83660046117c0565b610af8565b60006103eb85858585610b0c565b90505b949350505050565b6103fe610c13565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610445573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104699190611ad4565b60405163a9059cbb60e01b81526001600160a01b038581166004830152602482018390529192509083169063a9059cbb906044016020604051808303816000875af11580156104bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e09190611aed565b50505050565b60006104f485858585610c68565b9695505050505050565b610506610c13565b60405147906000906001600160a01b0384169083908381818185875af1925050503d8060008114610553576040519150601f19603f3d011682016040523d82523d6000602084013e610558565b606091505b505090508061059757604051639d11f56360e01b81523360048201526001600160a01b0384166024820152604481018390526064015b60405180910390fd5b505050565b6105a4610c13565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031633146106195760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b604482015260640161058e565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610678610c13565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000bf3de8c5d3e8a2b34d2beeb17abfcebaf363a5981166004830152600019602483015282169063095ea7b3906044016020604051808303816000875af11580156106e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070c9190611aed565b5050565b610718610c13565b6001600160401b039590951660009081526005602090815260408083209683529581528582206001600160a01b03959095168252939093529290912080546001600160601b03948516600160781b026bffffffffffffffffffffffff60781b19959094166301000000026effffffffffffffffffffffffffffff1990911662ffffff909316929092179190911792909216179055565b3360009081526003602052604090205460ff1661080d5760405162461bcd60e51b815260206004820152601c60248201527f4e6f742066726f6d2061206578656d7074656420636f6e747261637400000000604482015260640161058e565b60ff8516600886901c60021982016108505760008061082e85870187611b0a565b9150915061084883838a8a6001600160e01b031685610d1a565b5050506108a0565b60028260ff1603610887576000610869848601866117c0565b9050610880828289896001600160e01b0316610e9c565b50506108a0565b604051630280e1e560e61b815260040160405180910390fd5b50505050505050565b6108b1610c13565b6001600160a01b03919091166000908152600360205260409020805460ff1916911515919091179055565b6000806108ec8760018787610b0c565b905060006108fa8286611b6f565b6040516370a0823160e01b815233600482015290915081906001600160a01b038816906370a0823190602401602060405180830381865afa158015610943573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109679190611ad4565b10156109bf5760405162461bcd60e51b815260206004820152602160248201527f4e6f7420656e6f75676820746f6b656e20696e2073656e6465722077616c6c656044820152601d60fa1b606482015260840161058e565b6109cb863330846110c2565b60025460405163041b7b2760e31b81523360048201526001600160a01b03909116906320dbd93890602401602060405180830381865afa158015610a13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a379190611aed565b15610a845760405162461bcd60e51b815260206004820152601a60248201527f53656e64657220616464726573732070726f6869746269746564000000000000604482015260640161058e565b610a918888888888610d1a565b98975050505050505050565b610aa5610c13565b6001600160401b0391909116600090815260046020526040902080546001600160a01b0319166001600160a01b03909216919091179055565b6000610aed868686868661111c565b979650505050505050565b610b00610c13565b610b09816111d1565b50565b6001600160401b038416600090815260056020908152604080832086845282528083206001600160a01b038616845290915281208054630100000090046001600160601b0316610b925760405162461bcd60e51b8152602060048201526011602482015270151bdad95b881b9bdd08185b1b1bddd959607a1b604482015260640161058e565b8054620f424090610ba89062ffffff1685611b88565b610bb29190611b9f565b81549092506001600160601b0363010000008204811691600160781b90041680841015610bea57806001600160601b03169350610c08565b816001600160601b0316841115610c0857816001600160601b031693505b505050949350505050565b6000546001600160a01b03163314610c665760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b604482015260640161058e565b565b610c70611699565b6000610c7d85858561127a565b6040516320487ded60e01b81529092506001600160a01b037f0000000000000000000000000bf3de8c5d3e8a2b34d2beeb17abfcebaf363a5916906320487ded90610cce9089908690600401611c11565b602060405180830381865afa158015610ceb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0f9190611ad4565b905094509492505050565b6000806000610d2c888888888861111c565b9150915080341015610d805760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820627269646765206761732070726f76696465640000604482015260640161058e565b6040516396f4e9f960e01b81526001600160a01b037f0000000000000000000000000bf3de8c5d3e8a2b34d2beeb17abfcebaf363a5916906396f4e9f9908390610dd0908c908790600401611c11565b60206040518083038185885af1158015610dee573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e139190611ad4565b6001600160401b0389166000818152600460209081526040918290205482516001600160a01b0391821681528c8216928101929092528a168183015260608101899052608081018590529051929550909185917f06ea52ce513cbc746bfacb0b686e05f64c9f8655be40558d18d45169960a6085919081900360a00190a3505095945050505050565b6000806000610ead87878787610c68565b9150915080341015610f015760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820627269646765206761732070726f76696465640000604482015260640161058e565b6040516396f4e9f960e01b81526001600160a01b037f0000000000000000000000000bf3de8c5d3e8a2b34d2beeb17abfcebaf363a5916906396f4e9f9908390610f51908b908790600401611c11565b60206040518083038185885af1158015610f6f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f949190611ad4565b60408051600081526001600160a01b038981166020830152881681830152606081018790526080810184905290519194506001600160401b0389169185917f06ea52ce513cbc746bfacb0b686e05f64c9f8655be40558d18d45169960a6085919081900360a00190a360025460405163041b7b2760e31b81526001600160a01b038881166004830152909116906320dbd93890602401602060405180830381865afa158015611047573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106b9190611aed565b156110b85760405162461bcd60e51b815260206004820152601c60248201527f526563656976657220616464726573732070726f686974626974656400000000604482015260640161058e565b5050949350505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526104e090859061137f565b611124611699565b60006111338787878787611454565b6040516320487ded60e01b81529092506001600160a01b037f0000000000000000000000000bf3de8c5d3e8a2b34d2beeb17abfcebaf363a5916906320487ded90611184908a908690600401611c11565b602060405180830381865afa1580156111a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c59190611ad4565b90509550959350505050565b336001600160a01b038216036112295760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640161058e565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b611282611699565b604080516001808252818301909252600091816020015b604080518082019091526000808252602082015281526020019060019003908161129957905050905060006040518060400160405280866001600160a01b0316815260200185815250905080826000815181106112f8576112f8611cea565b60209081029190910101526040805160a081019091526001600160a01b03871660c08201528060e08101604051602081830303815290604052815260200160405180602001604052806000815250815260200183815260200160006001600160a01b0316815260200160405180602001604052806000815250815250925050509392505050565b60006113d4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115869092919063ffffffff16565b90508051600014806113f55750808060200190518101906113f59190611aed565b6105975760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161058e565b61145c611699565b604080516001808252818301909252600091816020015b604080518082019091526000808252602082015281526020019060019003908161147357905050905060006040518060400160405280876001600160a01b0316815260200186815250905080826000815181106114d2576114d2611cea565b6020908102919091018101919091526040805160a0810182526001600160401b038b16600090815260049093529120546001600160a01b031660c08201528060e081016040516020818303038152906040528152602001888660405160200161153c929190611d00565b604051602081830303815290604052815260200183815260200160006001600160a01b03168152602001604051806020016040528060008152508152509250505095945050505050565b60606103ee848460008585600080866001600160a01b031685876040516115ad9190611d24565b60006040518083038185875af1925050503d80600081146115ea576040519150601f19603f3d011682016040523d82523d6000602084013e6115ef565b606091505b5091509150610aed878383876060831561166a578251600003611663576001600160a01b0385163b6116635760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161058e565b50816103ee565b6103ee838381511561167f5781518083602001fd5b8060405162461bcd60e51b815260040161058e9190611d40565b6040518060a0016040528060608152602001606081526020016060815260200160006001600160a01b03168152602001606081525090565b80356001600160401b03811681146116e857600080fd5b919050565b6001600160a01b0381168114610b0957600080fd5b6000806000806080858703121561171857600080fd5b611721856116d1565b9350602085013592506040850135611738816116ed565b9396929550929360600135925050565b6000806040838503121561175b57600080fd5b8235611766816116ed565b91506020830135611776816116ed565b809150509250929050565b6000806000806080858703121561179757600080fd5b6117a0856116d1565b935060208501356117b0816116ed565b92506040850135611738816116ed565b6000602082840312156117d257600080fd5b81356117dd816116ed565b9392505050565b80356001600160601b03811681146116e857600080fd5b60008060008060008060c0878903121561181457600080fd5b61181d876116d1565b9550602087013594506040870135611834816116ed565b9350606087013562ffffff8116811461184c57600080fd5b925061185a608088016117e4565b915061186860a088016117e4565b90509295509295509295565b60008060008060006080868803121561188c57600080fd5b85359450602086013561189e816116ed565b935060408601356001600160e01b03811681146118ba57600080fd5b925060608601356001600160401b03808211156118d657600080fd5b818801915088601f8301126118ea57600080fd5b8135818111156118f957600080fd5b89602082850101111561190b57600080fd5b9699959850939650602001949392505050565b8015158114610b0957600080fd5b6000806040838503121561193f57600080fd5b823561194a816116ed565b915060208301356117768161191e565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261198157600080fd5b81356001600160401b038082111561199b5761199b61195a565b604051601f8301601f19908116603f011681019082821181831017156119c3576119c361195a565b816040528381528660208588010111156119dc57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a08688031215611a1457600080fd5b611a1d866116d1565b94506020860135611a2d816116ed565b93506040860135611a3d816116ed565b92506060860135915060808601356001600160401b03811115611a5f57600080fd5b611a6b88828901611970565b9150509295509295909350565b600080600060608486031215611a8d57600080fd5b611a96846116d1565b9250602084013591506040840135611aad816116ed565b809150509250925092565b60008060408385031215611acb57600080fd5b611766836116d1565b600060208284031215611ae657600080fd5b5051919050565b600060208284031215611aff57600080fd5b81516117dd8161191e565b60008060408385031215611b1d57600080fd5b8235611b28816116ed565b915060208301356001600160401b03811115611b4357600080fd5b611b4f85828601611970565b9150509250929050565b634e487b7160e01b600052601160045260246000fd5b80820180821115611b8257611b82611b59565b92915050565b8082028115828204841417611b8257611b82611b59565b600082611bbc57634e487b7160e01b600052601260045260246000fd5b500490565b60005b83811015611bdc578181015183820152602001611bc4565b50506000910152565b60008151808452611bfd816020860160208601611bc1565b601f01601f19169290920160200192915050565b600060406001600160401b038516835260208181850152845160a083860152611c3d60e0860182611be5565b905081860151603f1980878403016060880152611c5a8383611be5565b88860151888203830160808a01528051808352908601945060009350908501905b80841015611cad57845180516001600160a01b0316835286015186830152938501936001939093019290860190611c7b565b5060608901516001600160a01b031660a08901526080890151888203830160c08a01529550611cdc8187611be5565b9a9950505050505050505050565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03831681526040602082018190526000906103ee90830184611be5565b60008251611d36818460208701611bc1565b9190910192915050565b6020815260006117dd6020830184611be556fea2646970667358221220830e32ef7debe02c873b2ac634d2a78d229b6bf41236617a92b4af348063808d64736f6c63430008130033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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