Mumbai Testnet

Contract

0xD688B04e2238b3F40DB74996Fd6127Cb41966b0E

Overview

MATIC Balance

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
Transfer EO Ato ...481231442024-04-11 11:22:3398 days ago1712834553IN
0xD688B04e...b41966b0E
0.01 MATIC0.000204342.82270001
Transfer EO Ato ...481231282024-04-11 11:21:5998 days ago1712834519IN
0xD688B04e...b41966b0E
0.01 MATIC0.000351054.85
Transfer EO Ato ...481230242024-04-11 11:18:1998 days ago1712834299IN
0xD688B04e...b41966b0E
0.001 MATIC0.0020434628.22700001
Transfer EO Ato ...481133762024-04-11 5:35:2199 days ago1712813721IN
0xD688B04e...b41966b0E
0.01 MATIC0.000434146
Transfer EO Ato ...480926852024-04-10 16:59:0699 days ago1712768346IN
0xD688B04e...b41966b0E
0.01 MATIC0.000434296
Transfer EO Ato ...480682082024-04-10 2:08:20100 days ago1712714900IN
0xD688B04e...b41966b0E
0.1 MATIC0.000408485.6454
Transfer EO Ato ...480584962024-04-09 20:23:03100 days ago1712694183IN
0xD688B04e...b41966b0E
0.01 MATIC0.000350994.85
Transfer EO Ato ...480478212024-04-09 13:51:51100 days ago1712670711IN
0xD688B04e...b41966b0E
0.5 MATIC0.000449416.20994
Transfer EO Ato ...480456502024-04-09 12:27:27100 days ago1712665647IN
0xD688B04e...b41966b0E
0.01 MATIC0.000330364.563365
Transfer EO Ato ...480456362024-04-09 12:26:51100 days ago1712665611IN
0xD688B04e...b41966b0E
0.01 MATIC0.000350934.85
Transfer EO Ato ...480251852024-04-08 23:56:36101 days ago1712620596IN
0xD688B04e...b41966b0E
0 MATIC0.000445214.563365
Transfer EO Ato ...480251512024-04-08 23:54:50101 days ago1712620490IN
0xD688B04e...b41966b0E
0.01 MATIC0.000330364.563365
Transfer EO Ato ...480119322024-04-08 15:48:41101 days ago1712591321IN
0xD688B04e...b41966b0E
0.01 MATIC0.000361915
Transfer EO Ato ...480091782024-04-08 14:10:30101 days ago1712585430IN
0xD688B04e...b41966b0E
0.00105288 MATIC0.0021070129.10000006
Transfer S Ato S...480003792024-04-08 8:20:31102 days ago1712564431IN
0xD688B04e...b41966b0E
0 MATIC0.000172332
Transfer EO Ato ...479997722024-04-08 7:59:01102 days ago1712563141IN
0xD688B04e...b41966b0E
0.001 MATIC0.000108571.50000001
Transfer EO Ato ...479791582024-04-07 18:48:24102 days ago1712515704IN
0xD688B04e...b41966b0E
0.02 MATIC0.000361915
Transfer EO Ato ...479781162024-04-07 18:11:14102 days ago1712513474IN
0xD688B04e...b41966b0E
0.0002 MATIC0.000108551.50000001
Transfer EO Ato ...479437992024-04-06 20:01:48103 days ago1712433708IN
0xD688B04e...b41966b0E
0.0001 MATIC0.000631898.73
Transfer EO Ato ...479437872024-04-06 20:01:14103 days ago1712433674IN
0xD688B04e...b41966b0E
0.001 MATIC0.000505596.984
Transfer EO Ato ...479437762024-04-06 20:00:30103 days ago1712433630IN
0xD688B04e...b41966b0E
0.001 MATIC0.000606718.3808
Transfer EO Ato ...479437492024-04-06 19:59:30103 days ago1712433570IN
0xD688B04e...b41966b0E
0.0001 MATIC0.000350764.85
Transfer EO Ato ...479437112024-04-06 19:57:36103 days ago1712433456IN
0xD688B04e...b41966b0E
0.001 MATIC0.000343974.753
Transfer EO Ato ...479437012024-04-06 19:56:56103 days ago1712433416IN
0xD688B04e...b41966b0E
0.001 MATIC0.000108571.50000001
Transfer EO Ato ...479436922024-04-06 19:56:24103 days ago1712433384IN
0xD688B04e...b41966b0E
0.001 MATIC0.00042145.82
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To Value
469622792024-03-12 13:52:42128 days ago1710251562
0xD688B04e...b41966b0E
0.0001 MATIC
469461762024-03-12 3:21:14129 days ago1710213674
0xD688B04e...b41966b0E
0.00488114 MATIC
468936162024-03-10 17:41:26130 days ago1710092486
0xD688B04e...b41966b0E
0.001 MATIC
468933042024-03-10 17:28:14130 days ago1710091694
0xD688B04e...b41966b0E
0.000181 MATIC
468931682024-03-10 17:22:54130 days ago1710091374
0xD688B04e...b41966b0E
0.000381 MATIC
467206472024-03-06 8:01:13135 days ago1709712073
0xD688B04e...b41966b0E
0.07 MATIC
467184842024-03-06 6:44:01135 days ago1709707441
0xD688B04e...b41966b0E
0.00088114 MATIC
466959852024-03-05 17:06:39135 days ago1709658399
0xD688B04e...b41966b0E
0.001 MATIC
466927792024-03-05 15:13:05135 days ago1709651585
0xD688B04e...b41966b0E
0.19972615 MATIC
466927542024-03-05 15:12:13135 days ago1709651533
0xD688B04e...b41966b0E
0.20972624 MATIC
466925462024-03-05 15:04:51135 days ago1709651091
0xD688B04e...b41966b0E
0.09988117 MATIC
466925072024-03-05 15:03:27135 days ago1709651007
0xD688B04e...b41966b0E
0.09969016 MATIC
466903182024-03-05 13:45:54135 days ago1709646354
0xD688B04e...b41966b0E
0.03 MATIC
466902862024-03-05 13:44:46135 days ago1709646286
0xD688B04e...b41966b0E
0.03 MATIC
466902502024-03-05 13:43:30135 days ago1709646210
0xD688B04e...b41966b0E
0.03 MATIC
466902002024-03-05 13:41:44135 days ago1709646104
0xD688B04e...b41966b0E
0.03 MATIC
466901612024-03-05 13:40:22135 days ago1709646022
0xD688B04e...b41966b0E
0.05 MATIC
466900912024-03-05 13:37:52135 days ago1709645872
0xD688B04e...b41966b0E
0.05 MATIC
466854072024-03-05 10:51:56135 days ago1709635916
0xD688B04e...b41966b0E
0.00988117 MATIC
466824642024-03-05 9:07:44135 days ago1709629664
0xD688B04e...b41966b0E
0.07 MATIC
466820422024-03-05 8:52:46135 days ago1709628766
0xD688B04e...b41966b0E
0.0835 MATIC
466811852024-03-05 8:22:26136 days ago1709626946
0xD688B04e...b41966b0E
0.07 MATIC
466787302024-03-05 6:55:28136 days ago1709621728
0xD688B04e...b41966b0E
0.07 MATIC
466719042024-03-05 2:42:32136 days ago1709606552
0xD688B04e...b41966b0E
0.22988114 MATIC
466718302024-03-05 2:39:54136 days ago1709606394
0xD688B04e...b41966b0E
0.19988114 MATIC
View All Internal Transactions
Loading...
Loading

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

