ETH Price: $3,078.68 (-1.98%)

Contract

0x00b0b14bAB0Ac46653A40BB00C137D2BB62802b6
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
Initialize1133950092023-12-12 13:46:35125 days ago1702388795IN
0x00b0b14b...BB62802b6
0 ETH0.000007080.1
0x60e060401133950092023-12-12 13:46:35125 days ago1702388795IN
 Create: SynapseCCTP
0 ETH0.000358850.1

View more zero value Internal Transactions in Advanced View mode

Advanced mode:

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SynapseCCTP

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 24 : SynapseCCTP.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

// prettier-ignore
import {
    CCTPIncorrectChainId,
    CCTPIncorrectDomain,
    CCTPIncorrectGasAmount,
    CCTPIncorrectTokenAmount,
    CCTPMessageNotReceived,
    CCTPTokenNotFound,
    CCTPZeroAddress,
    CCTPZeroAmount,
    RemoteCCTPDeploymentNotSet,
    RemoteCCTPTokenNotSet
} from "./libs/Errors.sol";
import {SynapseCCTPEvents} from "./events/SynapseCCTPEvents.sol";
import {EnumerableSet, SynapseCCTPFees} from "./fees/SynapseCCTPFees.sol";
import {IMessageTransmitter} from "./interfaces/IMessageTransmitter.sol";
import {ISynapseCCTP} from "./interfaces/ISynapseCCTP.sol";
import {ITokenMinter} from "./interfaces/ITokenMinter.sol";
import {ITokenMessenger} from "./interfaces/ITokenMessenger.sol";
import {RequestLib} from "./libs/Request.sol";
import {MinimalForwarderLib} from "./libs/MinimalForwarder.sol";
import {TypeCasts} from "./libs/TypeCasts.sol";

import {IDefaultPool} from "../router/interfaces/IDefaultPool.sol";

import {SafeERC20, IERC20} from "@openzeppelin/contracts-4.5.0/token/ERC20/utils/SafeERC20.sol";
import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable-4.5.0/security/PausableUpgradeable.sol";

contract SynapseCCTP is SynapseCCTPFees, PausableUpgradeable, SynapseCCTPEvents, ISynapseCCTP {
    using EnumerableSet for EnumerableSet.AddressSet;
    using MinimalForwarderLib for address;
    using SafeERC20 for IERC20;
    using TypeCasts for address;
    using TypeCasts for bytes32;

    /// @notice Struct defining the configuration of a remote domain that has SynapseCCTP deployed.
    /// @dev CCTP uses the following convention for domain numbers:
    /// - 0: Ethereum Mainnet
    /// - 1: Avalanche Mainnet
    /// With more chains added, the convention will be extended.
    /// @param domain       Value for the remote domain used in CCTP messages.
    /// @param synapseCCTP  Address of the SynapseCCTP deployed on the remote chain.
    struct DomainConfig {
        uint32 domain;
        address synapseCCTP;
    }

    /// @notice Refers to the local domain number used in CCTP messages.
    uint32 public immutable localDomain;
    IMessageTransmitter public immutable messageTransmitter;
    ITokenMessenger public immutable tokenMessenger;

    // (chainId => configuration of the remote chain)
    mapping(uint256 => DomainConfig) public remoteDomainConfig;
    // (Circle token => liquidity pool with the token)
    mapping(address => address) public circleTokenPool;

    constructor(ITokenMessenger tokenMessenger_) {
        tokenMessenger = tokenMessenger_;
        messageTransmitter = IMessageTransmitter(tokenMessenger_.localMessageTransmitter());
        localDomain = messageTransmitter.localDomain();
    }

    function initialize(address owner_) external initializer {
        __Pausable_init();
        _transferOwnership(owner_);
    }

    // ═════════════════════════════════════════════ SET CONFIG LOGIC ══════════════════════════════════════════════════

    /// @notice Sets the remote domain and deployment of SynapseCCTP for the given remote chainId.
    function setRemoteDomainConfig(
        uint256 remoteChainId,
        uint32 remoteDomain,
        address remoteSynapseCCTP
    ) external onlyOwner {
        // ChainId should be non-zero and different from the local chain id.
        if (remoteChainId == 0 || remoteChainId == block.chainid) revert CCTPIncorrectChainId();
        // Remote domain should differ from the local domain.
        if (remoteDomain == localDomain) revert CCTPIncorrectDomain();
        // Remote domain should be 0 IF AND ONLY IF remote chain id is 1 (Ethereum Mainnet).
        if ((remoteDomain == 0) != (remoteChainId == 1)) revert CCTPIncorrectDomain();
        // Remote SynapseCCTP should be non-zero.
        if (remoteSynapseCCTP == address(0)) revert CCTPZeroAddress();
        remoteDomainConfig[remoteChainId] = DomainConfig(remoteDomain, remoteSynapseCCTP);
        emit RemoteDomainConfigSet(remoteChainId, remoteDomain, remoteSynapseCCTP);
    }

    /// @notice Sets the liquidity pool for the given Circle token.
    function setCircleTokenPool(address circleToken, address pool) external onlyOwner {
        if (circleToken == address(0)) revert CCTPZeroAddress();
        if (!_bridgeTokens.contains(circleToken)) revert CCTPTokenNotFound();
        // Pool address can be zero if no swaps are supported for the Circle token.
        circleTokenPool[circleToken] = pool;
        emit CircleTokenPoolSet(circleToken, pool);
    }

    /// @notice Allows the contract owner to pause the sending of CCTP tokens.
    /// Note: this does not affect the receiving of CCTP tokens.
    function pauseSending() external onlyOwner {
        _pause();
    }

    /// @notice Allows the contract owner to unpause the sending of CCTP tokens.
    /// Note: this does not affect the receiving of CCTP tokens.
    function unpauseSending() external onlyOwner {
        _unpause();
    }

    // ═════════════════════════════════════════════ FEES WITHDRAWING ══════════════════════════════════════════════════

    /// @notice Allows the owner to withdraw accumulated protocol fees.
    function withdrawProtocolFees(address token) external onlyOwner {
        uint256 accFees = accumulatedFees[address(0)][token];
        if (accFees == 0) revert CCTPZeroAmount();
        accumulatedFees[address(0)][token] = 0;
        IERC20(token).safeTransfer(msg.sender, accFees);
        emit FeesWithdrawn(msg.sender, token, accFees);
    }

    /// @notice Allows the Relayer's fee collector to withdraw accumulated relayer fees.
    function withdrawRelayerFees(address token) external {
        uint256 accFees = accumulatedFees[msg.sender][token];
        if (accFees == 0) revert CCTPZeroAmount();
        accumulatedFees[msg.sender][token] = 0;
        IERC20(token).safeTransfer(msg.sender, accFees);
        emit FeesWithdrawn(msg.sender, token, accFees);
    }

    // ════════════════════════════════════════════════ CCTP LOGIC ═════════════════════════════════════════════════════

    /// @inheritdoc ISynapseCCTP
    function sendCircleToken(
        address recipient,
        uint256 chainId,
        address burnToken,
        uint256 amount,
        uint32 requestVersion,
        bytes memory swapParams
    ) external whenNotPaused {
        // Check if token is supported before doing anything else.
        if (!_bridgeTokens.contains(burnToken)) revert CCTPTokenNotFound();
        // Pull token from user and update the amount in case of transfer fee.
        amount = _pullToken(burnToken, amount);
        uint64 nonce = messageTransmitter.nextAvailableNonce();
        // This will revert if the request version is not supported, or swap params are not properly formatted.
        bytes memory formattedRequest = RequestLib.formatRequest(
            requestVersion,
            RequestLib.formatBaseRequest(localDomain, nonce, burnToken, amount, recipient),
            swapParams
        );
        DomainConfig memory config = remoteDomainConfig[chainId];
        bytes32 dstSynapseCCTP = config.synapseCCTP.addressToBytes32();
        if (dstSynapseCCTP == 0) revert RemoteCCTPDeploymentNotSet();
        uint32 destinationDomain = config.domain;
        // Construct the request identifier to be used as salt later.
        // The identifier (requestID) is unique for every single request on all the chains.
        // This is done by including origin and destination domains as well as origin nonce in the hashed data.
        // Origin domain and nonce are included in `formattedRequest`, so we only need to add the destination domain.
        bytes32 requestID = _requestID(destinationDomain, requestVersion, formattedRequest);
        // Issue allowance if needed
        _approveToken(burnToken, address(tokenMessenger), amount);
        tokenMessenger.depositForBurnWithCaller(
            amount,
            destinationDomain,
            dstSynapseCCTP,
            burnToken,
            _destinationCaller(dstSynapseCCTP.bytes32ToAddress(), requestID)
        );
        // We want to emit the EOA address that initiated the transaction as "sender",
        // so we use `tx.origin` instead of `msg.sender`.
        // Note: this is done for analytics only, and should NOT be used by off-chain actors
        // for security purposes.
        // solhint-disable avoid-tx-origin
        emit CircleRequestSent(
            chainId,
            tx.origin,
            nonce,
            burnToken,
            amount,
            requestVersion,
            formattedRequest,
            requestID
        );
    }

    /// @inheritdoc ISynapseCCTP
    function receiveCircleToken(
        bytes calldata message,
        bytes calldata signature,
        uint32 requestVersion,
        bytes memory formattedRequest
    ) external payable {
        // Check that the Relayer provided correct `msg.value`
        if (msg.value != chainGasAmount) revert CCTPIncorrectGasAmount();
        (bytes memory baseRequest, bytes memory swapParams) = RequestLib.decodeRequest(
            requestVersion,
            formattedRequest
        );
        (uint32 originDomain, , address originBurnToken, uint256 amount, address recipient) = RequestLib
            .decodeBaseRequest(baseRequest);
        // For requestID hashing we use origin and destination domains as well as origin nonce.
        // This ensures that requestID is unique for each request, and that it is not possible to replay requests.
        bytes32 requestID = _requestID(localDomain, requestVersion, formattedRequest);
        // Kindly ask the Circle Bridge to mint the tokens for us.
        address token = _getLocalToken(originDomain, originBurnToken);
        uint256 balanceBefore = IERC20(token).balanceOf(address(this));
        _mintCircleToken(message, signature, requestID);
        if (IERC20(token).balanceOf(address(this)) != balanceBefore + amount) revert CCTPIncorrectTokenAmount();
        uint256 fee;
        // Apply the bridging fee. This will revert if amount <= fee.
        (amount, fee) = _applyRelayerFee(token, amount, requestVersion == RequestLib.REQUEST_SWAP);
        // Fulfill the request: perform an optional swap and send the end tokens to the recipient.
        (address tokenOut, uint256 amountOut) = _fulfillRequest(recipient, token, amount, swapParams);
        // Perform the gas airdrop and emit corresponding event if gas airdrop is enabled
        if (msg.value > 0) _transferMsgValue(recipient);
        emit CircleRequestFulfilled(originDomain, recipient, token, fee, tokenOut, amountOut, requestID);
    }

    // ═══════════════════════════════════════════════════ VIEWS ═══════════════════════════════════════════════════════

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

    /// @notice Checks if the given request is already fulfilled.
    function isRequestFulfilled(bytes32 requestID) external view returns (bool) {
        // Request is fulfilled if the requestID is already used, meaning the forwarder is already deployed.
        return MinimalForwarderLib.predictAddress(address(this), requestID).code.length > 0;
    }

    // ══════════════════════════════════════════════ INTERNAL LOGIC ═══════════════════════════════════════════════════

    /// @dev Approves the token to be spent by the given spender indefinitely by giving infinite allowance.
    /// Doesn't modify the allowance if it's already enough for the given amount.
    function _approveToken(
        address token,
        address spender,
        uint256 amount
    ) internal {
        uint256 allowance = IERC20(token).allowance(address(this), spender);
        if (allowance < amount) {
            // Reset allowance to 0 before setting it to the new value.
            if (allowance != 0) IERC20(token).safeApprove(spender, 0);
            IERC20(token).safeApprove(spender, type(uint256).max);
        }
    }

    /// @dev Pulls the token from the sender.
    function _pullToken(address token, uint256 amount) internal returns (uint256 amountPulled) {
        uint256 balanceBefore = IERC20(token).balanceOf(address(this));
        IERC20(token).safeTransferFrom(msg.sender, address(this), amount);
        amountPulled = IERC20(token).balanceOf(address(this)) - balanceBefore;
    }

    /// @dev Mints the Circle token by sending the message and signature to the Circle Bridge.
    function _mintCircleToken(
        bytes calldata message,
        bytes calldata signature,
        bytes32 requestID
    ) internal {
        // Deploy a forwarder specific to this request. Will return the address if already deployed.
        address forwarder = MinimalForwarderLib.deploy(requestID);
        // Form the payload for the Circle Bridge.
        bytes memory payload = abi.encodeWithSelector(IMessageTransmitter.receiveMessage.selector, message, signature);
        // Use the deployed forwarder (the only one who can call the Circle Bridge for a valid SynapseCCTP message).
        // This will revert if the provided message is not properly formatted, if the signatures are invalid,
        // or if this message has been already used before.
        bytes memory returnData = forwarder.forwardCall(address(messageTransmitter), payload);
        // messageTransmitter.receiveMessage is supposed to return true if the message was received.
        if (!abi.decode(returnData, (bool))) revert CCTPMessageNotReceived();
    }

    /// @dev Performs a swap, if was requested back on origin chain, and transfers the tokens to the recipient.
    /// Should the swap fail, will transfer `token` to the recipient instead.
    function _fulfillRequest(
        address recipient,
        address token,
        uint256 amount,
        bytes memory swapParams
    ) internal returns (address tokenOut, uint256 amountOut) {
        // Fallback to Base Request if no swap params are provided
        if (swapParams.length == 0) {
            IERC20(token).safeTransfer(recipient, amount);
            return (token, amount);
        }
        // We checked request version to be a valid value when wrapping into `request`,
        // so this could only be `RequestLib.REQUEST_SWAP`.
        address pool = circleTokenPool[token];
        // Fallback to Base Request if no pool is found
        if (pool == address(0)) {
            IERC20(token).safeTransfer(recipient, amount);
            return (token, amount);
        }
        (uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 deadline, uint256 minAmountOut) = RequestLib
            .decodeSwapParams(swapParams);
        tokenOut = _tryGetToken(pool, tokenIndexTo);
        // Fallback to Base Request if failed to get tokenOut address
        if (tokenOut == address(0)) {
            IERC20(token).safeTransfer(recipient, amount);
            return (token, amount);
        }
        // Approve the pool to spend the token, if needed.
        _approveToken(token, pool, amount);
        amountOut = _trySwap(pool, tokenIndexFrom, tokenIndexTo, amount, deadline, minAmountOut);
        // Fallback to Base Request if failed to swap
        if (amountOut == 0) {
            IERC20(token).safeTransfer(recipient, amount);
            return (token, amount);
        }
        // Transfer the swapped tokens to the recipient.
        IERC20(tokenOut).safeTransfer(recipient, amountOut);
    }

    /// @dev Tries to swap tokens using the provided swap instructions.
    /// Instead of reverting, returns 0 if the swap failed.
    function _trySwap(
        address pool,
        uint8 tokenIndexFrom,
        uint8 tokenIndexTo,
        uint256 amount,
        uint256 deadline,
        uint256 minAmountOut
    ) internal returns (uint256 amountOut) {
        try IDefaultPool(pool).swap(tokenIndexFrom, tokenIndexTo, amount, minAmountOut, deadline) returns (
            uint256 amountOut_
        ) {
            amountOut = amountOut_;
        } catch {
            // Swapping failed, return 0
            amountOut = 0;
        }
    }

    // ══════════════════════════════════════════════ INTERNAL VIEWS ═══════════════════════════════════════════════════

    /// @dev Gets the address of the local minted Circle token from the local TokenMinter.
    function _getLocalToken(uint32 remoteDomain, address remoteToken) internal view returns (address token) {
        ITokenMinter minter = ITokenMinter(tokenMessenger.localMinter());
        token = minter.getLocalToken(remoteDomain, remoteToken.addressToBytes32());
        // Revert if TokenMinter is not aware of this remote token.
        if (token == address(0)) revert CCTPTokenNotFound();
    }

    /// @dev Tries to get the token address from the pool.
    /// Instead of reverting, returns 0 if the getToken failed.
    function _tryGetToken(address pool, uint8 tokenIndex) internal view returns (address token) {
        // Issue a low level static call instead of IDefaultPool(pool).getToken(tokenIndex)
        // to ensure this never reverts
        (bool success, bytes memory returnData) = pool.staticcall(
            abi.encodeWithSelector(IDefaultPool.getToken.selector, tokenIndex)
        );
        if (success && returnData.length == 32) {
            // Do the casting instead of using abi.decode to discard the dirty highest bits if there are any
            token = bytes32(returnData).bytes32ToAddress();
        } else {
            // Return 0 on revert or if pool returned something unexpected
            token = address(0);
        }
    }

    /// @dev Predicts the address of the destination caller that will be used to call the Circle Message Transmitter.
    function _destinationCaller(address synapseCCTP, bytes32 requestID) internal pure returns (bytes32) {
        // On the destination chain, Synapse CCTP will deploy a MinimalForwarder for each request,
        // using requestID as salt for the create2 deployment.
        return synapseCCTP.predictAddress(requestID).addressToBytes32();
    }

    /// @dev Calculates the unique identifier of the request.
    function _requestID(
        uint32 destinationDomain,
        uint32 requestVersion,
        bytes memory formattedRequest
    ) internal pure returns (bytes32 requestID) {
        // Merge the destination domain and the request version into a single uint256.
        uint256 prefix = (uint256(destinationDomain) << 32) | requestVersion;
        bytes32 requestHash = keccak256(formattedRequest);
        // Use assembly to return hash of the prefix and the request hash.
        // We are using scratch space to avoid unnecessary memory expansion.
        // solhint-disable-next-line no-inline-assembly
        assembly {
            // Store prefix in memory at 0, and requestHash at 32.
            mstore(0, prefix)
            mstore(32, requestHash)
            // Return hash of first 64 bytes of memory.
            requestID := keccak256(0, 64)
        }
    }
}

