S Price: $0.81203 (-4.52%)

Contract

0x4f363D0ECd1Ee5e0C55c0c23a053543374F57907

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

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

Contract Name:
UTSDeploymentRouter

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 99999 runs

Other Settings:
paris EvmVersion
File 1 of 27 : UTSDeploymentRouter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "../libraries/AddressConverter.sol";
import "../libraries/UTSCoreDataTypes.sol";
import "../libraries/UTSERC20DataTypes.sol";
import "../libraries/DecimalsConverter.sol";

import "./interfaces/IUTSFactory.sol";
import "./interfaces/IUTSDeploymentRouter.sol";
import "../interfaces/IPausable.sol";
import "../interfaces/IUTSRegistry.sol";
import "../interfaces/IUTSPriceFeed.sol";
import "../interfaces/IUTSMasterRouter.sol";

/**
 * @notice A contract manages the sending and receiving of crosschain deployment requests for UTSTokens and 
 * UTSConnectors via UTS protocol V1.
 *
 * @dev It is an implementation of {UTSDeploymentRouter} for UUPS.
 */
contract UTSDeploymentRouter is IUTSDeploymentRouter, AccessControlUpgradeable, PausableUpgradeable, UUPSUpgradeable {
    using SafeERC20 for IERC20;
    using AddressConverter for address;
    using DecimalsConverter for uint256;

    /// @notice {AccessControl} role identifier for pauser addresses.
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");

    /// @notice {AccessControl} role identifier for manager addresses.
    bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");

    /// @notice Reserved chain Id for the native currency to payment token rate fetching.
    uint256 public constant EOB_CHAIN_ID = 33033;

    /// @notice Internal UTS protocol identifier for crosschain deploy messages.
    bytes1 private constant DEPLOY_MESSAGE_TYPE = 0x02;

    /// @notice Basis points divisor for percentage calculations (100.00%).
    uint16 private constant BPS = 10000;

    /// @dev Precision used for the native currency to payment token rate calculations.
    uint24 private constant PRECISION = 1000000;

    /// @notice Address of the {UTSMasterRouter} contract.
    address public immutable MASTER_ROUTER;

    /// @notice Address of the {UTSPriceFeed} contract.
    address public immutable PRICE_FEED;

    /// @notice Address of the {UTSFactory} contract.
    address public immutable FACTORY;

    /// @notice Address of the {UTSRegistry} contract.
    address public immutable REGISTRY;

    /// @notice Address of the token used for crosschain deploy payment.
    /// @dev Payment in native currency is also available.
    address public immutable PAYMENT_TOKEN;

    /// @notice {PAYMENT_TOKEN} decimals.
    uint8 private immutable PAYMENT_TOKEN_DECIMALS;

    /// @notice Native currency decimals.
    uint8 private immutable NATIVE_TOKEN_DECIMALS;

    /// @notice The gas limit for payment native currency transfer by low level {call} function.
    uint16 private immutable PAYMENT_TRANSFER_GAS_LIMIT;

    /// @notice The maximum number of chains on which crosschain deployment is available.
    uint8 private immutable AVAILABLE_CHAINS_NUMBER; 

    /// @custom:storage-location erc7201:UTSProtocol.storage.UTSDeploymentRouter.Main
    struct Main {
        mapping(uint256 chainId => DstDeployConfig) _dstDeployConfig;
    }

    /// @dev keccak256(abi.encode(uint256(keccak256("UTSProtocol.storage.UTSDeploymentRouter.Main")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant MAIN_STORAGE_LOCATION = 0x5ef83cde492754da3fd6bddb04f9c0eea61921570db6556ef7bb11412c3f9000;

    /// @notice Indicates an error that the provided {deployMetadata} array has zero length.
    error UTSDeploymentRouter__E0();

    /// @notice Indicates an error that the provided {deployMetadata.dstChainId} is not supported.
    error UTSDeploymentRouter__E1();

    /// @notice Indicates an error that the function caller is not the {MASTER_ROUTER}.
    error UTSDeploymentRouter__E2();

    /// @notice Indicates an error that lengths of provided arrays do not match.
    error UTSDeploymentRouter__E3();

    /// @notice Indicates an error that the provided {deployMetadata.params} contains unsupported {UTSToken} configuration to deploy.
    error UTSDeploymentRouter__E4();

    /// @notice Indicates an error that the provided {msg.value} is insufficient to pay for the request.
    error UTSDeploymentRouter__E5();

    /// @notice Indicates an error that the provided {DeployTokenData.mintedAmountToOwner} exceeds the {DeployTokenData.initialSupply}.
    error UTSDeploymentRouter__E6();

    /// @notice Indicates an error that the provided {DeployMetadata.params.allowedChainIds} exceeds the {AVAILABLE_CHAINS_NUMBER}.
    error UTSDeploymentRouter__E7();

    /// @notice Indicates an error that the selected {DeployMetadata.params.feeModule} or {paymentToken} temporarily unsupported.
    error UTSDeploymentRouter__E8();

    /**
     * @notice Emitted when the {DstDeployConfig.factory} is updated.
     * @param dstChainId destination chain Id.
     * @param newFactory new {DstDeployConfig.factory} address for corresponding {dstChainId}.
     * @param caller the caller address who set the new {DstDeployConfig.factory}.
     */
    event ConfigFactorySet(uint256 indexed dstChainId, bytes newFactory, address indexed caller);

    /**
     * @notice Emitted when the {DstDeployConfig.protocolFee} is updated.
     * @param dstChainId destination chain Id.
     * @param newProtocolFee new {DstDeployConfig.protocolFee} value for corresponding {dstChainId}.
     * @param caller the caller address who set the new {DstDeployConfig.protocolFee}.
     */
    event ConfigProtocolFeeSet(uint256 indexed dstChainId, uint16 newProtocolFee, address indexed caller);

    /**
     * @notice Emitted when the {DstDeployConfig.tokenDeployGas} is updated.
     * @param dstChainId destination chain Id.
     * @param newTokenDeployGas new {DstDeployConfig.tokenDeployGas} amount for corresponding {dstChainId}.
     * @param caller the caller address who set the new {DstDeployConfig.tokenDeployGas}.
     */
    event ConfigTokenDeployGasSet(uint256 indexed dstChainId, uint64 newTokenDeployGas, address indexed caller);

    /**
     * @notice Emitted when the {DstDeployConfig.connectorDeployGas} is updated.
     * @param dstChainId destination chain Id.
     * @param newConnectorDeployGas new {DstDeployConfig.connectorDeployGas} amount for corresponding {dstChainId}.
     * @param caller the caller address who set the new {DstDeployConfig.connectorDeployGas}.
     */
    event ConfigConnectorDeployGasSet(uint256 indexed dstChainId, uint64 newConnectorDeployGas, address indexed caller);

    /**
     * @notice Initializes immutable variables.
     * @param masterRouter address of the {UTSMasterRouter} contract.
     * @param priceFeed address of the {UTSPriceFeed} contract.
     * @param factory address of the {UTSFactory} contract.
     * @param registry address of the {UTSRegistry} contract.
     * @param paymentToken address of the {PAYMENT_TOKEN} used for payment.
     * @param paymentTokenDecimals {PAYMENT_TOKEN} decimals.
     * @param nativeTokenDecimals native currency decimals.
     * @param paymentTransferGasLimit gas limit for payment native currency transfer by low level {call} function.
     * @param availableChainsNumber maximum number of chains on which crosschain deployment is available.
     *
     * @custom:oz-upgrades-unsafe-allow constructor
     */ 
    constructor(
        address masterRouter, 
        address priceFeed, 
        address factory, 
        address registry, 
        address paymentToken,
        uint8 paymentTokenDecimals,
        uint8 nativeTokenDecimals,
        uint16 paymentTransferGasLimit,
        uint8 availableChainsNumber
    ) {
        _disableInitializers();

        MASTER_ROUTER = masterRouter;
        PRICE_FEED = priceFeed;
        FACTORY = factory;
        REGISTRY = registry;
        PAYMENT_TOKEN = paymentToken;
        PAYMENT_TOKEN_DECIMALS = paymentTokenDecimals;
        NATIVE_TOKEN_DECIMALS = nativeTokenDecimals;
        PAYMENT_TRANSFER_GAS_LIMIT = paymentTransferGasLimit;
        AVAILABLE_CHAINS_NUMBER = availableChainsNumber;
    }

    /**
     * @notice Initializes basic settings with provided parameters.
     * @param defaultAdmin initial {DEFAULT_ADMIN_ROLE} address.
     */
    function initialize(address defaultAdmin) external initializer() {
        __UUPSUpgradeable_init();
        __AccessControl_init();
        __Pausable_init();

        _grantRole(DEFAULT_ADMIN_ROLE, defaultAdmin);
    }

    /**
     * @notice Sends UTSToken and UTSConnector deployment crosschain requests via UTS protocol V1.
     * @param deployMetadata array of {DeployMetadata} structs, containing destination chain Ids and deploy parameters:
     *        dstChainId: destination chain Id
     *        isConnector: flag indicating whether is request for deploy connector(true) or token(false)
     *        params: abi.encoded {DeployTokenData} struct or abi.encoded {DeployConnectorData} struct
     * @dev See the {UTSERC20DataTypes.DeployTokenData} and {UTSERC20DataTypes.DeployConnectorData} for details.
     *
     * @param paymentToken address of the token used for payment.
     * @dev Any {paymentToken} address different from the {PAYMENT_TOKEN} is identified as a payment in native currency.
     *
     * @return paymentAmount total payment required for send deployment requests.
     * @return currentChainDeployment deployment address on the current chain (if a relevant request was provided).
     */
    function sendDeployRequest(
        DeployMetadata[] calldata deployMetadata,
        address paymentToken
    ) external payable whenNotPaused() returns(uint256 paymentAmount, address currentChainDeployment) {
        if (deployMetadata.length == 0) revert UTSDeploymentRouter__E0();

        for (uint256 i; deployMetadata.length > i; ++i) {
            if (deployMetadata[i].dstChainId != block.chainid) {
                DstDeployConfig memory config = dstDeployConfig(deployMetadata[i].dstChainId);

                if (config.factory.length == 0) revert UTSDeploymentRouter__E1();

                if (deployMetadata[i].isConnector) {
                    DeployConnectorData memory _params = abi.decode(deployMetadata[i].params, (DeployConnectorData));

                    if (_params.feeModule) revert UTSDeploymentRouter__E8();

                    if (_params.allowedChainIds.length != _params.chainConfigs.length) revert UTSDeploymentRouter__E3();
                    if (_params.allowedChainIds.length > AVAILABLE_CHAINS_NUMBER) revert UTSDeploymentRouter__E7();
                } else {
                    DeployTokenData memory _params = abi.decode(deployMetadata[i].params, (DeployTokenData));

                    if (_params.feeModule) revert UTSDeploymentRouter__E8();

                    if (_params.allowedChainIds.length != _params.chainConfigs.length) revert UTSDeploymentRouter__E3();
                    if (_params.allowedChainIds.length > AVAILABLE_CHAINS_NUMBER) revert UTSDeploymentRouter__E7();

                    if (_params.pureToken) {
                        if (_params.mintable || _params.globalBurnable || _params.onlyRoleBurnable || _params.feeModule) {
                            revert UTSDeploymentRouter__E4();
                        }

                        if (_params.mintedAmountToOwner > _params.initialSupply) revert UTSDeploymentRouter__E6();
                    } else {
                        if (_params.mintedAmountToOwner != _params.initialSupply) revert UTSDeploymentRouter__E6();
                    }
                }

                IUTSMasterRouter(MASTER_ROUTER).sendProposal(
                    0, // user's payload length
                    deployMetadata[i].dstChainId, 
                    abi.encode(
                        config.factory,
                        DEPLOY_MESSAGE_TYPE,
                        abi.encode(
                            deployMetadata[i].isConnector, 
                            msg.sender.toBytes(), 
                            deployMetadata[i].params
                        )
                    )
                );

                paymentAmount += 
                    IUTSPriceFeed(PRICE_FEED).getDstGasPriceAtSrcNative(deployMetadata[i].dstChainId) * 
                    (deployMetadata[i].isConnector ? config.connectorDeployGas : config.tokenDeployGas) * 
                    (BPS + config.protocolFee) / BPS;

            } else {
                ( , currentChainDeployment) = IUTSFactory(FACTORY).deployByRouter(
                    deployMetadata[i].isConnector, 
                    msg.sender.toBytes(), 
                    deployMetadata[i].params
                );
            }
        }

        if (paymentToken == PAYMENT_TOKEN) {
            revert UTSDeploymentRouter__E8();

            paymentAmount = _normalize(paymentAmount, IUTSPriceFeed(PRICE_FEED).getDstGasPriceAtSrcNative(EOB_CHAIN_ID));

            if (paymentAmount > 0) {
                IERC20(PAYMENT_TOKEN).safeTransferFrom(
                    msg.sender, 
                    IUTSMasterRouter(MASTER_ROUTER).feeCollector(), 
                    paymentAmount
                );
            }
        } else {
            if (paymentAmount > msg.value) revert UTSDeploymentRouter__E5();

            IUTSMasterRouter(MASTER_ROUTER).feeCollector().call{
                value: address(this).balance, 
                gas: PAYMENT_TRANSFER_GAS_LIMIT
            }("");
        }

        return (paymentAmount, currentChainDeployment);
    }

    /**
     * @notice Executes a deployment request received from source chain via UTS protocol V1.
     * @param factoryAddress {UTSFactory} address on current chain.
     * @param messageType internal UTS protocol identifier for crosschain messages. Must match {DEPLOY_MESSAGE_TYPE}.
     * @param localParams abi.encoded deploy parameters, containing:
     *        isConnector: flag indicating whether is request for deploy connector(true) or token(false)
     *        deployer: source chain {msg.sender} address
     *        deployParams: abi.encoded {DeployTokenData} struct or abi.encoded {DeployConnectorData} struct
     * @return opResult the execution result code, represented as a uint8(UTSCoreDataTypes.OperationResult).
     * @dev Only {MASTER_ROUTER} can execute this function.
     */
    function execute(
        address factoryAddress, 
        bytes1 messageType,
        bytes calldata localParams
    ) external payable returns(uint8 opResult) {
        if (msg.sender != MASTER_ROUTER) revert UTSDeploymentRouter__E2();

        if (paused()) return uint8(OperationResult.RouterPaused); 
        if (messageType != DEPLOY_MESSAGE_TYPE) return uint8(OperationResult.InvalidMessageType); 
        if (!IUTSRegistry(REGISTRY).validateFactory(factoryAddress)) return uint8(OperationResult.UnauthorizedRouter);
        if (IPausable(factoryAddress).paused()) return uint8(OperationResult.RouterPaused);

        ( 
            bool _isConnector, 
            bytes memory _deployer,
            bytes memory _deployParams
        ) = abi.decode(localParams, (bool, bytes, bytes));

        (bool _deployResult, bytes memory _deployResponse) = factoryAddress.call(
            abi.encodeCall(IUTSFactory.deployByRouter, (_isConnector, _deployer, _deployParams))
        );

        if (_deployResult && _deployResponse.length > 0) {
            return uint8(OperationResult.Success);
        } else {
            return uint8(OperationResult.DeployFailed);
        }
    }

    /**
     * @notice Pauses the {sendDeployRequest} and {execute} functions.
     * @dev Only addresses with the {PAUSER_ROLE} can execute this function.
     */
    function pause() external onlyRole(PAUSER_ROLE) {
        _pause();
    }

    /**
     * @notice Unpauses the {sendDeployRequest} and {execute} functions.
     * @dev Only addresses with the {PAUSER_ROLE} can execute this function.
     */
    function unpause() external onlyRole(PAUSER_ROLE) {
        _unpause();
    }

    /**
     * @notice Sets the destination chains settings.
     * @param dstChainIds destination chain Ids.
     * @param newConfigs {DstDeployConfig} structs array containing destination chains settings: 
     *        factory: destination {UTSFactory} address
     *        tokenDeployGas: the amount of gas required to deploy the {UTSToken} on the destination chain
     *        connectorDeployGas: the amount of gas required to deploy the {UTSConnector} on the destination chain
     *        protocolFee: protocol fee (basis points) for crosschain deployment on the destination chain
     * @dev Only addresses with the {DEFAULT_ADMIN_ROLE} can execute this function.
     */
    function setDstDeployConfig(
        uint256[] calldata dstChainIds,
        DstDeployConfig[] calldata newConfigs
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (dstChainIds.length != newConfigs.length) revert UTSDeploymentRouter__E3();
        for (uint256 i; dstChainIds.length > i; ++i) {
            _setFactory(dstChainIds[i], newConfigs[i].factory);
            _setTokenDeployGas(dstChainIds[i], newConfigs[i].tokenDeployGas);
            _setConnectorDeployGas(dstChainIds[i], newConfigs[i].connectorDeployGas);
            _setProtocolFee(dstChainIds[i], newConfigs[i].protocolFee);
        }
    }

    /**
     * @notice Sets the amounts of gas required to deploy on the destination chains.
     * @param dstChainIds destination chain Ids.
     * @param newTokenDeployGas the amounts of gas required to deploy the {UTSToken} on the corresponding {dstChainId}.
     * @param newTokenDeployGas the amounts of gas required to deploy the {UTSConnector} on the corresponding {dstChainId}.
     * @dev Only addresses with the {MANAGER_ROLE} can execute this function.
     */
    function setDstDeployGas(
        uint256[] calldata dstChainIds,
        uint64[] calldata newTokenDeployGas,
        uint64[] calldata newConnectorDeployGas
    ) external onlyRole(MANAGER_ROLE) {
        if (dstChainIds.length != newTokenDeployGas.length) revert UTSDeploymentRouter__E3();
        if (dstChainIds.length != newConnectorDeployGas.length) revert UTSDeploymentRouter__E3();
        for (uint256 i; dstChainIds.length > i; ++i) {
            _setTokenDeployGas(dstChainIds[i], newTokenDeployGas[i]);
            _setConnectorDeployGas(dstChainIds[i], newConnectorDeployGas[i]);
        }
    }

    /**
     * @notice Sets the protocol fees for deploy on the destination chains.
     * @param dstChainIds destination chain Ids.
     * @param newProtocolFees protocol fees (basis points) for crosschain deployment on the corresponding {dstChainId}.
     * @dev Only addresses with the {MANAGER_ROLE} can execute this function.
     */
    function setDstProtocolFee(
        uint256[] calldata dstChainIds, 
        uint16[] calldata newProtocolFees
    ) external onlyRole(MANAGER_ROLE) {
        if (dstChainIds.length != newProtocolFees.length) revert UTSDeploymentRouter__E3();
        for (uint256 i; dstChainIds.length > i; ++i) _setProtocolFee(dstChainIds[i], newProtocolFees[i]);
    }

    /**
     * @notice Sets the destination {UTSFactory} addresses.
     * @param dstChainIds destination chain Ids.
     * @param newFactory {UTSFactory} addresses on the corresponding {dstChainId}.
     * @dev Only addresses with the {DEFAULT_ADMIN_ROLE} can execute this function.
     */
    function setDstFactory(
        uint256[] calldata dstChainIds, 
        bytes[] calldata newFactory
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (dstChainIds.length != newFactory.length) revert UTSDeploymentRouter__E3();
        for (uint256 i; dstChainIds.length > i; ++i) _setFactory(dstChainIds[i], newFactory[i]);
    }

    /**
     * @notice Estimates the total payment required for send crosschain deployment requests.
     * @param dstTokenChainIds destination chain Ids for {UTSToken} deployments.
     * @param dstConnectorChainIds destination chain Ids for {UTSConnector} deployments.
     * @return paymentTokenAmount estimated total payment amount in the {PAYMENT_TOKEN}.
     * @return paymentNativeAmount estimated total payment amount in native currency.
     */
    function estimateDeployTotal(
        uint256[] calldata dstTokenChainIds,
        uint256[] calldata dstConnectorChainIds
    ) external view returns(uint256 paymentTokenAmount, uint256 paymentNativeAmount) {
        for (uint256 i; dstTokenChainIds.length > i; ++i) {
            if (dstTokenChainIds[i] != block.chainid) {
                DstDeployConfig memory config = dstDeployConfig(dstTokenChainIds[i]);

                paymentNativeAmount += 
                    IUTSPriceFeed(PRICE_FEED).getDstGasPriceAtSrcNative(dstTokenChainIds[i]) * 
                    config.tokenDeployGas * (BPS + config.protocolFee) / BPS;
            }
        }

        for (uint256 i; dstConnectorChainIds.length > i; ++i) {
            if (dstConnectorChainIds[i] != block.chainid) {
                DstDeployConfig memory config = dstDeployConfig(dstConnectorChainIds[i]);

                paymentNativeAmount += 
                    IUTSPriceFeed(PRICE_FEED).getDstGasPriceAtSrcNative(dstConnectorChainIds[i]) * 
                    config.connectorDeployGas * (BPS + config.protocolFee) / BPS;
            }
        }

        return (
            _normalize(paymentNativeAmount, IUTSPriceFeed(PRICE_FEED).getDstGasPriceAtSrcNative(EOB_CHAIN_ID)), 
            paymentNativeAmount
        );
    }

    /**
     * @notice Estimates the separated payments required for send crosschain deployment requests in the {PAYMENT_TOKEN}.
     * @param dstTokenChainIds destination chain Ids for {UTSToken} deployments.
     * @param dstConnectorChainIds destination chain Ids for {UTSConnector} deployments.
     * @return tokenPaymentAmount array of estimated payment amount in the {PAYMENT_TOKEN} for each {dstChainId}.
     * @return connectorPaymentAmount array of estimated payment amount in the {PAYMENT_TOKEN} for each {dstChainId}.
     * @return totalPaymentAmount estimated total payment amount in the {PAYMENT_TOKEN}.
     */
    function estimateDeploy(
        uint256[] calldata dstTokenChainIds,
        uint256[] calldata dstConnectorChainIds
    ) external view returns(
        uint256[] memory tokenPaymentAmount, 
        uint256[] memory connectorPaymentAmount, 
        uint256 totalPaymentAmount
    ) {
        uint256 _tokenToCurNativeRate = IUTSPriceFeed(PRICE_FEED).getDstGasPriceAtSrcNative(EOB_CHAIN_ID);

        tokenPaymentAmount = new uint256[](dstTokenChainIds.length);
        connectorPaymentAmount = new uint256[](dstConnectorChainIds.length);

        for (uint256 i; dstTokenChainIds.length > i; ++i) {
            if (dstTokenChainIds[i] != block.chainid) {
                DstDeployConfig memory config = dstDeployConfig(dstTokenChainIds[i]);

                uint256 _paymentAmount = _normalize(
                    IUTSPriceFeed(PRICE_FEED).getDstGasPriceAtSrcNative(dstTokenChainIds[i]) * 
                    config.tokenDeployGas * (BPS + config.protocolFee) / BPS,
                    _tokenToCurNativeRate
                );

                tokenPaymentAmount[i] = _paymentAmount;
                totalPaymentAmount += _paymentAmount;
            } else {
                tokenPaymentAmount[i] = 0;
            }
        }

        for (uint256 i; dstConnectorChainIds.length > i; ++i) {
            if (dstConnectorChainIds[i] != block.chainid) {
                DstDeployConfig memory config = dstDeployConfig(dstConnectorChainIds[i]);

                uint256 _paymentAmount = _normalize(
                    IUTSPriceFeed(PRICE_FEED).getDstGasPriceAtSrcNative(dstConnectorChainIds[i]) * 
                    config.connectorDeployGas * (BPS + config.protocolFee) / BPS,
                    _tokenToCurNativeRate
                );

                connectorPaymentAmount[i] = _paymentAmount;
                totalPaymentAmount += _paymentAmount;
            } else {
                connectorPaymentAmount[i] = 0;
            }
        }
    }

    /**
     * @notice Estimates the separated payments required for send crosschain deployment requests in native currency.
     * @param dstTokenChainIds destination chain Ids for {UTSToken} deployments.
     * @param dstConnectorChainIds destination chain Ids for {UTSConnector} deployments.
     * @return tokenPaymentAmountNative array of estimated payment amount in native currency for each {dstChainId}.
     * @return connectorPaymentAmountNative array of estimated payment amount in native currency for each {dstChainId}.
     * @return totalPaymentAmountNative estimated total payment amount in native currency.
     */
    function estimateDeployNative(
        uint256[] calldata dstTokenChainIds,
        uint256[] calldata dstConnectorChainIds
    ) external view returns(
        uint256[] memory tokenPaymentAmountNative, 
        uint256[] memory connectorPaymentAmountNative, 
        uint256 totalPaymentAmountNative
    ) {
        tokenPaymentAmountNative = new uint256[](dstTokenChainIds.length);
        connectorPaymentAmountNative = new uint256[](dstConnectorChainIds.length);

        for (uint256 i; dstTokenChainIds.length > i; ++i) {
            if (dstTokenChainIds[i] != block.chainid) {
                DstDeployConfig memory config = dstDeployConfig(dstTokenChainIds[i]);

                uint256 _paymentAmount = 
                    IUTSPriceFeed(PRICE_FEED).getDstGasPriceAtSrcNative(dstTokenChainIds[i]) * 
                    config.tokenDeployGas * (BPS + config.protocolFee) / BPS;

                tokenPaymentAmountNative[i] = _paymentAmount;
                totalPaymentAmountNative += _paymentAmount;
            } else {
                tokenPaymentAmountNative[i] = 0;
            }
        }

        for (uint256 i; dstConnectorChainIds.length > i; ++i) {
            if (dstConnectorChainIds[i] != block.chainid) {
                DstDeployConfig memory config = dstDeployConfig(dstConnectorChainIds[i]);

                uint256 _paymentAmount =
                    IUTSPriceFeed(PRICE_FEED).getDstGasPriceAtSrcNative(dstConnectorChainIds[i]) * 
                    config.connectorDeployGas * (BPS + config.protocolFee) / BPS;

                connectorPaymentAmountNative[i] = _paymentAmount;
                totalPaymentAmountNative += _paymentAmount;
            } else {
                connectorPaymentAmountNative[i] = 0;
            }
        }
    }

    /**
     * @notice Returns the abi.encoded {DeployTokenData} struct as a parameter for the {sendDeployRequest} function.
     * @param deployData see the {UTSERC20DataTypes.DeployTokenData} for details.
     * @return abi.encoded {DeployTokenData} struct.
     */
    function getDeployTokenParams(DeployTokenData calldata deployData) external pure returns(bytes memory) {
        return abi.encode(deployData);
    }

    /**
     * @notice Returns the abi.encoded {DeployConnectorData} struct as a parameter for the {sendDeployRequest} function.
     * @param deployData see the {UTSERC20DataTypes.DeployConnectorData} for details.
     * @return abi.encoded {DeployConnectorData} struct.
     */
    function getDeployConnectorParams(DeployConnectorData calldata deployData) external pure returns(bytes memory) {
        return abi.encode(deployData);
    }

    /**
     * @notice Returns the UTSDeploymentRouter protocol version.
     * @return UTS protocol version.
     */
    function protocolVersion() public pure returns(bytes2) {
        return 0x0101;
    }

    /**
     * @notice Returns true if this contract implements the interface defined by `interfaceId`.
     * See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified
     * to learn more about how these ids are created.
     */
    function supportsInterface(bytes4 interfaceId) public view override returns(bool) {
        return interfaceId == type(IUTSDeploymentRouter).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @notice Returns destination chain settings.
     * @param dstChainId destination chain Id.
     * @return {DstDeployConfig} struct.
     * @dev See the {UTSERC20DataTypes.DstDeployConfig} for details.
     */
    function dstDeployConfig(uint256 dstChainId) public view returns(DstDeployConfig memory) {
        Main storage $ = _getMainStorage();
        return $._dstDeployConfig[dstChainId];
    }

    /**
     * @notice Returns the amount of gas required to deploy the {UTSToken}.
     * @param dstChainId destination chain Id.
     * @return The amount of gas required to deploy the {UTSToken} on the provided {dstChainId}.
     */
    function dstTokenDeployGas(uint256 dstChainId) external view returns(uint64) {
        Main storage $ = _getMainStorage();
        return $._dstDeployConfig[dstChainId].tokenDeployGas;
    }

    /**
     * @notice Returns the amount of gas required to deploy the {UTSConnector}.
     * @param dstChainId destination chain Id.
     * @return The amount of gas required to deploy the {UTSConnector} on the provided {dstChainId}.
     */
    function dstConnectorDeployGas(uint256 dstChainId) external view returns(uint64) {
        Main storage $ = _getMainStorage();
        return $._dstDeployConfig[dstChainId].connectorDeployGas;
    }

    /**
     * @notice Returns the protocol fee for deploy on the destination chains.
     * @param dstChainId destination chain Id.
     * @return Protocol fees (basis points) for crosschain deployment on the provided {dstChainId}.
     */
    function dstProtocolFee(uint256 dstChainId) external view returns(uint16) {
        Main storage $ = _getMainStorage();
        return $._dstDeployConfig[dstChainId].protocolFee;
    }

    /**
     * @notice Returns the destination {UTSFactory} contract address.
     * @param dstChainId destination chain Id.
     * @return {UTSFactory} address on the provided {dstChainId}.
     */
    function dstFactory(uint256 dstChainId) external view returns(bytes memory) {
        Main storage $ = _getMainStorage();
        return $._dstDeployConfig[dstChainId].factory;
    }

    function _normalize(uint256 amount, uint256 rate) internal view returns(uint256) {
        return (amount * rate / PRECISION).convert(NATIVE_TOKEN_DECIMALS, PAYMENT_TOKEN_DECIMALS);
    }

    function _authorizeUpgrade(address /* newImplementation */) internal override onlyRole(DEFAULT_ADMIN_ROLE) {

    }

    function _setTokenDeployGas(uint256 dstChainId, uint64 newTokenDeployGas) internal {
        Main storage $ = _getMainStorage();
        $._dstDeployConfig[dstChainId].tokenDeployGas = newTokenDeployGas;

        emit ConfigTokenDeployGasSet(dstChainId, newTokenDeployGas, msg.sender);
    }

    function _setConnectorDeployGas(uint256 dstChainId, uint64 newConnectorDeployGas) internal {
        Main storage $ = _getMainStorage();
        $._dstDeployConfig[dstChainId].connectorDeployGas = newConnectorDeployGas;

        emit ConfigConnectorDeployGasSet(dstChainId, newConnectorDeployGas, msg.sender);
    }

    function _setProtocolFee(uint256 dstChainId, uint16 newProtocolFee) internal {
        Main storage $ = _getMainStorage();
        $._dstDeployConfig[dstChainId].protocolFee = newProtocolFee;

        emit ConfigProtocolFeeSet(dstChainId, newProtocolFee, msg.sender);
    }

    function _setFactory(uint256 dstChainId, bytes memory newFactory) internal {
        Main storage $ = _getMainStorage();
        $._dstDeployConfig[dstChainId].factory = newFactory;

        emit ConfigFactorySet(dstChainId, newFactory, msg.sender);
    }

    function _getMainStorage() private pure returns(Main storage $) {
        assembly {
            $.slot := MAIN_STORAGE_LOCATION
        }
    }
}

File 2 of 27 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {ERC165Upgradeable} from "../utils/introspection/ERC165Upgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControl, ERC165Upgradeable {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;


    /// @custom:storage-location erc7201:openzeppelin.storage.AccessControl
    struct AccessControlStorage {
        mapping(bytes32 role => RoleData) _roles;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessControl")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant AccessControlStorageLocation = 0x02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800;

    function _getAccessControlStorage() private pure returns (AccessControlStorage storage $) {
        assembly {
            $.slot := AccessControlStorageLocation
        }
    }

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    function __AccessControl_init() internal onlyInitializing {
    }

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual returns (bool) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        return $._roles[role].hasRole[account];
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        return $._roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        AccessControlStorage storage $ = _getAccessControlStorage();
        bytes32 previousAdminRole = getRoleAdmin(role);
        $._roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        if (!hasRole(role, account)) {
            $._roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        if (hasRole(role, account)) {
            $._roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

File 3 of 27 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.20;

/**
 * @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.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * 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 prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Storage of the initializable contract.
     *
     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
     * when using with upgradeable contracts.
     *
     * @custom:storage-location erc7201:openzeppelin.storage.Initializable
     */
    struct InitializableStorage {
        /**
         * @dev Indicates that the contract has been initialized.
         */
        uint64 _initialized;
        /**
         * @dev Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;

    /**
     * @dev The contract is already initialized.
     */
    error InvalidInitialization();

    /**
     * @dev The contract is not initializing.
     */
    error NotInitializing();

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint64 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
     * production.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        // Cache values to avoid duplicated sloads
        bool isTopLevelCall = !$._initializing;
        uint64 initialized = $._initialized;

        // Allowed calls:
        // - initialSetup: the contract is not in the initializing state and no previous version was
        //                 initialized
        // - construction: the contract is initialized at version 1 (no reininitialization) and the
        //                 current contract is just being deployed
        bool initialSetup = initialized == 0 && isTopLevelCall;
        bool construction = initialized == 1 && address(this).code.length == 0;

        if (!initialSetup && !construction) {
            revert InvalidInitialization();
        }
        $._initialized = 1;
        if (isTopLevelCall) {
            $._initializing = true;
        }
        _;
        if (isTopLevelCall) {
            $._initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint64 version) {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing || $._initialized >= version) {
            revert InvalidInitialization();
        }
        $._initialized = version;
        $._initializing = true;
        _;
        $._initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        _checkInitializing();
        _;
    }

    /**
     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
     */
    function _checkInitializing() internal view virtual {
        if (!_isInitializing()) {
            revert NotInitializing();
        }
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing) {
            revert InvalidInitialization();
        }
        if ($._initialized != type(uint64).max) {
            $._initialized = type(uint64).max;
            emit Initialized(type(uint64).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint64) {
        return _getInitializableStorage()._initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _getInitializableStorage()._initializing;
    }

    /**
     * @dev Returns a pointer to the storage namespace.
     */
    // solhint-disable-next-line var-name-mixedcase
    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
        assembly {
            $.slot := INITIALIZABLE_STORAGE
        }
    }
}

File 4 of 27 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.20;

import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol";
import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol";
import {Initializable} from "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 */
abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    address private immutable __self = address(this);

    /**
     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`
     * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
     * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.
     * If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must
     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function
     * during an upgrade.
     */
    string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";

    /**
     * @dev The call is from an unauthorized context.
     */
    error UUPSUnauthorizedCallContext();

    /**
     * @dev The storage `slot` is unsupported as a UUID.
     */
    error UUPSUnsupportedProxiableUUID(bytes32 slot);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        _checkProxy();
        _;
    }

    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        _checkNotDelegated();
        _;
    }

    function __UUPSUpgradeable_init() internal onlyInitializing {
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual notDelegated returns (bytes32) {
        return ERC1967Utils.IMPLEMENTATION_SLOT;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data);
    }

    /**
     * @dev Reverts if the execution is not performed via delegatecall or the execution
     * context is not of a proxy with an ERC1967-compliant implementation pointing to self.
     * See {_onlyProxy}.
     */
    function _checkProxy() internal view virtual {
        if (
            address(this) == __self || // Must be called through delegatecall
            ERC1967Utils.getImplementation() != __self // Must be called through an active proxy
        ) {
            revert UUPSUnauthorizedCallContext();
        }
    }

    /**
     * @dev Reverts if the execution is performed via delegatecall.
     * See {notDelegated}.
     */
    function _checkNotDelegated() internal view virtual {
        if (address(this) != __self) {
            // Must not be called through delegatecall
            revert UUPSUnauthorizedCallContext();
        }
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;

    /**
     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.
     *
     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value
     * is expected to be the implementation slot in ERC1967.
     *
     * Emits an {IERC1967-Upgraded} event.
     */
    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {
        try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
            if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {
                revert UUPSUnsupportedProxiableUUID(slot);
            }
            ERC1967Utils.upgradeToAndCall(newImplementation, data);
        } catch {
            // The implementation is not UUPS
            revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);
        }
    }
}

