Sepolia Testnet

Contract

0x9eA18De905e654F9FB98498109C60EdFE133C145

Overview

ETH Balance

4.487477584298493039 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Send To SA73344312024-12-22 22:45:3692 days ago1734907536IN
0x9eA18De9...FE133C145
0.00015333 ETH0.00020451.51775153
Send To SA73344312024-12-22 22:45:3692 days ago1734907536IN
0x9eA18De9...FE133C145
0.00015359 ETH0.000204521.51775153
Send To SA73344292024-12-22 22:45:1292 days ago1734907512IN
0x9eA18De9...FE133C145
0.00015231 ETH0.000204421.51707461
Send To SA73344292024-12-22 22:45:1292 days ago1734907512IN
0x9eA18De9...FE133C145
0.00016177 ETH0.000204411.51707461
Send To SA73115082024-12-19 13:36:1296 days ago1734615372IN
0x9eA18De9...FE133C145
0.00028151 ETH0.0177638757.45126043
Send To SA73100772024-12-19 8:33:4896 days ago1734597228IN
0x9eA18De9...FE133C145
0.00016713 ETH0.0053301517.23725045
Send To SA73097042024-12-19 7:15:0096 days ago1734592500IN
0x9eA18De9...FE133C145
0.00015236 ETH0.0042329913.69019166
Send To SA73092132024-12-19 5:32:2496 days ago1734586344IN
0x9eA18De9...FE133C145
0.00015893 ETH0.002253917.28951594
Send To SA73088872024-12-19 4:22:1296 days ago1734582132IN
0x9eA18De9...FE133C145
0.00015876 ETH0.0047908615.49503157
Send To SA73088762024-12-19 4:20:0096 days ago1734582000IN
0x9eA18De9...FE133C145
0.00015876 ETH0.0038307712.39030085
Send To SA73084762024-12-19 2:53:1296 days ago1734576792IN
0x9eA18De9...FE133C145
0.00014889 ETH0.001066343.39318915
Send To SA73077712024-12-19 0:22:1296 days ago1734567732IN
0x9eA18De9...FE133C145
0.00015287 ETH0.001658225.27680825
Send To SA73046872024-12-18 13:26:3697 days ago1734528396IN
0x9eA18De9...FE133C145
0.00020246 ETH0.06343363205.15472379
Send To SA73042242024-12-18 11:48:1297 days ago1734522492IN
0x9eA18De9...FE133C145
0.00017137 ETH0.0139939345.26043833
Send To SA73042192024-12-18 11:47:1297 days ago1734522432IN
0x9eA18De9...FE133C145
0.00017137 ETH0.0137424544.44362623
Send To SA73041462024-12-18 11:31:2497 days ago1734521484IN
0x9eA18De9...FE133C145
0.00017137 ETH0.0164131953.0912043
Send To SA73034152024-12-18 8:56:4897 days ago1734512208IN
0x9eA18De9...FE133C145
0.00015901 ETH0.0086038427.82516376
Send To SA73008352024-12-17 23:49:4897 days ago1734479388IN
0x9eA18De9...FE133C145
0.00015351 ETH0.0036013811.45992901
Send To SA73001162024-12-17 21:20:0097 days ago1734470400IN
0x9eA18De9...FE133C145
0.00015934 ETH0.001196673.80808584
Send To SA72977592024-12-17 13:01:2498 days ago1734440484IN
0x9eA18De9...FE133C145
0.00019757 ETH0.0194235262.81396038
Send To SA72977122024-12-17 12:50:4898 days ago1734439848IN
0x9eA18De9...FE133C145
0.00019757 ETH0.0165365753.47783817
Send To SA72966072024-12-17 8:57:3698 days ago1734425856IN
0x9eA18De9...FE133C145
0.00018181 ETH0.0194509862.91252997
Send To SA72965372024-12-17 8:43:1298 days ago1734424992IN
0x9eA18De9...FE133C145
0.00018181 ETH0.0231956675.0243858
Send To SA72938902024-12-16 23:22:2498 days ago1734391344IN
0x9eA18De9...FE133C145
0.00015432 ETH0.001313384.17977153
Send To SA72916332024-12-16 15:26:0099 days ago1734362760IN
0x9eA18De9...FE133C145
0.0001865 ETH0.0106398934.38092655
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Ccip Send73115082024-12-19 13:36:1296 days ago1734615372
0x9eA18De9...FE133C145
0.00028151 ETH
Ccip Send73100772024-12-19 8:33:4896 days ago1734597228
0x9eA18De9...FE133C145
0.00016713 ETH
Ccip Send73097042024-12-19 7:15:0096 days ago1734592500
0x9eA18De9...FE133C145
0.00015236 ETH
Ccip Send73092132024-12-19 5:32:2496 days ago1734586344
0x9eA18De9...FE133C145
0.00015893 ETH
Ccip Send73088872024-12-19 4:22:1296 days ago1734582132
0x9eA18De9...FE133C145
0.00015876 ETH
Ccip Send73088762024-12-19 4:20:0096 days ago1734582000
0x9eA18De9...FE133C145
0.00015876 ETH
Ccip Send73084762024-12-19 2:53:1296 days ago1734576792
0x9eA18De9...FE133C145
0.00014889 ETH
Ccip Send73077712024-12-19 0:22:1296 days ago1734567732
0x9eA18De9...FE133C145
0.00015287 ETH
Ccip Send73046872024-12-18 13:26:3697 days ago1734528396
0x9eA18De9...FE133C145
0.00020246 ETH
Ccip Send73042242024-12-18 11:48:1297 days ago1734522492
0x9eA18De9...FE133C145
0.00017137 ETH
Ccip Send73042192024-12-18 11:47:1297 days ago1734522432
0x9eA18De9...FE133C145
0.00017137 ETH
Ccip Send73041462024-12-18 11:31:2497 days ago1734521484
0x9eA18De9...FE133C145
0.00017137 ETH
Ccip Send73034152024-12-18 8:56:4897 days ago1734512208
0x9eA18De9...FE133C145
0.00015901 ETH
Ccip Send73008352024-12-17 23:49:4897 days ago1734479388
0x9eA18De9...FE133C145
0.00015351 ETH
Ccip Send73001162024-12-17 21:20:0097 days ago1734470400
0x9eA18De9...FE133C145
0.00015934 ETH
Ccip Send72977592024-12-17 13:01:2498 days ago1734440484
0x9eA18De9...FE133C145
0.00019757 ETH
Ccip Send72977122024-12-17 12:50:4898 days ago1734439848
0x9eA18De9...FE133C145
0.00019757 ETH
Ccip Send72966072024-12-17 8:57:3698 days ago1734425856
0x9eA18De9...FE133C145
0.00018181 ETH
Ccip Send72965372024-12-17 8:43:1298 days ago1734424992
0x9eA18De9...FE133C145
0.00018181 ETH
Ccip Send72938902024-12-16 23:22:2498 days ago1734391344
0x9eA18De9...FE133C145
0.00015432 ETH
Ccip Send72916332024-12-16 15:26:0099 days ago1734362760
0x9eA18De9...FE133C145
0.0001865 ETH
Ccip Send72902872024-12-16 10:43:1299 days ago1734345792
0x9eA18De9...FE133C145
0.00018085 ETH
Ccip Send72896912024-12-16 8:35:3699 days ago1734338136
0x9eA18De9...FE133C145
0.00018418 ETH
Ccip Send72895182024-12-16 7:58:1299 days ago1734335892
0x9eA18De9...FE133C145
0.00018418 ETH
Ccip Send72891302024-12-16 6:37:0099 days ago1734331020
0x9eA18De9...FE133C145
0.00017086 ETH
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xf0563c34...3ad2a2237
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 SAMessageSent(
        bytes32 indexed messageId,
        uint64 indexed destinationChainSelector,
        address sapBridgeReceiver,
        address destination,
        address token,
        uint256 amount,
        uint256 bridgeGas,
        bytes ciphertext
    );

    event NormalAddressMessageSent(
        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 SAMessageSent(messageId, destinationChainSelector, sapBridgeReceivers[destinationChainSelector],
        saDest, token, amount, bridgeGas, keyCipher);
        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 NormalAddressMessageSent(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, uint216 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, uint216 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

API
[{"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":"NormalAddressMessageSent","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"},{"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"},{"indexed":false,"internalType":"bytes","name":"ciphertext","type":"bytes"}],"name":"SAMessageSent","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":"uint216","name":"amount","type":"uint216"},{"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

0x6080604052600436106100fe5760003560e01c80638c3c708d11610095578063ac1a37d111610064578063ac1a37d11461027b578063b539c04f14610305578063b8ad2e931461037d578063ef6360d41461039d578063f2fde38b146103bd57600080fd5b80638c3c708d146102005780638da5cb5b146102205780639fde54f514610248578063a143886c1461026857600080fd5b806351cff8d9116100d157806351cff8d91461018b57806372700241146101ab57806379ba5097146101cb57806380b2edd8146101e057600080fd5b8063079a8452146101035780633333fb34146101185780633aeac4e11461014b5780633c80f74b1461016b575b600080fd5b6101166101113660046116d3565b6103dd565b005b34801561012457600080fd5b50610138610133366004611799565b6104dd565b6040519081526020015b60405180910390f35b34801561015757600080fd5b506101166101663660046117df565b6104f6565b34801561017757600080fd5b50610138610186366004611818565b6105e6565b34801561019757600080fd5b506101166101a6366004611857565b6105fe565b3480156101b757600080fd5b506101166101c6366004611857565b610697565b3480156101d757600080fd5b506101166106c1565b3480156101ec57600080fd5b506101166101fb366004611857565b61076b565b34801561020c57600080fd5b5061011661021b366004611892565b61080b565b34801561022c57600080fd5b506000546040516001600160a01b039091168152602001610142565b34801561025457600080fd5b50610116610263366004611919565b6108a9565b6101386102763660046119e9565b6108dc565b34801561028757600080fd5b506102da610296366004611a65565b600560209081526000938452604080852082529284528284209052825290205462ffffff8116906001600160601b0363010000008204811691600160781b90041683565b6040805162ffffff90941684526001600160601b039283166020850152911690820152606001610142565b34801561031157600080fd5b506102da610320366004611a65565b6001600160401b0390921660009081526005602090815260408083209383529281528282206001600160a01b0390941682529290925290205462ffffff8116916001600160601b0363010000008304811692600160781b90041690565b34801561038957600080fd5b50610116610398366004611aa5565b610a9d565b3480156103a957600080fd5b506101386103b83660046119e9565b610ade565b3480156103c957600080fd5b506101166103d8366004611857565b610af8565b3360009081526003602052604090205460ff166104415760405162461bcd60e51b815260206004820152601c60248201527f4e6f742066726f6d2061206578656d7074656420636f6e74726163740000000060448201526064015b60405180910390fd5b60ff8516600886901c60021982016104845760008061046285870187611ac1565b9150915061047c83838a8a6001600160d81b031685610b0c565b5050506104d4565b60028260ff16036104bb57600061049d84860186611857565b90506104b4828289896001600160d81b0316610c7b565b50506104d4565b604051630280e1e560e61b815260040160405180910390fd5b50505050505050565b60006104eb85858585610ea1565b90505b949350505050565b6104fe610fa8565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610545573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105699190611b10565b60405163a9059cbb60e01b81526001600160a01b038581166004830152602482018390529192509083169063a9059cbb906044016020604051808303816000875af11580156105bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e09190611b29565b50505050565b60006105f485858585610ffd565b9695505050505050565b610606610fa8565b60405147906000906001600160a01b0384169083908381818185875af1925050503d8060008114610653576040519150601f19603f3d011682016040523d82523d6000602084013e610658565b606091505b505090508061069257604051639d11f56360e01b81523360048201526001600160a01b038416602482015260448101839052606401610438565b505050565b61069f610fa8565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031633146107145760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b6044820152606401610438565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610773610fa8565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000bf3de8c5d3e8a2b34d2beeb17abfcebaf363a5981166004830152600019602483015282169063095ea7b3906044016020604051808303816000875af11580156107e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108079190611b29565b5050565b610813610fa8565b6001600160401b039590951660009081526005602090815260408083209683529581528582206001600160a01b03959095168252939093529290912080546001600160601b03948516600160781b026bffffffffffffffffffffffff60781b19959094166301000000026effffffffffffffffffffffffffffff1990911662ffffff909316929092179190911792909216179055565b6108b1610fa8565b6001600160a01b03919091166000908152600360205260409020805460ff1916911515919091179055565b6000806108ec8760018787610ea1565b905060006108fa8286611b5c565b6040516370a0823160e01b815233600482015290915081906001600160a01b038816906370a0823190602401602060405180830381865afa158015610943573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109679190611b10565b10156109bf5760405162461bcd60e51b815260206004820152602160248201527f4e6f7420656e6f75676820746f6b656e20696e2073656e6465722077616c6c656044820152601d60fa1b6064820152608401610438565b6109cb863330846110af565b60025460405163041b7b2760e31b81523360048201526001600160a01b03909116906320dbd93890602401602060405180830381865afa158015610a13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a379190611b29565b15610a845760405162461bcd60e51b815260206004820152601a60248201527f53656e64657220616464726573732070726f68697462697465640000000000006044820152606401610438565b610a918888888888610b0c565b98975050505050505050565b610aa5610fa8565b6001600160401b0391909116600090815260046020526040902080546001600160a01b0319166001600160a01b03909216919091179055565b6000610aed8686868686611109565b979650505050505050565b610b00610fa8565b610b09816111be565b50565b6000806000610b1e8888888888611109565b9150915080341015610b725760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820627269646765206761732070726f766964656400006044820152606401610438565b6040516396f4e9f960e01b81526001600160a01b037f0000000000000000000000000bf3de8c5d3e8a2b34d2beeb17abfcebaf363a5916906396f4e9f9908390610bc2908c908790600401611bc5565b60206040518083038185885af1158015610be0573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c059190611b10565b6001600160401b03891660008181526004602052604090819020549051929550909185917f33a5e8b29e1d4467f19ea2f25a8582f30f8cfad53c4d50d500af63142faba89091610c68916001600160a01b0316908c908c908c9089908d90611c9e565b60405180910390a3505095945050505050565b6000806000610c8c87878787610ffd565b9150915080341015610ce05760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820627269646765206761732070726f766964656400006044820152606401610438565b6040516396f4e9f960e01b81526001600160a01b037f0000000000000000000000000bf3de8c5d3e8a2b34d2beeb17abfcebaf363a5916906396f4e9f9908390610d30908b908790600401611bc5565b60206040518083038185885af1158015610d4e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d739190611b10565b60408051600081526001600160a01b038981166020830152881681830152606081018790526080810184905290519194506001600160401b0389169185917f8ecb75091686203a6844d5ec2b444d1c0bacdd1ebbc9afc0d7e947d872d03051919081900360a00190a360025460405163041b7b2760e31b81526001600160a01b038881166004830152909116906320dbd93890602401602060405180830381865afa158015610e26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4a9190611b29565b15610e975760405162461bcd60e51b815260206004820152601c60248201527f526563656976657220616464726573732070726f6869746269746564000000006044820152606401610438565b5050949350505050565b6001600160401b038416600090815260056020908152604080832086845282528083206001600160a01b038616845290915281208054630100000090046001600160601b0316610f275760405162461bcd60e51b8152602060048201526011602482015270151bdad95b881b9bdd08185b1b1bddd959607a1b6044820152606401610438565b8054620f424090610f3d9062ffffff1685611ce0565b610f479190611cf7565b81549092506001600160601b0363010000008204811691600160781b90041680841015610f7f57806001600160601b03169350610f9d565b816001600160601b0316841115610f9d57816001600160601b031693505b505050949350505050565b6000546001600160a01b03163314610ffb5760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b6044820152606401610438565b565b611005611686565b6000611012858585611267565b6040516320487ded60e01b81529092506001600160a01b037f0000000000000000000000000bf3de8c5d3e8a2b34d2beeb17abfcebaf363a5916906320487ded906110639089908690600401611bc5565b602060405180830381865afa158015611080573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a49190611b10565b905094509492505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526105e090859061136c565b611111611686565b60006111208787878787611441565b6040516320487ded60e01b81529092506001600160a01b037f0000000000000000000000000bf3de8c5d3e8a2b34d2beeb17abfcebaf363a5916906320487ded90611171908a908690600401611bc5565b602060405180830381865afa15801561118e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b29190611b10565b90509550959350505050565b336001600160a01b038216036112165760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c660000000000000000006044820152606401610438565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b61126f611686565b604080516001808252818301909252600091816020015b604080518082019091526000808252602082015281526020019060019003908161128657905050905060006040518060400160405280866001600160a01b0316815260200185815250905080826000815181106112e5576112e5611d19565b60209081029190910101526040805160a081019091526001600160a01b03871660c08201528060e08101604051602081830303815290604052815260200160405180602001604052806000815250815260200183815260200160006001600160a01b0316815260200160405180602001604052806000815250815250925050509392505050565b60006113c1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115739092919063ffffffff16565b90508051600014806113e25750808060200190518101906113e29190611b29565b6106925760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610438565b611449611686565b604080516001808252818301909252600091816020015b604080518082019091526000808252602082015281526020019060019003908161146057905050905060006040518060400160405280876001600160a01b0316815260200186815250905080826000815181106114bf576114bf611d19565b6020908102919091018101919091526040805160a0810182526001600160401b038b16600090815260049093529120546001600160a01b031660c08201528060e0810160405160208183030381529060405281526020018886604051602001611529929190611d2f565b604051602081830303815290604052815260200183815260200160006001600160a01b03168152602001604051806020016040528060008152508152509250505095945050505050565b60606104ee848460008585600080866001600160a01b0316858760405161159a9190611d53565b60006040518083038185875af1925050503d80600081146115d7576040519150601f19603f3d011682016040523d82523d6000602084013e6115dc565b606091505b5091509150610aed8783838760608315611657578251600003611650576001600160a01b0385163b6116505760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610438565b50816104ee565b6104ee838381511561166c5781518083602001fd5b8060405162461bcd60e51b81526004016104389190611d6f565b6040518060a0016040528060608152602001606081526020016060815260200160006001600160a01b03168152602001606081525090565b6001600160a01b0381168114610b0957600080fd5b6000806000806000608086880312156116eb57600080fd5b8535945060208601356116fd816116be565b935060408601356001600160d81b038116811461171957600080fd5b925060608601356001600160401b038082111561173557600080fd5b818801915088601f83011261174957600080fd5b81358181111561175857600080fd5b89602082850101111561176a57600080fd5b9699959850939650602001949392505050565b80356001600160401b038116811461179457600080fd5b919050565b600080600080608085870312156117af57600080fd5b6117b88561177d565b93506020850135925060408501356117cf816116be565b9396929550929360600135925050565b600080604083850312156117f257600080fd5b82356117fd816116be565b9150602083013561180d816116be565b809150509250929050565b6000806000806080858703121561182e57600080fd5b6118378561177d565b93506020850135611847816116be565b925060408501356117cf816116be565b60006020828403121561186957600080fd5b8135611874816116be565b9392505050565b80356001600160601b038116811461179457600080fd5b60008060008060008060c087890312156118ab57600080fd5b6118b48761177d565b95506020870135945060408701356118cb816116be565b9350606087013562ffffff811681146118e357600080fd5b92506118f16080880161187b565b91506118ff60a0880161187b565b90509295509295509295565b8015158114610b0957600080fd5b6000806040838503121561192c57600080fd5b8235611937816116be565b9150602083013561180d8161190b565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261196e57600080fd5b81356001600160401b038082111561198857611988611947565b604051601f8301601f19908116603f011681019082821181831017156119b0576119b0611947565b816040528381528660208588010111156119c957600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a08688031215611a0157600080fd5b611a0a8661177d565b94506020860135611a1a816116be565b93506040860135611a2a816116be565b92506060860135915060808601356001600160401b03811115611a4c57600080fd5b611a588882890161195d565b9150509295509295909350565b600080600060608486031215611a7a57600080fd5b611a838461177d565b9250602084013591506040840135611a9a816116be565b809150509250925092565b60008060408385031215611ab857600080fd5b6117fd8361177d565b60008060408385031215611ad457600080fd5b8235611adf816116be565b915060208301356001600160401b03811115611afa57600080fd5b611b068582860161195d565b9150509250929050565b600060208284031215611b2257600080fd5b5051919050565b600060208284031215611b3b57600080fd5b81516118748161190b565b634e487b7160e01b600052601160045260246000fd5b80820180821115611b6f57611b6f611b46565b92915050565b60005b83811015611b90578181015183820152602001611b78565b50506000910152565b60008151808452611bb1816020860160208601611b75565b601f01601f19169290920160200192915050565b600060406001600160401b038516835260208181850152845160a083860152611bf160e0860182611b99565b905081860151603f1980878403016060880152611c0e8383611b99565b88860151888203830160808a01528051808352908601945060009350908501905b80841015611c6157845180516001600160a01b0316835286015186830152938501936001939093019290860190611c2f565b5060608901516001600160a01b031660a08901526080890151888203830160c08a01529550611c908187611b99565b9a9950505050505050505050565b6001600160a01b038781168252868116602083015285166040820152606081018490526080810183905260c060a08201819052600090610a9190830184611b99565b8082028115828204841417611b6f57611b6f611b46565b600082611d1457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03831681526040602082018190526000906104ee90830184611b99565b60008251611d65818460208701611b75565b9190910192915050565b6020815260006118746020830184611b9956fea2646970667358221220723f3da233247c67f6a1fcc9dfecf79d9f4589fd511f0ec1a800318ee5fddc7e64736f6c63430008130033

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
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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