File 2 of 24 : Errors.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

error CastOverflow();

error IncorrectRequestLength();
error UnknownRequestVersion();

error CCTPGasRescueFailed();
error CCTPIncorrectChainId();
error CCTPIncorrectConfig();
error CCTPIncorrectDomain();
error CCTPIncorrectGasAmount();
error CCTPIncorrectProtocolFee();
error CCTPIncorrectTokenAmount();
error CCTPInsufficientAmount();
error CCTPSymbolAlreadyAdded();
error CCTPSymbolIncorrect();
error CCTPTokenAlreadyAdded();
error CCTPTokenNotFound();
error CCTPZeroAddress();
error CCTPZeroAmount();

error CCTPMessageNotReceived();
error RemoteCCTPDeploymentNotSet();
error RemoteCCTPTokenNotSet();

error ForwarderDeploymentFailed();

File 3 of 24 : SynapseCCTPEvents.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

abstract contract SynapseCCTPEvents {
    /// @notice Emitted when a Circle token is sent with an attached action request.
    /// @dev To fulfill the request, the validator needs to fetch `message` from `MessageSent` event
    /// emitted by Circle's MessageTransmitter in the same tx, then fetch `signature` for the message from Circle API.
    /// This data will need to be presented to SynapseCCTP on the destination chain,
    /// along with `requestVersion` and `formattedRequest` emitted in this event.
    /// @param chainId              Chain ID of the destination chain
    /// @param sender               Sender of the CCTP tokens on origin chain
    /// @param nonce                Nonce of the CCTP message on origin chain
    /// @param token                Address of Circle token that was burnt
    /// @param amount               Amount of Circle tokens burnt
    /// @param requestVersion       Version of the request format
    /// @param formattedRequest     Formatted request for the action to take on the destination chain
    /// @param requestID            Unique identifier of the request
    event CircleRequestSent(
        uint256 chainId,
        address indexed sender,
        uint64 nonce,
        address token,
        uint256 amount,
        uint32 requestVersion,
        bytes formattedRequest,
        bytes32 requestID
    );

    /// @notice Emitted when a Circle token is received with an attached action request.
    /// @param originDomain         CCTP domain of the origin chain
    /// @param recipient            End recipient of the tokens on this chain
    /// @param mintToken            Address of the minted Circle token
    /// @param fee                  Fee paid for fulfilling the request, in minted tokens
    /// @param token                Address of token that recipient received
    /// @param amount               Amount of tokens received by recipient
    /// @param requestID            Unique identifier of the request
    event CircleRequestFulfilled(
        uint32 originDomain,
        address indexed recipient,
        address mintToken,
        uint256 fee,
        address token,
        uint256 amount,
        bytes32 requestID
    );

    /// @notice Emitted when a remote deployment of SynapseCCTP is set.
    /// @param remoteChainId        Chain ID of the remote chain
    /// @param remoteDomain         CCTP domain of the remote chain
    /// @param remoteSynapseCCTP    Address of the SynapseCCTP contract on the remote chain
    event RemoteDomainConfigSet(uint256 remoteChainId, uint32 remoteDomain, address remoteSynapseCCTP);

    /// @notice Emitted when a liquidity pool is set for a Circle token.
    /// @param token                Address of the Circle token
    /// @param pool                 Address of the liquidity pool
    event CircleTokenPoolSet(address token, address pool);

    /// @notice Emitted when collected fees are withdrawn from the contract.
    /// @param recipient            Address of the recipient
    /// @param token                Address of the token
    /// @param amount               Amount of tokens withdrawn
    event FeesWithdrawn(address recipient, address token, uint256 amount);
}

File 4 of 24 : SynapseCCTPFees.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {SynapseCCTPFeesEvents} from "../events/SynapseCCTPFeesEvents.sol";
import {ISynapseCCTPFees} from "../interfaces/ISynapseCCTPFees.sol";
// prettier-ignore
import {
    CCTPGasRescueFailed,
    CCTPIncorrectConfig,
    CCTPIncorrectProtocolFee,
    CCTPInsufficientAmount,
    CCTPSymbolAlreadyAdded,
    CCTPSymbolIncorrect,
    CCTPTokenAlreadyAdded,
    CCTPTokenNotFound
} from "../libs/Errors.sol";
import {TypeCasts} from "../libs/TypeCasts.sol";
import {BridgeToken} from "../../router/libs/Structs.sol";

import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable-4.5.0/access/OwnableUpgradeable.sol";
import {EnumerableSet} from "@openzeppelin/contracts-4.5.0/utils/structs/EnumerableSet.sol";

abstract contract SynapseCCTPFees is SynapseCCTPFeesEvents, OwnableUpgradeable, ISynapseCCTPFees {
    using EnumerableSet for EnumerableSet.AddressSet;
    using TypeCasts for uint256;

    /// @notice CCTP fee structure for a supported Circle token.
    /// @dev Optimized for storage. 2**72 is 4*10**21, which is enough to represent adequate amounts
    /// for stable coins with 18 decimals. Circle tokens have 6 decimals, so this is more than enough.
    /// @param relayerFee   Fee % for bridging a token to this chain, multiplied by `FEE_DENOMINATOR`
    /// @param minBaseFee   Minimum fee for bridging a token to this chain using a base request
    /// @param minSwapFee   Minimum fee for bridging a token to this chain using a swap request
    /// @param maxFee       Maximum fee for bridging a token to this chain
    struct CCTPFee {
        uint40 relayerFee;
        uint72 minBaseFee;
        uint72 minSwapFee;
        uint72 maxFee;
    }

    /// @dev Denominator used to calculate the bridge fee
    uint256 private constant FEE_DENOMINATOR = 10**10;
    /// @dev Maximum relayer fee that can be set: 10 bps
    uint256 private constant MAX_RELAYER_FEE = 10**7;
    /// @dev Maximum protocol fee that can be set: 50%
    uint256 private constant MAX_PROTOCOL_FEE = FEE_DENOMINATOR / 2;
    /// @dev Mandatory prefix used for CCTP token symbols to distinguish them from other bridge symbols
    bytes private constant SYMBOL_PREFIX = "CCTP.";
    /// @dev Length of the mandatory prefix used for CCTP token symbols
    uint256 private constant SYMBOL_PREFIX_LENGTH = 5;

    // ══════════════════════════════════════════════════ STORAGE ══════════════════════════════════════════════════════

    /// @notice Maps bridge token address into bridge token symbol
    mapping(address => string) public tokenToSymbol;
    /// @notice Maps bridge token symbol into bridge token address
    mapping(string => address) public symbolToToken;
    /// @notice Maps bridge token address into CCTP fee structure
    mapping(address => CCTPFee) public feeStructures;
    /// @notice Maps fee collector address into accumulated fees for a token
    /// (feeCollector => (token => amount))
    /// @dev Fee collector address of address(0) indicates that fees are accumulated by the Protocol
    mapping(address => mapping(address => uint256)) public accumulatedFees;
    /// @notice Maps Relayer address into collector address for accumulated Relayer's fees
    /// @dev Default value of address(0) indicates that a Relayer's fees are accumulated by the Protocol
    mapping(address => address) public relayerFeeCollectors;
    /// @notice Protocol fee: percentage of the relayer fee that is collected by the Protocol
    /// @dev Protocol collects the full fee amount, if the Relayer hasn't set a fee collector
    uint256 public protocolFee;
    /// @notice Amount of chain's native gas airdropped to the token recipient for every fulfilled CCTP request
    uint256 public chainGasAmount;
    /// @dev A list of all supported bridge tokens
    /// Note: takes two storage slots
    EnumerableSet.AddressSet internal _bridgeTokens;

    /**
     * This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[41] private __gap;

    // ════════════════════════════════════════════════ ONLY OWNER ═════════════════════════════════════════════════════

    /// @notice Adds a new token to the list of supported tokens, with the given symbol and fee structure.
    /// @dev The symbol must start with "CCTP."
    /// @param symbol       Symbol of the token
    /// @param token        Address of the token
    /// @param relayerFee   Fee % for bridging a token to this chain, multiplied by `FEE_DENOMINATOR`
    /// @param minBaseFee   Minimum fee for bridging a token to this chain using a base request
    /// @param minSwapFee   Minimum fee for bridging a token to this chain using a swap request
    /// @param maxFee       Maximum fee for bridging a token to this chain
    function addToken(
        string memory symbol,
        address token,
        uint256 relayerFee,
        uint256 minBaseFee,
        uint256 minSwapFee,
        uint256 maxFee
    ) external onlyOwner {
        if (token == address(0)) revert CCTPIncorrectConfig();
        // Add a new token to the list of supported tokens, and check that it hasn't been added before
        if (!_bridgeTokens.add(token)) revert CCTPTokenAlreadyAdded();
        // Check that symbol hasn't been added yet and starts with "CCTP."
        _assertCanAddSymbol(symbol);
        // Add token <> symbol link
        tokenToSymbol[token] = symbol;
        symbolToToken[symbol] = token;
        emit TokenAdded(symbol, token);
        // Set token fee
        _setTokenFee(token, relayerFee, minBaseFee, minSwapFee, maxFee);
    }

    /// @notice Removes a token from the list of supported tokens.
    /// @dev Will revert if the token is not supported.
    function removeToken(address token) external onlyOwner {
        // Remove a token from the list of supported tokens, and check that it has been added before
        if (!_bridgeTokens.remove(token)) revert CCTPTokenNotFound();
        // Remove token <> symbol link
        string memory symbol = tokenToSymbol[token];
        delete tokenToSymbol[token];
        delete symbolToToken[symbol];
        // Remove token fee structure
        delete feeStructures[token];
        emit TokenRemoved(symbol, token);
    }

    /// @notice Allows to rescue stuck gas from the contract.
    function rescueGas() external onlyOwner {
        (bool success, ) = msg.sender.call{value: address(this).balance}("");
        if (!success) revert CCTPGasRescueFailed();
    }

    /// @notice Sets the amount of chain gas airdropped to the token recipient for every fulfilled CCTP request.
    function setChainGasAmount(uint256 newChainGasAmount) external onlyOwner {
        chainGasAmount = newChainGasAmount;
        emit ChainGasAmountUpdated(newChainGasAmount);
    }

    /// @notice Updates the fee structure for a supported Circle token.
    /// @dev Will revert if the token is not supported.
    /// @param token        Address of the token
    /// @param relayerFee   Fee % for bridging a token to this chain, multiplied by `FEE_DENOMINATOR`
    /// @param minBaseFee   Minimum fee for bridging a token to this chain using a base request
    /// @param minSwapFee   Minimum fee for bridging a token to this chain using a swap request
    /// @param maxFee       Maximum fee for bridging a token to this chain
    function setTokenFee(
        address token,
        uint256 relayerFee,
        uint256 minBaseFee,
        uint256 minSwapFee,
        uint256 maxFee
    ) external onlyOwner {
        if (!_bridgeTokens.contains(token)) revert CCTPTokenNotFound();
        _setTokenFee(token, relayerFee, minBaseFee, minSwapFee, maxFee);
    }

    /// @notice Sets a new protocol fee.
    /// @dev The protocol fee is a percentage of the relayer fee that is collected by the Protocol.
    /// @param newProtocolFee   New protocol fee, multiplied by `FEE_DENOMINATOR`
    function setProtocolFee(uint256 newProtocolFee) external onlyOwner {
        if (newProtocolFee > MAX_PROTOCOL_FEE) revert CCTPIncorrectProtocolFee();
        protocolFee = newProtocolFee;
        emit ProtocolFeeUpdated(newProtocolFee);
    }

    // ═══════════════════════════════════════════ RELAYER INTERACTIONS ════════════════════════════════════════════════

    /// @notice Allows the Relayer to set a fee collector for accumulated fees.
    /// - New fees accumulated by the Relayer could only be withdrawn by new Relayer's fee collector.
    /// - Old fees accumulated by the Relayer could only be withdrawn by old Relayer's fee collector.
    /// @dev Default value of address(0) indicates that a Relayer's fees are accumulated by the Protocol.
    function setFeeCollector(address feeCollector) external {
        address oldFeeCollector = relayerFeeCollectors[msg.sender];
        relayerFeeCollectors[msg.sender] = feeCollector;
        emit FeeCollectorUpdated(msg.sender, oldFeeCollector, feeCollector);
    }

    // ═══════════════════════════════════════════════════ VIEWS ═══════════════════════════════════════════════════════

    /// @notice Calculates the fee amount for bridging a token to this chain using CCTP.
    /// @dev Will not check if fee exceeds the token amount. Will return 0 if the token is not supported.
    /// @param token        Address of the Circle token
    /// @param amount       Amount of the Circle tokens to be bridged to this chain
    /// @param isSwap       Whether the request is a swap request
    /// @return fee         Fee amount
    function calculateFeeAmount(
        address token,
        uint256 amount,
        bool isSwap
    ) external view returns (uint256 fee) {
        return _calculateFeeAmount(token, amount, isSwap);
    }

    /// @notice Returns the list of all supported bridge tokens and their symbols.
    function getBridgeTokens() external view returns (BridgeToken[] memory bridgeTokens) {
        uint256 length = _bridgeTokens.length();
        bridgeTokens = new BridgeToken[](length);
        for (uint256 i = 0; i < length; i++) {
            address token = _bridgeTokens.at(i);
            bridgeTokens[i] = BridgeToken({symbol: tokenToSymbol[token], token: token});
        }
    }

    // ══════════════════════════════════════════════ INTERNAL LOGIC ═══════════════════════════════════════════════════

    /// @dev Applies the relayer fee and updates the accumulated fee amount for the token.
    /// Will revert if the fee exceeds the token amount, or token is not supported.
    function _applyRelayerFee(
        address token,
        uint256 amount,
        bool isSwap
    ) internal returns (uint256 amountAfterFee, uint256 fee) {
        if (!_bridgeTokens.contains(token)) revert CCTPTokenNotFound();
        fee = _calculateFeeAmount(token, amount, isSwap);
        if (fee >= amount) revert CCTPInsufficientAmount();
        // Could use the unchecked math, as we already checked that fee < amount
        unchecked {
            amountAfterFee = amount - fee;
        }
        // Check if the Relayer has specified a fee collector
        address feeCollector = relayerFeeCollectors[msg.sender];
        if (feeCollector == address(0)) {
            // If the fee collector is not set, the Protocol will collect the full fees
            accumulatedFees[address(0)][token] += fee;
            emit FeeCollected(address(0), 0, fee);
        } else {
            // Otherwise, the Relayer and the Protocol will split the fees
            uint256 protocolFeeAmount = (fee * protocolFee) / FEE_DENOMINATOR;
            uint256 relayerFeeAmount = fee - protocolFeeAmount;
            accumulatedFees[address(0)][token] += protocolFeeAmount;
            accumulatedFees[feeCollector][token] += relayerFeeAmount;
            emit FeeCollected(feeCollector, relayerFeeAmount, protocolFeeAmount);
        }
    }

    /// @dev Sets the fee structure for a supported Circle token.
    function _setTokenFee(
        address token,
        uint256 relayerFee,
        uint256 minBaseFee,
        uint256 minSwapFee,
        uint256 maxFee
    ) internal {
        // Check that relayer fee is not too high
        if (relayerFee > MAX_RELAYER_FEE) revert CCTPIncorrectConfig();
        // Min base fee must not exceed min swap fee
        if (minBaseFee > minSwapFee) revert CCTPIncorrectConfig();
        // Min swap fee must not exceed max fee
        if (minSwapFee > maxFee) revert CCTPIncorrectConfig();
        feeStructures[token] = CCTPFee({
            relayerFee: relayerFee.safeCastToUint40(),
            minBaseFee: minBaseFee.safeCastToUint72(),
            minSwapFee: minSwapFee.safeCastToUint72(),
            maxFee: maxFee.safeCastToUint72()
        });
        emit TokenFeeSet(token, relayerFee, minBaseFee, minSwapFee, maxFee);
    }

    /// @dev Transfers `msg.value` to the recipient. Assumes that `msg.value == chainGasAmount` at this point.
    function _transferMsgValue(address recipient) internal {
        // Try to send the gas airdrop to the recipient
        (bool success, ) = recipient.call{value: msg.value}("");
        // If the transfer failed, set the emitted amount to 0
        emit ChainGasAirdropped(success ? msg.value : 0);
    }

    // ══════════════════════════════════════════════ INTERNAL VIEWS ═══════════════════════════════════════════════════

    /// @dev Checks that the symbol hasn't been added yet and starts with "CCTP."
    function _assertCanAddSymbol(string memory symbol) internal view {
        // Check if the symbol has already been added
        if (symbolToToken[symbol] != address(0)) revert CCTPSymbolAlreadyAdded();
        // Cast to bytes to check the length
        bytes memory symbolBytes = bytes(symbol);
        // Check that symbol is correct: starts with "CCTP." and has at least 1 more character
        if (symbolBytes.length <= SYMBOL_PREFIX_LENGTH) revert CCTPSymbolIncorrect();
        for (uint256 i = 0; i < SYMBOL_PREFIX_LENGTH; ) {
            if (symbolBytes[i] != SYMBOL_PREFIX[i]) revert CCTPSymbolIncorrect();
            unchecked {
                ++i;
            }
        }
    }

    /// @dev Calculates the fee amount for bridging a token to this chain using CCTP.
    /// Will not check if fee exceeds the token amount. Will return 0 if the token is not supported.
    function _calculateFeeAmount(
        address token,
        uint256 amount,
        bool isSwap
    ) internal view returns (uint256 fee) {
        CCTPFee memory feeStructure = feeStructures[token];
        // Calculate the fee amount
        fee = (amount * feeStructure.relayerFee) / FEE_DENOMINATOR;
        // Apply minimum fee
        uint256 minFee = isSwap ? feeStructure.minSwapFee : feeStructure.minBaseFee;
        if (fee < minFee) fee = minFee;
        // Apply maximum fee
        if (fee > feeStructure.maxFee) fee = feeStructure.maxFee;
    }
}

File 5 of 24 : IMessageTransmitter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface IMessageTransmitter {
    /**
     * @notice Receives an incoming message, validating the header and passing
     * the body to application-specific handler.
     * @param message The message raw bytes
     * @param signature The message signature
     * @return success bool, true if successful
     */
    function receiveMessage(bytes calldata message, bytes calldata signature) external returns (bool success);

    /**
     * @notice Sends an outgoing message from the source domain, with a specified caller on the
     * destination domain.
     * @dev Increment nonce, format the message, and emit `MessageSent` event with message information.
     * WARNING: if the `destinationCaller` does not represent a valid address as bytes32, then it will not be possible
     * to broadcast the message on the destination domain. This is an advanced feature, and the standard
     * sendMessage() should be preferred for use cases where a specific destination caller is not required.
     * @param destinationDomain Domain of destination chain
     * @param recipient Address of message recipient on destination domain as bytes32
     * @param destinationCaller caller on the destination domain, as bytes32
     * @param messageBody Raw bytes content of message
     * @return nonce reserved by message
     */
    function sendMessageWithCaller(
        uint32 destinationDomain,
        bytes32 recipient,
        bytes32 destinationCaller,
        bytes calldata messageBody
    ) external returns (uint64);

    // ═══════════════════════════════════════════════════ VIEWS ═══════════════════════════════════════════════════════

    // Domain of chain on which the contract is deployed
    function localDomain() external view returns (uint32);

    // Next available nonce from this source domain
    function nextAvailableNonce() external view returns (uint64);
}