File 5 of 27 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;
import {Initializable} from "../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;
    }

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

File 6 of 27 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165Upgradeable is Initializable, IERC165 {
    function __ERC165_init() internal onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 7 of 27 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../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 {
    /// @custom:storage-location erc7201:openzeppelin.storage.Pausable
    struct PausableStorage {
        bool _paused;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Pausable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300;

    function _getPausableStorage() private pure returns (PausableStorage storage $) {
        assembly {
            $.slot := PausableStorageLocation
        }
    }

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

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

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

    function __Pausable_init_unchained() internal onlyInitializing {
        PausableStorage storage $ = _getPausableStorage();
        $._paused = false;
    }

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

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

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

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

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

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

File 8 of 27 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}

File 9 of 27 : draft-IERC1822.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.20;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822Proxiable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}

File 10 of 27 : IBeacon.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {UpgradeableBeacon} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

File 11 of 27 : ERC1967Utils.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol)

pragma solidity ^0.8.20;

import {IBeacon} from "../beacon/IBeacon.sol";
import {Address} from "../../utils/Address.sol";
import {StorageSlot} from "../../utils/StorageSlot.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 */
library ERC1967Utils {
    // We re-declare ERC-1967 events here because they can't be used directly from IERC1967.
    // This will be fixed in Solidity 0.8.21. At that point we should remove these events.
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev The `implementation` of the proxy is invalid.
     */
    error ERC1967InvalidImplementation(address implementation);

    /**
     * @dev The `admin` of the proxy is invalid.
     */
    error ERC1967InvalidAdmin(address admin);

    /**
     * @dev The `beacon` of the proxy is invalid.
     */
    error ERC1967InvalidBeacon(address beacon);

    /**
     * @dev An upgrade function sees `msg.value > 0` that may be lost.
     */
    error ERC1967NonPayable();

    /**
     * @dev Returns the current implementation address.
     */
    function getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        if (newImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(newImplementation);
        }
        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Performs implementation upgrade with additional setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);

        if (data.length > 0) {
            Address.functionDelegateCall(newImplementation, data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Returns the current admin.
     *
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using
     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
     */
    function getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        if (newAdmin == address(0)) {
            revert ERC1967InvalidAdmin(address(0));
        }
        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {IERC1967-AdminChanged} event.
     */
    function changeAdmin(address newAdmin) internal {
        emit AdminChanged(getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Returns the current beacon.
     */
    function getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        if (newBeacon.code.length == 0) {
            revert ERC1967InvalidBeacon(newBeacon);
        }

        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;

        address beaconImplementation = IBeacon(newBeacon).implementation();
        if (beaconImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(beaconImplementation);
        }
    }

    /**
     * @dev Change the beacon and trigger a setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-BeaconUpgraded} event.
     *
     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since
     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for
     * efficiency.
     */
    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);

        if (data.length > 0) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract
     * if an upgrade doesn't perform an initialization call.
     */
    function _checkNonPayable() private {
        if (msg.value > 0) {
            revert ERC1967NonPayable();
        }
    }
}

File 12 of 27 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

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

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

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

File 13 of 27 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}