Contract Name:
SAClientERC20

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 13 : SAClientERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./utils/ISAPHandler.sol";
import "./utils/IBlackList.sol";

contract SAClientERC20 is Ownable {
    event SATransaction(address indexed saDest, uint224 amount, address indexed token, bytes ciphertext);
    event NormalAddressTransaction(address indexed saSrc, uint224 amount, address indexed token);
    error FailedToWithdrawEth(address target, uint256 value);

    struct Account {
        uint32 nonce;
        uint224 balance;
    }

    struct FeeParameter {
        uint24 rate; // 1feeRate = 1/1,000,000
        uint96 cap;
        uint96 floor;
    }

    address payable public feeReceiver;
    IBlackList blackList;
    mapping(address => mapping(uint256 => mapping(address => FeeParameter))) public feeParam; // feeParam[contractAddress][actionId][tokenAddress] = FeeParameter
    mapping(address => mapping(address => uint256)) public beneficiaryBalance; // balance for transaction fee and relayer, beneficiaryBalance[roleWallet][tokenAddress] = amount
    mapping(address => mapping(address => Account)) public saAccount; // saAccount[sa][token] = Account
    mapping(address => bool) internal exemptList; // Address list of fee exemption
    
    address internal constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
    address internal constant THIS_CONTRACT = 0x0000000000000000000000000000000000000001;
    uint256 internal constant ACTION_EOAtoSA = 1;
    uint256 internal constant ACTION_SAtoEOA = 2;
    uint256 internal constant ACTION_SAtoSA = 3;

    constructor(address blackListAddress) {
        feeReceiver = payable(msg.sender);
        blackList = IBlackList(blackListAddress);
    }

    function setFee(address contractAddress, uint256 actionId, address tokenAddress, uint24 rate, uint96 cap, uint96 floor) external onlyOwner {
        _setFee(contractAddress, actionId, tokenAddress, rate, cap, floor);
    }

    function _setFee(address contractAddress, uint256 actionId, address tokenAddress, uint24 rate, uint96 cap, uint96 floor) internal {
        feeParam[contractAddress][actionId][tokenAddress].rate = rate;
        feeParam[contractAddress][actionId][tokenAddress].cap = cap;
        feeParam[contractAddress][actionId][tokenAddress].floor = floor;
    }

    function setFeeReceiver(address payable receiver) external onlyOwner {
        feeReceiver = receiver;
    }

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

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

    function collectFee(address token) external {
        _collectFee(token);
    }

    function _collectFee(address token) internal {
        uint256 balance = beneficiaryBalance[msg.sender][token];
        if (balance > 0) {
            if (token == NATIVE_TOKEN) {
                (bool sent, ) = msg.sender.call{value: balance}("");
                if (!sent) revert FailedToWithdrawEth(msg.sender, balance);
            } else {
                SafeERC20.safeTransfer(IERC20(token), msg.sender, balance);
            }
            beneficiaryBalance[msg.sender][token] = 0;
        }
    }

    function collectFeeBatch(address[] calldata tokens) external {
        for (uint256 i = 0; i < tokens.length; i++) {
            address token = tokens[i];
            _collectFee(token);
        }
    }

    function _calcFee(address contractAddress, uint256 actionId, address tokenAddress, uint224 amount) internal view returns (uint224 fee) {
        FeeParameter storage fParam = feeParam[contractAddress][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(address contractAddress, uint256 actionId, address tokenAddress, uint224 amount) external view returns (uint224 fee) {
        return _calcFee(contractAddress, actionId, tokenAddress, amount);
    }
    
    function transferEOAtoSA(address saDest, address token, uint224 amount, bytes calldata keyCipher) external payable {
        _transferEOAtoSA(saDest, token, amount);
        emit SATransaction(saDest, amount, token, keyCipher);
    }

    function transferEOAtoExistingSA(address saDest, address token, uint224 amount) external payable {
        _transferEOAtoSA(saDest, token, amount);
        emit SATransaction(saDest, amount, token, bytes(""));
    }

    function _transferEOAtoSA(address saDest, address token, uint224 amount) internal {
        uint224 fee = _calcFee(THIS_CONTRACT, ACTION_EOAtoSA, token, amount);
        uint224 total = amount + fee;
        if (token == NATIVE_TOKEN) {
            // Sending native token
            require(msg.value >= total, "Not enough token sended to SA");
            uint256 restAmount = msg.value - uint256(amount);
            if (restAmount > 0) beneficiaryBalance[feeReceiver][token] += restAmount;
        } else {
            // Sending contract token
            require(IERC20(token).balanceOf(msg.sender) >= total, "Not enough token in wallet");
            SafeERC20.safeTransferFrom(IERC20(token), msg.sender, address(this), total);
            if (fee > 0) beneficiaryBalance[feeReceiver][token] += fee;
        }
        saAccount[saDest][token].nonce += 1;
        saAccount[saDest][token].balance += amount;
        require(!blackList.isProhibited(msg.sender), "Sender address prohitbited");
    }

    function transferContractToSA(address saDest, address token, uint224 amount, bytes calldata keyCipher) external payable {
        _transferContractToSA(saDest, token, amount);
        emit SATransaction(saDest, amount, token, keyCipher);
    }

    function transferContractToExistingSA(address saDest, address token, uint224 amount) external payable {
        _transferContractToSA(saDest, token, amount);
        emit SATransaction(saDest, amount, token, bytes(""));
    }

    function _transferContractToSA(address saDest, address token, uint224 amount) internal {
        require(exemptList[msg.sender], "Not from a exempted contract");
        if (token == NATIVE_TOKEN) {
            // Sending native token
            require(msg.value >= amount, "Not enough token sended to SA");
        } else {
            // Sending contract token
            require(IERC20(token).balanceOf(msg.sender) >= amount, "Not enough token in wallet");
            SafeERC20.safeTransferFrom(IERC20(token), msg.sender, address(this), amount);
        }
        saAccount[saDest][token].nonce += 1;
        saAccount[saDest][token].balance += amount;
    }

    function transferSAtoEOA(address saSrc, address payable walletAddressDest, address token, uint224 amount, uint32 nonce, 
    address payable relayerWallet, uint224 gas, bytes32 r, bytes32 s, uint8 v) external {
        _verifySASig(saSrc, walletAddressDest, ACTION_SAtoEOA, token, amount, nonce, relayerWallet, gas, r, s, v);
        _transferToEVMAddr(_calcFee(THIS_CONTRACT, ACTION_SAtoEOA, token, amount), saSrc, walletAddressDest, token, amount, relayerWallet, gas);
        require(!blackList.isProhibited(walletAddressDest), "Receiver address prohitbited");
    }

    function transferSAtoSA(address saSrc, address saDest, address token, uint224 amount, bytes calldata keyCipher, uint32 nonce, 
    address payable relayerWallet, uint224 gas, bytes32 r, bytes32 s, uint8 v) external {
        _verifySASig(saSrc, saDest, ACTION_SAtoSA, token, amount, nonce, relayerWallet, gas, r, s, v);
        _transferSAtoSA(saSrc, saDest, token, amount, relayerWallet, gas);
        emit SATransaction(saDest, amount, token, keyCipher);
    }

    function transferSAtoExistingSA(address saSrc, address saDest, address token, uint224 amount,uint32 nonce, 
    address payable relayerWallet, uint224 gas, bytes32 r, bytes32 s, uint8 v) external {
        _verifySASig(saSrc, saDest, ACTION_SAtoSA, token, amount, nonce, relayerWallet, gas, r, s, v);
        _transferSAtoSA(saSrc, saDest, token, amount, relayerWallet, gas);
        emit SATransaction(saDest, amount, token, bytes(""));
    }

    function transferSAToHandler(address saSrc, address payable contractAddressDest, uint256 actionId, address token, uint224 amount, 
    bytes calldata paramData, uint32 nonce, address payable relayerWallet, uint224 gas, bytes32[2] calldata rs, uint8 v) external payable {
        // combine r and s together to avoid Stack too deep error
        _verifySASig(saSrc, contractAddressDest, actionId, token, amount, paramData, nonce, relayerWallet, gas, rs, v);
        _transferToEVMAddr(_calcFee(contractAddressDest, actionId, token, amount), saSrc, contractAddressDest, token, amount, relayerWallet, gas);
        ISAPHandler(contractAddressDest).handle{value: msg.value}(actionId, token, amount, paramData);
    }

    function _verifySASig(address saSrc, address dest, uint256 actionId, address token, uint224 amount, bytes memory paramData, 
    uint32 nonce, address relayerWallet, uint224 gas, bytes32[2] memory rs, uint8 v) internal {
        bytes32 hash = ECDSA.toEthSignedMessageHash(abi.encode(block.chainid, address(this), dest, actionId, token, amount, paramData, nonce, relayerWallet, gas));
        address addressRecover = ecrecover(hash, v, rs[0], rs[1]);
        require(addressRecover == saSrc, "Fail to verify signature");
        require(saAccount[saSrc][token].nonce == nonce, "Incorrect nonce");
        saAccount[saSrc][token].nonce += 1;
    }

    function _verifySASig(address saSrc, address dest, uint256 actionId, address token, uint224 amount, uint32 nonce, 
    address relayerWallet, uint224 gas, bytes32 r, bytes32 s, uint8 v) internal {
        _verifySASig(saSrc, dest, actionId, token, amount, "", nonce, relayerWallet, gas, [r, s], v);
    }

    function _transferSAtoSA(address saSrc, address saDest, address token, uint224 amount, address payable relayerWallet, uint224 gas) internal {
        uint224 fee = _calcFee(THIS_CONTRACT, ACTION_SAtoSA, token, amount);
        uint224 total = amount + fee + gas;
        require(saAccount[saSrc][token].balance >= total, "Not enough token in SA balance");

        saAccount[saSrc][token].balance -= total;
        if (fee > 0) beneficiaryBalance[feeReceiver][token] += fee;
        saAccount[saDest][token].nonce += 1;
        saAccount[saDest][token].balance += amount;
        if (gas > 0) beneficiaryBalance[relayerWallet][token] += gas;
    }

    function _transferToEVMAddr(uint224 fee, address saSrc, address payable addrDest, address token, 
    uint224 amount, address payable relayerWallet, uint224 gas) internal {
        uint224 total = amount + gas + fee;
        require(saAccount[saSrc][token].balance >= total, "Not enough token in SA balance");

        saAccount[saSrc][token].balance -= total;
        if (token == NATIVE_TOKEN) {
            (bool sent, ) = addrDest.call{value: amount}("");
            if (!sent) revert FailedToWithdrawEth(addrDest, amount);
        } else {
            SafeERC20.safeTransfer(IERC20(token), addrDest, amount);
        }
        if (gas > 0) beneficiaryBalance[relayerWallet][token] += gas;
        if (fee > 0) beneficiaryBalance[feeReceiver][token] += fee;
        emit NormalAddressTransaction(saSrc, amount, token);
    }

    function getSA(address sa, address token) external view returns (uint32 nonce, uint224 balance) {
        Account storage saInfo = saAccount[sa][token];
        return (saInfo.nonce, saInfo.balance);
    }

    function existSA(address sa, address[] calldata tokens) external view returns (bool isExist) {
        for (uint256 i = 0; i < tokens.length; i++) {
            address token = tokens[i];
            if (saAccount[sa][token].nonce > 0) return true;
        }
        return false;
    }

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

File 1 of 13 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

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

File 1 of 13 : 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 1 of 13 : 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 1 of 13 : 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 1 of 13 : 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 1 of 13 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

File 1 of 13 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32")
            mstore(0x1c, hash)
            message := keccak256(0x00, 0x3c)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, "\x19\x01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            data := keccak256(ptr, 0x42)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Data with intended validator, created from a
     * `validator` and `data` according to the version 0 of EIP-191.
     *
     * See {recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x00", validator, data));
    }
}

File 1 of 13 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 1 of 13 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 1 of 13 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

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

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

File 2 of 13 : 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;
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"blackListAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"FailedToWithdrawEth","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"saSrc","type":"address"},{"indexed":false,"internalType":"uint224","name":"amount","type":"uint224"},{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"NormalAddressTransaction","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"saDest","type":"address"},{"indexed":false,"internalType":"uint224","name":"amount","type":"uint224"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bytes","name":"ciphertext","type":"bytes"}],"name":"SATransaction","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"beneficiaryBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256","name":"actionId","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint224","name":"amount","type":"uint224"}],"name":"calcFee","outputs":[{"internalType":"uint224","name":"fee","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"collectFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"collectFeeBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sa","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"existSA","outputs":[{"internalType":"bool","name":"isExist","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"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":[],"name":"feeReceiver","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"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":"address","name":"sa","type":"address"},{"internalType":"address","name":"token","type":"address"}],"name":"getSA","outputs":[{"internalType":"uint32","name":"nonce","type":"uint32"},{"internalType":"uint224","name":"balance","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"saAccount","outputs":[{"internalType":"uint32","name":"nonce","type":"uint32"},{"internalType":"uint224","name":"balance","type":"uint224"}],"stateMutability":"view","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":"address","name":"contractAddress","type":"address"},{"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":"address payable","name":"receiver","type":"address"}],"name":"setFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"saDest","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint224","name":"amount","type":"uint224"}],"name":"transferContractToExistingSA","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"saDest","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"bytes","name":"keyCipher","type":"bytes"}],"name":"transferContractToSA","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"saDest","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint224","name":"amount","type":"uint224"}],"name":"transferEOAtoExistingSA","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"saDest","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"bytes","name":"keyCipher","type":"bytes"}],"name":"transferEOAtoSA","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"saSrc","type":"address"},{"internalType":"address payable","name":"contractAddressDest","type":"address"},{"internalType":"uint256","name":"actionId","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"bytes","name":"paramData","type":"bytes"},{"internalType":"uint32","name":"nonce","type":"uint32"},{"internalType":"address payable","name":"relayerWallet","type":"address"},{"internalType":"uint224","name":"gas","type":"uint224"},{"internalType":"bytes32[2]","name":"rs","type":"bytes32[2]"},{"internalType":"uint8","name":"v","type":"uint8"}],"name":"transferSAToHandler","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"saSrc","type":"address"},{"internalType":"address payable","name":"walletAddressDest","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"nonce","type":"uint32"},{"internalType":"address payable","name":"relayerWallet","type":"address"},{"internalType":"uint224","name":"gas","type":"uint224"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"name":"transferSAtoEOA","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"saSrc","type":"address"},{"internalType":"address","name":"saDest","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"nonce","type":"uint32"},{"internalType":"address payable","name":"relayerWallet","type":"address"},{"internalType":"uint224","name":"gas","type":"uint224"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"name":"transferSAtoExistingSA","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"saSrc","type":"address"},{"internalType":"address","name":"saDest","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"bytes","name":"keyCipher","type":"bytes"},{"internalType":"uint32","name":"nonce","type":"uint32"},{"internalType":"address payable","name":"relayerWallet","type":"address"},{"internalType":"uint224","name":"gas","type":"uint224"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"name":"transferSAtoSA","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x6080604052600436106101665760003560e01c806372700241116100d1578063a2ab6af61161008a578063db6e648211610064578063db6e648214610540578063efdcd97414610560578063f2fde38b14610580578063f83d276d146105a057600080fd5b8063a2ab6af6146104c7578063b3f006741461050d578063bf043b701461052d57600080fd5b806372700241146103b65780638da5cb5b146103d6578063938ec537146104085780639fde18a3146104285780639fde54f514610448578063a24325d31461046857600080fd5b806348c3a6ee1161012357806348c3a6ee146102ba5780635390a091146102cd5780635627a9221461034157806358ed851b1461036157806369b59e7514610381578063715018a6146103a157600080fd5b80631490c3151461016b57806322990c6a14610180578063272127d81461021f5780633d3048711461023257806342e28f3b146102625780634591bbcd1461029a575b600080fd5b61017e6101793660046121d4565b6105b3565b005b34801561018c57600080fd5b506101ef61019b36600461221b565b6001600160a01b039283166000908152600360209081526040808320948352938152838220929094168152925290205462ffffff8116916001600160601b0363010000008304811692600160781b90041690565b6040805162ffffff90941684526001600160601b0392831660208501529116908201526060015b60405180910390f35b61017e61022d3660046121d4565b61060d565b34801561023e57600080fd5b5061025261024d3660046122a2565b610618565b6040519015158152602001610216565b34801561026e57600080fd5b5061028261027d3660046122f7565b6106ac565b6040516001600160e01b039091168152602001610216565b3480156102a657600080fd5b5061017e6102b5366004612348565b6106c5565b61017e6102c83660046123cc565b61071c565b3480156102d957600080fd5b5061031d6102e8366004612446565b600560209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160e01b031682565b6040805163ffffffff90931683526001600160e01b03909116602083015201610216565b34801561034d57600080fd5b5061031d61035c366004612446565b61076b565b34801561036d57600080fd5b5061017e61037c366004612496565b6107b1565b34801561038d57600080fd5b5061017e61039c366004612511565b61083e565b3480156103ad57600080fd5b5061017e61084a565b3480156103c257600080fd5b5061017e6103d1366004612511565b61085e565b3480156103e257600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610216565b34801561041457600080fd5b5061017e610423366004612553565b610888565b34801561043457600080fd5b5061017e610443366004612607565b610984565b34801561045457600080fd5b5061017e6104633660046126fd565b6109f1565b34801561047457600080fd5b506101ef61048336600461221b565b600360209081526000938452604080852082529284528284209052825290205462ffffff8116906001600160601b0363010000008204811691600160781b90041683565b3480156104d357600080fd5b506104ff6104e2366004612446565b600460209081526000928352604080842090915290825290205481565b604051908152602001610216565b34801561051957600080fd5b506001546103f0906001600160a01b031681565b61017e61053b36600461273c565b610a24565b34801561054c57600080fd5b5061017e61055b366004612553565b610b21565b34801561056c57600080fd5b5061017e61057b366004612511565b610b99565b34801561058c57600080fd5b5061017e61059b366004612511565b610bc3565b61017e6105ae3660046123cc565b610c39565b6105be838383610c40565b816001600160a01b0316836001600160a01b0316600080516020612ba3833981519152836040518060200160405280600081525060405161060092919061286a565b60405180910390a3505050565b6105be838383610ec8565b6000805b8281101561069f5760008484838181106106385761063861288e565b905060200201602081019061064d9190612511565b6001600160a01b0380881660009081526005602090815260408083209385168352929052205490915063ffffffff161561068c576001925050506106a5565b5080610697816128ba565b91505061061c565b50600090505b9392505050565b60006106ba85858585611280565b90505b949350505050565b60005b818110156107175760008383838181106106e4576106e461288e565b90506020020160208101906106f99190612511565b905061070481611394565b508061070f816128ba565b9150506106c8565b505050565b610727858585610ec8565b836001600160a01b0316856001600160a01b0316600080516020612ba383398151915285858560405161075c939291906128fc565b60405180910390a35050505050565b6001600160a01b0382811660009081526005602090815260408083209385168352929052205463ffffffff811690600160201b90046001600160e01b03165b9250929050565b6107b961148f565b6001600160a01b038681166000908152600360209081526040808320898452825280832093881683529290522080546001600160601b03838116600160781b026bffffffffffffffffffffffff60781b199186166301000000026effffffffffffffffffffffffffffff1990931662ffffff8816179290921716179055505050505050565b61084781611394565b50565b61085261148f565b61085c60006114e9565b565b61086661148f565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b61089c8a8a60028b8b8b8b8b8b8b8b611539565b6108b86108ad600160028b8b611280565b8b8b8b8b8a8a61157c565b60025460405163041b7b2760e31b81526001600160a01b038b81166004830152909116906320dbd93890602401602060405180830381865afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109269190612921565b156109785760405162461bcd60e51b815260206004820152601c60248201527f526563656976657220616464726573732070726f68697462697465640000000060448201526064015b60405180910390fd5b50505050505050505050565b6109988c8c60038d8d8b8b8b8b8b8b611539565b6109a68c8c8c8c898961186b565b896001600160a01b03168b6001600160a01b0316600080516020612ba38339815191528b8b8b6040516109db939291906128fc565b60405180910390a3505050505050505050505050565b6109f961148f565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b610a918c8c8c8c8c8c8c8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040805180820182528f93508e92508d918d9060029083908390808284376000920191909152508d9150611b139050565b610aab610aa08c8c8c8c611280565b8d8d8c8c898961157c565b604051634b03188360e11b81526001600160a01b038c16906396063106903490610ae1908e908e908e908e908e9060040161293e565b6000604051808303818588803b158015610afa57600080fd5b505af1158015610b0e573d6000803e3d6000fd5b5050505050505050505050505050505050565b610b358a8a60038b8b8b8b8b8b8b8b611539565b610b438a8a8a8a898961186b565b876001600160a01b0316896001600160a01b0316600080516020612ba38339815191528960405180602001604052806000815250604051610b8592919061286a565b60405180910390a350505050505050505050565b610ba161148f565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b610bcb61148f565b6001600160a01b038116610c305760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161096f565b610847816114e9565b6107278585855b3360009081526006602052604090205460ff16610c9f5760405162461bcd60e51b815260206004820152601c60248201527f4e6f742066726f6d2061206578656d7074656420636f6e747261637400000000604482015260640161096f565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03831601610d2257806001600160e01b0316341015610d1d5760405162461bcd60e51b815260206004820152601d60248201527f4e6f7420656e6f75676820746f6b656e2073656e64656420746f205341000000604482015260640161096f565b610df8565b6040516370a0823160e01b81523360048201526001600160e01b038216906001600160a01b038416906370a0823190602401602060405180830381865afa158015610d71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d959190612978565b1015610de35760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420656e6f75676820746f6b656e20696e2077616c6c6574000000000000604482015260640161096f565b610df8823330846001600160e01b0316611cf3565b6001600160a01b0380841660009081526005602090815260408083209386168352929052908120805460019290610e3690849063ffffffff16612991565b825463ffffffff9182166101009390930a9283029190920219909116179055506001600160a01b0380841660009081526005602090815260408083209386168352929052208054829190600490610e9f9084906001600160e01b03600160201b909104166129b5565b92506101000a8154816001600160e01b0302191690836001600160e01b03160217905550505050565b6000610ed76001808585611280565b90506000610ee582846129b5565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03851601610fc857806001600160e01b0316341015610f655760405162461bcd60e51b815260206004820152601d60248201527f4e6f7420656e6f75676820746f6b656e2073656e64656420746f205341000000604482015260640161096f565b6000610f7a6001600160e01b038516346129d5565b90508015610fc2576001546001600160a01b03908116600090815260046020908152604080832093891683529290529081208054839290610fbc9084906129e8565b90915550505b506110f6565b6040516370a0823160e01b81523360048201526001600160e01b038216906001600160a01b038616906370a0823190602401602060405180830381865afa158015611017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103b9190612978565b10156110895760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420656e6f75676820746f6b656e20696e2077616c6c6574000000000000604482015260640161096f565b61109e843330846001600160e01b0316611cf3565b6001600160e01b038216156110f6576001546001600160a01b039081166000908152600460209081526040808320938816835292905290812080546001600160e01b03851692906110f09084906129e8565b90915550505b6001600160a01b038086166000908152600560209081526040808320938816835292905290812080546001929061113490849063ffffffff16612991565b825463ffffffff9182166101009390930a9283029190920219909116179055506001600160a01b038086166000908152600560209081526040808320938816835292905220805484919060049061119d9084906001600160e01b03600160201b909104166129b5565b82546001600160e01b039182166101009390930a92830291909202199091161790555060025460405163041b7b2760e31b81523360048201526001600160a01b03909116906320dbd93890602401602060405180830381865afa158015611208573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122c9190612921565b156112795760405162461bcd60e51b815260206004820152601a60248201527f53656e64657220616464726573732070726f6869746269746564000000000000604482015260640161096f565b5050505050565b6001600160a01b038481166000908152600360209081526040808320878452825280832093861683529290529081208054630100000090046001600160601b03166113015760405162461bcd60e51b8152602060048201526011602482015270151bdad95b881b9bdd08185b1b1bddd959607a1b604482015260640161096f565b8054620f4240906113179062ffffff16856129fb565b6113219190612a2d565b81549092506001600160601b0363010000008204811691600160781b9004166001600160e01b03841681111561136257806001600160601b03169350611389565b816001600160601b0316846001600160e01b0316111561138957816001600160601b031693505b505050949350505050565b3360009081526004602090815260408083206001600160a01b0385168452909152902054801561148b5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0383160161145b57604051600090339083908381818185875af1925050503d8060008114611425576040519150601f19603f3d011682016040523d82523d6000602084013e61142a565b606091505b505090508061145557604051630cd9003760e01b81523360048201526024810183905260440161096f565b50611466565b611466823383611d64565b3360009081526004602090815260408083206001600160a01b03861684529091528120555b5050565b6000546001600160a01b0316331461085c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61156f8b8b8b8b8b604051806020016040528060008152508c8c8c60405180604001604052808e81526020018d8152508b611b13565b5050505050505050505050565b60008761158983866129b5565b61159391906129b5565b6001600160a01b038089166000908152600560209081526040808320938a16835292905220549091506001600160e01b03808316600160201b90920416101561161e5760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820746f6b656e20696e2053412062616c616e63650000604482015260640161096f565b6001600160a01b0387811660009081526005602090815260408083209389168352929052208054829190600490611666908490600160201b90046001600160e01b0316612a61565b92506101000a8154816001600160e01b0302191690836001600160e01b0316021790555073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0316856001600160a01b031603611754576000866001600160a01b0316856001600160e01b031660405160006040518083038185875af1925050503d806000811461170d576040519150601f19603f3d011682016040523d82523d6000602084013e611712565b606091505b505090508061174e57604051630cd9003760e01b81526001600160a01b03881660048201526001600160e01b038616602482015260440161096f565b50611768565b6117688587866001600160e01b0316611d64565b6001600160e01b038216156117bd576001600160a01b038084166000908152600460209081526040808320938916835292905290812080546001600160e01b03851692906117b79084906129e8565b90915550505b6001600160e01b03881615611815576001546001600160a01b039081166000908152600460209081526040808320938916835292905290812080546001600160e01b038b16929061180f9084906129e8565b90915550505b6040516001600160e01b03851681526001600160a01b0380871691908916907f41bae6c39aaf3ccc19cf8bc60cb5cc37b9d01bff8045b1cae9d9726a31e4d9c89060200160405180910390a35050505050505050565b600061187b600160038787611280565b905060008261188a83876129b5565b61189491906129b5565b6001600160a01b03808a166000908152600560209081526040808320938b16835292905220549091506001600160e01b03808316600160201b90920416101561191f5760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820746f6b656e20696e2053412062616c616e63650000604482015260640161096f565b6001600160a01b038881166000908152600560209081526040808320938a168352929052208054829190600490611967908490600160201b90046001600160e01b0316612a61565b92506101000a8154816001600160e01b0302191690836001600160e01b031602179055506000826001600160e01b031611156119e6576001546001600160a01b039081166000908152600460209081526040808320938a16835292905290812080546001600160e01b03851692906119e09084906129e8565b90915550505b6001600160a01b038088166000908152600560209081526040808320938a168352929052908120805460019290611a2490849063ffffffff16612991565b825463ffffffff9182166101009390930a9283029190920219909116179055506001600160a01b038088166000908152600560209081526040808320938a168352929052208054869190600490611a8d9084906001600160e01b03600160201b909104166129b5565b92506101000a8154816001600160e01b0302191690836001600160e01b031602179055506000836001600160e01b03161115611b09576001600160a01b038085166000908152600460209081526040808320938a16835292905290812080546001600160e01b0386169290611b039084906129e8565b90915550505b5050505050505050565b6000611b4f46308d8d8d8d8d8d8d8d604051602001611b3b9a99989796959493929190612a81565b604051602081830303815290604052611d94565b835160208086015160408051600080825293810180835286905260ff8816918101919091526060810193909352608083015291925060019060a0016020604051602081039080840390855afa158015611bac573d6000803e3d6000fd5b5050506020604051035190508c6001600160a01b0316816001600160a01b031614611c195760405162461bcd60e51b815260206004820152601860248201527f4661696c20746f20766572696679207369676e61747572650000000000000000604482015260640161096f565b6001600160a01b038d81166000908152600560209081526040808320938e168352929052205463ffffffff888116911614611c885760405162461bcd60e51b815260206004820152600f60248201526e496e636f7272656374206e6f6e636560881b604482015260640161096f565b6001600160a01b03808e166000908152600560209081526040808320938e168352929052908120805460019290611cc690849063ffffffff16612991565b92506101000a81548163ffffffff021916908363ffffffff16021790555050505050505050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611d5e9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611dcf565b50505050565b6040516001600160a01b03831660248201526044810182905261071790849063a9059cbb60e01b90606401611d27565b6000611da08251611ea4565b82604051602001611db2929190612b02565b604051602081830303815290604052805190602001209050919050565b6000611e24826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611f379092919063ffffffff16565b9050805160001480611e45575080806020019051810190611e459190612921565b6107175760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161096f565b60606000611eb183611f46565b600101905060008167ffffffffffffffff811115611ed157611ed1612b5d565b6040519080825280601f01601f191660200182016040528015611efb576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611f0557509392505050565b60606106bd848460008561201f565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611f855772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611fb1576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611fcf57662386f26fc10000830492506010015b6305f5e1008310611fe7576305f5e100830492506008015b6127108310611ffb57612710830492506004015b6064831061200d576064830492506002015b600a8310612019576001015b92915050565b6060824710156120805760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161096f565b600080866001600160a01b0316858760405161209c9190612b73565b60006040518083038185875af1925050503d80600081146120d9576040519150601f19603f3d011682016040523d82523d6000602084013e6120de565b606091505b50915091506120ef878383876120fa565b979650505050505050565b60608315612169578251600003612162576001600160a01b0385163b6121625760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161096f565b50816106bd565b6106bd838381511561217e5781518083602001fd5b8060405162461bcd60e51b815260040161096f9190612b8f565b6001600160a01b038116811461084757600080fd5b80356121b881612198565b919050565b80356001600160e01b03811681146121b857600080fd5b6000806000606084860312156121e957600080fd5b83356121f481612198565b9250602084013561220481612198565b9150612212604085016121bd565b90509250925092565b60008060006060848603121561223057600080fd5b833561223b81612198565b925060208401359150604084013561225281612198565b809150509250925092565b60008083601f84011261226f57600080fd5b50813567ffffffffffffffff81111561228757600080fd5b6020830191508360208260051b85010111156107aa57600080fd5b6000806000604084860312156122b757600080fd5b83356122c281612198565b9250602084013567ffffffffffffffff8111156122de57600080fd5b6122ea8682870161225d565b9497909650939450505050565b6000806000806080858703121561230d57600080fd5b843561231881612198565b935060208501359250604085013561232f81612198565b915061233d606086016121bd565b905092959194509250565b6000806020838503121561235b57600080fd5b823567ffffffffffffffff81111561237257600080fd5b61237e8582860161225d565b90969095509350505050565b60008083601f84011261239c57600080fd5b50813567ffffffffffffffff8111156123b457600080fd5b6020830191508360208285010111156107aa57600080fd5b6000806000806000608086880312156123e457600080fd5b85356123ef81612198565b945060208601356123ff81612198565b935061240d604087016121bd565b9250606086013567ffffffffffffffff81111561242957600080fd5b6124358882890161238a565b969995985093965092949392505050565b6000806040838503121561245957600080fd5b823561246481612198565b9150602083013561247481612198565b809150509250929050565b80356001600160601b03811681146121b857600080fd5b60008060008060008060c087890312156124af57600080fd5b86356124ba81612198565b95506020870135945060408701356124d181612198565b9350606087013562ffffff811681146124e957600080fd5b92506124f76080880161247f565b915061250560a0880161247f565b90509295509295509295565b60006020828403121561252357600080fd5b81356106a581612198565b803563ffffffff811681146121b857600080fd5b803560ff811681146121b857600080fd5b6000806000806000806000806000806101408b8d03121561257357600080fd5b8a3561257e81612198565b995060208b013561258e81612198565b985060408b013561259e81612198565b97506125ac60608c016121bd565b96506125ba60808c0161252e565b955060a08b01356125ca81612198565b94506125d860c08c016121bd565b935060e08b013592506101008b013591506125f66101208c01612542565b90509295989b9194979a5092959850565b6000806000806000806000806000806000806101608d8f03121561262a57600080fd5b6126348d35612198565b8c359b5061264560208e0135612198565b60208d01359a5061265860408e016121ad565b995061266660608e016121bd565b985067ffffffffffffffff60808e0135111561268157600080fd5b6126918e60808f01358f0161238a565b90985096506126a260a08e0161252e565b95506126b060c08e016121ad565b94506126be60e08e016121bd565b93506101008d013592506101208d013591506126dd6101408e01612542565b90509295989b509295989b509295989b565b801515811461084757600080fd5b6000806040838503121561271057600080fd5b823561271b81612198565b91506020830135612474816126ef565b806040810183101561201957600080fd5b6000806000806000806000806000806000806101808d8f03121561275f57600080fd5b6127698d35612198565b8c359b5061277a60208e0135612198565b60208d01359a5060408d0135995061279460608e016121ad565b98506127a260808e016121bd565b975067ffffffffffffffff60a08e013511156127bd57600080fd5b6127cd8e60a08f01358f0161238a565b90975095506127de60c08e0161252e565b94506127ec60e08e016121ad565b93506127fb6101008e016121bd565b925061280b8e6101208f0161272b565b91506126dd6101608e01612542565b60005b8381101561283557818101518382015260200161281d565b50506000910152565b6000815180845261285681602086016020860161281a565b601f01601f19169290920160200192915050565b6001600160e01b03831681526040602082018190526000906106bd9083018461283e565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016128cc576128cc6128a4565b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160e01b03841681526040602082018190526000906106ba90830184866128d3565b60006020828403121561293357600080fd5b81516106a5816126ef565b8581526001600160a01b03851660208201526001600160e01b03841660408201526080606082018190526000906120ef90830184866128d3565b60006020828403121561298a57600080fd5b5051919050565b63ffffffff8181168382160190808211156129ae576129ae6128a4565b5092915050565b6001600160e01b038181168382160190808211156129ae576129ae6128a4565b81810381811115612019576120196128a4565b80820180821115612019576120196128a4565b6001600160e01b03828116828216818102831692918115828504821417612a2457612a246128a4565b50505092915050565b60006001600160e01b0383811680612a5557634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b6001600160e01b038281168282160390808211156129ae576129ae6128a4565b8a81526001600160a01b038a8116602083015289811660408301526060820189905287811660808301526001600160e01b0387811660a084015261014060c084018190526000929091612ad68584018a61283e565b63ffffffff9890981660e086015295166101008401525050911661012090910152979650505050505050565b7f19457468657265756d205369676e6564204d6573736167653a0a000000000000815260008351612b3a81601a85016020880161281a565b835190830190612b5181601a84016020880161281a565b01601a01949350505050565b634e487b7160e01b600052604160045260246000fd5b60008251612b8581846020870161281a565b9190910192915050565b6020815260006106a5602083018461283e56fe928f516e65e86dec7d349ac7ebd7010c690bfd1614e2f864bf3f7c480aea1908a264697066735822122037a1d5d11d2c9aac3d1503467a1c707315029a735e6dde75b261887a685312b564736f6c63430008130033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Txn 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.