File 6 of 24 : ISynapseCCTP.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {ITokenMessenger} from "./ITokenMessenger.sol";
import {ISynapseCCTPFees} from "./ISynapseCCTPFees.sol";

interface ISynapseCCTP is ISynapseCCTPFees {
    /// @notice Send a Circle token supported by CCTP to a given chain
    /// with the request for the action to take on the destination chain.
    /// @dev The request is a bytes array containing information about the end recipient of the tokens,
    /// as well as an optional swap action to take on the destination chain.
    /// `chainId` refers to value from EIP-155 (block.chainid).
    /// @param recipient            Recipient of the tokens on destination chain
    /// @param chainId              Chain ID of the destination chain
    /// @param burnToken            Address of Circle token to burn
    /// @param amount               Amount of tokens to burn
    /// @param requestVersion       Version of the request format
    /// @param swapParams           Swap parameters for the action to take on the destination chain (could be empty)
    function sendCircleToken(
        address recipient,
        uint256 chainId,
        address burnToken,
        uint256 amount,
        uint32 requestVersion,
        bytes memory swapParams
    ) external;

    /// @notice Receive  Circle token supported by CCTP with the request for the action to take.
    /// @dev The request is a bytes array containing information about the end recipient of the tokens,
    /// as well as an optional swap action to take on this chain.
    /// @dev The relayers need to use SynapseCCTP.chainGasAmount() as `msg.value` when calling this function,
    /// or the call will revert.
    /// @param message              Message raw bytes emitted by CCTP MessageTransmitter on origin chain
    /// @param signature            Circle's attestation for the message obtained from Circle's API
    /// @param requestVersion       Version of the request format
    /// @param formattedRequest     Formatted request for the action to take on this chain
    function receiveCircleToken(
        bytes calldata message,
        bytes calldata signature,
        uint32 requestVersion,
        bytes memory formattedRequest
    ) external payable;

    // ═══════════════════════════════════════════════════ VIEWS ═══════════════════════════════════════════════════════

    /// @notice Returns the whitelisted liquidity pool for a given Circle token.
    /// @dev Returns address(0) if the token bridge+swap is not supported.
    function circleTokenPool(address token) external view returns (address pool);

    /// @notice Returns the address of Circle's TokenMessenger contract used for bridging Circle tokens.
    function tokenMessenger() external view returns (ITokenMessenger);
}

File 7 of 24 : ITokenMinter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

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

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

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

    // local token (address) => maximum burn amounts per message
    function burnLimitsPerMessage(address token) external view returns (uint256);
}

File 8 of 24 : ITokenMessenger.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface ITokenMessenger {
    /**
     * @notice Deposits and burns tokens from sender to be minted on destination domain. The mint
     * on the destination domain must be called by `destinationCaller`.
     * WARNING: if the `destinationCaller` does not represent a valid address as bytes32, then it will not be possible
     * to broadcast the message on the destination domain. This is an advanced feature, and the standard
     * depositForBurn() should be preferred for use cases where a specific destination caller is not required.
     * Emits a `DepositForBurn` event.
     * @dev reverts if:
     * - given destinationCaller is zero address
     * - given burnToken is not supported
     * - given destinationDomain has no TokenMessenger registered
     * - transferFrom() reverts. For example, if sender's burnToken balance or approved allowance
     * to this contract is less than `amount`.
     * - burn() reverts. For example, if `amount` is 0.
     * - MessageTransmitter returns false or reverts.
     * @param amount amount of tokens to burn
     * @param destinationDomain destination domain
     * @param mintRecipient address of mint recipient on destination domain
     * @param burnToken address of contract to burn deposited tokens, on local domain
     * @param destinationCaller caller on the destination domain, as bytes32
     * @return nonce unique nonce reserved by message
     */
    function depositForBurnWithCaller(
        uint256 amount,
        uint32 destinationDomain,
        bytes32 mintRecipient,
        address burnToken,
        bytes32 destinationCaller
    ) external returns (uint64 nonce);

    /**
     * @notice Handles an incoming message received by the local MessageTransmitter,
     * and takes the appropriate action. For a burn message, mints the
     * associated token to the requested recipient on the local domain.
     * @dev Validates the local sender is the local MessageTransmitter, and the
     * remote sender is a registered remote TokenMessenger for `remoteDomain`.
     * @param remoteDomain The domain where the message originated from.
     * @param sender The sender of the message (remote TokenMessenger).
     * @param messageBody The message body bytes.
     * @return success Bool, true if successful.
     */
    function handleReceiveMessage(
        uint32 remoteDomain,
        bytes32 sender,
        bytes calldata messageBody
    ) external returns (bool success);

    // ═══════════════════════════════════════════════════ VIEWS ═══════════════════════════════════════════════════════

    // Local Message Transmitter responsible for sending and receiving messages to/from remote domains
    function localMessageTransmitter() external view returns (address);

    // Minter responsible for minting and burning tokens on the local domain
    function localMinter() external view returns (address);
}

File 9 of 24 : Request.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {IncorrectRequestLength, UnknownRequestVersion} from "./Errors.sol";

/// # Base Request layout
///
/// | Field           | Type    | Description                                    |
/// | --------------- | ------- | ---------------------------------------------- |
/// | originDomain    | uint32  | Domain of the origin chain used by Circle CCTP |
/// | nonce           | uint64  | Nonce of the CCTP message on origin chain      |
/// | originBurnToken | address | Circle token that was burned on origin chain   |
/// | amount          | uint256 | Amount of tokens burned on origin chain        |
/// | recipient       | address | Recipient of the tokens on destination chain   |
///
/// # Swap Params layout
///
/// | Field          | Type    | Description                                                   |
/// | -------------- | ------- | ------------------------------------------------------------- |
/// | tokenIndexFrom | uint8   | Index of the minted Circle token in the pool                  |
/// | tokenIndexTo   | uint8   | Index of the final token in the pool                          |
/// | deadline       | uint256 | Latest timestamp to execute the swap                          |
/// | minAmountOut   | uint256 | Minimum amount of tokens to receive from the swap             |
library RequestLib {
    uint32 internal constant REQUEST_BASE = 0;
    uint32 internal constant REQUEST_SWAP = 1;

    /// @notice Length of the encoded base request.
    uint256 internal constant REQUEST_BASE_LENGTH = 5 * 32;
    /// @notice Length of the encoded swap parameters.
    uint256 internal constant SWAP_PARAMS_LENGTH = 4 * 32;
    /// @notice Length of the encoded swap request.
    /// Need 2 extra words for each `bytes` field to store its offset in the full payload, and length.
    uint256 internal constant REQUEST_SWAP_LENGTH = 4 * 32 + REQUEST_BASE_LENGTH + SWAP_PARAMS_LENGTH;

    // ════════════════════════════════════════════════ FORMATTING ═════════════════════════════════════════════════════

    /// @notice Formats the base request into a bytes array.
    /// @param originDomain         Domain of the origin chain
    /// @param nonce                Nonce of the CCTP message on origin chain
    /// @param originBurnToken      Circle token that was burned on origin chain
    /// @param amount               Amount of tokens burned on origin chain
    /// @param recipient            Recipient of the tokens on destination chain
    /// @return formattedRequest    Properly formatted base request
    function formatBaseRequest(
        uint32 originDomain,
        uint64 nonce,
        address originBurnToken,
        uint256 amount,
        address recipient
    ) internal pure returns (bytes memory formattedRequest) {
        return abi.encode(originDomain, nonce, originBurnToken, amount, recipient);
    }

    /// @notice Formats the swap parameters part of the swap request into a bytes array.
    /// @param tokenIndexFrom       Index of the minted Circle token in the pool
    /// @param tokenIndexTo         Index of the final token in the pool
    /// @param deadline             Latest timestamp to execute the swap
    /// @param minAmountOut         Minimum amount of tokens to receive from the swap
    /// @return formattedSwapParams Properly formatted swap parameters
    function formatSwapParams(
        uint8 tokenIndexFrom,
        uint8 tokenIndexTo,
        uint256 deadline,
        uint256 minAmountOut
    ) internal pure returns (bytes memory formattedSwapParams) {
        return abi.encode(tokenIndexFrom, tokenIndexTo, deadline, minAmountOut);
    }

    /// @notice Formats the request into a bytes array.
    /// @dev Will revert if the either of these is true:
    /// - Request version is unknown.
    /// - Base request is not properly formatted.
    /// - Swap parameters are specified for a base request.
    /// - Swap parameters are not properly formatted.
    /// @param requestVersion       Version of the request format
    /// @param baseRequest          Formatted base request
    /// @param swapParams           Formatted swap parameters
    /// @return formattedRequest    Properly formatted request
    function formatRequest(
        uint32 requestVersion,
        bytes memory baseRequest,
        bytes memory swapParams
    ) internal pure returns (bytes memory formattedRequest) {
        if (baseRequest.length != REQUEST_BASE_LENGTH) revert IncorrectRequestLength();
        if (requestVersion == REQUEST_BASE) {
            if (swapParams.length != 0) revert IncorrectRequestLength();
            // swapParams is empty, so we can just return the base request
            return baseRequest;
        } else if (requestVersion == REQUEST_SWAP) {
            if (swapParams.length != SWAP_PARAMS_LENGTH) revert IncorrectRequestLength();
            // Encode both the base request and the swap parameters
            return abi.encode(baseRequest, swapParams);
        } else {
            revert UnknownRequestVersion();
        }
    }

    // ═════════════════════════════════════════════════ DECODING ══════════════════════════════════════════════════════

    /// @notice Decodes the base request from a bytes array.
    /// @dev Will revert if the request is not properly formatted.
    /// @param baseRequest          Formatted base request
    /// @return originDomain        Domain of the origin chain
    /// @return nonce               Nonce of the CCTP message on origin domain
    /// @return originBurnToken     Circle token that was burned on origin domain
    /// @return amount              Amount of tokens to burn
    /// @return recipient           Recipient of the tokens on destination domain
    function decodeBaseRequest(bytes memory baseRequest)
        internal
        pure
        returns (
            uint32 originDomain,
            uint64 nonce,
            address originBurnToken,
            uint256 amount,
            address recipient
        )
    {
        if (baseRequest.length != REQUEST_BASE_LENGTH) revert IncorrectRequestLength();
        return abi.decode(baseRequest, (uint32, uint64, address, uint256, address));
    }

    /// @notice Decodes the swap parameters from a bytes array.
    /// @dev Will revert if the swap parameters are not properly formatted.
    /// @param swapParams           Formatted swap parameters
    /// @return tokenIndexFrom      Index of the minted Circle token in the pool
    /// @return tokenIndexTo        Index of the final token in the pool
    /// @return deadline            Latest timestamp to execute the swap
    /// @return minAmountOut        Minimum amount of tokens to receive from the swap
    function decodeSwapParams(bytes memory swapParams)
        internal
        pure
        returns (
            uint8 tokenIndexFrom,
            uint8 tokenIndexTo,
            uint256 deadline,
            uint256 minAmountOut
        )
    {
        if (swapParams.length != SWAP_PARAMS_LENGTH) revert IncorrectRequestLength();
        return abi.decode(swapParams, (uint8, uint8, uint256, uint256));
    }

    /// @notice Decodes the versioned request from a bytes array.
    /// @dev Will revert if the either of these is true:
    /// - Request version is unknown.
    /// - Request is not properly formatted.
    /// @param requestVersion       Version of the request format
    /// @param formattedRequest     Formatted request
    /// @return baseRequest         Formatted base request
    /// @return swapParams          Formatted swap parameters
    function decodeRequest(uint32 requestVersion, bytes memory formattedRequest)
        internal
        pure
        returns (bytes memory baseRequest, bytes memory swapParams)
    {
        if (requestVersion == REQUEST_BASE) {
            if (formattedRequest.length != REQUEST_BASE_LENGTH) revert IncorrectRequestLength();
            return (formattedRequest, "");
        } else if (requestVersion == REQUEST_SWAP) {
            if (formattedRequest.length != REQUEST_SWAP_LENGTH) revert IncorrectRequestLength();
            return abi.decode(formattedRequest, (bytes, bytes));
        } else {
            revert UnknownRequestVersion();
        }
    }
}

File 10 of 24 : MinimalForwarder.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {ForwarderDeploymentFailed} from "./Errors.sol";
import {TypeCasts} from "./TypeCasts.sol";

import {Address} from "@openzeppelin/contracts-4.5.0/utils/Address.sol";