File 14 of 27 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

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

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

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

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

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

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

    /**
     * @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);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

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

File 15 of 27 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

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

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

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

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert FailedInnerCall();
        }
    }
}

File 16 of 27 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 17 of 27 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(newImplementation.code.length > 0);
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

File 18 of 27 : IUTSDeploymentRouter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import "contracts/libraries/UTSERC20DataTypes.sol";

interface IUTSDeploymentRouter {

    function MASTER_ROUTER() external view returns(address);

    function PRICE_FEED() external view returns(address);

    function FACTORY() external view returns(address);

    function REGISTRY() external view returns(address);

    function PAYMENT_TOKEN() external view returns(address);

    function EOB_CHAIN_ID() external view returns(uint256);

    function protocolVersion() external view returns(bytes2);

    function dstDeployConfig(uint256 dstChainId) external view returns(DstDeployConfig memory);

    function dstTokenDeployGas(uint256 dstChainId) external view returns(uint64);

    function dstConnectorDeployGas(uint256 dstChainId) external view returns(uint64);

    function dstProtocolFee(uint256 dstChainId) external view returns(uint16);

    function dstFactory(uint256 dstChainId) external view returns(bytes memory);

    function estimateDeployTotal(
        uint256[] calldata dstTokenChainIds, 
        uint256[] calldata dstConnectorChainIds
    ) external view returns(uint256 paymentTokenAmount, uint256 paymentNativeAmount);

    function estimateDeploy(
        uint256[] calldata dstTokenChainIds,
        uint256[] calldata dstConnectorChainIds
    ) external view returns(
        uint256[] memory tokenPaymentAmount, 
        uint256[] memory connectorPaymentAmount, 
        uint256 totalPaymentAmount
    );

    function estimateDeployNative(
        uint256[] calldata dstTokenChainIds,
        uint256[] calldata dstConnectorChainIds
    ) external view returns(
        uint256[] memory tokenPaymentAmountNative, 
        uint256[] memory connectorPaymentAmountNative, 
        uint256 totalPaymentAmountNative
    );

    function sendDeployRequest(
        DeployMetadata[] calldata deployMetadata,
        address paymentToken
    ) external payable returns(uint256 paymentAmount, address currentChainDeployment);

    function getDeployTokenParams(DeployTokenData calldata deployData) external pure returns(bytes memory);

    function getDeployConnectorParams(DeployConnectorData calldata deployData) external pure returns(bytes memory);

    function setDstDeployConfig(uint256[] calldata dstChainIds, DstDeployConfig[] calldata newConfigs) external;

    function setDstDeployGas(
        uint256[] calldata dstChainIds, 
        uint64[] calldata newTokenDeployGas, 
        uint64[] calldata newConnectorDeployGas
    ) external;

    function setDstProtocolFee(uint256[] calldata dstChainIds, uint16[] calldata newProtocolFees) external;

    function setDstFactory(uint256[] calldata dstChainIds, bytes[] calldata newFactory) external;

    function execute(
        address dstFactoryAddress, 
        bytes1 messageType, 
        bytes calldata localParams
    ) external payable returns(uint8 opResult);

    function pause() external;

    function unpause() external;

}

File 19 of 27 : IUTSFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import "contracts/libraries/UTSERC20DataTypes.sol";

interface IUTSFactory {

    function MASTER_ROUTER() external view returns(address);

    function REGISTRY() external view returns(address);

    function router() external view returns(address);

    function codeStorage(uint8 blueprintId) external view returns(address);

    function protocolVersion() external pure returns(bytes2);

    function getPrecomputedAddress(
        uint8 blueprintId,
        bytes calldata deployer, 
        bytes32 salt, 
        bool isConnector
    ) external view returns(address deployment, bool hasCode);

    function deployToken(DeployTokenData calldata deployData) external returns(bool success, address newToken);

    function deployConnector(DeployConnectorData calldata deployData) external returns(bool success, address newConnector);

    function deployByRouter(
        bool isConnector, 
        bytes calldata deployer, 
        bytes calldata deployParams
    ) external returns(bool success, address newDeployment);

    function pause() external;

    function unpause() external;

    function setRouter(address newRouter) external;

    function setCodeStorage(uint8[] calldata blueprintIds, address[] calldata newCodeStorage) external;
    
}

File 20 of 27 : IPausable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

interface IPausable {

    function paused() external view returns(bool);

}

File 21 of 27 : IUTSMasterRouter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

interface IUTSMasterRouter {

    function feeCollector() external view returns(address);

    function PAYLOAD_SIZE_LIMIT() external view returns(uint16);

    function validateRouter(address target) external view returns(bool);

    function dstMasterRouter(uint256 dstChainId) external view returns(bytes memory);

    function sendProposal(uint256 payloadLength, uint256 dstChainId, bytes calldata params) external payable;

    function executeProposal(bytes calldata data) external payable;

    function setFeeCollector(address newFeeCollector) external;

    function setDstMasterRouter(uint256[] calldata dstChainIds, bytes[] calldata newDstMasterRouter) external;

    function pause() external;

    function unpause() external;

}

File 22 of 27 : IUTSPriceFeed.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

interface IUTSPriceFeed {

    function setPrices(uint256[] calldata groupIds, uint256[] calldata packedPrices) external;

    function setDstPricePerByteInWei(uint256[] calldata chainIds, uint64[] calldata dstPricePerByteInWei) external;

    function setChainInfo(uint256[] calldata chainIds, uint256[] calldata packedChainInfo) external;

    function pause() external;

    function unpause() external;

    function getPrices(uint256 chainId) external view returns(uint256 dstGasPrice, uint256 dstPricePerByte);

    function getDstGasPriceAtSrcNative(uint256 chainId) external view returns(uint256 dstGasPrice);

    function getDstPricePerByteInWei(uint256 chainId) external view returns(uint64);

    function getChainInfo(uint256 chainId) external view returns(
        uint176 reserved, 
        uint8 groupId, 
        uint8 slotOffset, 
        uint64 pricePerByte
    );

    function getPriceByOffset(uint8 groupId, uint8 offset) external view returns(uint256);

    function getGroupPrices(uint8 groupId) external view returns(uint256, uint256, uint256, uint256);

    function getRawChainInfo(uint256 chainId) external view returns(uint256);

    function getRawPrices(uint256 groupId) external view returns(uint256);

}

File 23 of 27 : IUTSRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import "../libraries/UTSCoreDataTypes.sol";
import "../libraries/UTSERC20DataTypes.sol";

interface IUTSRegistry {

    function validateUnderlyingRegistered(address underlyingToken) external view returns(bool);

    function validateDeploymentRegistered(address deployment) external view returns(bool);

    function validateFactory(address target) external view returns(bool);
    
    function deploymentData(address deployment) external view returns(DeploymentData memory);

    function totalDeployments() external view returns(uint256);

    function underlyingTokens() external view returns(address[] memory);

    function deployments() external view returns(address[] memory);

    function deploymentsByIndex(uint256[] calldata indexes) external view returns(address[] memory);

    function deploymentsByUnderlying(address underlyingToken) external view returns(address[] memory);

    function deploymentsByDeployer(bytes calldata deployer) external view returns(address[] memory);
    
    function registerDeployment(
        address deployment,
        bytes calldata deployer,
        address underlyingToken,
        bytes2 protocolVersion
    ) external;

    function approveRequestBatch(ApproveRequestData[] calldata requests) external returns(bool);

    function updateChainConfigs(uint256[] calldata allowedChainIds, ChainConfig[] calldata chainConfigs) external;

    function updateRouter(address newRouter) external;

}

File 24 of 27 : AddressConverter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

library AddressConverter {

    function toBytes(address _address) internal pure returns(bytes memory) {
        return abi.encodePacked(_address);
    }

    function toAddress(bytes memory _params) internal pure returns(address) {
        return address(uint160(bytes20(_params)));
    }

    function toAddressPadded(bytes memory _params) internal pure returns(address addressPadded) {
        if (32 > _params.length) return address(0);

        assembly {
            addressPadded := div(mload(add(add(_params, 0x20), 12)), 0x1000000000000000000000000)
        }
    }

}

File 25 of 27 : DecimalsConverter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

library DecimalsConverter {

    function convert(uint256 amount, uint256 decimalsIn, uint256 decimalsOut) internal pure returns(uint256) {
        if (decimalsOut > decimalsIn) {
            return amount * (10 ** (decimalsOut - decimalsIn));
        } else {
            if (decimalsOut < decimalsIn) {
                return amount / (10 ** (decimalsIn - decimalsOut));
            }
        }

        return amount;
    }

}

File 26 of 27 : UTSCoreDataTypes.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

    struct DeploymentData {
        bytes   deployer;
        address underlyingToken;
        bytes2  initProtocolVersion;
    }

    struct ApproveRequestData {
        address deployment;
        bytes   deployer;
        address underlyingToken;
        bytes2  protocolVersion;
    }

    enum OperationResult {
        Success,
        FailedAndStored,
        Failed,
        RouterPaused,
        UnauthorizedRouter,
        InvalidDstPeerAddress,
        InvalidSrcChainId,
        InvalidToAddress,
        InvalidSrcPeerAddress,
        DeployFailed,
        IncompatibleRouter,
        MasterRouterPaused,
        InvalidMessageType
    }

File 27 of 27 : UTSERC20DataTypes.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

    struct ChainConfig {
        bytes   peerAddress;
        uint64  minGasLimit;
        uint8   decimals;
        bool    paused;
    }

    struct ChainConfigUpdate {
        uint256[] allowedChainIds;
        ChainConfig[] chainConfigs;
    }

    struct Origin {
        bytes   sender;
        uint256 chainId;
        bytes   peerAddress;
        uint8   decimals;
    }

    struct DeployTokenData {
        bytes     owner;
        string    name;
        string    symbol;
        uint8     decimals;
        uint256   initialSupply;
        uint256   mintedAmountToOwner;
        bool      pureToken;
        bool      mintable;
        bool      globalBurnable;
        bool      onlyRoleBurnable;
        bool      feeModule;
        bytes     router;
        uint256[] allowedChainIds;
        ChainConfig[] chainConfigs;
        bytes32   salt;
    }

    struct DeployConnectorData {
        bytes     owner;
        bytes     underlyingToken;
        bool      feeModule;
        bytes     router;
        uint256[] allowedChainIds;
        ChainConfig[] chainConfigs;
        bytes32   salt;
    }

    struct DeployMetadata {
        uint256 dstChainId;
        bool    isConnector;
        bytes   params;
    }

    struct DstDeployConfig {
        bytes   factory;
        uint64  tokenDeployGas;
        uint64  connectorDeployGas;
        uint16  protocolFee;
    }

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"masterRouter","type":"address"},{"internalType":"address","name":"priceFeed","type":"address"},{"internalType":"address","name":"factory","type":"address"},{"internalType":"address","name":"registry","type":"address"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint8","name":"paymentTokenDecimals","type":"uint8"},{"internalType":"uint8","name":"nativeTokenDecimals","type":"uint8"},{"internalType":"uint16","name":"paymentTransferGasLimit","type":"uint16"},{"internalType":"uint8","name":"availableChainsNumber","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"UTSDeploymentRouter__E0","type":"error"},{"inputs":[],"name":"UTSDeploymentRouter__E1","type":"error"},{"inputs":[],"name":"UTSDeploymentRouter__E2","type":"error"},{"inputs":[],"name":"UTSDeploymentRouter__E3","type":"error"},{"inputs":[],"name":"UTSDeploymentRouter__E4","type":"error"},{"inputs":[],"name":"UTSDeploymentRouter__E5","type":"error"},{"inputs":[],"name":"UTSDeploymentRouter__E6","type":"error"},{"inputs":[],"name":"UTSDeploymentRouter__E7","type":"error"},{"inputs":[],"name":"UTSDeploymentRouter__E8","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"dstChainId","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"newConnectorDeployGas","type":"uint64"},{"indexed":true,"internalType":"address","name":"caller","type":"address"}],"name":"ConfigConnectorDeployGasSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"dstChainId","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"newFactory","type":"bytes"},{"indexed":true,"internalType":"address","name":"caller","type":"address"}],"name":"ConfigFactorySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"dstChainId","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"newProtocolFee","type":"uint16"},{"indexed":true,"internalType":"address","name":"caller","type":"address"}],"name":"ConfigProtocolFeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"dstChainId","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"newTokenDeployGas","type":"uint64"},{"indexed":true,"internalType":"address","name":"caller","type":"address"}],"name":"ConfigTokenDeployGasSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EOB_CHAIN_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FACTORY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MASTER_ROUTER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAYMENT_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_FEED","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REGISTRY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dstChainId","type":"uint256"}],"name":"dstConnectorDeployGas","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dstChainId","type":"uint256"}],"name":"dstDeployConfig","outputs":[{"components":[{"internalType":"bytes","name":"factory","type":"bytes"},{"internalType":"uint64","name":"tokenDeployGas","type":"uint64"},{"internalType":"uint64","name":"connectorDeployGas","type":"uint64"},{"internalType":"uint16","name":"protocolFee","type":"uint16"}],"internalType":"struct DstDeployConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dstChainId","type":"uint256"}],"name":"dstFactory","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dstChainId","type":"uint256"}],"name":"dstProtocolFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dstChainId","type":"uint256"}],"name":"dstTokenDeployGas","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"dstTokenChainIds","type":"uint256[]"},{"internalType":"uint256[]","name":"dstConnectorChainIds","type":"uint256[]"}],"name":"estimateDeploy","outputs":[{"internalType":"uint256[]","name":"tokenPaymentAmount","type":"uint256[]"},{"internalType":"uint256[]","name":"connectorPaymentAmount","type":"uint256[]"},{"internalType":"uint256","name":"totalPaymentAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"dstTokenChainIds","type":"uint256[]"},{"internalType":"uint256[]","name":"dstConnectorChainIds","type":"uint256[]"}],"name":"estimateDeployNative","outputs":[{"internalType":"uint256[]","name":"tokenPaymentAmountNative","type":"uint256[]"},{"internalType":"uint256[]","name":"connectorPaymentAmountNative","type":"uint256[]"},{"internalType":"uint256","name":"totalPaymentAmountNative","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"dstTokenChainIds","type":"uint256[]"},{"internalType":"uint256[]","name":"dstConnectorChainIds","type":"uint256[]"}],"name":"estimateDeployTotal","outputs":[{"internalType":"uint256","name":"paymentTokenAmount","type":"uint256"},{"internalType":"uint256","name":"paymentNativeAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"factoryAddress","type":"address"},{"internalType":"bytes1","name":"messageType","type":"bytes1"},{"internalType":"bytes","name":"localParams","type":"bytes"}],"name":"execute","outputs":[{"internalType":"uint8","name":"opResult","type":"uint8"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes","name":"owner","type":"bytes"},{"internalType":"bytes","name":"underlyingToken","type":"bytes"},{"internalType":"bool","name":"feeModule","type":"bool"},{"internalType":"bytes","name":"router","type":"bytes"},{"internalType":"uint256[]","name":"allowedChainIds","type":"uint256[]"},{"components":[{"internalType":"bytes","name":"peerAddress","type":"bytes"},{"internalType":"uint64","name":"minGasLimit","type":"uint64"},{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"bool","name":"paused","type":"bool"}],"internalType":"struct ChainConfig[]","name":"chainConfigs","type":"tuple[]"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"internalType":"struct DeployConnectorData","name":"deployData","type":"tuple"}],"name":"getDeployConnectorParams","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"bytes","name":"owner","type":"bytes"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"uint256","name":"mintedAmountToOwner","type":"uint256"},{"internalType":"bool","name":"pureToken","type":"bool"},{"internalType":"bool","name":"mintable","type":"bool"},{"internalType":"bool","name":"globalBurnable","type":"bool"},{"internalType":"bool","name":"onlyRoleBurnable","type":"bool"},{"internalType":"bool","name":"feeModule","type":"bool"},{"internalType":"bytes","name":"router","type":"bytes"},{"internalType":"uint256[]","name":"allowedChainIds","type":"uint256[]"},{"components":[{"internalType":"bytes","name":"peerAddress","type":"bytes"},{"internalType":"uint64","name":"minGasLimit","type":"uint64"},{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"bool","name":"paused","type":"bool"}],"internalType":"struct ChainConfig[]","name":"chainConfigs","type":"tuple[]"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"internalType":"struct DeployTokenData","name":"deployData","type":"tuple"}],"name":"getDeployTokenParams","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"defaultAdmin","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolVersion","outputs":[{"internalType":"bytes2","name":"","type":"bytes2"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"dstChainId","type":"uint256"},{"internalType":"bool","name":"isConnector","type":"bool"},{"internalType":"bytes","name":"params","type":"bytes"}],"internalType":"struct DeployMetadata[]","name":"deployMetadata","type":"tuple[]"},{"internalType":"address","name":"paymentToken","type":"address"}],"name":"sendDeployRequest","outputs":[{"internalType":"uint256","name":"paymentAmount","type":"uint256"},{"internalType":"address","name":"currentChainDeployment","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"dstChainIds","type":"uint256[]"},{"components":[{"internalType":"bytes","name":"factory","type":"bytes"},{"internalType":"uint64","name":"tokenDeployGas","type":"uint64"},{"internalType":"uint64","name":"connectorDeployGas","type":"uint64"},{"internalType":"uint16","name":"protocolFee","type":"uint16"}],"internalType":"struct DstDeployConfig[]","name":"newConfigs","type":"tuple[]"}],"name":"setDstDeployConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"dstChainIds","type":"uint256[]"},{"internalType":"uint64[]","name":"newTokenDeployGas","type":"uint64[]"},{"internalType":"uint64[]","name":"newConnectorDeployGas","type":"uint64[]"}],"name":"setDstDeployGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"dstChainIds","type":"uint256[]"},{"internalType":"bytes[]","name":"newFactory","type":"bytes[]"}],"name":"setDstFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"dstChainIds","type":"uint256[]"},{"internalType":"uint16[]","name":"newProtocolFees","type":"uint16[]"}],"name":"setDstProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}]

Deployed Bytecode

0x608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a714612ebe5750806306433b1b14612e4f57806309c9577514612d5f578063248a9ca314612cf35780632895127314612adc5780632ae9c60014612a835780632ba111a5146129105780632c2ecd07146125d85780632dd31000146125695780632f2ff15d146124ed57806331eb318a1461247e57806336568abe146123f45780633ecc376c146123675780633f4ba83a1461228a5780634077675b146122175780634f1ef28614611f6257806352d1902d14611ea257806354cdb4d914611e175780635c975abb14611db75780637e21d15f14611d7c57806383658d93146111fd5780638456cb5914611148578063877c86fb146110d95780638d46e6381461106357806391bd5bd714610f8657806391d1485414610eee578063a217fddf14610eb4578063acb5465b14610b1e578063ad3cb1cc14610aa2578063bd6ec01914610a33578063c481d09f146109b6578063c4d66de8146107b4578063c58a1c4a14610728578063ccad7e8c146106af578063d547741f14610631578063de74a3cf14610335578063e63ab1e9146102dc578063e9d300ff1461022a5763ec87621c146101cc57600080fd5b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102255760206040517f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b088152f35b600080fd5b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102255761025c6130c8565b602435907fff0000000000000000000000000000000000000000000000000000000000000082168203610225576044359067ffffffffffffffff9081831161022557366023840112156102255782600401359182116102255736602483850101116102255760209360246102d1940191613a59565b60ff60405191168152f35b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102255760206040517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a8152f35b34610225576103433661303c565b60009061034f846139f6565b93610359826139f6565b956000915b8281116104f7575050506000925b83821161038a575050610386915060405193849384613227565b0390f35b9091466103988585856132b1565b35146104e0576103b26103ac8585856132b1565b356136c5565b906103be8585856132b1565b35604051907fb226bd1c0000000000000000000000000000000000000000000000000000000082526004820152602090818160248173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d3c91feabb9f071beafc249056b9450b1ad317c5165afa9182156104d4576000926104a0575b50509061271061047f8460606104786104696104929767ffffffffffffffff60406104989b01511690613529565b9261ffff92839101511661353c565b1690613529565b04908161048c888b613a45565b52613550565b93613255565b92919061036c565b9080939250813d83116104cd575b6104b88183613123565b8101031261022557905161271061047f61043b565b503d6104ae565b6040513d6000823e3d90fd5b928060006104f16104989389613a45565b52613255565b9091949293466105088784866132b1565b35146106205761051c6103ac8784866132b1565b6105278784866132b1565b35604051907fb226bd1c00000000000000000000000000000000000000000000000000000000825260048201526020808260248173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d3c91feabb9f071beafc249056b9450b1ad317c5165afa9182156104d4576000926105ed575b506105cf8360606104786104696105e2989667ffffffffffffffff612710976105dc9a01511690613529565b04908161048c8a8c613a45565b95613255565b91909493929461035e565b908094925081813d8311610619575b6106068183613123565b81010312610225575190926105cf6105a3565b503d6105fc565b948060006104f16105e2938a613a45565b346102255760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610225576106ad60043561066e6130a5565b90806000527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020526106a8600160406000200154613ee2565b614268565b005b346102255760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610225576004356000527f5ef83cde492754da3fd6bddb04f9c0eea61921570db6556ef7bb11412c3f9000602052602067ffffffffffffffff60016040600020015460401c16604051908152f35b34610225576107363661303c565b919290610741613db9565b82840361078a5760005b80851161075457005b806107806107666107859388876132b1565b3561077a6107758489886132b1565b6139e7565b906145d3565b613255565b61074b565b60046040517f6280732e000000000000000000000000000000000000000000000000000000008152fd5b346102255760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610225576107eb6130c8565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0090815460ff8160401c16159167ffffffffffffffff8216801590816109ae575b60011490816109a4575b15908161099b575b5061097157818360017fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000006108e2951617865561093c575b5061087e614709565b610886614709565b61088e614709565b610896614709565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690556140c0565b506108e957005b7fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff81541690557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a1005b7fffffffffffffffffffffffffffffffffffffffffffffff000000000000000000166801000000000000000117845584610875565b60046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b9050158561083e565b303b159150610836565b84915061082c565b346102255760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610225576004356000527f5ef83cde492754da3fd6bddb04f9c0eea61921570db6556ef7bb11412c3f9000602052610386610a1f6040600020613601565b604051918291602083526020830190612fde565b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022557602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d685179d71b41b1bf67bdac3d12ad72d5045e4b5168152f35b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022557610386604051610ae081613107565b600581527f352e302e300000000000000000000000000000000000000000000000000000006020820152604051918291602083526020830190612fde565b3461022557610b2c3661303c565b6040517fb226bd1c00000000000000000000000000000000000000000000000000000000815261810960048201526000926020826024817f000000000000000000000000d3c91feabb9f071beafc249056b9450b1ad317c573ffffffffffffffffffffffffffffffffffffffff165afa9182156104d457600092610e80575b50929190610bba8596956139f6565b94610bc4836139f6565b966000915b828211610d37575050506000935b848311610bee5760405180610386868a8a84613227565b90919246610bfd8686856132b1565b3514610d2657610c116103ac8686856132b1565b610c1c8686856132b1565b3590604051917fb226bd1c000000000000000000000000000000000000000000000000000000008352600483015260208260248173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d3c91feabb9f071beafc249056b9450b1ad317c5165afa80156104d4578592600091610ceb575b50610cdc92612710610cca846060610478610469610cd09767ffffffffffffffff6040610ce29d9b01511690613529565b0461405f565b908161048c898c613a45565b94613255565b93929190610bd7565b925050916020823d602011610d1e575b81610d0860209383613123565b8101031261022557905190918491610cdc610c99565b3d9150610cfb565b938060006104f1610ce2938a613a45565b90919592939446610d498885856132b1565b3514610e6f57610d5d6103ac8885856132b1565b610d688885856132b1565b3590604051917fb226bd1c000000000000000000000000000000000000000000000000000000008352600483015260208260248173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d3c91feabb9f071beafc249056b9450b1ad317c5165afa80156104d4578792600091610e34575b50610e2292612710610cca846060610478610469610e169767ffffffffffffffff6020610e289d9b01511690613529565b908161048c8b8d613a45565b96613255565b91909594939295610bc9565b925050916020823d602011610e67575b81610e5160209383613123565b8101031261022557905190918691610e22610de5565b3d9150610e44565b958060006104f1610e28938b613a45565b9091506020813d602011610eac575b81610e9c60209383613123565b8101031261022557519086610bab565b3d9150610e8f565b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022557602060405160008152f35b346102255760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022557610f256130a5565b6004356000527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b62680060205273ffffffffffffffffffffffffffffffffffffffff60406000209116600052602052602060ff604060002054166040519015158152f35b3461022557610f943661303c565b929190610f9f613e4c565b83820361078a5760005b808311610fb257005b80610fe9610fc461105e9386886132b1565b35610fe3610fdc610fd6858b896139a7565b8061355d565b369161319e565b90614329565b611014610ff78286886132b1565b3561100e6020611008858b896139a7565b016132c1565b90613f27565b6110396110228286886132b1565b356110336040611008858b896139a7565b90613fb9565b6107806110478286886132b1565b3561077a6060611058858b896139a7565b016139e7565b610fa9565b346102255760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610225576004356000527f5ef83cde492754da3fd6bddb04f9c0eea61921570db6556ef7bb11412c3f9000602052602067ffffffffffffffff60016040600020015416604051908152f35b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022557602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000dead168152f35b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102255761117f613e86565b611187614543565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1005b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102255760043567ffffffffffffffff811161022557611247903690600401612fad565b61124f6130a5565b611257614543565b6000916000938115611d5257906000915b8282116113ff5750505073ffffffffffffffffffffffffffffffffffffffff9081807f000000000000000000000000000000000000000000000000000000000000dead169116146000146112e05760046040517fff4b2ddd000000000000000000000000000000000000000000000000000000008152fd5b3482116113d557604051927fc415b95c000000000000000000000000000000000000000000000000000000008452602084600481857f000000000000000000000000d685179d71b41b1bf67bdac3d12ad72d5045e4b5165afa9384156104d457600094611390575b506000808080604097479061ffff7f0000000000000000000000000000000000000000000000000000000000000bb816f150611382613977565b508351928352166020820152f35b93506020843d6020116113cd575b816113ab60209383613123565b810103126102255760008080806113c36040986137b1565b9750505050611348565b3d915061139e565b60046040517f97f24dbf000000000000000000000000000000000000000000000000000000008152fd5b9091934661140e868585613757565b3514611c41576114226103ac868585613757565b9081515115611c1757611441602061143b888787613757565b01613797565b1561192f5761145e611454878686613757565b604081019061355d565b8101906020818303126102255780359067ffffffffffffffff821161022557019060e0828203126102255760405160e0810181811067ffffffffffffffff8211176118ac57604052823567ffffffffffffffff811161022557826114c39185016131d5565b8152602083013567ffffffffffffffff811161022557826114e59185016131d5565b60208201526114f660408401613373565b906040810191825260608085013567ffffffffffffffff8111610225578461151f9187016131d5565b908201526080938481013567ffffffffffffffff81116102255784611545918301613818565b94820194855260a093848201359067ffffffffffffffff82116102255761156d918301613878565b93820193845260c08091013591015251611905578151519051510361078a57515160ff7f000000000000000000000000000000000000000000000000000000000000001116106118db575b6116556115c6878686613757565b35611697858961168b8961160c6115fc6114548b51956115ec602061143b83888c613757565b946115f633614598565b98613757565b90604051968794602086016137d2565b039261163e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe094858101835282613123565b604051968793606060208601526080850190612fde565b907f0200000000000000000000000000000000000000000000000000000000000000604085015284848303016060850152612fde565b03908101845283613123565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d685179d71b41b1bf67bdac3d12ad72d5045e4b5163b15610225576117229160009160405193849283927f13f14bf10000000000000000000000000000000000000000000000000000000084528560048501526024840152606060448401526064830190612fde565b03818373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d685179d71b41b1bf67bdac3d12ad72d5045e4b5165af180156104d457611894575b50611775868585613757565b35604051907fb226bd1c000000000000000000000000000000000000000000000000000000008252600482015260208160248173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d3c91feabb9f071beafc249056b9450b1ad317c5165afa9081156104d45785858992600094611859575b50946060610478610469610cdc979661181c602061143b612710996118369961183d9e613757565b1561184457604085015167ffffffffffffffff1690613529565b0490613550565b9190611268565b67ffffffffffffffff80602087015116610478565b9493505050506020823d60201161188c575b8161187860209383613123565b8101031261022557905186858560606117f4565b3d915061186b565b67ffffffffffffffff81116118ac5760405287611769565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60046040517f7b5fcd35000000000000000000000000000000000000000000000000000000008152fd5b60046040517fff4b2ddd000000000000000000000000000000000000000000000000000000008152fd5b61193d611454878686613757565b8101906020818303126102255780359067ffffffffffffffff82116102255701906101e09182818303126102255760405192830183811067ffffffffffffffff8211176118ac57604052803567ffffffffffffffff811161022557826119a49183016131d5565b8352602081013567ffffffffffffffff811161022557826119c69183016131d5565b6020840152604081013567ffffffffffffffff811161022557826119eb9183016131d5565b604084015260606119fd818301613365565b9084015260809283810193820135845260a09283820193830135845260c0611a26818501613373565b908301908152611a3860e08501613373565b9060e0840191825261010094611a4f868201613373565b95850195865261012093611a64858301613373565b94860194855261014095611a79878401613373565b9681019687526101608084013567ffffffffffffffff81116102255783611aa19186016131d5565b90820152610180928381013567ffffffffffffffff81116102255783611ac8918301613818565b9382019384526101a092838201359067ffffffffffffffff821161022557611af1918301613878565b9282019283526101c0809101359101528551611905578151519051510361078a57515160ff7f000000000000000000000000000000000000000000000000000000000000001116106118db575115611be157511592831593611bd6575b508215611bcb575b508115611bc0575b50611b965751905110156115b85760046040517fef988473000000000000000000000000000000000000000000000000000000008152fd5b60046040517f5d31c282000000000000000000000000000000000000000000000000000000008152fd5b90505115158a611b5e565b51151591508b611b56565b51151592508c611b4e565b50505050519051146115b85760046040517fef988473000000000000000000000000000000000000000000000000000000008152fd5b60046040517f09adf76c000000000000000000000000000000000000000000000000000000008152fd5b9394506020611cb16040611c5a8361143b8a8888613757565b611c6333614598565b90611c7b611c728b8989613757565b8481019061355d565b849591955195869485947fa17f0e91000000000000000000000000000000000000000000000000000000008652600486016137d2565b0381600073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000123d82338e00aecb432f526a8aeb9442d48e4412165af19081156104d457600091611d09575b5061183d915095613255565b90506040813d604011611d4a575b81611d2460409383613123565b810103126102255761183d9181611d3d611d44936137a4565b50016137b1565b87611cfd565b3d9150611d17565b60046040517fcd5fbf2e000000000000000000000000000000000000000000000000000000008152fd5b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102255760206040516181098152f35b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022557602060ff7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330054166040519015158152f35b346102255760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022557611e516004356136c5565b60405180916020825261ffff6060611e7583516080602087015260a0860190612fde565b92602081015167ffffffffffffffff80911660408701526040820151168286015201511660808301520390f35b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102255773ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004f363d0ecd1ee5e0c55c0c23a053543374f57907163003611f385760206040517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152f35b60046040517fe07c8dba000000000000000000000000000000000000000000000000000000008152fd5b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022557611f946130c8565b60243567ffffffffffffffff811161022557611fb49036906004016131d5565b9073ffffffffffffffffffffffffffffffffffffffff807f0000000000000000000000004f363d0ecd1ee5e0c55c0c23a053543374f57907168030149081156121e9575b50611f3857612005613e4c565b8116906040517f52d1902d000000000000000000000000000000000000000000000000000000008152602081600481865afa600091816121b5575b5061207657602483604051907f4c9c8ce30000000000000000000000000000000000000000000000000000000082526004820152fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc929192908181036121845750823b1561215357817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a282511561212157506000808360206106ad95519101845af461211b613977565b91614762565b9150503461212b57005b807fb398979f0000000000000000000000000000000000000000000000000000000060049252fd5b602482604051907f4c9c8ce30000000000000000000000000000000000000000000000000000000082526004820152fd5b602490604051907faa1d49a40000000000000000000000000000000000000000000000000000000082526004820152fd5b9091506020813d6020116121e1575b816121d160209383613123565b8101031261022557519085612040565b3d91506121c4565b9050817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416141584611ff8565b346102255760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610225576004356000527f5ef83cde492754da3fd6bddb04f9c0eea61921570db6556ef7bb11412c3f9000602052602061ffff60016040600020015460801c16604051908152f35b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610225576122c1613e86565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff81161561233d577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b60046040517f8dfc202b000000000000000000000000000000000000000000000000000000008152fd5b34610225576123753661303c565b929161237f613e4c565b83810361078a5760005b80821161239257005b61239d8183866132b1565b3590858110156123c5576107806123c092610fe3610fdc8460051b88018861355d565b612389565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b346102255760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102255761242b6130a5565b3373ffffffffffffffffffffffffffffffffffffffff821603612454576106ad90600435614268565b60046040517f6697b232000000000000000000000000000000000000000000000000000000008152fd5b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022557602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d3c91feabb9f071beafc249056b9450b1ad317c5168152f35b346102255760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610225576106ad60043561252a6130a5565b90806000527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602052612564600160406000200154613ee2565b61419d565b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022557602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000123d82338e00aecb432f526a8aeb9442d48e4412168152f35b34610225576125e63661303c565b909160009360005b8083116127f25750505060005b8082116126cf576040517fb226bd1c0000000000000000000000000000000000000000000000000000000081526181096004820152846020826024817f000000000000000000000000d3c91feabb9f071beafc249056b9450b1ad317c573ffffffffffffffffffffffffffffffffffffffff165afa9182156104d457600092612699575b5061268c6040928261405f565b9082519182526020820152f35b91506020823d6020116126c7575b816126b460209383613123565b810103126102255790519061268c61267f565b3d91506126a7565b466126db8284866132b1565b35036126f0575b6126eb90613255565b6125fb565b926126ff6103ac8584866132b1565b9061270b8584866132b1565b35604051907fb226bd1c0000000000000000000000000000000000000000000000000000000082526004820152602090818160248173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d3c91feabb9f071beafc249056b9450b1ad317c5165afa9182156104d4576000926127be575b5050906127106118368460606104786104696127b69767ffffffffffffffff60406126eb9b01511690613529565b9390506126e2565b9080939250813d83116127eb575b6127d68183613123565b81010312610225579051612710611836612788565b503d6127cc565b466127fe8285856132b1565b3503612813575b61280e90613255565b6125ee565b946128226103ac8785856132b1565b61282d8785856132b1565b35604051907fb226bd1c00000000000000000000000000000000000000000000000000000000825260048201526020808260248173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d3c91feabb9f071beafc249056b9450b1ad317c5165afa9182156104d4576000926128dd575b5061183683606061047861046961280e989667ffffffffffffffff612710976128d59a01511690613529565b959050612805565b908094925081813d8311612909575b6128f68183613123565b81010312610225575190926118366128a9565b503d6128ec565b34610225577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602081360112610225576004359067ffffffffffffffff82116102255760e08260040191833603011261022557610a1f612a4e916103869360c460405194859360208086015261299b61298982806132d6565b60e06040890152610120880191613326565b612a3f612a34612a176129e76129b460248a01876132d6565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc096918c60608982860301910152613326565b6129f360448a01613373565b151560808b0152612a0760648a01876132d6565b90868c84030160a08d0152613326565b612a246084890186613380565b90858b84030160c08c01526133d3565b9260a4870190613380565b918784030160e0880152613425565b910135610100830152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282613123565b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102255760206040517f01010000000000000000000000000000000000000000000000000000000000008152f35b34610225577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc6020813601126102255760043567ffffffffffffffff81116102255780600401906101e0809382360301126102255761038692610a1f916101c4612cbe60405195869460208087015285612cae612ca2612c83612bd5612bb8612b79612b6889806132d6565b8960408a0152610220890191613326565b612b8660248d018a6132d6565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc09860608a82860301910152613326565b612bc560448c01896132d6565b8d8303880160808f015290613326565b60ff612be360648c01613365565b1660a08c015260848a013560c08c015260a48a013560e08c0152612c0960c48b01613373565b15156101008c0152612c1d60e48b01613373565b15156101208c0152612c326101048b01613373565b15156101408c0152612c476101248b01613373565b15156101608c0152612c5c6101448b01613373565b15156101808c0152612c726101648b01886132d6565b8c830387016101a08e015290613326565b612c916101848a0187613380565b90858c8403016101c08d01526133d3565b936101a4880190613380565b9290918885030190880152613425565b910135610200830152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282613123565b346102255760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610225576004356000527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020526020600160406000200154604051908152f35b346102255760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102255767ffffffffffffffff60043581811161022557612daf903690600401612fad565b60243583811161022557612dc7903690600401612fad565b91909360443590811161022557612de2903690600401612fad565b949091612ded613db9565b83810361078a5785810361078a5760005b808211612e0757005b80612e2d612e19612e4a93858a6132b1565b3561100e612e28848a896132b1565b6132c1565b610780612e3b82858a6132b1565b35611033612e28848c8a6132b1565b612dfe565b346102255760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022557602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000481d89337abcb336bdfa422e85af8aa88919b342168152f35b346102255760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261022557600435907fffffffff00000000000000000000000000000000000000000000000000000000821680920361022557817f0a33324b0000000000000000000000000000000000000000000000000000000060209314908115612f50575b5015158152f35b7f7965db0b00000000000000000000000000000000000000000000000000000000811491508115612f83575b5083612f49565b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501483612f7c565b9181601f840112156102255782359167ffffffffffffffff8311610225576020808501948460051b01011161022557565b919082519283825260005b8481106130285750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b602081830181015184830182015201612fe9565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126102255767ffffffffffffffff91600435838111610225578261308791600401612fad565b93909392602435918211610225576130a191600401612fad565b9091565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361022557565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361022557565b6080810190811067ffffffffffffffff8211176118ac57604052565b6040810190811067ffffffffffffffff8211176118ac57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176118ac57604052565b67ffffffffffffffff81116118ac57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b9291926131aa82613164565b916131b86040519384613123565b829481845281830111610225578281602093846000960137010152565b9080601f83011215610225578160206131f09335910161319e565b90565b90815180825260208080930193019160005b828110613213575050505090565b835185529381019392810192600101613205565b939291613250906132426040936060885260608801906131f3565b9086820360208801526131f3565b930152565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146132825760010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b91908110156123c55760051b0190565b3567ffffffffffffffff811681036102255790565b90357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18236030181121561022557016020813591019167ffffffffffffffff821161022557813603831361022557565b601f82602094937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0938186528686013760008582860101520116010190565b359060ff8216820361022557565b3590811515820361022557565b90357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18236030181121561022557016020813591019167ffffffffffffffff8211610225578160051b3603831361022557565b90918281527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83116102255760209260051b809284830137010190565b359067ffffffffffffffff8216820361022557565b90918092808252602080920191808260051b8601019484600080925b85841061345357505050505050505090565b90919293949596977fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820301885288357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8185360301811215613525578660019286829301906134d560806134c884806132d6565b9091808552840191613326565b9167ffffffffffffffff6134ea858301613410565b1684830152604060ff6134fe828401613365565b16908301526135106060809201613373565b15159101529a01980196959401929190613441565b8380fd5b8181029291811591840414171561328257565b9061ffff8092166127100191821161328257565b9190820180921161328257565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610225570180359067ffffffffffffffff82116102255760200191813603831361022557565b90600182811c921680156135f7575b60208310146135c857565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f16916135bd565b90604051918260008254613614816135ae565b908184526020946001916001811690816000146136845750600114613645575b50505061364392500383613123565b565b600090815285812095935091905b81831061366c5750506136439350820101388080613634565b85548884018501529485019487945091830191613653565b9150506136439593507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b820101388080613634565b6040906000606083516136d7816130eb565b818152826020820152828582015201526000527f5ef83cde492754da3fd6bddb04f9c0eea61921570db6556ef7bb11412c3f900060205261ffff81600020916001815193613724856130eb565b61372d81613601565b855201549067ffffffffffffffff808316602086015282821c169084015260801c16606082015290565b91908110156123c55760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa181360301821215610225570190565b3580151581036102255790565b5190811515820361022557565b519073ffffffffffffffffffffffffffffffffffffffff8216820361022557565b92906131f094926137f29115158552606060208601526060850190612fde565b926040818503910152613326565b67ffffffffffffffff81116118ac5760051b60200190565b9080601f8301121561022557602090823561383281613800565b936138406040519586613123565b81855260208086019260051b82010192831161022557602001905b828210613869575050505090565b8135815290830190830161385b565b81601f820112156102255780359160209161389284613800565b936040926138a36040519687613123565b818652848087019260051b8401019381851161022557858401925b8584106138cf575050505050505090565b67ffffffffffffffff90843582811161022557860190608091827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082880301126102255784519061391f826130eb565b8a810135948511610225576139688b959461393f898880988601016131d5565b845261394c888401613410565b8685015260609261395e848201613365565b8986015201613373565b908201528152019301926138be565b3d156139a2573d9061398882613164565b916139966040519384613123565b82523d6000602084013e565b606090565b91908110156123c55760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8181360301821215610225570190565b3561ffff811681036102255790565b90613a0082613800565b613a0d6040519182613123565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0613a3b8294613800565b0190602036910137565b80518210156123c55760209160051b010190565b9092919273ffffffffffffffffffffffffffffffffffffffff90817f000000000000000000000000d685179d71b41b1bf67bdac3d12ad72d5045e4b5163303613d8f5760ff7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005416613cf1577fff000000000000000000000000000000000000000000000000000000000000007f0200000000000000000000000000000000000000000000000000000000000000911603613d86576040928351917f2af57555000000000000000000000000000000000000000000000000000000008352828185169182600483015281602460209687937f000000000000000000000000481d89337abcb336bdfa422e85af8aa88919b342165afa908115613d7b57600091613d46575b5015613d3b57826004918651928380927f5c975abb0000000000000000000000000000000000000000000000000000000082525afa908115613d3057600091613cfb575b50613cf15784019360608186031261022557613bdc81613373565b9167ffffffffffffffff91808201358381116102255787613bfe9183016131d5565b918682013593841161022557613c9860009897613c68613c258b9a8b98613cc497016131d5565b91519586948501987fa17f0e91000000000000000000000000000000000000000000000000000000008a5215156024860152606060448601526084850190612fde565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc848303016064850152612fde565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282613123565b51925af1613cd0613977565b81613ce6575b5015613ce157600090565b600990565b905051151538613cd6565b5050505050600390565b90508281813d8311613d29575b613d128183613123565b8101031261022557613d23906137a4565b38613bc1565b503d613d08565b85513d6000823e3d90fd5b505050505050600490565b90508381813d8311613d74575b613d5d8183613123565b8101031261022557613d6e906137a4565b38613b7d565b503d613d53565b86513d6000823e3d90fd5b50505050600c90565b60046040517f8a6e4889000000000000000000000000000000000000000000000000000000008152fd5b3360009081527f06484cc59dc38e4f67c31122333a17ca81b3ca18cdf02bfc298072fa52b0316a60205260409020547f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b089060ff1615613e155750565b604490604051907fe2517d3f0000000000000000000000000000000000000000000000000000000082523360048301526024820152fd5b3360009081527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d602052604081205460ff1615613e155750565b3360009081527f75442b0a96088b5456bc4ed01394c96a4feec0f883c9494257d76b96ab1c9b6b60205260409020547f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a9060ff1615613e155750565b806000527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b62680060205260406000203360005260205260ff6040600020541615613e155750565b806000527f5ef83cde492754da3fd6bddb04f9c0eea61921570db6556ef7bb11412c3f900060205267ffffffffffffffff6001604060002001921691827fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008254161790556040519182527fc926b7036cb485c0b90a20d1afaa71b700b19774f5ffdf5641762cb7a1fc7b7660203393a3565b806000527f5ef83cde492754da3fd6bddb04f9c0eea61921570db6556ef7bb11412c3f9000602052600160406000200180547fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff6fffffffffffffffff00000000000000008560401b16911617905567ffffffffffffffff604051921682527f9f5bca54e08d1db06d5d14af829f4f29d47d4396810593c6506c4fa3b16d373960203393a3565b6140706131f092620f424092613529565b0460ff7f0000000000000000000000000000000000000000000000000000000000000012169060ff7f00000000000000000000000000000000000000000000000000000000000000121690614690565b73ffffffffffffffffffffffffffffffffffffffff1660008181527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d60205260408120549091907f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268009060ff1661419857828052602052604082208183526020526040822060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905533917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4600190565b505090565b906000918083527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268008060205273ffffffffffffffffffffffffffffffffffffffff6040852093169283855260205260ff6040852054161560001461426257818452602052604083208284526020526040832060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4600190565b50505090565b906000918083527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268008060205273ffffffffffffffffffffffffffffffffffffffff6040852093169283855260205260ff6040852054166000146142625781845260205260408320828452602052604083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4600190565b6000918183526020927f5ef83cde492754da3fd6bddb04f9c0eea61921570db6556ef7bb11412c3f90008452604081209082519067ffffffffffffffff82116145165761437683546135ae565b601f81116144d3575b508590601f831160011461441157918061440194927f7b6fcb86043271f690c05ea2cbc744b1bd2087903b3bed692a1f18b7c6a9624a969491614406575b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790555b6040519182918683523396830190612fde565b0390a3565b9050830151386143bd565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08316848352878320925b888282106144bd575050926144019492600192827f7b6fcb86043271f690c05ea2cbc744b1bd2087903b3bed692a1f18b7c6a9624a989610614486575b5050811b0190556143ee565b8501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c19169055388061447a565b600184958293958a01518155019401920161443d565b838252868220601f840160051c81019188851061450c575b601f0160051c01905b818110614501575061437f565b8281556001016144f4565b90915081906144eb565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526041600452fd5b60ff7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300541661456e57565b60046040517fd93c0665000000000000000000000000000000000000000000000000000000008152fd5b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000006040519160601b166020820152601481526131f081613107565b806000527f5ef83cde492754da3fd6bddb04f9c0eea61921570db6556ef7bb11412c3f9000602052600160406000200180547fffffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffff71ffff000000000000000000000000000000008560801b16911617905561ffff604051921682527f2c003ff6fddfe10e5d4671730649c39c78794096717448ca0e700e92601c2aba60203393a3565b9190820391821161328257565b604d811161328257600a0a90565b91818111156146b5576146aa6131f093926146af92614675565b614682565b90613529565b908082106146c257505090565b6146cf916146aa91614675565b9081156146da570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60ff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460401c161561473857565b60046040517fd7e6bcf8000000000000000000000000000000000000000000000000000000008152fd5b906147a1575080511561477757805190602001fd5b60046040517f1425ea42000000000000000000000000000000000000000000000000000000008152fd5b815115806147f9575b6147b2575090565b60249073ffffffffffffffffffffffffffffffffffffffff604051917f9996b315000000000000000000000000000000000000000000000000000000008352166004820152fd5b50803b156147aa56fea264697066735822122089dcc78eb1ba765309f92375bda8be109642e2bf72f311c6fc17b2dd167ab8c664736f6c63430008180033

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits

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.