/// Minimal Forwarder is a EIP-1167 (Minimal Proxy Contract) spin-off that
/// forwards all calls to a any target address with any payload.
/// Unlike EIP-1167, delegates calls are not used, so the forwarder contract
/// is `msg.sender` as far as the target contract is concerned.
/// # Minimal Forwarder Bytecode
/// Inspired by [EIP-1167](https://eips.ethereum.org/EIPS/eip-1167).
/// Following changes were made:
/// - Target address is not saved in the deployed contract code, but is passed as a part of the payload.
/// - To forward a call, the sender needs to provide the target address as the first 32 bytes of the payload.
/// - The payload to pass to the target contract occupies the rest of the payload, having an offset of 32 bytes.
/// - The target address is derived using CALLDATALOAD.
/// - CALLVALUE is used to pass the msg.value to the target contract.
/// - `call()` is used instead of `delegatecall()`.
/// ## Bytecode Table
/// | Pos  | OP   | OP + Args | Description    | S7  | S6   | S5  | S4  | S3     | S2  | S1     | S0     |
/// | ---- | ---- | --------- | -------------- | --- | ---- | --- | --- | ------ | --- | ------ | ------ |
/// | 0x00 | 0x60 | 0x6020    | push1 0x20     |     |      |     |     |        |     |        | 32     |
/// | 0x02 | 0x36 | 0x36      | calldatasize   |     |      |     |     |        |     | cds    | 32     |
/// | 0x03 | 0x03 | 0x03      | sub            |     |      |     |     |        |     |        | cds-32 |
/// | 0x04 | 0x80 | 0x80      | dup1           |     |      |     |     |        |     | cds-32 | cds-32 |
/// | 0x05 | 0x60 | 0x6020    | push1 0x20     |     |      |     |     |        | 32  | cds-32 | cds-32 |
/// | 0x07 | 0x3d | 0x3d      | returndatasize |     |      |     |     | 0      | 32  | cds-32 | cds-32 |
/// | 0x08 | 0x37 | 0x37      | calldatacopy   |     |      |     |     |        |     |        | cds-32 |
/// | 0x09 | 0x3d | 0x3d      | returndatasize |     |      |     |     |        |     | 0      | cds-32 |
/// | 0x0a | 0x3d | 0x3d      | returndatasize |     |      |     |     |        | 0   | 0      | cds-32 |
/// | 0x0b | 0x3d | 0x3d      | returndatasize |     |      |     |     | 0      | 0   | 0      | cds-32 |
/// | 0x0c | 0x92 | 0x92      | swap3          |     |      |     |     | cds-32 | 0   | 0      | 0      |
/// | 0x0d | 0x3d | 0x3d      | returndatasize |     |      |     | 0   | cds-32 | 0   | 0      | 0      |
/// | 0x0e | 0x34 | 0x34      | callvalue      |     |      | val | 0   | cds-32 | 0   | 0      | 0      |
/// | 0x0f | 0x3d | 0x3d      | returndatasize |     | 0    | val | 0   | cds-32 | 0   | 0      | 0      |
/// | 0x10 | 0x35 | 0x35      | calldataload   |     | addr | val | 0   | cds-32 | 0   | 0      | 0      |
/// | 0x11 | 0x5a | 0x5a      | gas            | gas | addr | val | 0   | cds-32 | 0   | 0      | 0      |
/// | 0x12 | 0xf1 | 0xf1      | call           |     |      |     |     |        |     | suc    | 0      |
/// | 0x13 | 0x3d | 0x3d      | returndatasize |     |      |     |     |        | rds | suc    | 0      |
/// | 0x14 | 0x82 | 0x82      | dup3           |     |      |     |     | 0      | rds | suc    | 0      |
/// | 0x15 | 0x80 | 0x80      | dup1           |     |      |     | 0   | 0      | rds | suc    | 0      |
/// | 0x16 | 0x3e | 0x3e      | returndatacopy |     |      |     |     |        |     | suc    | 0      |
/// | 0x17 | 0x90 | 0x90      | swap1          |     |      |     |     |        |     | 0      | suc    |
/// | 0x18 | 0x3d | 0x3d      | returndatasize |     |      |     |     |        | rds | 0      | suc    |
/// | 0x19 | 0x91 | 0x91      | swap2          |     |      |     |     |        | suc | 0      | rds    |
/// | 0x1a | 0x60 | 0x601e    | push1 0x1e     |     |      |     |     | 0x1e   | suc | 0      | rds    |
/// | 0x1c | 0x57 | 0x57      | jumpi          |     |      |     |     |        |     | 0      | rds    |
/// | 0x1d | 0xfd | 0xfd      | revert         |     |      |     |     |        |     |        |        |
/// | 0x1e | 0x5b | 0x5b      | jumpdest       |     |      |     |     |        |     | 0      | rds    |
/// | 0x1f | 0xf3 | 0xf3      | return         |     |      |     |     |        |     |        |        |
/// > - Opcode + Args refers to the bytecode of the opcode and its arguments (if there are any).
/// > - Stack View (S7..S0) is shown after the execution of the opcode.
/// > - The stack elements are shown from top to bottom.
/// > Opcodes are typically dealing with the top stack elements, so they are shown first.
/// > - `cds` refers to the calldata size.
/// > - `rds` refers to the returndata size (which is zero before the first external call).
/// > - `val` refers to the provided `msg.value`.
/// > - `addr` refers to the target address loaded from calldata.
/// > - `gas` refers to the return value of the `gas()` opcode: the amount of gas left.
/// > - `suc` refers to the return value of the `call()` opcode: 0 on failure, 1 on success.
/// ## Bytecode Explanation
/// - `0x00..0x03` - Calculate the offset of the payload in the calldata (first 32 bytes is target address).
/// > - `sub` pops the top two stack items, subtracts them, and pushes the result onto the stack.
/// - `0x04..0x04` - Duplicate the offset to use it later as "payload length".
/// > - `dup1` duplicates the top stack item.
/// - `0x05..0x08` - Copy the target call payload to memory.
/// > - `calldatacopy` copies a portion of the calldata to memory. Pops three top stack elements:
/// > memory offset to write to, calldata offset to read from, and length of the data to copy.
/// - `0x09..0x11` - Prepare the stack for the `call` opcode.
/// > - We are putting an extra zero on the stack to use it later on, as `returndatacopy` will not return zero
/// > after we perform the first external call.
/// > - `swap3` swaps the top stack item with the fourth stack item.
/// > - `callvalue` pushes `msg.value` onto the stack.
/// > - `calldataload` pushes a word (32 bytes) onto the stack from calldata. Pops the calldata offset from the stack.
/// > Writes the word from calldata to the stack. We are using offset==0 to load the target address.
/// > - `gas` pushes the remaining gas onto the stack.
/// - `0x12..0x12` - Call the target contract.
/// > - `call` issues an external call to a target address.
/// > -  Pops seven top stack items: gas, target address, value, input offset, input length,
/// > memory offset to write return data to, and length of return data to write to memory.
/// > - Pushes on stack: 0 on failure, 1 on success.
/// - `0x13..0x16` - Copy the return data to memory.
/// > - `returndatasize` pushes the size of the returned data from the external call onto the stack.
/// > - `dup3` duplicates the third stack item.
/// > - `returncopydata` copies a portion of the returned data to memory. Pops three top stack elements:
/// > memory offset to write to, return data offset to read from, and length of the data to copy.
/// - `0x17..0x1b` - Prepare the stack for either revert or return: jump dst, success flag, zero, and return data size.
/// > - `swap1` swaps the top stack item with the second stack item.
/// > - `swap2` swaps the top stack item with the third stack item.
/// > - `0x1e` refers to the position of the `jumpdest` opcode.
/// >  It is used to jump to the `return` opcode, if call was successful.
/// - `0x1c..0x1c` - Jump to 0x1e position, if call was successful.
/// > - `jumpi` pops two top stack items: jump destination and jump condition.
/// > If jump condition is nonzero, jumps to the jump destination.
/// - `0x1d..0x1d` - Revert if call was unsuccessful.
/// > - `revert` pops two top stack items: memory offset to read revert message from and length of the revert message.
/// > - This allows us to bubble the revert message from the external call.
/// - `0x1e..0x1e` - Jump destination for successful call.
/// > - `jumpdest` is a no-op that marks a valid jump destination.
/// - `0x1f..0x1f` - Return if call was successful.
/// > - `return` pops two top stack items: memory offset to read return data from and length of the return data.
/// > - This allows us to reuse the return data from the external call.
/// # Minimal Forwarder Init Code
/// Inspired by [Create3 Init Code](https://github.com/0xSequence/create3/blob/master/contracts/Create3.sol).
/// Following changes were made:
/// - Adjusted bytecode length to 32 bytes.
/// - Replaced second PUSH1 opcode with RETURNDATASIZE to push 0 onto the stack.
/// > `bytecode` refers to the bytecode specified in the above table.
/// ## Init Code Table
/// | Pos  | OP   | OP + Args | Description     | S1  | S0       |
/// | ---- | ---- | --------- | --------------- | --- | -------- |
/// | 0x00 | 0x7f | 0x7fXXXX  | push32 bytecode |     | bytecode |
/// | 0x1b | 0x3d | 0x3d      | returndatasize  | 0   | bytecode |
/// | 0x1c | 0x52 | 0x52      | mstore          |     |          |
/// | 0x1d | 0x60 | 0x6020    | push1 0x20      |     | 32       |
/// | 0x1f | 0x3d | 0x3d      | returndatasize  | 0   | 32       |
/// | 0x20 | 0xf3 | 0xf3      | return          |     |          |
/// > Init Code is executed when a contract is deployed. The returned value is saved as the contract code.
/// > Therefore, the init code is constructed in such a way that it returns the Minimal Forwarder bytecode.
/// ## Init Code Explanation
/// - `0x00..0x1a` - Push the Minimal Forwarder bytecode onto the stack.
/// > - `push32` pushes 32 bytes as a single stack item onto the stack.
/// - `0x1b..0x1b` - Push 0 onto the stack.
/// > No external calls were made, so the return data size is 0.
/// - `0x1c..0x1c` - Write the Minimal Forwarder bytecode to memory.
/// > - `mstore` pops two top stack items: memory offset to write to and value to write.
/// > - Minimal Forwarder bytecode is 32 bytes long, so we need a single `mstore` to write it to memory.
/// - `0x1d..0x1f` - Prepare stack for `return` opcode.
/// > - We need to put `0 32` on the stack in order to return first 32 bytes of memory.
/// - `0x20..0x20` - Return the Minimal Forwarder bytecode.
/// > - `return` pops two top stack items: memory offset to read return data from and length of the return data.
/// > - This allows us to return the Minimal Forwarder bytecode.
library MinimalForwarderLib {
    using Address for address;
    using TypeCasts for address;
    using TypeCasts for bytes32;

    /// @notice Minimal Forwarder deployed bytecode. See the above table for more details.
    bytes internal constant FORWARDER_BYTECODE =
        hex"60_20_36_03_80_60_20_3d_37_3d_3d_3d_92_3d_34_3d_35_5a_f1_3d_82_80_3e_90_3d_91_60_1e_57_fd_5b_f3";

    /// @notice Init code to deploy a minimal forwarder contract.
    bytes internal constant FORWARDER_INIT_CODE = abi.encodePacked(hex"7f", FORWARDER_BYTECODE, hex"3d_52_60_20_3d_f3");

    /// @notice Hash of the minimal forwarder init code. Used to predict the address of a deployed forwarder.
    bytes32 internal constant FORWARDER_INIT_CODE_HASH = keccak256(FORWARDER_INIT_CODE);

    /// @notice Deploys a minimal forwarder contract using `CREATE2` with a given salt.
    /// @dev No-op if the contract is already deployed.
    /// @param salt         The salt to use for the deployment
    /// @return forwarder   The address of the deployed minimal forwarder
    function deploy(bytes32 salt) internal returns (address forwarder) {
        // Check if the Forwarder has already been deployed.
        forwarder = predictAddress(address(this), salt);
        if (forwarder.code.length > 0) return forwarder;
        // `bytes arr` is stored in memory in the following way
        // 1. First, uint256 arr.length is stored. That requires 32 bytes (0x20).
        // 2. Then, the array data is stored.
        bytes memory initCode = FORWARDER_INIT_CODE;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            // Deploy the minimal forwarder with our pre-made bytecode via CREATE2.
            // We add 0x20 to get the location where the init code starts.
            forwarder := create2(0, add(initCode, 0x20), mload(initCode), salt)
        }
        // Check if the deployment was successful.
        if (forwarder == address(0)) {
            revert ForwarderDeploymentFailed();
        }
    }

    /// @notice Forwards a call to a target address using a minimal forwarder.
    /// @dev Will bubble up any revert messages from the target.
    /// @param forwarder    The address of the minimal forwarder to use
    /// @param target       The address of the target contract to call
    /// @param payload      The payload to pass to the target contract
    /// @return returnData  The return data from the target contract
    function forwardCall(
        address forwarder,
        address target,
        bytes memory payload
    ) internal returns (bytes memory returnData) {
        // Forward a call without any ETH value
        returnData = forwardCallWithValue(forwarder, target, payload, 0);
    }

    /// @notice Forwards a call to a target address using a minimal forwarder with the given `msg.value`.
    /// @dev Will bubble up any revert messages from the target.
    /// @param forwarder    The address of the minimal forwarder to use
    /// @param target       The address of the target contract to call
    /// @param payload      The payload to pass to the target contract
    /// @param value        The amount of ETH to send with the call
    /// @return returnData  The return data from the target contract
    function forwardCallWithValue(
        address forwarder,
        address target,
        bytes memory payload,
        uint256 value
    ) internal returns (bytes memory returnData) {
        // The payload to pass to the forwarder:
        // 1. First 32 bytes is the encoded target address
        // 2. The rest is the encoded payload to pass to the target
        returnData = forwarder.functionCallWithValue(abi.encodePacked(target.addressToBytes32(), payload), value);
    }

    /// @notice Predicts the address of a minimal forwarder contract deployed using `deploy()`.
    /// @param deployer     The address of the deployer of the minimal forwarder
    /// @param salt         The salt to use for the deployment
    /// @return The predicted address of the minimal forwarder deployed with the given salt
    function predictAddress(address deployer, bytes32 salt) internal pure returns (address) {
        return keccak256(abi.encodePacked(hex"ff", deployer, salt, FORWARDER_INIT_CODE_HASH)).bytes32ToAddress();
    }
}

File 11 of 24 : TypeCasts.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {CastOverflow} from "./Errors.sol";

library TypeCasts {
    // alignment preserving cast
    function addressToBytes32(address addr) internal pure returns (bytes32) {
        return bytes32(uint256(uint160(addr)));
    }

    // alignment preserving cast
    function bytes32ToAddress(bytes32 buf) internal pure returns (address) {
        return address(uint160(uint256(buf)));
    }

    /// @dev Casts uint256 to uint40, reverts on overflow
    function safeCastToUint40(uint256 value) internal pure returns (uint40) {
        if (value > type(uint40).max) {
            revert CastOverflow();
        }
        return uint40(value);
    }

    /// @dev Casts uint256 to uint72, reverts on overflow
    function safeCastToUint72(uint256 value) internal pure returns (uint72) {
        if (value > type(uint72).max) {
            revert CastOverflow();
        }
        return uint72(value);
    }
}

File 12 of 24 : IDefaultPool.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface IDefaultPool {
    function swap(
        uint8 tokenIndexFrom,
        uint8 tokenIndexTo,
        uint256 dx,
        uint256 minDy,
        uint256 deadline
    ) external returns (uint256 amountOut);

    function calculateSwap(
        uint8 tokenIndexFrom,
        uint8 tokenIndexTo,
        uint256 dx
    ) external view returns (uint256 amountOut);

    function getToken(uint8 index) external view returns (address token);
}

File 13 of 24 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

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

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

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

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

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

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 14 of 24 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }

    /**
     * This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 15 of 24 : SynapseCCTPFeesEvents.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

abstract contract SynapseCCTPFeesEvents {
    /// @notice Emitted when the fee collector is updated for a relayer
    /// @param relayer          The relayer address
    /// @param oldFeeCollector  The old fee collector address: will be able to withdraw prior fees
    /// @param newFeeCollector  The new fee collector address: will be able to withdraw future fees
    event FeeCollectorUpdated(address indexed relayer, address oldFeeCollector, address newFeeCollector);

    /// @notice Emitted when the fee for relaying a CCTP message is collected
    /// @dev If fee collector address is not set, the full fee is collected for the protocol
    /// @param feeCollector      The fee collector address
    /// @param relayerFeeAmount  The amount of fees collected for the relayer
    /// @param protocolFeeAmount The amount of fees collected for the protocol
    event FeeCollected(address feeCollector, uint256 relayerFeeAmount, uint256 protocolFeeAmount);

    /// @notice Emitted when the amount of native gas airdropped to recipients is updated
    /// @param chainGasAmount   The new amount of native gas airdropped to recipients
    event ChainGasAmountUpdated(uint256 chainGasAmount);

    /// @notice Emitted when the native chain gas is airdropped to a recipient
    event ChainGasAirdropped(uint256 amount);

    /// @notice Emitted when the protocol fee is updated
    /// @param newProtocolFee  The new protocol fee
    event ProtocolFeeUpdated(uint256 newProtocolFee);

    /// @notice Emitted when a support for the Circle token is added
    /// @param symbol           Symbol of the Circle token
    /// @param token            Address of the Circle token
    event TokenAdded(string symbol, address token);

    /// @notice Emitted when a support for the Circle token is removed
    /// @param symbol           Symbol of the Circle token
    /// @param token            Address of the Circle token
    event TokenRemoved(string symbol, address token);

    /// @notice Emitted when the token fee is set for a token
    /// @param token            Address of the Circle token
    /// @param relayerFee       Fee % for bridging a token to this chain, multiplied by `FEE_DENOMINATOR`
    /// @param minBaseFee       Minimum fee for bridging a token to this chain using a base request
    /// @param minSwapFee       Minimum fee for bridging a token to this chain using a swap request
    /// @param maxFee           Maximum fee for bridging a token to this chain
    event TokenFeeSet(address token, uint256 relayerFee, uint256 minBaseFee, uint256 minSwapFee, uint256 maxFee);
}

File 16 of 24 : ISynapseCCTPFees.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {BridgeToken} from "../../router/libs/Structs.sol";

interface ISynapseCCTPFees {
    /// @notice Calculates the fee amount for bridging a token to this chain using CCTP.
    /// @dev Will not check if fee exceeds the token amount. Will return 0 if the token is not supported.
    /// @param token        Address of the Circle token
    /// @param amount       Amount of the Circle tokens to be bridged to this chain
    /// @param isSwap       Whether the request is a swap request
    /// @return fee         Fee amount
    function calculateFeeAmount(
        address token,
        uint256 amount,
        bool isSwap
    ) external view returns (uint256 fee);

    /// @notice Gets the fee structure for bridging a token to this chain.
    /// @dev Will return 0 for all fields if the token is not supported.
    /// @param token        Address of the Circle token
    /// @return relayerFee  Fee % for bridging a token to this chain, multiplied by `FEE_DENOMINATOR`
    /// @return minBaseFee  Minimum fee for bridging a token to this chain using a base request
    /// @return minSwapFee  Minimum fee for bridging a token to this chain using a swap request
    /// @return maxFee      Maximum fee for bridging a token to this chain
    function feeStructures(address token)
        external
        view
        returns (
            uint40 relayerFee,
            uint72 minBaseFee,
            uint72 minSwapFee,
            uint72 maxFee
        );

    /// @notice Returns the list of all supported bridge tokens and their symbols.
    function getBridgeTokens() external view returns (BridgeToken[] memory bridgeTokens);

    /// @notice Returns the address of the CCTP token for a given symbol.
    /// @dev Will return address(0) if the token is not supported.
    function symbolToToken(string memory symbol) external view returns (address token);

    /// @notice Returns the symbol of a given CCTP token.
    /// @dev Will return empty string if the token is not supported.
    function tokenToSymbol(address token) external view returns (string memory symbol);
}

File 17 of 24 : Structs.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.13; // "using A for B global" requires 0.8.13 or higher

// ══════════════════════════════════════════ TOKEN AND POOL DESCRIPTION ═══════════════════════════════════════════════

/// @notice Struct representing a bridge token. Used as the return value in view functions.
/// @param symbol   Bridge token symbol: unique token ID consistent among all chains
/// @param token    Bridge token address
struct BridgeToken {
    string symbol;
    address token;
}

/// @notice Struct used by IPoolHandler to represent a token in a pool
/// @param index    Token index in the pool
/// @param token    Token address
struct IndexedToken {
    uint8 index;
    address token;
}

/// @notice Struct representing a token, and the available Actions for performing a swap.
/// @param actionMask   Bitmask representing what actions (see ActionLib) are available for swapping a token
/// @param token        Token address
struct LimitedToken {
    uint256 actionMask;
    address token;
}

/// @notice Struct representing how pool tokens are stored by `SwapQuoter`.
/// @param isWeth   Whether the token represents Wrapped ETH.
/// @param token    Token address.
struct PoolToken {
    bool isWeth;
    address token;
}

/// @notice Struct representing a liquidity pool. Used as the return value in view functions.
/// @param pool         Pool address.
/// @param lpToken      Address of pool's LP token.
/// @param tokens       List of pool's tokens.
struct Pool {
    address pool;
    address lpToken;
    PoolToken[] tokens;
}

// ════════════════════════════════════════════════ ROUTER STRUCTS ═════════════════════════════════════════════════════

/// @notice Struct representing a quote request for swapping a bridge token.
/// Used in destination chain's SynapseRouter, hence the name "Destination Request".
/// @dev tokenOut is passed externally.
/// @param symbol   Bridge token symbol: unique token ID consistent among all chains
/// @param amountIn Amount of bridge token to start with, before the bridge fee is applied
struct DestRequest {
    string symbol;
    uint256 amountIn;
}

/// @notice Struct representing a swap request for SynapseRouter.
/// @dev tokenIn is supplied separately.
/// @param routerAdapter    Contract that will perform the swap for the Router. Address(0) specifies a "no swap" query.
/// @param tokenOut         Token address to swap to.
/// @param minAmountOut     Minimum amount of tokens to receive after the swap, or tx will be reverted.
/// @param deadline         Latest timestamp for when the transaction needs to be executed, or tx will be reverted.
/// @param rawParams        ABI-encoded params for the swap that will be passed to `routerAdapter`.
///                         Should be DefaultParams for swaps via DefaultAdapter.
struct SwapQuery {
    address routerAdapter;
    address tokenOut;
    uint256 minAmountOut;
    uint256 deadline;
    bytes rawParams;
}

using SwapQueryLib for SwapQuery global;

library SwapQueryLib {
    /// @notice Checks whether the router adapter was specified in the query.
    /// Query without a router adapter specifies that no action needs to be taken.
    function hasAdapter(SwapQuery memory query) internal pure returns (bool) {
        return query.routerAdapter != address(0);
    }

    /// @notice Fills `routerAdapter` and `deadline` fields in query, if it specifies one of the supported Actions,
    /// and if a path for this action was found.
    function fillAdapterAndDeadline(SwapQuery memory query, address routerAdapter) internal pure {
        // Fill the fields only if some path was found.
        if (query.minAmountOut == 0) return;
        // Empty params indicates no action needs to be done, thus no adapter is needed.
        query.routerAdapter = query.rawParams.length == 0 ? address(0) : routerAdapter;
        // Set default deadline to infinity. Not using the value of 0,
        // which would lead to every swap to revert by default.
        query.deadline = type(uint256).max;
    }
}

// ════════════════════════════════════════════════ ADAPTER STRUCTS ════════════════════════════════════════════════════

/// @notice Struct representing parameters for swapping via DefaultAdapter.
/// @param action           Action that DefaultAdapter needs to perform.
/// @param pool             Liquidity pool that will be used for Swap/AddLiquidity/RemoveLiquidity actions.
/// @param tokenIndexFrom   Token index to swap from. Used for swap/addLiquidity actions.
/// @param tokenIndexTo     Token index to swap to. Used for swap/removeLiquidity actions.
struct DefaultParams {
    Action action;
    address pool;
    uint8 tokenIndexFrom;
    uint8 tokenIndexTo;
}

/// @notice All possible actions that DefaultAdapter could perform.
enum Action {
    Swap, // swap between two pools tokens
    AddLiquidity, // add liquidity in a form of a single pool token
    RemoveLiquidity, // remove liquidity in a form of a single pool token
    HandleEth // ETH <> WETH interaction
}

using ActionLib for Action global;

/// @notice Library for dealing with bit masks which describe what set of Actions is available.
library ActionLib {
    /// @notice Returns a bitmask with all possible actions set to True.
    function allActions() internal pure returns (uint256 actionMask) {
        actionMask = type(uint256).max;
    }

    /// @notice Returns whether the given action is set to True in the bitmask.
    function isIncluded(Action action, uint256 actionMask) internal pure returns (bool) {
        return actionMask & mask(action) != 0;
    }

    /// @notice Returns a bitmask with only the given action set to True.
    function mask(Action action) internal pure returns (uint256) {
        return 1 << uint256(action);
    }

    /// @notice Returns a bitmask with only two given actions set to True.
    function mask(Action a, Action b) internal pure returns (uint256) {
        return mask(a) | mask(b);
    }
}

File 18 of 24 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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);
    }

    /**
     * This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 19 of 24 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

File 20 of 24 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 21 of 24 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

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

File 22 of 24 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    /**
     * This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 23 of 24 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 24 of 24 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "solmate/=lib/solmate/src/",
    "@boringcrypto/=node_modules/@boringcrypto/",
    "@ensdomains/=node_modules/@ensdomains/",
    "@openzeppelin/=node_modules/@openzeppelin/",
    "eth-gas-reporter/=node_modules/eth-gas-reporter/",
    "forge-std/=lib/forge-std/src/",
    "hardhat-deploy/=node_modules/hardhat-deploy/",
    "hardhat/=node_modules/hardhat/",
    "sol-explore/=node_modules/sol-explore/",
    "solmate/=lib/solmate/src/",
    "synthetix/=node_modules/synthetix/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract ITokenMessenger","name":"tokenMessenger_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CCTPGasRescueFailed","type":"error"},{"inputs":[],"name":"CCTPIncorrectChainId","type":"error"},{"inputs":[],"name":"CCTPIncorrectConfig","type":"error"},{"inputs":[],"name":"CCTPIncorrectDomain","type":"error"},{"inputs":[],"name":"CCTPIncorrectGasAmount","type":"error"},{"inputs":[],"name":"CCTPIncorrectProtocolFee","type":"error"},{"inputs":[],"name":"CCTPIncorrectTokenAmount","type":"error"},{"inputs":[],"name":"CCTPInsufficientAmount","type":"error"},{"inputs":[],"name":"CCTPMessageNotReceived","type":"error"},{"inputs":[],"name":"CCTPSymbolAlreadyAdded","type":"error"},{"inputs":[],"name":"CCTPSymbolIncorrect","type":"error"},{"inputs":[],"name":"CCTPTokenAlreadyAdded","type":"error"},{"inputs":[],"name":"CCTPTokenNotFound","type":"error"},{"inputs":[],"name":"CCTPZeroAddress","type":"error"},{"inputs":[],"name":"CCTPZeroAmount","type":"error"},{"inputs":[],"name":"CastOverflow","type":"error"},{"inputs":[],"name":"ForwarderDeploymentFailed","type":"error"},{"inputs":[],"name":"IncorrectRequestLength","type":"error"},{"inputs":[],"name":"RemoteCCTPDeploymentNotSet","type":"error"},{"inputs":[],"name":"UnknownRequestVersion","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ChainGasAirdropped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainGasAmount","type":"uint256"}],"name":"ChainGasAmountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"originDomain","type":"uint32"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"address","name":"mintToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"requestID","type":"bytes32"}],"name":"CircleRequestFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainId","type":"uint256"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint64","name":"nonce","type":"uint64"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"requestVersion","type":"uint32"},{"indexed":false,"internalType":"bytes","name":"formattedRequest","type":"bytes"},{"indexed":false,"internalType":"bytes32","name":"requestID","type":"bytes32"}],"name":"CircleRequestSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"pool","type":"address"}],"name":"CircleTokenPoolSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"feeCollector","type":"address"},{"indexed":false,"internalType":"uint256","name":"relayerFeeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"protocolFeeAmount","type":"uint256"}],"name":"FeeCollected","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"relayer","type":"address"},{"indexed":false,"internalType":"address","name":"oldFeeCollector","type":"address"},{"indexed":false,"internalType":"address","name":"newFeeCollector","type":"address"}],"name":"FeeCollectorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeesWithdrawn","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newProtocolFee","type":"uint256"}],"name":"ProtocolFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"remoteChainId","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"remoteDomain","type":"uint32"},{"indexed":false,"internalType":"address","name":"remoteSynapseCCTP","type":"address"}],"name":"RemoteDomainConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"TokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"relayerFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minBaseFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minSwapFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxFee","type":"uint256"}],"name":"TokenFeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"TokenRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"accumulatedFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"relayerFee","type":"uint256"},{"internalType":"uint256","name":"minBaseFee","type":"uint256"},{"internalType":"uint256","name":"minSwapFee","type":"uint256"},{"internalType":"uint256","name":"maxFee","type":"uint256"}],"name":"addToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"isSwap","type":"bool"}],"name":"calculateFeeAmount","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chainGasAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"circleTokenPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feeStructures","outputs":[{"internalType":"uint40","name":"relayerFee","type":"uint40"},{"internalType":"uint72","name":"minBaseFee","type":"uint72"},{"internalType":"uint72","name":"minSwapFee","type":"uint72"},{"internalType":"uint72","name":"maxFee","type":"uint72"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBridgeTokens","outputs":[{"components":[{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"token","type":"address"}],"internalType":"struct BridgeToken[]","name":"bridgeTokens","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"remoteDomain","type":"uint32"},{"internalType":"address","name":"remoteToken","type":"address"}],"name":"getLocalToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestID","type":"bytes32"}],"name":"isRequestFulfilled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"localDomain","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"messageTransmitter","outputs":[{"internalType":"contract IMessageTransmitter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseSending","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint32","name":"requestVersion","type":"uint32"},{"internalType":"bytes","name":"formattedRequest","type":"bytes"}],"name":"receiveCircleToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"relayerFeeCollectors","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"remoteDomainConfig","outputs":[{"internalType":"uint32","name":"domain","type":"uint32"},{"internalType":"address","name":"synapseCCTP","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"removeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rescueGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"burnToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint32","name":"requestVersion","type":"uint32"},{"internalType":"bytes","name":"swapParams","type":"bytes"}],"name":"sendCircleToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newChainGasAmount","type":"uint256"}],"name":"setChainGasAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"circleToken","type":"address"},{"internalType":"address","name":"pool","type":"address"}],"name":"setCircleTokenPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"feeCollector","type":"address"}],"name":"setFeeCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newProtocolFee","type":"uint256"}],"name":"setProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"remoteChainId","type":"uint256"},{"internalType":"uint32","name":"remoteDomain","type":"uint32"},{"internalType":"address","name":"remoteSynapseCCTP","type":"address"}],"name":"setRemoteDomainConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"relayerFee","type":"uint256"},{"internalType":"uint256","name":"minBaseFee","type":"uint256"},{"internalType":"uint256","name":"minSwapFee","type":"uint256"},{"internalType":"uint256","name":"maxFee","type":"uint256"}],"name":"setTokenFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"symbolToToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenMessenger","outputs":[{"internalType":"contract ITokenMessenger","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenToSymbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpauseSending","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"withdrawProtocolFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"withdrawRelayerFees","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60e06040523480156200001157600080fd5b50604051620041b9380380620041b983398101604081905262000034916200013e565b6001600160a01b03811660c081905260408051632c12192160e01b81529051632c121921916004808201926020929091908290030181865afa1580156200007f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000a591906200013e565b6001600160a01b031660a08190526040805163234d8e3d60e21b81529051638d3638f4916004808201926020929091908290030181865afa158015620000ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000115919062000165565b63ffffffff16608052506200018d565b6001600160a01b03811681146200013b57600080fd5b50565b6000602082840312156200015157600080fd5b81516200015e8162000125565b9392505050565b6000602082840312156200017857600080fd5b815163ffffffff811681146200015e57600080fd5b60805160a05160c051613fc4620001f56000396000818161034f01528181610c9701528181610cc6015261204501526000818161044f01528181610b0201526121fe01526000818161048301528181610b8d01528181610ecc01526118d90152613fc46000f3fe60806040526004361061020f5760003560e01c806392a442ea11610118578063d77938e4116100a0578063e9259ab91161006f578063e9259ab914610713578063e9bbb36d1461077d578063f2fde38b1461079d578063f7265b3a146107bd578063f879a41a146107dd57600080fd5b8063d77938e41461063f578063dc72495b14610654578063e00a83e0146106e8578063e7a64a80146106fe57600080fd5b8063a5bc29c2116100e7578063a5bc29c214610570578063b0e21e8a146105b1578063b250fe6b146105c7578063c4d66de8146105e7578063d4a67c6d1461060757600080fd5b806392a442ea146104d85780639c1d060e146104f8578063a42dce801461051a578063a4b1d0341461053a57600080fd5b80634a85178d1161019b578063715018a61161016a578063715018a614610408578063787dce3d1461041d5780637b04c1811461043d5780638d3638f4146104715780638da5cb5b146104ba57600080fd5b80634a85178d146103845780634bdb4eed146103a45780635c975abb146103c45780635fa7b584146103e857600080fd5b8063304ddb4c116101e2578063304ddb4c146102ba57806340432d51146102da57806341f355ee146102ef578063461178301461033d5780634a5ae51d1461037157600080fd5b80630ba36121146102145780630d25aafe1461024a5780632cc9e7e5146102785780632d80caa51461029a575b600080fd5b34801561022057600080fd5b5061023461022f366004613436565b6107fd565b60405161024191906134a3565b60405180910390f35b34801561025657600080fd5b5061026a6102653660046134c4565b610897565b604051908152602001610241565b34801561028457600080fd5b50610298610293366004613506565b6108ae565b005b3480156102a657600080fd5b506102986102b5366004613436565b61099c565b3480156102c657600080fd5b506102986102d5366004613614565b610a84565b3480156102e657600080fd5b50610298610de0565b3480156102fb57600080fd5b5061032561030a366004613436565b6069602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610241565b34801561034957600080fd5b506103257f000000000000000000000000000000000000000000000000000000000000000081565b61029861037f3660046136db565b610e76565b34801561039057600080fd5b5061029861039f366004613774565b6110e8565b3480156103b057600080fd5b506102986103bf3660046137e5565b61121a565b3480156103d057600080fd5b5060975460ff165b6040519015158152602001610241565b3480156103f457600080fd5b50610298610403366004613436565b611280565b34801561041457600080fd5b5061029861140f565b34801561042957600080fd5b50610298610438366004613829565b611445565b34801561044957600080fd5b506103257f000000000000000000000000000000000000000000000000000000000000000081565b34801561047d57600080fd5b506104a57f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff9091168152602001610241565b3480156104c657600080fd5b506033546001600160a01b0316610325565b3480156104e457600080fd5b506103d86104f3366004613829565b6114db565b34801561050457600080fd5b5061050d6114f9565b6040516102419190613842565b34801561052657600080fd5b50610298610535366004613436565b611685565b34801561054657600080fd5b50610325610555366004613436565b60ca602052600090815260409020546001600160a01b031681565b34801561057c57600080fd5b5061032561058b3660046138c1565b80516020818301810180516066825292820191909301209152546001600160a01b031681565b3480156105bd57600080fd5b5061026a606a5481565b3480156105d357600080fd5b506102986105e2366004613829565b6116f5565b3480156105f357600080fd5b50610298610602366004613436565b611754565b34801561061357600080fd5b5061026a610622366004613506565b606860209081526000928352604080842090915290825290205481565b34801561064b57600080fd5b5061029861181f565b34801561066057600080fd5b506106b161066f366004613436565b60676020526000908152604090205464ffffffffff8116906001600160481b03650100000000008204811691600160701b8104821691600160b81b9091041684565b6040805164ffffffffff90951685526001600160481b03938416602086015291831691840191909152166060820152608001610241565b3480156106f457600080fd5b5061026a606b5481565b34801561070a57600080fd5b50610298611851565b34801561071f57600080fd5b5061075961072e366004613829565b60c96020526000908152604090205463ffffffff81169064010000000090046001600160a01b031682565b6040805163ffffffff90931683526001600160a01b03909116602083015201610241565b34801561078957600080fd5b506102986107983660046138f5565b611883565b3480156107a957600080fd5b506102986107b8366004613436565b611a10565b3480156107c957600080fd5b506102986107d8366004613436565b611aa8565b3480156107e957600080fd5b506103256107f836600461392c565b611b1e565b606560205260009081526040902080546108169061394a565b80601f01602080910402602001604051908101604052809291908181526020018280546108429061394a565b801561088f5780601f106108645761010080835404028352916020019161088f565b820191906000526020600020905b81548152906001019060200180831161087257829003601f168201915b505050505081565b60006108a4848484611b33565b90505b9392505050565b6033546001600160a01b031633146108e15760405162461bcd60e51b81526004016108d89061397e565b60405180910390fd5b6001600160a01b038216610908576040516312182f6560e11b815260040160405180910390fd5b610913606c83611c16565b610930576040516314ed699b60e21b815260040160405180910390fd5b6001600160a01b03828116600081815260ca602090815260409182902080546001600160a01b031916948616948517905581519283528201929092527fc6d7c140f387f52deb49db5ae3684b5f3b459a2927f8d32a4e01c72e7d3ef44891015b60405180910390a15050565b6033546001600160a01b031633146109c65760405162461bcd60e51b81526004016108d89061397e565b6001600160a01b0381166000908152600080516020613f6f833981519152602052604081205490819003610a0d576040516330b93f1d60e01b815260040160405180910390fd5b6001600160a01b0382166000818152600080516020613f6f8339815191526020526040812055610a3e903383611c38565b604080513381526001600160a01b03841660208201529081018290527f5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa890606001610990565b60975460ff1615610aca5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108d8565b610ad5606c85611c16565b610af2576040516314ed699b60e21b815260040160405180910390fd5b610afc8484611ca0565b925060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638371744e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8291906139cf565b6040805163ffffffff7f00000000000000000000000000000000000000000000000000000000000000001660208201526001600160401b038316818301526001600160a01b038089166060830152608082018890528a1660a0808301919091528251808303909101815260c0909101909152909150600090610c0690859085611da0565b600088815260c96020908152604080832081518083019092525463ffffffff8116825264010000000090046001600160a01b031691810182905292935090819003610c64576040516354351d8760e11b815260040160405180910390fd5b8151835160208086019190912067ffffffff0000000083831b1663ffffffff8a16176000908152915260409020610cbc8a7f00000000000000000000000000000000000000000000000000000000000000008b611e69565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663f856ddb68a84868e610cf98288611f1e565b6040516001600160e01b031960e088901b168152600481019590955263ffffffff93909316602485015260448401919091526001600160a01b03166064830152608482015260a4016020604051808303816000875af1158015610d60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8491906139cf565b50326001600160a01b03167fc4980459837e213aedb84d9046eab1db050fec66cb9e046c4fe3b5578b01b20c8c888d8d8d8b88604051610dca97969594939291906139ea565b60405180910390a2505050505050505050505050565b6033546001600160a01b03163314610e0a5760405162461bcd60e51b81526004016108d89061397e565b604051600090339047908381818185875af1925050503d8060008114610e4c576040519150601f19603f3d011682016040523d82523d6000602084013e610e51565b606091505b5050905080610e735760405163272b087d60e11b815260040160405180910390fd5b50565b606b543414610e985760405163c561806560e01b815260040160405180910390fd5b600080610ea58484611f42565b91509150600080600080610eb886611ff0565b8b516020808e019190912063ffffffff8f167f0000000000000000000000000000000000000000000000000000000000000000831b67ffffffff0000000016176000908152915260408120959950929750909550935091905090506000610f1f8686612040565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610f69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8d9190613a46565b9050610f9c8f8f8f8f8761218b565b610fa68582613a75565b6040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa158015610fea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100e9190613a46565b1461102c57604051630796574f60e31b815260040160405180910390fd5b6000611042838763ffffffff8f16600114612260565b909650905060008061105687868a8e61245a565b9092509050341561106a5761106a87612573565b6040805163ffffffff8c1681526001600160a01b03878116602083015291810185905283821660608201526080810183905260a08101889052908816907f7864397c00beabf21ab17a04795e450354505d879a634dd2632f4fdc4b5ba04e9060c00160405180910390a2505050505050505050505050505050505050565b6033546001600160a01b031633146111125760405162461bcd60e51b81526004016108d89061397e565b6001600160a01b038516611139576040516376998feb60e01b815260040160405180910390fd5b611144606c86612606565b61116157604051631191732560e01b815260040160405180910390fd5b61116a8661261b565b6001600160a01b038516600090815260656020526040902061118c8782613ace565b508460668760405161119e9190613b8d565b90815260405190819003602001812080546001600160a01b03939093166001600160a01b0319909316929092179091557f6d97a31531bdb3c43d920bc996ec8b9fd7733f5f55a81cd74700f88631fc6032906111fd9088908890613ba9565b60405180910390a16112128585858585612728565b505050505050565b6033546001600160a01b031633146112445760405162461bcd60e51b81526004016108d89061397e565b61124f606c86611c16565b61126c576040516314ed699b60e21b815260040160405180910390fd5b6112798585858585612728565b5050505050565b6033546001600160a01b031633146112aa5760405162461bcd60e51b81526004016108d89061397e565b6112b5606c826128d9565b6112d2576040516314ed699b60e21b815260040160405180910390fd5b6001600160a01b038116600090815260656020526040812080546112f59061394a565b80601f01602080910402602001604051908101604052809291908181526020018280546113219061394a565b801561136e5780601f106113435761010080835404028352916020019161136e565b820191906000526020600020905b81548152906001019060200180831161135157829003601f168201915b505050506001600160a01b03841660009081526065602052604081209293506113989291506133d7565b6066816040516113a89190613b8d565b90815260408051918290036020908101832080546001600160a01b03191690556001600160a01b03851660009081526067909152908120557f1adb68f0a540855cafa9d341c1e94a36fa13b8a15ff602507addfe49c0f018d1906109909083908590613ba9565b6033546001600160a01b031633146114395760405162461bcd60e51b81526004016108d89061397e565b61144360006128ee565b565b6033546001600160a01b0316331461146f5760405162461bcd60e51b81526004016108d89061397e565b61147f60026402540be400613bd3565b81111561149f576040516328562c4760e01b815260040160405180910390fd5b606a8190556040518181527fd10d75876659a287a59a6ccfa2e3fff42f84d94b542837acd30bc184d562de40906020015b60405180910390a150565b6000806114e83084612940565b6001600160a01b03163b1192915050565b60606000611507606c612a01565b9050806001600160401b0381111561152157611521613551565b60405190808252806020026020018201604052801561156757816020015b60408051808201909152606081526000602082015281526020019060019003908161153f5790505b50915060005b81811015611680576000611582606c83612a0b565b9050604051806040016040528060656000846001600160a01b03166001600160a01b0316815260200190815260200160002080546115bf9061394a565b80601f01602080910402602001604051908101604052809291908181526020018280546115eb9061394a565b80156116385780601f1061160d57610100808354040283529160200191611638565b820191906000526020600020905b81548152906001019060200180831161161b57829003601f168201915b50505050508152602001826001600160a01b031681525084838151811061166157611661613bf5565b602002602001018190525050808061167890613c0b565b91505061156d565b505090565b3360008181526069602090815260409182902080546001600160a01b031981166001600160a01b03878116918217909355845192909116808352928201529092917f9dfcadd14a1ddfb19c51e84b87452ca32a43c5559e9750d1575c77105cdeac1e910160405180910390a25050565b6033546001600160a01b0316331461171f5760405162461bcd60e51b81526004016108d89061397e565b606b8190556040518181527f5e8bad84cb22c143a6757c7f1252a7d53493816880330977cc99bb7c15aaf6b4906020016114d0565b600054610100900460ff1661176f5760005460ff1615611773565b303b155b6117d65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108d8565b600054610100900460ff161580156117f8576000805461ffff19166101011790555b611800612a17565b611809826128ee565b801561181b576000805461ff00191690555b5050565b6033546001600160a01b031633146118495760405162461bcd60e51b81526004016108d89061397e565b611443612a46565b6033546001600160a01b0316331461187b5760405162461bcd60e51b81526004016108d89061397e565b611443612ade565b6033546001600160a01b031633146118ad5760405162461bcd60e51b81526004016108d89061397e565b8215806118b957504683145b156118d757604051633f8f40a960e01b815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff168263ffffffff1603611923576040516312792e1960e31b815260040160405180910390fd5b63ffffffff821615600184141461194d576040516312792e1960e31b815260040160405180910390fd5b6001600160a01b038116611974576040516312182f6560e11b815260040160405180910390fd5b60408051808201825263ffffffff8481168083526001600160a01b03858116602080860182815260008b815260c9835288902096518754915196166001600160c01b031990911617640100000000959093169490940291909117909355835187815291820152918201527f7a209ef38b3b8ab043b7f0a705899f4fe0f8dcfef657a6e12e943da0dae1ac739060600160405180910390a1505050565b6033546001600160a01b03163314611a3a5760405162461bcd60e51b81526004016108d89061397e565b6001600160a01b038116611a9f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108d8565b610e73816128ee565b3360009081526068602090815260408083206001600160a01b038516845290915281205490819003611aed576040516330b93f1d60e01b815260040160405180910390fd5b3360008181526068602090815260408083206001600160a01b0387168085529252822091909155610a3e9183611c38565b6000611b2a8383612040565b90505b92915050565b6001600160a01b03831660009081526067602090815260408083208151608081018352905464ffffffffff81168083526001600160481b03650100000000008304811695840195909552600160701b8204851693830193909352600160b81b900490921660608301526402540be40090611bad9086613c24565b611bb79190613bd3565b9150600083611bca578160200151611bd0565b81604001515b6001600160481b0316905080831015611be7578092505b81606001516001600160481b0316831115611c0d5781606001516001600160481b031692505b50509392505050565b6001600160a01b03811660009081526001830160205260408120541515611b2a565b6040516001600160a01b038316602482015260448101829052611c9b90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612b58565b505050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015611ce9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d0d9190613a46565b9050611d246001600160a01b038516333086612c2a565b6040516370a0823160e01b815230600482015281906001600160a01b038616906370a0823190602401602060405180830381865afa158015611d6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d8e9190613a46565b611d989190613c3b565b949350505050565b606060a0835114611dc4576040516374593f8760e01b815260040160405180910390fd5b63ffffffff8416611df657815115611def576040516374593f8760e01b815260040160405180910390fd5b50816108a7565b60001963ffffffff851601611e50576080825114611e27576040516374593f8760e01b815260040160405180910390fd5b8282604051602001611e3a929190613c4e565b60405160208183030381529060405290506108a7565b60405163523fa8d560e01b815260040160405180910390fd5b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015611eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611edd9190613a46565b905081811015611f18578015611f0257611f026001600160a01b038516846000612c62565b611f186001600160a01b03851684600019612c62565b50505050565b6000611b2a611f366001600160a01b03851684612940565b6001600160a01b031690565b60608063ffffffff8416611f8a5760a0835114611f72576040516374593f8760e01b815260040160405180910390fd5b50506040805160208101909152600081528190611fe9565b60001963ffffffff851601611e50576080611fa660a082613a75565b611fb09190613a75565b835114611fd0576040516374593f8760e01b815260040160405180910390fd5b82806020019051810190611fe49190613cb8565b915091505b9250929050565b600080600080600060a086511461201a576040516374593f8760e01b815260040160405180910390fd5b8580602001905181019061202e9190613d1b565b939a9299509097509550909350915050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663cb75c11c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c59190613d82565b9050806001600160a01b03166378a0565e856120f0866001600160a01b03166001600160a01b031690565b6040516001600160e01b031960e085901b16815263ffffffff9290921660048301526024820152604401602060405180830381865afa158015612137573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215b9190613d82565b91506001600160a01b038216612184576040516314ed699b60e21b815260040160405180910390fd5b5092915050565b600061219682612d77565b905060006357ecfd2860e01b878787876040516024016121b99493929190613dc8565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905060006122236001600160a01b0384167f000000000000000000000000000000000000000000000000000000000000000084612e2c565b9050808060200190518101906122399190613def565b6122565760405163182f34eb60e01b815260040160405180910390fd5b5050505050505050565b60008061226e606c86611c16565b61228b576040516314ed699b60e21b815260040160405180910390fd5b612296858585611b33565b90508381106122b857604051630fab90b960e21b815260040160405180910390fd5b3360009081526069602052604090205481850392506001600160a01b03168061235b576001600160a01b0386166000908152600080516020613f6f833981519152602052604081208054849290612310908490613a75565b909155505060408051600080825260208201529081018390527f108516ddcf5ba43cea6bb2cd5ff6d59ac196c1c86ccb9178332b9dd72d1ca5619060600160405180910390a1612451565b60006402540be400606a54846123719190613c24565b61237b9190613bd3565b905060006123898285613c3b565b6001600160a01b0389166000908152600080516020613f6f83398151915260205260408120805492935084929091906123c3908490613a75565b90915550506001600160a01b038084166000908152606860209081526040808320938c16835292905290812080548392906123ff908490613a75565b9091555050604080516001600160a01b0385168152602081018390529081018390527f108516ddcf5ba43cea6bb2cd5ff6d59ac196c1c86ccb9178332b9dd72d1ca5619060600160405180910390a150505b50935093915050565b60008082516000036124845761247a6001600160a01b0386168786611c38565b508390508261256a565b6001600160a01b03808616600090815260ca602052604090205416806124c4576124b86001600160a01b0387168887611c38565b8585925092505061256a565b6000806000806124d388612e3b565b93509350935093506124e58584612e86565b96506001600160a01b038716612519576125096001600160a01b038b168c8b611c38565b898996509650505050505061256a565b6125248a868b611e69565b6125328585858c8686612f5a565b955085600003612550576125096001600160a01b038b168c8b611c38565b6125646001600160a01b0388168c88611c38565b50505050505b94509492505050565b6000816001600160a01b03163460405160006040518083038185875af1925050503d80600081146125c0576040519150601f19603f3d011682016040523d82523d6000602084013e6125c5565b606091505b505090507ff9b0951a3a6282341e1ba9414555d42d04e99076337702ee6dc484a706bfd683816125f65760006125f8565b345b604051908152602001610990565b6000611b2a836001600160a01b038416612ff8565b60006001600160a01b03166066826040516126369190613b8d565b908152604051908190036020019020546001600160a01b03161461266d576040516382ca3adf60e01b815260040160405180910390fd5b80518190600510612691576040516307f1fcb560e31b815260040160405180910390fd5b60005b6005811015611c9b576040518060400160405280600581526020016421a1aa281760d91b81525081815181106126cc576126cc613bf5565b602001015160f81c60f81b6001600160f81b0319168282815181106126f3576126f3613bf5565b01602001516001600160f81b03191614612720576040516307f1fcb560e31b815260040160405180910390fd5b600101612694565b6298968084111561274c576040516376998feb60e01b815260040160405180910390fd5b8183111561276d576040516376998feb60e01b815260040160405180910390fd5b8082111561278e576040516376998feb60e01b815260040160405180910390fd5b60405180608001604052806127a286613047565b64ffffffffff1681526020016127b785613073565b6001600160481b031681526020016127ce84613073565b6001600160481b031681526020016127e583613073565b6001600160481b039081169091526001600160a01b0387166000818152606760209081526040918290208551815487840151888601516060998a015164ffffffffff9094166dffffffffffffffffffffffffffff19909316929092176501000000000091891691909102176dffffffffffffffffffffffffffff16600160701b918816919091026001600160b81b031617600160b81b9190961602949094179093558051918252918101879052908101859052908101839052608081018290527f2447edf4fb96a663c0a6b0bb22ec30cdc8948d2041782ef779c8c6ad7059098b9060a00160405180910390a15050505050565b6000611b2a836001600160a01b03841661309d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000611b2a83836040518060400160405280602081526020017f602036038060203d373d3d3d923d343d355af13d82803e903d91601e57fd5bf381525060405160200161298d9190613e0c565b604051602081830303815290604052805190602001206040516020016129e8939291906001600160f81b0319815260609390931b6bffffffffffffffffffffffff191660018401526015830191909152603582015260550190565b6040516020818303038152906040528051906020012090565b6000611b2d825490565b6000611b2a8383613190565b600054610100900460ff16612a3e5760405162461bcd60e51b81526004016108d890613e46565b6114436131ba565b60975460ff1615612a8c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108d8565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612ac13390565b6040516001600160a01b03909116815260200160405180910390a1565b60975460ff16612b275760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108d8565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612ac1565b6000612bad826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166131ed9092919063ffffffff16565b805190915015611c9b5780806020019051810190612bcb9190613def565b611c9b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016108d8565b6040516001600160a01b0380851660248301528316604482015260648101829052611f189085906323b872dd60e01b90608401611c64565b801580612cdc5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015612cb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cda9190613a46565b155b612d475760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016108d8565b6040516001600160a01b038316602482015260448101829052611c9b90849063095ea7b360e01b90606401611c64565b6000612d833083612940565b90506001600160a01b0381163b15612d9a57919050565b60006040518060400160405280602081526020017f602036038060203d373d3d3d923d343d355af13d82803e903d91601e57fd5bf3815250604051602001612de29190613e0c565b6040516020818303038152906040529050828151602083016000f591506001600160a01b038216612e26576040516309ebea7f60e21b815260040160405180910390fd5b50919050565b60606108a484848460006131fc565b6000806000806080855114612e63576040516374593f8760e01b815260040160405180910390fd5b84806020019051810190612e779190613ea2565b93509350935093509193509193565b6040805160ff831660248083019190915282518083039091018152604490910182526020810180516001600160e01b031662415c3360e91b1790529051600091829182916001600160a01b03871691612edf9190613b8d565b600060405180830381855afa9150503d8060008114612f1a576040519150601f19603f3d011682016040523d82523d6000602084013e612f1f565b606091505b5091509150818015612f32575080516020145b15612f4d57612f46612f4382613ee5565b90565b9250612f52565b600092505b505092915050565b6040516348b4aac360e11b815260ff8087166004830152851660248201526044810184905260648101829052608481018390526000906001600160a01b0388169063916955869060a4016020604051808303816000875af1925050508015612fdf575060408051601f3d908101601f19168201909252612fdc91810190613a46565b60015b612feb57506000612fee565b90505b9695505050505050565b600081815260018301602052604081205461303f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611b2d565b506000611b2d565b600064ffffffffff82111561306f57604051631cb1a8e360e31b815260040160405180910390fd5b5090565b60006001600160481b0382111561306f57604051631cb1a8e360e31b815260040160405180910390fd5b600081815260018301602052604081205480156131865760006130c1600183613c3b565b85549091506000906130d590600190613c3b565b905081811461313a5760008660000182815481106130f5576130f5613bf5565b906000526020600020015490508087600001848154811061311857613118613bf5565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061314b5761314b613f09565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611b2d565b6000915050611b2d565b60008260000182815481106131a7576131a7613bf5565b9060005260206000200154905092915050565b600054610100900460ff166131e15760405162461bcd60e51b81526004016108d890613e46565b6097805460ff19169055565b60606108a48484600085613247565b606061323e6001600160a01b0385168460405160200161321d929190613f1f565b60408051601f198184030181529190526001600160a01b0387169084613378565b95945050505050565b6060824710156132a85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016108d8565b6001600160a01b0385163b6132ff5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108d8565b600080866001600160a01b0316858760405161331b9190613b8d565b60006040518083038185875af1925050503d8060008114613358576040519150601f19603f3d011682016040523d82523d6000602084013e61335d565b606091505b509150915061336d82828661339e565b979650505050505050565b60606108a4848484604051806060016040528060298152602001613f4660299139613247565b606083156133ad5750816108a7565b8251156133bd5782518084602001fd5b8160405162461bcd60e51b81526004016108d891906134a3565b5080546133e39061394a565b6000825580601f106133f3575050565b601f016020900490600052602060002090810190610e7391905b8082111561306f576000815560010161340d565b6001600160a01b0381168114610e7357600080fd5b60006020828403121561344857600080fd5b81356108a781613421565b60005b8381101561346e578181015183820152602001613456565b50506000910152565b6000815180845261348f816020860160208601613453565b601f01601f19169290920160200192915050565b602081526000611b2a6020830184613477565b8015158114610e7357600080fd5b6000806000606084860312156134d957600080fd5b83356134e481613421565b92506020840135915060408401356134fb816134b6565b809150509250925092565b6000806040838503121561351957600080fd5b823561352481613421565b9150602083013561353481613421565b809150509250929050565b63ffffffff81168114610e7357600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561358f5761358f613551565b604052919050565b60006001600160401b038211156135b0576135b0613551565b50601f01601f191660200190565b600082601f8301126135cf57600080fd5b81356135e26135dd82613597565b613567565b8181528460208386010111156135f757600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c0878903121561362d57600080fd5b863561363881613421565b955060208701359450604087013561364f81613421565b93506060870135925060808701356136668161353f565b915060a08701356001600160401b0381111561368157600080fd5b61368d89828a016135be565b9150509295509295509295565b60008083601f8401126136ac57600080fd5b5081356001600160401b038111156136c357600080fd5b602083019150836020828501011115611fe957600080fd5b600080600080600080608087890312156136f457600080fd5b86356001600160401b038082111561370b57600080fd5b6137178a838b0161369a565b9098509650602089013591508082111561373057600080fd5b61373c8a838b0161369a565b9096509450604089013591506137518261353f565b9092506060880135908082111561376757600080fd5b5061368d89828a016135be565b60008060008060008060c0878903121561378d57600080fd5b86356001600160401b038111156137a357600080fd5b6137af89828a016135be565b96505060208701356137c081613421565b95989597505050506040840135936060810135936080820135935060a0909101359150565b600080600080600060a086880312156137fd57600080fd5b853561380881613421565b97602087013597506040870135966060810135965060800135945092505050565b60006020828403121561383b57600080fd5b5035919050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156138b357888303603f190185528151805187855261388d88860182613477565b918901516001600160a01b03169489019490945294870194925090860190600101613869565b509098975050505050505050565b6000602082840312156138d357600080fd5b81356001600160401b038111156138e957600080fd5b611d98848285016135be565b60008060006060848603121561390a57600080fd5b83359250602084013561391c8161353f565b915060408401356134fb81613421565b6000806040838503121561393f57600080fd5b82356135248161353f565b600181811c9082168061395e57607f821691505b602082108103612e2657634e487b7160e01b600052602260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b80516001600160401b03811681146139ca57600080fd5b919050565b6000602082840312156139e157600080fd5b611b2a826139b3565b8781526001600160401b038716602082015260018060a01b038616604082015284606082015263ffffffff8416608082015260e060a08201526000613a3260e0830185613477565b90508260c083015298975050505050505050565b600060208284031215613a5857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115611b2d57611b2d613a5f565b601f821115611c9b57600081815260208120601f850160051c81016020861015613aaf5750805b601f850160051c820191505b8181101561121257828155600101613abb565b81516001600160401b03811115613ae757613ae7613551565b613afb81613af5845461394a565b84613a88565b602080601f831160018114613b305760008415613b185750858301515b600019600386901b1c1916600185901b178555611212565b600085815260208120601f198616915b82811015613b5f57888601518255948401946001909101908401613b40565b5085821015613b7d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251613b9f818460208701613453565b9190910192915050565b604081526000613bbc6040830185613477565b905060018060a01b03831660208301529392505050565b600082613bf057634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060018201613c1d57613c1d613a5f565b5060010190565b8082028115828204841417611b2d57611b2d613a5f565b81810381811115611b2d57611b2d613a5f565b604081526000613c616040830185613477565b828103602084015261323e8185613477565b600082601f830112613c8457600080fd5b8151613c926135dd82613597565b818152846020838601011115613ca757600080fd5b611d98826020830160208701613453565b60008060408385031215613ccb57600080fd5b82516001600160401b0380821115613ce257600080fd5b613cee86838701613c73565b93506020850151915080821115613d0457600080fd5b50613d1185828601613c73565b9150509250929050565b600080600080600060a08688031215613d3357600080fd5b8551613d3e8161353f565b9450613d4c602087016139b3565b93506040860151613d5c81613421565b606087015160808801519194509250613d7481613421565b809150509295509295909350565b600060208284031215613d9457600080fd5b81516108a781613421565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b604081526000613ddc604083018688613d9f565b828103602084015261336d818587613d9f565b600060208284031215613e0157600080fd5b81516108a7816134b6565b607f60f81b81528151600090613e29816001850160208701613453565b653d5260203df360d01b6001939091019283015250600701919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b805160ff811681146139ca57600080fd5b60008060008060808587031215613eb857600080fd5b613ec185613e91565b9350613ecf60208601613e91565b6040860151606090960151949790965092505050565b80516020808301519190811015612e265760001960209190910360031b1b16919050565b634e487b7160e01b600052603160045260246000fd5b82815260008251613f37816020850160208701613453565b91909101602001939250505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564ad6f8124f6081c2622ab3a16acd47af73d52fe87b755c3f897263c58ba3fdbd7a2646970667358221220e6c9c255f9aa0659a73a8cc39e24f6a9176a63231b69e031de8df31721a973e164736f6c634300081100330000000000000000000000002b4069517957735be00cee0fadae88a26365528f

Deployed Bytecode

0x60806040526004361061020f5760003560e01c806392a442ea11610118578063d77938e4116100a0578063e9259ab91161006f578063e9259ab914610713578063e9bbb36d1461077d578063f2fde38b1461079d578063f7265b3a146107bd578063f879a41a146107dd57600080fd5b8063d77938e41461063f578063dc72495b14610654578063e00a83e0146106e8578063e7a64a80146106fe57600080fd5b8063a5bc29c2116100e7578063a5bc29c214610570578063b0e21e8a146105b1578063b250fe6b146105c7578063c4d66de8146105e7578063d4a67c6d1461060757600080fd5b806392a442ea146104d85780639c1d060e146104f8578063a42dce801461051a578063a4b1d0341461053a57600080fd5b80634a85178d1161019b578063715018a61161016a578063715018a614610408578063787dce3d1461041d5780637b04c1811461043d5780638d3638f4146104715780638da5cb5b146104ba57600080fd5b80634a85178d146103845780634bdb4eed146103a45780635c975abb146103c45780635fa7b584146103e857600080fd5b8063304ddb4c116101e2578063304ddb4c146102ba57806340432d51146102da57806341f355ee146102ef578063461178301461033d5780634a5ae51d1461037157600080fd5b80630ba36121146102145780630d25aafe1461024a5780632cc9e7e5146102785780632d80caa51461029a575b600080fd5b34801561022057600080fd5b5061023461022f366004613436565b6107fd565b60405161024191906134a3565b60405180910390f35b34801561025657600080fd5b5061026a6102653660046134c4565b610897565b604051908152602001610241565b34801561028457600080fd5b50610298610293366004613506565b6108ae565b005b3480156102a657600080fd5b506102986102b5366004613436565b61099c565b3480156102c657600080fd5b506102986102d5366004613614565b610a84565b3480156102e657600080fd5b50610298610de0565b3480156102fb57600080fd5b5061032561030a366004613436565b6069602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610241565b34801561034957600080fd5b506103257f0000000000000000000000002b4069517957735be00cee0fadae88a26365528f81565b61029861037f3660046136db565b610e76565b34801561039057600080fd5b5061029861039f366004613774565b6110e8565b3480156103b057600080fd5b506102986103bf3660046137e5565b61121a565b3480156103d057600080fd5b5060975460ff165b6040519015158152602001610241565b3480156103f457600080fd5b50610298610403366004613436565b611280565b34801561041457600080fd5b5061029861140f565b34801561042957600080fd5b50610298610438366004613829565b611445565b34801561044957600080fd5b506103257f0000000000000000000000004d41f22c5a0e5c74090899e5a8fb597a8842b3e881565b34801561047d57600080fd5b506104a57f000000000000000000000000000000000000000000000000000000000000000281565b60405163ffffffff9091168152602001610241565b3480156104c657600080fd5b506033546001600160a01b0316610325565b3480156104e457600080fd5b506103d86104f3366004613829565b6114db565b34801561050457600080fd5b5061050d6114f9565b6040516102419190613842565b34801561052657600080fd5b50610298610535366004613436565b611685565b34801561054657600080fd5b50610325610555366004613436565b60ca602052600090815260409020546001600160a01b031681565b34801561057c57600080fd5b5061032561058b3660046138c1565b80516020818301810180516066825292820191909301209152546001600160a01b031681565b3480156105bd57600080fd5b5061026a606a5481565b3480156105d357600080fd5b506102986105e2366004613829565b6116f5565b3480156105f357600080fd5b50610298610602366004613436565b611754565b34801561061357600080fd5b5061026a610622366004613506565b606860209081526000928352604080842090915290825290205481565b34801561064b57600080fd5b5061029861181f565b34801561066057600080fd5b506106b161066f366004613436565b60676020526000908152604090205464ffffffffff8116906001600160481b03650100000000008204811691600160701b8104821691600160b81b9091041684565b6040805164ffffffffff90951685526001600160481b03938416602086015291831691840191909152166060820152608001610241565b3480156106f457600080fd5b5061026a606b5481565b34801561070a57600080fd5b50610298611851565b34801561071f57600080fd5b5061075961072e366004613829565b60c96020526000908152604090205463ffffffff81169064010000000090046001600160a01b031682565b6040805163ffffffff90931683526001600160a01b03909116602083015201610241565b34801561078957600080fd5b506102986107983660046138f5565b611883565b3480156107a957600080fd5b506102986107b8366004613436565b611a10565b3480156107c957600080fd5b506102986107d8366004613436565b611aa8565b3480156107e957600080fd5b506103256107f836600461392c565b611b1e565b606560205260009081526040902080546108169061394a565b80601f01602080910402602001604051908101604052809291908181526020018280546108429061394a565b801561088f5780601f106108645761010080835404028352916020019161088f565b820191906000526020600020905b81548152906001019060200180831161087257829003601f168201915b505050505081565b60006108a4848484611b33565b90505b9392505050565b6033546001600160a01b031633146108e15760405162461bcd60e51b81526004016108d89061397e565b60405180910390fd5b6001600160a01b038216610908576040516312182f6560e11b815260040160405180910390fd5b610913606c83611c16565b610930576040516314ed699b60e21b815260040160405180910390fd5b6001600160a01b03828116600081815260ca602090815260409182902080546001600160a01b031916948616948517905581519283528201929092527fc6d7c140f387f52deb49db5ae3684b5f3b459a2927f8d32a4e01c72e7d3ef44891015b60405180910390a15050565b6033546001600160a01b031633146109c65760405162461bcd60e51b81526004016108d89061397e565b6001600160a01b0381166000908152600080516020613f6f833981519152602052604081205490819003610a0d576040516330b93f1d60e01b815260040160405180910390fd5b6001600160a01b0382166000818152600080516020613f6f8339815191526020526040812055610a3e903383611c38565b604080513381526001600160a01b03841660208201529081018290527f5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa890606001610990565b60975460ff1615610aca5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108d8565b610ad5606c85611c16565b610af2576040516314ed699b60e21b815260040160405180910390fd5b610afc8484611ca0565b925060007f0000000000000000000000004d41f22c5a0e5c74090899e5a8fb597a8842b3e86001600160a01b0316638371744e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8291906139cf565b6040805163ffffffff7f00000000000000000000000000000000000000000000000000000000000000021660208201526001600160401b038316818301526001600160a01b038089166060830152608082018890528a1660a0808301919091528251808303909101815260c0909101909152909150600090610c0690859085611da0565b600088815260c96020908152604080832081518083019092525463ffffffff8116825264010000000090046001600160a01b031691810182905292935090819003610c64576040516354351d8760e11b815260040160405180910390fd5b8151835160208086019190912067ffffffff0000000083831b1663ffffffff8a16176000908152915260409020610cbc8a7f0000000000000000000000002b4069517957735be00cee0fadae88a26365528f8b611e69565b6001600160a01b037f0000000000000000000000002b4069517957735be00cee0fadae88a26365528f1663f856ddb68a84868e610cf98288611f1e565b6040516001600160e01b031960e088901b168152600481019590955263ffffffff93909316602485015260448401919091526001600160a01b03166064830152608482015260a4016020604051808303816000875af1158015610d60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8491906139cf565b50326001600160a01b03167fc4980459837e213aedb84d9046eab1db050fec66cb9e046c4fe3b5578b01b20c8c888d8d8d8b88604051610dca97969594939291906139ea565b60405180910390a2505050505050505050505050565b6033546001600160a01b03163314610e0a5760405162461bcd60e51b81526004016108d89061397e565b604051600090339047908381818185875af1925050503d8060008114610e4c576040519150601f19603f3d011682016040523d82523d6000602084013e610e51565b606091505b5050905080610e735760405163272b087d60e11b815260040160405180910390fd5b50565b606b543414610e985760405163c561806560e01b815260040160405180910390fd5b600080610ea58484611f42565b91509150600080600080610eb886611ff0565b8b516020808e019190912063ffffffff8f167f0000000000000000000000000000000000000000000000000000000000000002831b67ffffffff0000000016176000908152915260408120959950929750909550935091905090506000610f1f8686612040565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610f69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8d9190613a46565b9050610f9c8f8f8f8f8761218b565b610fa68582613a75565b6040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa158015610fea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100e9190613a46565b1461102c57604051630796574f60e31b815260040160405180910390fd5b6000611042838763ffffffff8f16600114612260565b909650905060008061105687868a8e61245a565b9092509050341561106a5761106a87612573565b6040805163ffffffff8c1681526001600160a01b03878116602083015291810185905283821660608201526080810183905260a08101889052908816907f7864397c00beabf21ab17a04795e450354505d879a634dd2632f4fdc4b5ba04e9060c00160405180910390a2505050505050505050505050505050505050565b6033546001600160a01b031633146111125760405162461bcd60e51b81526004016108d89061397e565b6001600160a01b038516611139576040516376998feb60e01b815260040160405180910390fd5b611144606c86612606565b61116157604051631191732560e01b815260040160405180910390fd5b61116a8661261b565b6001600160a01b038516600090815260656020526040902061118c8782613ace565b508460668760405161119e9190613b8d565b90815260405190819003602001812080546001600160a01b03939093166001600160a01b0319909316929092179091557f6d97a31531bdb3c43d920bc996ec8b9fd7733f5f55a81cd74700f88631fc6032906111fd9088908890613ba9565b60405180910390a16112128585858585612728565b505050505050565b6033546001600160a01b031633146112445760405162461bcd60e51b81526004016108d89061397e565b61124f606c86611c16565b61126c576040516314ed699b60e21b815260040160405180910390fd5b6112798585858585612728565b5050505050565b6033546001600160a01b031633146112aa5760405162461bcd60e51b81526004016108d89061397e565b6112b5606c826128d9565b6112d2576040516314ed699b60e21b815260040160405180910390fd5b6001600160a01b038116600090815260656020526040812080546112f59061394a565b80601f01602080910402602001604051908101604052809291908181526020018280546113219061394a565b801561136e5780601f106113435761010080835404028352916020019161136e565b820191906000526020600020905b81548152906001019060200180831161135157829003601f168201915b505050506001600160a01b03841660009081526065602052604081209293506113989291506133d7565b6066816040516113a89190613b8d565b90815260408051918290036020908101832080546001600160a01b03191690556001600160a01b03851660009081526067909152908120557f1adb68f0a540855cafa9d341c1e94a36fa13b8a15ff602507addfe49c0f018d1906109909083908590613ba9565b6033546001600160a01b031633146114395760405162461bcd60e51b81526004016108d89061397e565b61144360006128ee565b565b6033546001600160a01b0316331461146f5760405162461bcd60e51b81526004016108d89061397e565b61147f60026402540be400613bd3565b81111561149f576040516328562c4760e01b815260040160405180910390fd5b606a8190556040518181527fd10d75876659a287a59a6ccfa2e3fff42f84d94b542837acd30bc184d562de40906020015b60405180910390a150565b6000806114e83084612940565b6001600160a01b03163b1192915050565b60606000611507606c612a01565b9050806001600160401b0381111561152157611521613551565b60405190808252806020026020018201604052801561156757816020015b60408051808201909152606081526000602082015281526020019060019003908161153f5790505b50915060005b81811015611680576000611582606c83612a0b565b9050604051806040016040528060656000846001600160a01b03166001600160a01b0316815260200190815260200160002080546115bf9061394a565b80601f01602080910402602001604051908101604052809291908181526020018280546115eb9061394a565b80156116385780601f1061160d57610100808354040283529160200191611638565b820191906000526020600020905b81548152906001019060200180831161161b57829003601f168201915b50505050508152602001826001600160a01b031681525084838151811061166157611661613bf5565b602002602001018190525050808061167890613c0b565b91505061156d565b505090565b3360008181526069602090815260409182902080546001600160a01b031981166001600160a01b03878116918217909355845192909116808352928201529092917f9dfcadd14a1ddfb19c51e84b87452ca32a43c5559e9750d1575c77105cdeac1e910160405180910390a25050565b6033546001600160a01b0316331461171f5760405162461bcd60e51b81526004016108d89061397e565b606b8190556040518181527f5e8bad84cb22c143a6757c7f1252a7d53493816880330977cc99bb7c15aaf6b4906020016114d0565b600054610100900460ff1661176f5760005460ff1615611773565b303b155b6117d65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108d8565b600054610100900460ff161580156117f8576000805461ffff19166101011790555b611800612a17565b611809826128ee565b801561181b576000805461ff00191690555b5050565b6033546001600160a01b031633146118495760405162461bcd60e51b81526004016108d89061397e565b611443612a46565b6033546001600160a01b0316331461187b5760405162461bcd60e51b81526004016108d89061397e565b611443612ade565b6033546001600160a01b031633146118ad5760405162461bcd60e51b81526004016108d89061397e565b8215806118b957504683145b156118d757604051633f8f40a960e01b815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000263ffffffff168263ffffffff1603611923576040516312792e1960e31b815260040160405180910390fd5b63ffffffff821615600184141461194d576040516312792e1960e31b815260040160405180910390fd5b6001600160a01b038116611974576040516312182f6560e11b815260040160405180910390fd5b60408051808201825263ffffffff8481168083526001600160a01b03858116602080860182815260008b815260c9835288902096518754915196166001600160c01b031990911617640100000000959093169490940291909117909355835187815291820152918201527f7a209ef38b3b8ab043b7f0a705899f4fe0f8dcfef657a6e12e943da0dae1ac739060600160405180910390a1505050565b6033546001600160a01b03163314611a3a5760405162461bcd60e51b81526004016108d89061397e565b6001600160a01b038116611a9f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108d8565b610e73816128ee565b3360009081526068602090815260408083206001600160a01b038516845290915281205490819003611aed576040516330b93f1d60e01b815260040160405180910390fd5b3360008181526068602090815260408083206001600160a01b0387168085529252822091909155610a3e9183611c38565b6000611b2a8383612040565b90505b92915050565b6001600160a01b03831660009081526067602090815260408083208151608081018352905464ffffffffff81168083526001600160481b03650100000000008304811695840195909552600160701b8204851693830193909352600160b81b900490921660608301526402540be40090611bad9086613c24565b611bb79190613bd3565b9150600083611bca578160200151611bd0565b81604001515b6001600160481b0316905080831015611be7578092505b81606001516001600160481b0316831115611c0d5781606001516001600160481b031692505b50509392505050565b6001600160a01b03811660009081526001830160205260408120541515611b2a565b6040516001600160a01b038316602482015260448101829052611c9b90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612b58565b505050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015611ce9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d0d9190613a46565b9050611d246001600160a01b038516333086612c2a565b6040516370a0823160e01b815230600482015281906001600160a01b038616906370a0823190602401602060405180830381865afa158015611d6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d8e9190613a46565b611d989190613c3b565b949350505050565b606060a0835114611dc4576040516374593f8760e01b815260040160405180910390fd5b63ffffffff8416611df657815115611def576040516374593f8760e01b815260040160405180910390fd5b50816108a7565b60001963ffffffff851601611e50576080825114611e27576040516374593f8760e01b815260040160405180910390fd5b8282604051602001611e3a929190613c4e565b60405160208183030381529060405290506108a7565b60405163523fa8d560e01b815260040160405180910390fd5b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015611eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611edd9190613a46565b905081811015611f18578015611f0257611f026001600160a01b038516846000612c62565b611f186001600160a01b03851684600019612c62565b50505050565b6000611b2a611f366001600160a01b03851684612940565b6001600160a01b031690565b60608063ffffffff8416611f8a5760a0835114611f72576040516374593f8760e01b815260040160405180910390fd5b50506040805160208101909152600081528190611fe9565b60001963ffffffff851601611e50576080611fa660a082613a75565b611fb09190613a75565b835114611fd0576040516374593f8760e01b815260040160405180910390fd5b82806020019051810190611fe49190613cb8565b915091505b9250929050565b600080600080600060a086511461201a576040516374593f8760e01b815260040160405180910390fd5b8580602001905181019061202e9190613d1b565b939a9299509097509550909350915050565b6000807f0000000000000000000000002b4069517957735be00cee0fadae88a26365528f6001600160a01b031663cb75c11c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c59190613d82565b9050806001600160a01b03166378a0565e856120f0866001600160a01b03166001600160a01b031690565b6040516001600160e01b031960e085901b16815263ffffffff9290921660048301526024820152604401602060405180830381865afa158015612137573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215b9190613d82565b91506001600160a01b038216612184576040516314ed699b60e21b815260040160405180910390fd5b5092915050565b600061219682612d77565b905060006357ecfd2860e01b878787876040516024016121b99493929190613dc8565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905060006122236001600160a01b0384167f0000000000000000000000004d41f22c5a0e5c74090899e5a8fb597a8842b3e884612e2c565b9050808060200190518101906122399190613def565b6122565760405163182f34eb60e01b815260040160405180910390fd5b5050505050505050565b60008061226e606c86611c16565b61228b576040516314ed699b60e21b815260040160405180910390fd5b612296858585611b33565b90508381106122b857604051630fab90b960e21b815260040160405180910390fd5b3360009081526069602052604090205481850392506001600160a01b03168061235b576001600160a01b0386166000908152600080516020613f6f833981519152602052604081208054849290612310908490613a75565b909155505060408051600080825260208201529081018390527f108516ddcf5ba43cea6bb2cd5ff6d59ac196c1c86ccb9178332b9dd72d1ca5619060600160405180910390a1612451565b60006402540be400606a54846123719190613c24565b61237b9190613bd3565b905060006123898285613c3b565b6001600160a01b0389166000908152600080516020613f6f83398151915260205260408120805492935084929091906123c3908490613a75565b90915550506001600160a01b038084166000908152606860209081526040808320938c16835292905290812080548392906123ff908490613a75565b9091555050604080516001600160a01b0385168152602081018390529081018390527f108516ddcf5ba43cea6bb2cd5ff6d59ac196c1c86ccb9178332b9dd72d1ca5619060600160405180910390a150505b50935093915050565b60008082516000036124845761247a6001600160a01b0386168786611c38565b508390508261256a565b6001600160a01b03808616600090815260ca602052604090205416806124c4576124b86001600160a01b0387168887611c38565b8585925092505061256a565b6000806000806124d388612e3b565b93509350935093506124e58584612e86565b96506001600160a01b038716612519576125096001600160a01b038b168c8b611c38565b898996509650505050505061256a565b6125248a868b611e69565b6125328585858c8686612f5a565b955085600003612550576125096001600160a01b038b168c8b611c38565b6125646001600160a01b0388168c88611c38565b50505050505b94509492505050565b6000816001600160a01b03163460405160006040518083038185875af1925050503d80600081146125c0576040519150601f19603f3d011682016040523d82523d6000602084013e6125c5565b606091505b505090507ff9b0951a3a6282341e1ba9414555d42d04e99076337702ee6dc484a706bfd683816125f65760006125f8565b345b604051908152602001610990565b6000611b2a836001600160a01b038416612ff8565b60006001600160a01b03166066826040516126369190613b8d565b908152604051908190036020019020546001600160a01b03161461266d576040516382ca3adf60e01b815260040160405180910390fd5b80518190600510612691576040516307f1fcb560e31b815260040160405180910390fd5b60005b6005811015611c9b576040518060400160405280600581526020016421a1aa281760d91b81525081815181106126cc576126cc613bf5565b602001015160f81c60f81b6001600160f81b0319168282815181106126f3576126f3613bf5565b01602001516001600160f81b03191614612720576040516307f1fcb560e31b815260040160405180910390fd5b600101612694565b6298968084111561274c576040516376998feb60e01b815260040160405180910390fd5b8183111561276d576040516376998feb60e01b815260040160405180910390fd5b8082111561278e576040516376998feb60e01b815260040160405180910390fd5b60405180608001604052806127a286613047565b64ffffffffff1681526020016127b785613073565b6001600160481b031681526020016127ce84613073565b6001600160481b031681526020016127e583613073565b6001600160481b039081169091526001600160a01b0387166000818152606760209081526040918290208551815487840151888601516060998a015164ffffffffff9094166dffffffffffffffffffffffffffff19909316929092176501000000000091891691909102176dffffffffffffffffffffffffffff16600160701b918816919091026001600160b81b031617600160b81b9190961602949094179093558051918252918101879052908101859052908101839052608081018290527f2447edf4fb96a663c0a6b0bb22ec30cdc8948d2041782ef779c8c6ad7059098b9060a00160405180910390a15050505050565b6000611b2a836001600160a01b03841661309d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000611b2a83836040518060400160405280602081526020017f602036038060203d373d3d3d923d343d355af13d82803e903d91601e57fd5bf381525060405160200161298d9190613e0c565b604051602081830303815290604052805190602001206040516020016129e8939291906001600160f81b0319815260609390931b6bffffffffffffffffffffffff191660018401526015830191909152603582015260550190565b6040516020818303038152906040528051906020012090565b6000611b2d825490565b6000611b2a8383613190565b600054610100900460ff16612a3e5760405162461bcd60e51b81526004016108d890613e46565b6114436131ba565b60975460ff1615612a8c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108d8565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612ac13390565b6040516001600160a01b03909116815260200160405180910390a1565b60975460ff16612b275760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108d8565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612ac1565b6000612bad826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166131ed9092919063ffffffff16565b805190915015611c9b5780806020019051810190612bcb9190613def565b611c9b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016108d8565b6040516001600160a01b0380851660248301528316604482015260648101829052611f189085906323b872dd60e01b90608401611c64565b801580612cdc5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015612cb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cda9190613a46565b155b612d475760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016108d8565b6040516001600160a01b038316602482015260448101829052611c9b90849063095ea7b360e01b90606401611c64565b6000612d833083612940565b90506001600160a01b0381163b15612d9a57919050565b60006040518060400160405280602081526020017f602036038060203d373d3d3d923d343d355af13d82803e903d91601e57fd5bf3815250604051602001612de29190613e0c565b6040516020818303038152906040529050828151602083016000f591506001600160a01b038216612e26576040516309ebea7f60e21b815260040160405180910390fd5b50919050565b60606108a484848460006131fc565b6000806000806080855114612e63576040516374593f8760e01b815260040160405180910390fd5b84806020019051810190612e779190613ea2565b93509350935093509193509193565b6040805160ff831660248083019190915282518083039091018152604490910182526020810180516001600160e01b031662415c3360e91b1790529051600091829182916001600160a01b03871691612edf9190613b8d565b600060405180830381855afa9150503d8060008114612f1a576040519150601f19603f3d011682016040523d82523d6000602084013e612f1f565b606091505b5091509150818015612f32575080516020145b15612f4d57612f46612f4382613ee5565b90565b9250612f52565b600092505b505092915050565b6040516348b4aac360e11b815260ff8087166004830152851660248201526044810184905260648101829052608481018390526000906001600160a01b0388169063916955869060a4016020604051808303816000875af1925050508015612fdf575060408051601f3d908101601f19168201909252612fdc91810190613a46565b60015b612feb57506000612fee565b90505b9695505050505050565b600081815260018301602052604081205461303f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611b2d565b506000611b2d565b600064ffffffffff82111561306f57604051631cb1a8e360e31b815260040160405180910390fd5b5090565b60006001600160481b0382111561306f57604051631cb1a8e360e31b815260040160405180910390fd5b600081815260018301602052604081205480156131865760006130c1600183613c3b565b85549091506000906130d590600190613c3b565b905081811461313a5760008660000182815481106130f5576130f5613bf5565b906000526020600020015490508087600001848154811061311857613118613bf5565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061314b5761314b613f09565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611b2d565b6000915050611b2d565b60008260000182815481106131a7576131a7613bf5565b9060005260206000200154905092915050565b600054610100900460ff166131e15760405162461bcd60e51b81526004016108d890613e46565b6097805460ff19169055565b60606108a48484600085613247565b606061323e6001600160a01b0385168460405160200161321d929190613f1f565b60408051601f198184030181529190526001600160a01b0387169084613378565b95945050505050565b6060824710156132a85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016108d8565b6001600160a01b0385163b6132ff5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108d8565b600080866001600160a01b0316858760405161331b9190613b8d565b60006040518083038185875af1925050503d8060008114613358576040519150601f19603f3d011682016040523d82523d6000602084013e61335d565b606091505b509150915061336d82828661339e565b979650505050505050565b60606108a4848484604051806060016040528060298152602001613f4660299139613247565b606083156133ad5750816108a7565b8251156133bd5782518084602001fd5b8160405162461bcd60e51b81526004016108d891906134a3565b5080546133e39061394a565b6000825580601f106133f3575050565b601f016020900490600052602060002090810190610e7391905b8082111561306f576000815560010161340d565b6001600160a01b0381168114610e7357600080fd5b60006020828403121561344857600080fd5b81356108a781613421565b60005b8381101561346e578181015183820152602001613456565b50506000910152565b6000815180845261348f816020860160208601613453565b601f01601f19169290920160200192915050565b602081526000611b2a6020830184613477565b8015158114610e7357600080fd5b6000806000606084860312156134d957600080fd5b83356134e481613421565b92506020840135915060408401356134fb816134b6565b809150509250925092565b6000806040838503121561351957600080fd5b823561352481613421565b9150602083013561353481613421565b809150509250929050565b63ffffffff81168114610e7357600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561358f5761358f613551565b604052919050565b60006001600160401b038211156135b0576135b0613551565b50601f01601f191660200190565b600082601f8301126135cf57600080fd5b81356135e26135dd82613597565b613567565b8181528460208386010111156135f757600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c0878903121561362d57600080fd5b863561363881613421565b955060208701359450604087013561364f81613421565b93506060870135925060808701356136668161353f565b915060a08701356001600160401b0381111561368157600080fd5b61368d89828a016135be565b9150509295509295509295565b60008083601f8401126136ac57600080fd5b5081356001600160401b038111156136c357600080fd5b602083019150836020828501011115611fe957600080fd5b600080600080600080608087890312156136f457600080fd5b86356001600160401b038082111561370b57600080fd5b6137178a838b0161369a565b9098509650602089013591508082111561373057600080fd5b61373c8a838b0161369a565b9096509450604089013591506137518261353f565b9092506060880135908082111561376757600080fd5b5061368d89828a016135be565b60008060008060008060c0878903121561378d57600080fd5b86356001600160401b038111156137a357600080fd5b6137af89828a016135be565b96505060208701356137c081613421565b95989597505050506040840135936060810135936080820135935060a0909101359150565b600080600080600060a086880312156137fd57600080fd5b853561380881613421565b97602087013597506040870135966060810135965060800135945092505050565b60006020828403121561383b57600080fd5b5035919050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156138b357888303603f190185528151805187855261388d88860182613477565b918901516001600160a01b03169489019490945294870194925090860190600101613869565b509098975050505050505050565b6000602082840312156138d357600080fd5b81356001600160401b038111156138e957600080fd5b611d98848285016135be565b60008060006060848603121561390a57600080fd5b83359250602084013561391c8161353f565b915060408401356134fb81613421565b6000806040838503121561393f57600080fd5b82356135248161353f565b600181811c9082168061395e57607f821691505b602082108103612e2657634e487b7160e01b600052602260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b80516001600160401b03811681146139ca57600080fd5b919050565b6000602082840312156139e157600080fd5b611b2a826139b3565b8781526001600160401b038716602082015260018060a01b038616604082015284606082015263ffffffff8416608082015260e060a08201526000613a3260e0830185613477565b90508260c083015298975050505050505050565b600060208284031215613a5857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115611b2d57611b2d613a5f565b601f821115611c9b57600081815260208120601f850160051c81016020861015613aaf5750805b601f850160051c820191505b8181101561121257828155600101613abb565b81516001600160401b03811115613ae757613ae7613551565b613afb81613af5845461394a565b84613a88565b602080601f831160018114613b305760008415613b185750858301515b600019600386901b1c1916600185901b178555611212565b600085815260208120601f198616915b82811015613b5f57888601518255948401946001909101908401613b40565b5085821015613b7d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251613b9f818460208701613453565b9190910192915050565b604081526000613bbc6040830185613477565b905060018060a01b03831660208301529392505050565b600082613bf057634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060018201613c1d57613c1d613a5f565b5060010190565b8082028115828204841417611b2d57611b2d613a5f565b81810381811115611b2d57611b2d613a5f565b604081526000613c616040830185613477565b828103602084015261323e8185613477565b600082601f830112613c8457600080fd5b8151613c926135dd82613597565b818152846020838601011115613ca757600080fd5b611d98826020830160208701613453565b60008060408385031215613ccb57600080fd5b82516001600160401b0380821115613ce257600080fd5b613cee86838701613c73565b93506020850151915080821115613d0457600080fd5b50613d1185828601613c73565b9150509250929050565b600080600080600060a08688031215613d3357600080fd5b8551613d3e8161353f565b9450613d4c602087016139b3565b93506040860151613d5c81613421565b606087015160808801519194509250613d7481613421565b809150509295509295909350565b600060208284031215613d9457600080fd5b81516108a781613421565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b604081526000613ddc604083018688613d9f565b828103602084015261336d818587613d9f565b600060208284031215613e0157600080fd5b81516108a7816134b6565b607f60f81b81528151600090613e29816001850160208701613453565b653d5260203df360d01b6001939091019283015250600701919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b805160ff811681146139ca57600080fd5b60008060008060808587031215613eb857600080fd5b613ec185613e91565b9350613ecf60208601613e91565b6040860151606090960151949790965092505050565b80516020808301519190811015612e265760001960209190910360031b1b16919050565b634e487b7160e01b600052603160045260246000fd5b82815260008251613f37816020850160208701613453565b91909101602001939250505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564ad6f8124f6081c2622ab3a16acd47af73d52fe87b755c3f897263c58ba3fdbd7a2646970667358221220e6c9c255f9aa0659a73a8cc39e24f6a9176a63231b69e031de8df31721a973e164736f6c63430008110033

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

0000000000000000000000002b4069517957735be00cee0fadae88a26365528f

-----Decoded View---------------
Arg [0] : tokenMessenger_ (address): 0x2B4069517957735bE00ceE0fadAE88a26365528f

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000002b4069517957735be00cee0fadae88a26365528f


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  ]

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.