ETH Price: $3,426.81 (+3.34%)

Contract

0xCE5B47FA5139fC5f3c8c5f4C278ad5F56A7b2016
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Native Gas F...214666832024-12-23 17:30:1112 hrs ago1734975011IN
Axelar : DVN Adapter
0 ETH0.0004429913.10649527
Set Native Gas F...214665352024-12-23 17:00:1112 hrs ago1734973211IN
Axelar : DVN Adapter
0 ETH0.0005696216.85281333
Execute214602102024-12-22 19:45:3533 hrs ago1734896735IN
Axelar : DVN Adapter
0 ETH0.000656268.23866647
Execute214569312024-12-22 8:45:3544 hrs ago1734857135IN
Axelar : DVN Adapter
0 ETH0.000524926.589832
Set Native Gas F...214438912024-12-20 13:00:113 days ago1734699611IN
Axelar : DVN Adapter
0 ETH0.001138933.6954737
Set Native Gas F...214437422024-12-20 12:30:113 days ago1734697811IN
Axelar : DVN Adapter
0 ETH0.0014852443.9421656
Set Native Gas F...214435932024-12-20 12:00:233 days ago1734696023IN
Axelar : DVN Adapter
0 ETH0.0019200456.76566956
Set Native Gas F...214434442024-12-20 11:30:113 days ago1734694211IN
Axelar : DVN Adapter
0 ETH0.0012230836.16041738
Set Native Gas F...214432942024-12-20 11:00:113 days ago1734692411IN
Axelar : DVN Adapter
0 ETH0.0008497325.14019104
Set Native Gas F...214431442024-12-20 10:30:113 days ago1734690611IN
Axelar : DVN Adapter
0 ETH0.0016247148.03449971
Set Native Gas F...214429942024-12-20 10:00:113 days ago1734688811IN
Axelar : DVN Adapter
0 ETH0.0006269818.54983561
Set Native Gas F...214428462024-12-20 9:30:353 days ago1734687035IN
Axelar : DVN Adapter
0 ETH0.0008933426.43045649
Execute214427472024-12-20 9:10:353 days ago1734685835IN
Axelar : DVN Adapter
0 ETH0.0032139940.35400454
Set Native Gas F...214426972024-12-20 9:00:353 days ago1734685235IN
Axelar : DVN Adapter
0 ETH0.0008339124.65447172
Set Native Gas F...214425482024-12-20 8:30:113 days ago1734683411IN
Axelar : DVN Adapter
0 ETH0.0005421616.04025728
Execute214404852024-12-20 1:35:354 days ago1734658535IN
Axelar : DVN Adapter
0 ETH0.0008722710.95036396
Execute214403852024-12-20 1:15:234 days ago1734657323IN
Axelar : DVN Adapter
0 ETH0.0008733910.9644592
Set Native Gas F...214392612024-12-19 21:30:114 days ago1734643811IN
Axelar : DVN Adapter
0 ETH0.0009278727.45207032
Set Native Gas F...214391132024-12-19 21:00:114 days ago1734642011IN
Axelar : DVN Adapter
0 ETH0.0012057835.67410418
Set Native Gas F...214388152024-12-19 20:00:114 days ago1734638411IN
Axelar : DVN Adapter
0 ETH0.0015316345.28256029
Set Native Gas F...214385152024-12-19 19:00:114 days ago1734634811IN
Axelar : DVN Adapter
0 ETH0.0013928441.20837403
Set Native Gas F...214383652024-12-19 18:30:114 days ago1734633011IN
Axelar : DVN Adapter
0 ETH0.0029007185.75898681
Set Native Gas F...214382162024-12-19 18:00:114 days ago1734631211IN
Axelar : DVN Adapter
0 ETH0.0027404481.02087118
Set Native Gas F...214376192024-12-19 16:00:114 days ago1734624011IN
Axelar : DVN Adapter
0 ETH0.0008164224.15464504
Set Native Gas F...214374712024-12-19 15:30:234 days ago1734622223IN
Axelar : DVN Adapter
0 ETH0.0010832232.04813093
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AxelarDVNAdapter

Compiler Version
v0.8.22+commit.4fc1097e

Optimization Enabled:
Yes with 20000 runs

Other Settings:
paris EvmVersion
File 1 of 36 : AxelarDVNAdapter.sol
// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

import { AxelarExecutable } from "@axelar-network/axelar-gmp-sdk-solidity/contracts/executable/AxelarExecutable.sol";
import { ISendLib } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol";

import { DVNAdapterBase } from "../DVNAdapterBase.sol";
import { IAxelarDVNAdapter } from "../../../interfaces/adapters/IAxelarDVNAdapter.sol";
import { IAxelarDVNAdapterFeeLib } from "../../../interfaces/adapters/IAxelarDVNAdapterFeeLib.sol";

interface ISendLibBase {
    function fees(address _worker) external view returns (uint256);
}

/// @title AxelarDVNAdapter
/// @dev How Axelar DVN Adapter works:
///  1. Estimate gas fee off-chain using the Axelar SDK.
///     refer to https://docs.axelar.dev/dev/axelarjs-sdk/axelar-query-api#estimategasfee
///  2. Pay gas fee by calling `payNativeGasForContractCall` on the AxelarGasService contract.
///     refer to https://docs.axelar.dev/dev/general-message-passing/gas-services/pay-gas#paynativegasforcontractcall
///  3. Send message by calling `callContract` on the AxelarGateway contract.
///     refer to https://docs.axelar.dev/dev/general-message-passing/gmp-messages#call-a-contract-on-chain-b-from-chain-a
///  4. Refund surplus gas fee asynchronously.
///     refer to https://docs.axelar.dev/dev/general-message-passing/gas-services/refund
/// @dev Recovery:
///  1. If not enough gas fee is paid, the message will be hangup on source chain and can `add gas` to retry.
///     refer to https://docs.axelar.dev/dev/general-message-passing/recovery#increase-gas-payment-to-the-gas-receiver-on-the-source-chain
///  2. If the message is not executed on the destination chain, you can manually retry by calling `execute` on the `ReceiveAxelarDVNAdapter` contract.
///     refer to https://docs.axelar.dev/dev/general-message-passing/recovery#manually-execute-a-transfer
/// @dev As the Gas is estimated off-chain, we need to update the gas fee periodically on-chain by calling `setNativeGasFee` with the new fee.
contract AxelarDVNAdapter is DVNAdapterBase, AxelarExecutable, IAxelarDVNAdapter {
    mapping(string srcChainName => SrcConfig) public srcConfig; // by chain name
    mapping(uint32 dstEid => DstConfig) public dstConfig; // by dstEid

    // set default multiplier to 2.5x
    constructor(
        address[] memory _admins,
        address _gateway
    ) AxelarExecutable(_gateway) DVNAdapterBase(msg.sender, _admins, 10000) {}

    // ========================= OnlyAdmin =========================
    function setDstConfig(DstConfigParam[] calldata _params) external onlyRole(ADMIN_ROLE) {
        for (uint256 i = 0; i < _params.length; i++) {
            DstConfigParam calldata param = _params[i];

            uint32 eid = param.eid % 30000;

            // set once per chainName
            // only one adapter per dvn that services both endpoint v1 and v2
            // we standardize the eid stored here with mod 30000
            if (bytes(dstConfig[eid].chainName).length == 0) {
                dstConfig[eid].chainName = param.chainName;
                dstConfig[eid].peer = param.peer;
                srcConfig[param.chainName].eid = eid;
                srcConfig[param.chainName].peer = param.peer;
            }

            dstConfig[eid].multiplierBps = param.multiplierBps;
            dstConfig[eid].nativeGasFee = param.nativeGasFee;
        }

        emit DstConfigSet(_params);
    }

    /// @notice sets message fee in native gas for destination chains.
    /// @dev Axelar does not support quoting fee on-chain. Instead, the fee needs to be obtained off-chain by querying through the Axelar SDK.
    /// @dev The fee may change over time when token prices change, requiring admins to monitor and make necessary updates to reflect the actual fee.
    /// @dev Adding a buffer to the required fee is advisable. Any surplus fee will be refunded asynchronously if it exceeds the necessary amount.
    /// https://docs.axelar.dev/dev/general-message-passing/gas-services/pay-gas
    /// https://github.com/axelarnetwork/axelarjs/blob/070c8fe061f1082e79772fdc5c4675c0237bbba2/packages/api/src/axelar-query/isomorphic.ts#L54
    /// https://github.com/axelarnetwork/axelar-cgp-solidity/blob/d4536599321774927bf9716178a9e360f8e0efac/contracts/gas-service/AxelarGasService.sol#L403
    function setNativeGasFee(NativeGasFeeParam[] calldata _params) external onlyRole(ADMIN_ROLE) {
        for (uint256 i = 0; i < _params.length; i++) {
            NativeGasFeeParam calldata param = _params[i];
            dstConfig[param.dstEid % 30000].nativeGasFee = param.nativeGasFee;
        }
        emit NativeGasFeeSet(_params);
    }

    // ========================= OnlyWorkerFeeLib =========================
    function withdrawToFeeLib(address _sendLib) external {
        if (msg.sender != workerFeeLib) revert AxelarDVNAdapter_OnlyWorkerFeeLib();

        _withdrawFeeFromSendLib(_sendLib, workerFeeLib);
    }

    // ========================= OnlyMessageLib =========================
    function assignJob(
        AssignJobParam calldata _param,
        bytes calldata _options
    ) external payable override onlyAcl(_param.sender) returns (uint totalFee) {
        bytes32 receiveLib = _getAndAssertReceiveLib(msg.sender, _param.dstEid);

        IAxelarDVNAdapterFeeLib.Param memory feeLibParam = IAxelarDVNAdapterFeeLib.Param({
            dstEid: _param.dstEid,
            confirmations: _param.confirmations,
            sender: _param.sender,
            defaultMultiplierBps: defaultMultiplierBps
        });
        DstConfig memory config = dstConfig[_param.dstEid % 30000];

        bytes memory payload = _encode(receiveLib, _param.packetHeader, _param.payloadHash);

        totalFee = IAxelarDVNAdapterFeeLib(workerFeeLib).getFeeOnSend(
            feeLibParam,
            config,
            payload,
            _options,
            msg.sender
        );

        gateway.callContract(config.chainName, config.peer, payload);
    }

    // ========================= View =========================
    function getFee(
        uint32 _dstEid,
        uint64 _confirmations,
        address _sender,
        bytes calldata _options
    ) external view override returns (uint256 totalFee) {
        IAxelarDVNAdapterFeeLib.Param memory feeLibParam = IAxelarDVNAdapterFeeLib.Param(
            _dstEid,
            _confirmations,
            _sender,
            defaultMultiplierBps
        );

        totalFee = IAxelarDVNAdapterFeeLib(workerFeeLib).getFee(feeLibParam, dstConfig[_dstEid % 30000], _options);
    }

    // ========================= Internal =========================
    function _execute(
        string calldata _sourceChain,
        string calldata _sourceAddress,
        bytes calldata _payload
    ) internal override {
        SrcConfig memory config = srcConfig[_sourceChain];

        // assert peer is the same as the source chain
        _assertPeer(_sourceChain, _sourceAddress, config.peer);

        _decodeAndVerify(config.eid, _payload);
    }

    function _assertPeer(string memory _sourceChain, string memory _sourceAddress, string memory peer) private pure {
        if (keccak256(bytes(_sourceAddress)) != keccak256(bytes(peer))) {
            revert AxelarDVNAdapter_UntrustedPeer(_sourceChain, _sourceAddress);
        }
    }
}

File 2 of 36 : AxelarExecutable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { IAxelarGateway } from '../interfaces/IAxelarGateway.sol';
import { IAxelarExecutable } from '../interfaces/IAxelarExecutable.sol';

contract AxelarExecutable is IAxelarExecutable {
    IAxelarGateway public immutable gateway;

    constructor(address gateway_) {
        if (gateway_ == address(0)) revert InvalidAddress();

        gateway = IAxelarGateway(gateway_);
    }

    function execute(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes calldata payload
    ) external {
        bytes32 payloadHash = keccak256(payload);

        if (!gateway.validateContractCall(commandId, sourceChain, sourceAddress, payloadHash))
            revert NotApprovedByGateway();

        _execute(sourceChain, sourceAddress, payload);
    }

    function executeWithToken(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes calldata payload,
        string calldata tokenSymbol,
        uint256 amount
    ) external {
        bytes32 payloadHash = keccak256(payload);

        if (
            !gateway.validateContractCallAndMint(
                commandId,
                sourceChain,
                sourceAddress,
                payloadHash,
                tokenSymbol,
                amount
            )
        ) revert NotApprovedByGateway();

        _executeWithToken(sourceChain, sourceAddress, payload, tokenSymbol, amount);
    }

    function _execute(
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes calldata payload
    ) internal virtual {}

    function _executeWithToken(
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes calldata payload,
        string calldata tokenSymbol,
        uint256 amount
    ) internal virtual {}
}

File 3 of 36 : IAxelarExecutable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { IAxelarGateway } from './IAxelarGateway.sol';

interface IAxelarExecutable {
    error InvalidAddress();
    error NotApprovedByGateway();

    function gateway() external view returns (IAxelarGateway);

    function execute(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes calldata payload
    ) external;

    function executeWithToken(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes calldata payload,
        string calldata tokenSymbol,
        uint256 amount
    ) external;
}

File 4 of 36 : IAxelarGateway.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { IGovernable } from './IGovernable.sol';
import { IImplementation } from './IImplementation.sol';

interface IAxelarGateway is IImplementation, IGovernable {
    /**********\
    |* Errors *|
    \**********/

    error NotSelf();
    error InvalidCodeHash();
    error SetupFailed();
    error InvalidAuthModule();
    error InvalidTokenDeployer();
    error InvalidAmount();
    error InvalidChainId();
    error InvalidCommands();
    error TokenDoesNotExist(string symbol);
    error TokenAlreadyExists(string symbol);
    error TokenDeployFailed(string symbol);
    error TokenContractDoesNotExist(address token);
    error BurnFailed(string symbol);
    error MintFailed(string symbol);
    error InvalidSetMintLimitsParams();
    error ExceedMintLimit(string symbol);

    /**********\
    |* Events *|
    \**********/

    event TokenSent(
        address indexed sender,
        string destinationChain,
        string destinationAddress,
        string symbol,
        uint256 amount
    );

    event ContractCall(
        address indexed sender,
        string destinationChain,
        string destinationContractAddress,
        bytes32 indexed payloadHash,
        bytes payload
    );

    event ContractCallWithToken(
        address indexed sender,
        string destinationChain,
        string destinationContractAddress,
        bytes32 indexed payloadHash,
        bytes payload,
        string symbol,
        uint256 amount
    );

    event Executed(bytes32 indexed commandId);

    event TokenDeployed(string symbol, address tokenAddresses);

    event ContractCallApproved(
        bytes32 indexed commandId,
        string sourceChain,
        string sourceAddress,
        address indexed contractAddress,
        bytes32 indexed payloadHash,
        bytes32 sourceTxHash,
        uint256 sourceEventIndex
    );

    event ContractCallApprovedWithMint(
        bytes32 indexed commandId,
        string sourceChain,
        string sourceAddress,
        address indexed contractAddress,
        bytes32 indexed payloadHash,
        string symbol,
        uint256 amount,
        bytes32 sourceTxHash,
        uint256 sourceEventIndex
    );

    event ContractCallExecuted(bytes32 indexed commandId);

    event TokenMintLimitUpdated(string symbol, uint256 limit);

    event OperatorshipTransferred(bytes newOperatorsData);

    event Upgraded(address indexed implementation);

    /********************\
    |* Public Functions *|
    \********************/

    function sendToken(
        string calldata destinationChain,
        string calldata destinationAddress,
        string calldata symbol,
        uint256 amount
    ) external;

    function callContract(
        string calldata destinationChain,
        string calldata contractAddress,
        bytes calldata payload
    ) external;

    function callContractWithToken(
        string calldata destinationChain,
        string calldata contractAddress,
        bytes calldata payload,
        string calldata symbol,
        uint256 amount
    ) external;

    function isContractCallApproved(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        address contractAddress,
        bytes32 payloadHash
    ) external view returns (bool);

    function isContractCallAndMintApproved(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        address contractAddress,
        bytes32 payloadHash,
        string calldata symbol,
        uint256 amount
    ) external view returns (bool);

    function validateContractCall(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes32 payloadHash
    ) external returns (bool);

    function validateContractCallAndMint(
        bytes32 commandId,
        string calldata sourceChain,
        string calldata sourceAddress,
        bytes32 payloadHash,
        string calldata symbol,
        uint256 amount
    ) external returns (bool);

    /***********\
    |* Getters *|
    \***********/

    function authModule() external view returns (address);

    function tokenDeployer() external view returns (address);

    function tokenMintLimit(string memory symbol) external view returns (uint256);

    function tokenMintAmount(string memory symbol) external view returns (uint256);

    function allTokensFrozen() external view returns (bool);

    function implementation() external view returns (address);

    function tokenAddresses(string memory symbol) external view returns (address);

    function tokenFrozen(string memory symbol) external view returns (bool);

    function isCommandExecuted(bytes32 commandId) external view returns (bool);

    /************************\
    |* Governance Functions *|
    \************************/

    function setTokenMintLimits(string[] calldata symbols, uint256[] calldata limits) external;

    function upgrade(
        address newImplementation,
        bytes32 newImplementationCodeHash,
        bytes calldata setupParams
    ) external;

    /**********************\
    |* External Functions *|
    \**********************/

    function execute(bytes calldata input) external;
}

File 5 of 36 : IContractIdentifier.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// General interface for upgradable contracts
interface IContractIdentifier {
    /**
     * @notice Returns the contract ID. It can be used as a check during upgrades.
     * @dev Meant to be overridden in derived contracts.
     * @return bytes32 The contract ID
     */
    function contractId() external pure returns (bytes32);
}

File 6 of 36 : IGovernable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title IGovernable Interface
 * @notice This is an interface used by the AxelarGateway contract to manage governance and mint limiter roles.
 */
interface IGovernable {
    error NotGovernance();
    error NotMintLimiter();
    error InvalidGovernance();
    error InvalidMintLimiter();

    event GovernanceTransferred(address indexed previousGovernance, address indexed newGovernance);
    event MintLimiterTransferred(address indexed previousGovernance, address indexed newGovernance);

    /**
     * @notice Returns the governance address.
     * @return address of the governance
     */
    function governance() external view returns (address);

    /**
     * @notice Returns the mint limiter address.
     * @return address of the mint limiter
     */
    function mintLimiter() external view returns (address);

    /**
     * @notice Transfer the governance role to another address.
     * @param newGovernance The new governance address
     */
    function transferGovernance(address newGovernance) external;

    /**
     * @notice Transfer the mint limiter role to another address.
     * @param newGovernance The new mint limiter address
     */
    function transferMintLimiter(address newGovernance) external;
}

File 7 of 36 : IImplementation.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { IContractIdentifier } from './IContractIdentifier.sol';

interface IImplementation is IContractIdentifier {
    error NotProxy();

    function setup(bytes calldata data) external;
}

File 8 of 36 : ILayerZeroEndpointV2.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

import { IMessageLibManager } from "./IMessageLibManager.sol";
import { IMessagingComposer } from "./IMessagingComposer.sol";
import { IMessagingChannel } from "./IMessagingChannel.sol";
import { IMessagingContext } from "./IMessagingContext.sol";

struct MessagingParams {
    uint32 dstEid;
    bytes32 receiver;
    bytes message;
    bytes options;
    bool payInLzToken;
}

struct MessagingReceipt {
    bytes32 guid;
    uint64 nonce;
    MessagingFee fee;
}

struct MessagingFee {
    uint256 nativeFee;
    uint256 lzTokenFee;
}

struct Origin {
    uint32 srcEid;
    bytes32 sender;
    uint64 nonce;
}

interface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext {
    event PacketSent(bytes encodedPayload, bytes options, address sendLibrary);

    event PacketVerified(Origin origin, address receiver, bytes32 payloadHash);

    event PacketDelivered(Origin origin, address receiver);

    event LzReceiveAlert(
        address indexed receiver,
        address indexed executor,
        Origin origin,
        bytes32 guid,
        uint256 gas,
        uint256 value,
        bytes message,
        bytes extraData,
        bytes reason
    );

    event LzTokenSet(address token);

    event DelegateSet(address sender, address delegate);

    function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory);

    function send(
        MessagingParams calldata _params,
        address _refundAddress
    ) external payable returns (MessagingReceipt memory);

    function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external;

    function verifiable(Origin calldata _origin, address _receiver) external view returns (bool);

    function initializable(Origin calldata _origin, address _receiver) external view returns (bool);

    function lzReceive(
        Origin calldata _origin,
        address _receiver,
        bytes32 _guid,
        bytes calldata _message,
        bytes calldata _extraData
    ) external payable;

    // oapp can burn messages partially by calling this function with its own business logic if messages are verified in order
    function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;

    function setLzToken(address _lzToken) external;

    function lzToken() external view returns (address);

    function nativeToken() external view returns (address);

    function setDelegate(address _delegate) external;
}

File 9 of 36 : IMessageLib.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

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

import { SetConfigParam } from "./IMessageLibManager.sol";

enum MessageLibType {
    Send,
    Receive,
    SendAndReceive
}

interface IMessageLib is IERC165 {
    function setConfig(address _oapp, SetConfigParam[] calldata _config) external;

    function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config);

    function isSupportedEid(uint32 _eid) external view returns (bool);

    // message libs of same major version are compatible
    function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion);

    function messageLibType() external view returns (MessageLibType);
}

File 10 of 36 : IMessageLibManager.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

struct SetConfigParam {
    uint32 eid;
    uint32 configType;
    bytes config;
}

interface IMessageLibManager {
    struct Timeout {
        address lib;
        uint256 expiry;
    }

    event LibraryRegistered(address newLib);
    event DefaultSendLibrarySet(uint32 eid, address newLib);
    event DefaultReceiveLibrarySet(uint32 eid, address newLib);
    event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry);
    event SendLibrarySet(address sender, uint32 eid, address newLib);
    event ReceiveLibrarySet(address receiver, uint32 eid, address newLib);
    event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout);

    function registerLibrary(address _lib) external;

    function isRegisteredLibrary(address _lib) external view returns (bool);

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

    function setDefaultSendLibrary(uint32 _eid, address _newLib) external;

    function defaultSendLibrary(uint32 _eid) external view returns (address);

    function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _timeout) external;

    function defaultReceiveLibrary(uint32 _eid) external view returns (address);

    function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external;

    function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry);

    function isSupportedEid(uint32 _eid) external view returns (bool);

    function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool);

    /// ------------------- OApp interfaces -------------------
    function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external;

    function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib);

    function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool);

    function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external;

    function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault);

    function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _gracePeriod) external;

    function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry);

    function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external;

    function getConfig(
        address _oapp,
        address _lib,
        uint32 _eid,
        uint32 _configType
    ) external view returns (bytes memory config);
}

File 11 of 36 : IMessagingChannel.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

interface IMessagingChannel {
    event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);
    event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);
    event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);

    function eid() external view returns (uint32);

    // this is an emergency function if a message cannot be verified for some reasons
    // required to provide _nextNonce to avoid race condition
    function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;

    function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;

    function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;

    function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);

    function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);

    function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);

    function inboundPayloadHash(
        address _receiver,
        uint32 _srcEid,
        bytes32 _sender,
        uint64 _nonce
    ) external view returns (bytes32);

    function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);
}

File 12 of 36 : IMessagingComposer.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

interface IMessagingComposer {
    event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message);
    event ComposeDelivered(address from, address to, bytes32 guid, uint16 index);
    event LzComposeAlert(
        address indexed from,
        address indexed to,
        address indexed executor,
        bytes32 guid,
        uint16 index,
        uint256 gas,
        uint256 value,
        bytes message,
        bytes extraData,
        bytes reason
    );

    function composeQueue(
        address _from,
        address _to,
        bytes32 _guid,
        uint16 _index
    ) external view returns (bytes32 messageHash);

    function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external;

    function lzCompose(
        address _from,
        address _to,
        bytes32 _guid,
        uint16 _index,
        bytes calldata _message,
        bytes calldata _extraData
    ) external payable;
}

File 13 of 36 : IMessagingContext.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

interface IMessagingContext {
    function isSendingMessage() external view returns (bool);

    function getSendContext() external view returns (uint32 dstEid, address sender);
}

File 14 of 36 : ISendLib.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

import { MessagingFee } from "./ILayerZeroEndpointV2.sol";
import { IMessageLib } from "./IMessageLib.sol";

struct Packet {
    uint64 nonce;
    uint32 srcEid;
    address sender;
    uint32 dstEid;
    bytes32 receiver;
    bytes32 guid;
    bytes message;
}

interface ISendLib is IMessageLib {
    function send(
        Packet calldata _packet,
        bytes calldata _options,
        bool _payInLzToken
    ) external returns (MessagingFee memory, bytes memory encodedPacket);

    function quote(
        Packet calldata _packet,
        bytes calldata _options,
        bool _payInLzToken
    ) external view returns (MessagingFee memory);

    function setTreasury(address _treasury) external;

    function withdrawFee(address _to, uint256 _amount) external;

    function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external;
}

File 15 of 36 : AddressCast.sol
// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

library AddressCast {
    error AddressCast_InvalidSizeForAddress();
    error AddressCast_InvalidAddress();

    function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) {
        if (_addressBytes.length > 32) revert AddressCast_InvalidAddress();
        result = bytes32(_addressBytes);
        unchecked {
            uint256 offset = 32 - _addressBytes.length;
            result = result >> (offset * 8);
        }
    }

    function toBytes32(address _address) internal pure returns (bytes32 result) {
        result = bytes32(uint256(uint160(_address)));
    }

    function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) {
        if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress();
        result = new bytes(_size);
        unchecked {
            uint256 offset = 256 - _size * 8;
            assembly {
                mstore(add(result, 32), shl(offset, _addressBytes32))
            }
        }
    }

    function toAddress(bytes32 _addressBytes32) internal pure returns (address result) {
        result = address(uint160(uint256(_addressBytes32)));
    }

    function toAddress(bytes calldata _addressBytes) internal pure returns (address result) {
        if (_addressBytes.length != 20) revert AddressCast_InvalidAddress();
        result = address(bytes20(_addressBytes));
    }
}

File 16 of 36 : Transfer.sol
// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

library Transfer {
    using SafeERC20 for IERC20;

    address internal constant ADDRESS_ZERO = address(0);

    error Transfer_NativeFailed(address _to, uint256 _value);
    error Transfer_ToAddressIsZero();

    function native(address _to, uint256 _value) internal {
        if (_to == ADDRESS_ZERO) revert Transfer_ToAddressIsZero();
        (bool success, ) = _to.call{ value: _value }("");
        if (!success) revert Transfer_NativeFailed(_to, _value);
    }

    function token(address _token, address _to, uint256 _value) internal {
        if (_to == ADDRESS_ZERO) revert Transfer_ToAddressIsZero();
        IERC20(_token).safeTransfer(_to, _value);
    }

    function nativeOrToken(address _token, address _to, uint256 _value) internal {
        if (_token == ADDRESS_ZERO) {
            native(_to, _value);
        } else {
            token(_token, _to, _value);
        }
    }
}

File 17 of 36 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.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 AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @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 override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @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 override returns (bytes32) {
        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 override 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 override 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 `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

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

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 18 of 36 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @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.
     *
     * _Available since v3.1._
     */
    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 `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 19 of 36 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.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 Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

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

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _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) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

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

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

File 20 of 36 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

File 21 of 36 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

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

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

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

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

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

File 23 of 36 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

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

File 24 of 36 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 26 of 36 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.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);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 27 of 36 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @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 28 of 36 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

File 30 of 36 : Worker.sol
// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

import { Pausable } from "@openzeppelin/contracts/security/Pausable.sol";
import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol";

import { ISendLib } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol";
import { Transfer } from "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Transfer.sol";

import { IWorker } from "./interfaces/IWorker.sol";

abstract contract Worker is AccessControl, Pausable, IWorker {
    bytes32 internal constant MESSAGE_LIB_ROLE = keccak256("MESSAGE_LIB_ROLE");
    bytes32 internal constant ALLOWLIST = keccak256("ALLOWLIST");
    bytes32 internal constant DENYLIST = keccak256("DENYLIST");
    bytes32 internal constant ADMIN_ROLE = keccak256("ADMIN_ROLE");

    address public workerFeeLib;

    uint64 public allowlistSize;
    uint16 public defaultMultiplierBps;
    address public priceFeed;

    mapping(uint32 eid => uint8[] optionTypes) internal supportedOptionTypes;

    // ========================= Constructor =========================

    /// @param _messageLibs array of message lib addresses that are granted the MESSAGE_LIB_ROLE
    /// @param _priceFeed price feed address
    /// @param _defaultMultiplierBps default multiplier for worker fee
    /// @param _roleAdmin address that is granted the DEFAULT_ADMIN_ROLE (can grant and revoke all roles)
    /// @param _admins array of admin addresses that are granted the ADMIN_ROLE
    constructor(
        address[] memory _messageLibs,
        address _priceFeed,
        uint16 _defaultMultiplierBps,
        address _roleAdmin,
        address[] memory _admins
    ) {
        defaultMultiplierBps = _defaultMultiplierBps;
        priceFeed = _priceFeed;

        if (_roleAdmin != address(0x0)) {
            _grantRole(DEFAULT_ADMIN_ROLE, _roleAdmin); // _roleAdmin can grant and revoke all roles
        }

        for (uint256 i = 0; i < _messageLibs.length; ++i) {
            _grantRole(MESSAGE_LIB_ROLE, _messageLibs[i]);
        }

        for (uint256 i = 0; i < _admins.length; ++i) {
            _grantRole(ADMIN_ROLE, _admins[i]);
        }
    }

    // ========================= Modifier =========================

    modifier onlyAcl(address _sender) {
        if (!hasAcl(_sender)) {
            revert Worker_NotAllowed();
        }
        _;
    }

    /// @dev Access control list using allowlist and denylist
    /// @dev 1) if one address is in the denylist -> deny
    /// @dev 2) else if address in the allowlist OR allowlist is empty (allows everyone)-> allow
    /// @dev 3) else deny
    /// @param _sender address to check
    function hasAcl(address _sender) public view returns (bool) {
        if (hasRole(DENYLIST, _sender)) {
            return false;
        } else if (allowlistSize == 0 || hasRole(ALLOWLIST, _sender)) {
            return true;
        } else {
            return false;
        }
    }

    // ========================= OnyDefaultAdmin =========================

    /// @dev flag to pause execution of workers (if used with whenNotPaused modifier)
    /// @param _paused true to pause, false to unpause
    function setPaused(bool _paused) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (_paused) {
            _pause();
        } else {
            _unpause();
        }
    }

    // ========================= OnlyAdmin =========================

    /// @param _priceFeed price feed address
    function setPriceFeed(address _priceFeed) external onlyRole(ADMIN_ROLE) {
        priceFeed = _priceFeed;
        emit SetPriceFeed(_priceFeed);
    }

    /// @param _workerFeeLib worker fee lib address
    function setWorkerFeeLib(address _workerFeeLib) external onlyRole(ADMIN_ROLE) {
        workerFeeLib = _workerFeeLib;
        emit SetWorkerLib(_workerFeeLib);
    }

    /// @param _multiplierBps default multiplier for worker fee
    function setDefaultMultiplierBps(uint16 _multiplierBps) external onlyRole(ADMIN_ROLE) {
        defaultMultiplierBps = _multiplierBps;
        emit SetDefaultMultiplierBps(_multiplierBps);
    }

    /// @dev supports withdrawing fee from ULN301, ULN302 and more
    /// @param _lib message lib address
    /// @param _to address to withdraw fee to
    /// @param _amount amount to withdraw
    function withdrawFee(address _lib, address _to, uint256 _amount) external onlyRole(ADMIN_ROLE) {
        if (!hasRole(MESSAGE_LIB_ROLE, _lib)) revert Worker_OnlyMessageLib();
        ISendLib(_lib).withdrawFee(_to, _amount);
        emit Withdraw(_lib, _to, _amount);
    }

    /// @dev supports withdrawing token from the contract
    /// @param _token token address
    /// @param _to address to withdraw token to
    /// @param _amount amount to withdraw
    function withdrawToken(address _token, address _to, uint256 _amount) external onlyRole(ADMIN_ROLE) {
        // transfers native if _token is address(0x0)
        Transfer.nativeOrToken(_token, _to, _amount);
    }

    function setSupportedOptionTypes(uint32 _eid, uint8[] calldata _optionTypes) external onlyRole(ADMIN_ROLE) {
        supportedOptionTypes[_eid] = _optionTypes;
    }

    // ========================= View Functions =========================
    function getSupportedOptionTypes(uint32 _eid) external view returns (uint8[] memory) {
        return supportedOptionTypes[_eid];
    }

    // ========================= Internal Functions =========================

    /// @dev overrides AccessControl to allow for counting of allowlistSize
    /// @param _role role to grant
    /// @param _account address to grant role to
    function _grantRole(bytes32 _role, address _account) internal override {
        if (_role == ALLOWLIST && !hasRole(_role, _account)) {
            ++allowlistSize;
        }
        super._grantRole(_role, _account);
    }

    /// @dev overrides AccessControl to allow for counting of allowlistSize
    /// @param _role role to revoke
    /// @param _account address to revoke role from
    function _revokeRole(bytes32 _role, address _account) internal override {
        if (_role == ALLOWLIST && hasRole(_role, _account)) {
            --allowlistSize;
        }
        super._revokeRole(_role, _account);
    }

    /// @dev overrides AccessControl to disable renouncing of roles
    function renounceRole(bytes32 /*role*/, address /*account*/) public pure override {
        revert Worker_RoleRenouncingDisabled();
    }
}

File 31 of 36 : IWorker.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

interface IWorker {
    event SetWorkerLib(address workerLib);
    event SetPriceFeed(address priceFeed);
    event SetDefaultMultiplierBps(uint16 multiplierBps);
    event SetSupportedOptionTypes(uint32 dstEid, uint8[] optionTypes);
    event Withdraw(address lib, address to, uint256 amount);

    error Worker_NotAllowed();
    error Worker_OnlyMessageLib();
    error Worker_RoleRenouncingDisabled();

    function setPriceFeed(address _priceFeed) external;

    function priceFeed() external view returns (address);

    function setDefaultMultiplierBps(uint16 _multiplierBps) external;

    function defaultMultiplierBps() external view returns (uint16);

    function withdrawFee(address _lib, address _to, uint256 _amount) external;

    function setSupportedOptionTypes(uint32 _eid, uint8[] calldata _optionTypes) external;

    function getSupportedOptionTypes(uint32 _eid) external view returns (uint8[] memory);
}

File 32 of 36 : DVNAdapterBase.sol
// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

import { Transfer } from "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Transfer.sol";
import { ISendLib } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol";

import { ILayerZeroDVN } from "../../interfaces/ILayerZeroDVN.sol";
import { Worker } from "../../../Worker.sol";
import { DVNAdapterMessageCodec } from "./libs/DVNAdapterMessageCodec.sol";

interface ISendLibBase {
    function fees(address _worker) external view returns (uint256);
}

interface IReceiveUln {
    function verify(bytes calldata _packetHeader, bytes32 _payloadHash, uint64 _confirmations) external;
}

struct ReceiveLibParam {
    address sendLib;
    uint32 dstEid;
    bytes32 receiveLib;
}

/// @title SendDVNAdapterBase
/// @notice base contract for DVN adapters
/// @dev limitations:
///  - doesn't accept alt token
///  - doesn't respect block confirmations
abstract contract DVNAdapterBase is Worker, ILayerZeroDVN {
    // --- Errors ---
    error DVNAdapter_InsufficientBalance(uint256 actual, uint256 requested);
    error DVNAdapter_NotImplemented();
    error DVNAdapter_MissingRecieveLib(address sendLib, uint32 dstEid);

    event ReceiveLibsSet(ReceiveLibParam[] params);

    /// @dev on change of application config, dvn adapters will not perform any additional verification
    /// @dev to avoid messages from being stuck, all verifications from adapters will be done with the maximum possible confirmations
    uint64 internal constant MAX_CONFIRMATIONS = type(uint64).max;

    /// @dev receive lib to call verify() on at destination
    mapping(address sendLib => mapping(uint32 dstEid => bytes32 receiveLib)) public receiveLibs;

    constructor(
        address _roleAdmin,
        address[] memory _admins,
        uint16 _defaultMultiplierBps
    ) Worker(new address[](0), address(0x0), _defaultMultiplierBps, _roleAdmin, _admins) {}

    // ========================= OnlyAdmin =========================
    /// @notice sets receive lib for destination chains
    /// @dev DEFAULT_ADMIN_ROLE can set MESSAGE_LIB_ROLE for sendLibs and use below function to set receiveLibs
    function setReceiveLibs(ReceiveLibParam[] calldata _params) external onlyRole(DEFAULT_ADMIN_ROLE) {
        for (uint256 i = 0; i < _params.length; i++) {
            ReceiveLibParam calldata param = _params[i];
            receiveLibs[param.sendLib][param.dstEid] = param.receiveLib;
        }

        emit ReceiveLibsSet(_params);
    }

    // ========================= Internal =========================
    function _getAndAssertReceiveLib(address _sendLib, uint32 _dstEid) internal view returns (bytes32 lib) {
        lib = receiveLibs[_sendLib][_dstEid];
        if (lib == bytes32(0)) revert DVNAdapter_MissingRecieveLib(_sendLib, _dstEid);
    }

    function _encode(
        bytes32 _receiveLib,
        bytes memory _packetHeader,
        bytes32 _payloadHash
    ) internal pure returns (bytes memory) {
        return DVNAdapterMessageCodec.encode(_receiveLib, _packetHeader, _payloadHash);
    }

    function _encodeEmpty() internal pure returns (bytes memory) {
        return
            DVNAdapterMessageCodec.encode(bytes32(0), new bytes(DVNAdapterMessageCodec.PACKET_HEADER_SIZE), bytes32(0));
    }

    function _decodeAndVerify(uint32 _srcEid, bytes calldata _payload) internal {
        require((DVNAdapterMessageCodec.srcEid(_payload) % 30000) == _srcEid, "DVNAdapterBase: invalid srcEid");

        (address receiveLib, bytes memory packetHeader, bytes32 payloadHash) = DVNAdapterMessageCodec.decode(_payload);

        IReceiveUln(receiveLib).verify(packetHeader, payloadHash, MAX_CONFIRMATIONS);
    }

    function _withdrawFeeFromSendLib(address _sendLib, address _to) internal {
        uint256 fee = ISendLibBase(_sendLib).fees(address(this));
        if (fee > 0) {
            ISendLib(_sendLib).withdrawFee(_to, fee);
            emit Withdraw(_sendLib, _to, fee);
        }
    }

    function _assertBalanceAndWithdrawFee(address _sendLib, uint256 _messageFee) internal {
        uint256 balance = address(this).balance;
        if (balance < _messageFee) {
            // withdraw all fees from the sendLib if balance is insufficient
            _withdrawFeeFromSendLib(_sendLib, address(this));

            // check balance again
            balance = address(this).balance;
            // revert if balance is still insufficient, need to transfer more funds manually to the adapter
            if (balance < _messageFee) revert DVNAdapter_InsufficientBalance(balance, _messageFee);
        }
    }

    /// @dev to receive refund
    receive() external payable {}
}

File 33 of 36 : DVNAdapterMessageCodec.sol
// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

import { AddressCast } from "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol";

library DVNAdapterMessageCodec {
    using AddressCast for bytes32;

    error DVNAdapter_InvalidMessageSize();

    uint256 private constant RECEIVE_LIB_OFFSET = 0;
    uint256 private constant PAYLOAD_HASH_OFFSET = 32;
    uint256 private constant PACKET_HEADER_OFFSET = 64;
    uint256 private constant SRC_EID_OFFSET = 73; // 64 + 1 + 8

    uint256 internal constant PACKET_HEADER_SIZE = 81; // version(uint8) + nonce(uint64) + path(uint32,bytes32,uint32,bytes32)
    uint256 internal constant MESSAGE_SIZE = 32 + 32 + PACKET_HEADER_SIZE; // receive_lib(bytes32) + payloadHash(bytes32) + packetHeader

    function encode(
        bytes32 _receiveLib,
        bytes memory _packetHeader,
        bytes32 _payloadHash
    ) internal pure returns (bytes memory payload) {
        return abi.encodePacked(_receiveLib, _payloadHash, _packetHeader);
    }

    function decode(
        bytes calldata _message
    ) internal pure returns (address receiveLib, bytes memory packetHeader, bytes32 payloadHash) {
        if (_message.length != MESSAGE_SIZE) revert DVNAdapter_InvalidMessageSize();

        receiveLib = bytes32(_message[RECEIVE_LIB_OFFSET:PAYLOAD_HASH_OFFSET]).toAddress();
        payloadHash = bytes32(_message[PAYLOAD_HASH_OFFSET:PACKET_HEADER_OFFSET]);
        packetHeader = _message[PACKET_HEADER_OFFSET:];
    }

    function srcEid(bytes calldata _message) internal pure returns (uint32) {
        return uint32(bytes4(_message[SRC_EID_OFFSET:SRC_EID_OFFSET + 4]));
    }
}

File 34 of 36 : ILayerZeroDVN.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

interface ILayerZeroDVN {
    struct AssignJobParam {
        uint32 dstEid;
        bytes packetHeader;
        bytes32 payloadHash;
        uint64 confirmations;
        address sender;
    }

    // @notice query price and assign jobs at the same time
    // @param _dstEid - the destination endpoint identifier
    // @param _packetHeader - version + nonce + path
    // @param _payloadHash - hash of guid + message
    // @param _confirmations - block confirmation delay before relaying blocks
    // @param _sender - the source sending contract address
    // @param _options - options
    function assignJob(AssignJobParam calldata _param, bytes calldata _options) external payable returns (uint256 fee);

    // @notice query the dvn fee for relaying block information to the destination chain
    // @param _dstEid the destination endpoint identifier
    // @param _confirmations - block confirmation delay before relaying blocks
    // @param _sender - the source sending contract address
    // @param _options - options
    function getFee(
        uint32 _dstEid,
        uint64 _confirmations,
        address _sender,
        bytes calldata _options
    ) external view returns (uint256 fee);
}

File 35 of 36 : IAxelarDVNAdapter.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

interface IAxelarDVNAdapter {
    struct MultiplierParam {
        uint32 dstEid;
        uint16 multiplierBps;
    }

    struct FloorMarginUSDParam {
        uint32 dstEid;
        uint128 floorMarginUSD;
    }

    struct NativeGasFeeParam {
        uint32 dstEid;
        uint256 nativeGasFee;
    }

    struct DstConfigParam {
        uint32 eid;
        string chainName;
        string peer;
        uint16 multiplierBps;
        uint256 nativeGasFee;
    }

    struct DstConfig {
        string chainName;
        string peer;
        uint16 multiplierBps;
        uint256 nativeGasFee;
    }

    struct SrcConfig {
        uint32 eid;
        string peer;
    }

    event DstConfigSet(DstConfigParam[] params);
    event NativeGasFeeSet(NativeGasFeeParam[] params);
    event MultiplierSet(MultiplierParam[] params);
    event FloorMarginUSDSet(FloorMarginUSDParam[] params);

    error AxelarDVNAdapter_UntrustedPeer(string chainName, string peer);
    error AxelarDVNAdapter_OnlyWorkerFeeLib();

    function withdrawToFeeLib(address _sendLib) external;
}

File 36 of 36 : IAxelarDVNAdapterFeeLib.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

import { IAxelarDVNAdapter } from "./IAxelarDVNAdapter.sol";

interface IAxelarDVNAdapterFeeLib {
    struct Param {
        uint32 dstEid;
        uint64 confirmations;
        address sender;
        uint16 defaultMultiplierBps;
    }

    struct DstConfig {
        uint64 gas;
        uint128 floorMarginUSD; // uses priceFeed PRICE_RATIO_DENOMINATOR
    }

    struct DstConfigParam {
        uint32 dstEid;
        uint64 gas;
        uint128 floorMarginUSD; // uses priceFeed PRICE_RATIO_DENOMINATOR
    }

    event DstConfigSet(DstConfigParam[] params);
    event TokenWithdrawn(address token, address to, uint256 amount);
    event GasServiceSet(address gasService);
    event PriceFeedSet(address priceFeed);
    event NativeGasFeeMultiplierBpsSet(uint16 multiplierBps);

    error AxelarDVNAdapter_OptionsUnsupported();
    error AxelarDVNAdapter_InsufficientBalance(uint256 actual, uint256 requested);
    error AxelarDVNAdapter_EidNotSupported(uint32 eid);

    function getFeeOnSend(
        Param calldata _params,
        IAxelarDVNAdapter.DstConfig calldata _dstConfig,
        bytes memory _payload,
        bytes calldata _options,
        address _sendLib
    ) external payable returns (uint256 totalFee);

    function getFee(
        Param calldata _params,
        IAxelarDVNAdapter.DstConfig calldata _dstConfig,
        bytes calldata _options
    ) external view returns (uint256 totalFee);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address[]","name":"_admins","type":"address[]"},{"internalType":"address","name":"_gateway","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AxelarDVNAdapter_OnlyWorkerFeeLib","type":"error"},{"inputs":[{"internalType":"string","name":"chainName","type":"string"},{"internalType":"string","name":"peer","type":"string"}],"name":"AxelarDVNAdapter_UntrustedPeer","type":"error"},{"inputs":[{"internalType":"uint256","name":"actual","type":"uint256"},{"internalType":"uint256","name":"requested","type":"uint256"}],"name":"DVNAdapter_InsufficientBalance","type":"error"},{"inputs":[],"name":"DVNAdapter_InvalidMessageSize","type":"error"},{"inputs":[{"internalType":"address","name":"sendLib","type":"address"},{"internalType":"uint32","name":"dstEid","type":"uint32"}],"name":"DVNAdapter_MissingRecieveLib","type":"error"},{"inputs":[],"name":"DVNAdapter_NotImplemented","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"NotApprovedByGateway","type":"error"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Transfer_NativeFailed","type":"error"},{"inputs":[],"name":"Transfer_ToAddressIsZero","type":"error"},{"inputs":[],"name":"Worker_NotAllowed","type":"error"},{"inputs":[],"name":"Worker_OnlyMessageLib","type":"error"},{"inputs":[],"name":"Worker_RoleRenouncingDisabled","type":"error"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"string","name":"chainName","type":"string"},{"internalType":"string","name":"peer","type":"string"},{"internalType":"uint16","name":"multiplierBps","type":"uint16"},{"internalType":"uint256","name":"nativeGasFee","type":"uint256"}],"indexed":false,"internalType":"struct IAxelarDVNAdapter.DstConfigParam[]","name":"params","type":"tuple[]"}],"name":"DstConfigSet","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"uint128","name":"floorMarginUSD","type":"uint128"}],"indexed":false,"internalType":"struct IAxelarDVNAdapter.FloorMarginUSDParam[]","name":"params","type":"tuple[]"}],"name":"FloorMarginUSDSet","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"uint16","name":"multiplierBps","type":"uint16"}],"indexed":false,"internalType":"struct IAxelarDVNAdapter.MultiplierParam[]","name":"params","type":"tuple[]"}],"name":"MultiplierSet","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"uint256","name":"nativeGasFee","type":"uint256"}],"indexed":false,"internalType":"struct IAxelarDVNAdapter.NativeGasFeeParam[]","name":"params","type":"tuple[]"}],"name":"NativeGasFeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"sendLib","type":"address"},{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"receiveLib","type":"bytes32"}],"indexed":false,"internalType":"struct ReceiveLibParam[]","name":"params","type":"tuple[]"}],"name":"ReceiveLibsSet","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":"uint16","name":"multiplierBps","type":"uint16"}],"name":"SetDefaultMultiplierBps","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"priceFeed","type":"address"}],"name":"SetPriceFeed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"dstEid","type":"uint32"},{"indexed":false,"internalType":"uint8[]","name":"optionTypes","type":"uint8[]"}],"name":"SetSupportedOptionTypes","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"workerLib","type":"address"}],"name":"SetWorkerLib","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"lib","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistSize","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes","name":"packetHeader","type":"bytes"},{"internalType":"bytes32","name":"payloadHash","type":"bytes32"},{"internalType":"uint64","name":"confirmations","type":"uint64"},{"internalType":"address","name":"sender","type":"address"}],"internalType":"struct ILayerZeroDVN.AssignJobParam","name":"_param","type":"tuple"},{"internalType":"bytes","name":"_options","type":"bytes"}],"name":"assignJob","outputs":[{"internalType":"uint256","name":"totalFee","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"defaultMultiplierBps","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"dstEid","type":"uint32"}],"name":"dstConfig","outputs":[{"internalType":"string","name":"chainName","type":"string"},{"internalType":"string","name":"peer","type":"string"},{"internalType":"uint16","name":"multiplierBps","type":"uint16"},{"internalType":"uint256","name":"nativeGasFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"commandId","type":"bytes32"},{"internalType":"string","name":"sourceChain","type":"string"},{"internalType":"string","name":"sourceAddress","type":"string"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"execute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"commandId","type":"bytes32"},{"internalType":"string","name":"sourceChain","type":"string"},{"internalType":"string","name":"sourceAddress","type":"string"},{"internalType":"bytes","name":"payload","type":"bytes"},{"internalType":"string","name":"tokenSymbol","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"executeWithToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gateway","outputs":[{"internalType":"contract IAxelarGateway","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_dstEid","type":"uint32"},{"internalType":"uint64","name":"_confirmations","type":"uint64"},{"internalType":"address","name":"_sender","type":"address"},{"internalType":"bytes","name":"_options","type":"bytes"}],"name":"getFee","outputs":[{"internalType":"uint256","name":"totalFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"}],"name":"getSupportedOptionTypes","outputs":[{"internalType":"uint8[]","name":"","type":"uint8[]"}],"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":"address","name":"_sender","type":"address"}],"name":"hasAcl","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceFeed","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sendLib","type":"address"},{"internalType":"uint32","name":"dstEid","type":"uint32"}],"name":"receiveLibs","outputs":[{"internalType":"bytes32","name":"receiveLib","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_multiplierBps","type":"uint16"}],"name":"setDefaultMultiplierBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"string","name":"chainName","type":"string"},{"internalType":"string","name":"peer","type":"string"},{"internalType":"uint16","name":"multiplierBps","type":"uint16"},{"internalType":"uint256","name":"nativeGasFee","type":"uint256"}],"internalType":"struct IAxelarDVNAdapter.DstConfigParam[]","name":"_params","type":"tuple[]"}],"name":"setDstConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"uint256","name":"nativeGasFee","type":"uint256"}],"internalType":"struct IAxelarDVNAdapter.NativeGasFeeParam[]","name":"_params","type":"tuple[]"}],"name":"setNativeGasFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_priceFeed","type":"address"}],"name":"setPriceFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"sendLib","type":"address"},{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"receiveLib","type":"bytes32"}],"internalType":"struct ReceiveLibParam[]","name":"_params","type":"tuple[]"}],"name":"setReceiveLibs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"uint8[]","name":"_optionTypes","type":"uint8[]"}],"name":"setSupportedOptionTypes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_workerFeeLib","type":"address"}],"name":"setWorkerFeeLib","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"srcChainName","type":"string"}],"name":"srcConfig","outputs":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"string","name":"peer","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_lib","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sendLib","type":"address"}],"name":"withdrawToFeeLib","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"workerFeeLib","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a06040523480156200001157600080fd5b50604051620048eb380380620048eb833981016040819052620000349162000334565b803383612710600060405190808252806020026020018201604052801562000066578160200160208202803683370190505b506001805460ff61ffff60e81b011916600160e81b61ffff851602179055600280546001600160a01b031916905560008285856001600160a01b03821615620000b657620000b6600083620001b3565b60005b85518110156200011a57620001117f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de878381518110620000fd57620000fd6200041a565b6020026020010151620001b360201b60201c565b600101620000b9565b5060005b81518110156200016b57620001627fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775838381518110620000fd57620000fd6200041a565b6001016200011e565b5050506001600160a01b03871695506200019e9450505050505760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b0316608052506200046d9050565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca821480156200020457506000828152602081815260408083206001600160a01b038516845290915290205460ff16155b156200025157600180546015906200022c90600160a81b90046001600160401b031662000430565b91906101000a8154816001600160401b0302191690836001600160401b031602179055505b6200025d828262000261565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200025d576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620002bd3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200032f57600080fd5b919050565b600080604083850312156200034857600080fd5b82516001600160401b03808211156200036057600080fd5b818501915085601f8301126200037557600080fd5b81516020828211156200038c576200038c62000301565b8160051b604051601f19603f83011681018181108682111715620003b457620003b462000301565b604052928352818301935084810182019289841115620003d357600080fd5b948201945b83861015620003fc57620003ec8662000317565b85529482019493820193620003d8565b96506200040d905087820162000317565b9450505050509250929050565b634e487b7160e01b600052603260045260246000fd5b60006001600160401b038281166002600160401b031981016200046357634e487b7160e01b600052601160045260246000fd5b6001019392505050565b60805161444d6200049e6000396000818161030501528181610c6401528181611063015261169b015261444d6000f3fe6080604052600436106102015760003560e01c8063491606581161011d5780639e944965116100b0578063c416aa511161007f578063cd88b90311610064578063cd88b903146106dd578063d2ae2104146106fd578063d547741f1461075057600080fd5b8063c416aa511461068b578063c7b2370b146106bd57600080fd5b80639e94496514610606578063a217fddf14610636578063af896a3b1461064b578063c358de0a1461066b57600080fd5b8063724e78da116100ec578063724e78da14610555578063741bef1a1461057557806391d14854146105a257806395d376d7146105f357600080fd5b806349160658146104c55780634cfa6d2c146104e557806351b6a0fd1461051d5780635c975abb1461053d57600080fd5b806316c38b3c116101955780632de11376116101645780632de11376146104455780632f2ff15d1461046557806330bb3aac1461048557806336568abe146104a557600080fd5b806316c38b3c1461039a5780631a98b2e0146103ba578063248a9ca3146103da57806326e67a371461041857600080fd5b80631095b6d7116101d15780631095b6d7146102d3578063116191b6146102f3578063127124171461034c578063143b165f1461036c57600080fd5b8062bf2e801461020d57806301e336671461026157806301ffc9a71461028357806302d6e8b0146102b357600080fd5b3661020857005b600080fd5b34801561021957600080fd5b50600154610249907d010000000000000000000000000000000000000000000000000000000000900461ffff1681565b60405161ffff90911681526020015b60405180910390f35b34801561026d57600080fd5b5061028161027c366004613013565b610770565b005b34801561028f57600080fd5b506102a361029e36600461304f565b6107ab565b6040519015158152602001610258565b3480156102bf57600080fd5b506102816102ce366004613091565b610844565b3480156102df57600080fd5b506102816102ee366004613013565b61091f565b3480156102ff57600080fd5b506103277f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610258565b34801561035857600080fd5b50610281610367366004613106565b610aae565b34801561037857600080fd5b5061038c610387366004613150565b610b31565b60405161025892919061328d565b3480156103a657600080fd5b506102816103b53660046132ba565b610be8565b3480156103c657600080fd5b506102816103d5366004613320565b610c0d565b3480156103e657600080fd5b5061040a6103f53660046133fa565b60009081526020819052604090206001015490565b604051908152602001610258565b34801561042457600080fd5b50610438610433366004613427565b610d2f565b6040516102589190613442565b34801561045157600080fd5b506102a3610460366004613106565b610db6565b34801561047157600080fd5b50610281610480366004613489565b610e9b565b34801561049157600080fd5b5061040a6104a03660046134cd565b610ec5565b3480156104b157600080fd5b506102816104c0366004613489565b610fda565b3480156104d157600080fd5b506102816104e0366004613543565b61100c565b3480156104f157600080fd5b5061040a6105003660046135e7565b600460209081526000928352604080842090915290825290205481565b34801561052957600080fd5b50610281610538366004613611565b611133565b34801561054957600080fd5b5060015460ff166102a3565b34801561056157600080fd5b50610281610570366004613106565b61121d565b34801561058157600080fd5b506002546103279073ffffffffffffffffffffffffffffffffffffffff1681565b3480156105ae57600080fd5b506102a36105bd366004613489565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b61040a610601366004613674565b6112c2565b34801561061257600080fd5b50610626610621366004613427565b611710565b60405161025894939291906136e5565b34801561064257600080fd5b5061040a600081565b34801561065757600080fd5b50610281610666366004613767565b61184d565b34801561067757600080fd5b506102816106863660046137bb565b611aa4565b34801561069757600080fd5b5060015461032790610100900473ffffffffffffffffffffffffffffffffffffffff1681565b3480156106c957600080fd5b506102816106d8366004613106565b611b52565b3480156106e957600080fd5b506102816106f83660046137d6565b611bf6565b34801561070957600080fd5b50600154610737907501000000000000000000000000000000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610258565b34801561075c57600080fd5b5061028161076b366004613489565b611c47565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561079a81611c6c565b6107a5848484611c76565b50505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061083e57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561086e81611c6c565b60005b828110156108e0573684848381811061088c5761088c61381c565b90506040020190508060200135600660006175308460000160208101906108b39190613427565b6108bd919061384b565b63ffffffff16815260208101919091526040016000206003015550600101610871565b507fd6dac4a884ac5f80781f154f28ed88464b2097f6b866143bb77e46736572136a8383604051610912929190613895565b60405180910390a1505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561094981611c6c565b73ffffffffffffffffffffffffffffffffffffffff841660009081527f9b50f4667d2d24216ccbf0dce3a90c0f620fa4d895e7b069d80ff6247fd25620602052604090205460ff166109c7576040517f5ee08b9700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517ffd9be52200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820184905285169063fd9be52290604401600060405180830381600087803b158015610a3757600080fd5b505af1158015610a4b573d6000803e3d6000fd5b50506040805173ffffffffffffffffffffffffffffffffffffffff8089168252871660208201529081018590527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9250606001905060405180910390a150505050565b600154610100900473ffffffffffffffffffffffffffffffffffffffff163314610b04576040517f611136c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b2e8160018054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611ca6565b50565b80516020818301810180516005825292820191909301209152805460018201805463ffffffff9092169291610b65906138e9565b80601f0160208091040260200160405190810160405280929190818152602001828054610b91906138e9565b8015610bde5780601f10610bb357610100808354040283529160200191610bde565b820191906000526020600020905b815481529060010190602001808311610bc157829003601f168201915b5050505050905082565b6000610bf381611c6c565b8115610c0557610c01611e1d565b5050565b610c01611e9c565b60008585604051610c1f92919061393c565b6040519081900381207f1876eed9000000000000000000000000000000000000000000000000000000008252915073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690631876eed990610ca9908e908e908e908e908e9089908d908d908d90600401613995565b6020604051808303816000875af1158015610cc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cec91906139f4565b610d22576040517f500c44b400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050505050505050565b63ffffffff8116600090815260036020908152604091829020805483518184028101840190945280845260609392830182828015610daa57602002820191906000526020600020906000905b825461010083900a900460ff16815260206001928301818104948501949093039092029101808411610d7b5790505b50505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff811660009081527f93c430521711328044ae92d0f1f1286cf040bc4a382f1642bd89984e86630553602052604081205460ff1615610e0b57506000919050565b6001547501000000000000000000000000000000000000000000900467ffffffffffffffff161580610e81575073ffffffffffffffffffffffffffffffffffffffff821660009081527f4ac82e3087b7dedf7f532cbc6915c722df8c1e31f1388c318a617b52760eaf8b602052604090205460ff165b15610e8e57506001919050565b506000919050565b919050565b600082815260208190526040902060010154610eb681611c6c565b610ec08383611ef3565b505050565b6040805160808101825263ffffffff8716815267ffffffffffffffff8616602082015273ffffffffffffffffffffffffffffffffffffffff8086169282019290925260015461ffff7d01000000000000000000000000000000000000000000000000000000000082041660608301526000926101009091041663f0b81bb482600685610f536175308d61384b565b63ffffffff1663ffffffff16815260200190815260200160002087876040518563ffffffff1660e01b8152600401610f8e9493929190613aac565b602060405180830381865afa158015610fab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcf9190613b7c565b979650505050505050565b6040517fdec9f03100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828260405161101e92919061393c565b6040519081900381207f5f6970c3000000000000000000000000000000000000000000000000000000008252915073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690635f6970c3906110a2908b908b908b908b908b908990600401613b95565b6020604051808303816000875af11580156110c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e591906139f4565b61111b576040517f500c44b400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611129878787878787611fb9565b5050505050505050565b600061113e81611c6c565b60005b828110156111eb573684848381811061115c5761115c61381c565b6060029190910191505060408101356004600061117c6020850185613106565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360200160208101906111cb9190613427565b63ffffffff16815260208101919091526040016000205550600101611141565b507f360a0efdea8fcc9a11ee20a2099e314ddcf49a941d66790cd4e5adea30faa0748383604051610912929190613bd6565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561124781611c6c565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040519081527ff724a45d041687842411f2b977ef22ab8f43c8f1104f4592b42a00f9b34a643d906020015b60405180910390a15050565b60006112d460a0850160808601613106565b6112dd81610db6565b611313576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061132b336113266020890189613427565b612113565b60408051608081019091529091506000908061134a60208a018a613427565b63ffffffff16815260200161136560808a0160608b01613c44565b67ffffffffffffffff16815260200161138460a08a0160808b01613106565b73ffffffffffffffffffffffffffffffffffffffff1681526001547d010000000000000000000000000000000000000000000000000000000000900461ffff166020918201529091506000906006908290617530906113e5908c018c613427565b6113ef919061384b565b63ffffffff1663ffffffff168152602001908152602001600020604051806080016040529081600082018054611424906138e9565b80601f0160208091040260200160405190810160405280929190818152602001828054611450906138e9565b801561149d5780601f106114725761010080835404028352916020019161149d565b820191906000526020600020905b81548152906001019060200180831161148057829003601f168201915b505050505081526020016001820180546114b6906138e9565b80601f01602080910402602001604051908101604052809291908181526020018280546114e2906138e9565b801561152f5780601f106115045761010080835404028352916020019161152f565b820191906000526020600020905b81548152906001019060200180831161151257829003601f168201915b5050509183525050600282015461ffff166020808301919091526003909201546040909101529091506000906115ab90859061156d908c018c613c5f565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050505060408c01356121aa565b6001546040517fd135ca93000000000000000000000000000000000000000000000000000000008152919250610100900473ffffffffffffffffffffffffffffffffffffffff169063d135ca9390611611908690869086908e908e903390600401613cc4565b6020604051808303816000875af1158015611630573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116549190613b7c565b825160208401516040517f1c92115f00000000000000000000000000000000000000000000000000000000815292985073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001692631c92115f926116d29290918690600401613dd7565b600060405180830381600087803b1580156116ec57600080fd5b505af1158015611700573d6000803e3d6000fd5b5050505050505050509392505050565b60066020526000908152604090208054819061172b906138e9565b80601f0160208091040260200160405190810160405280929190818152602001828054611757906138e9565b80156117a45780601f10611779576101008083540402835291602001916117a4565b820191906000526020600020905b81548152906001019060200180831161178757829003601f168201915b5050505050908060010180546117b9906138e9565b80601f01602080910402602001604051908101604052809291908181526020018280546117e5906138e9565b80156118325780601f1061180757610100808354040283529160200191611832565b820191906000526020600020905b81548152906001019060200180831161181557829003601f168201915b505050506002830154600390930154919261ffff1691905084565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561187781611c6c565b60005b82811015611a7257368484838181106118955761189561381c565b90506020028101906118a79190613e1a565b905060006175306118bb6020840184613427565b6118c5919061384b565b63ffffffff811660009081526006602052604090208054919250906118e9906138e9565b9050600003611a01576118ff6020830183613c5f565b63ffffffff8316600090815260066020526040902091611920919083613ea8565b5061192e6040830183613c5f565b63ffffffff8316600090815260066020526040902060010191611952919083613ea8565b508060056119636020850185613c5f565b60405161197192919061393c565b9081526040805191829003602001909120805463ffffffff939093167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000909316929092179091556119c490830183613c5f565b60056119d36020860186613c5f565b6040516119e192919061393c565b908152602001604051809103902060010191826119ff929190613ea8565b505b611a1160808301606084016137bb565b63ffffffff9190911660009081526006602052604090206002810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff909316929092179091556080919091013560039091015560010161187a565b507f53ede267f8a00cf87be90c85641900454b96a922b10a82a0d5f5b4d93b16b38a8383604051610912929190614026565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611ace81611c6c565b600180547fff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167d01000000000000000000000000000000000000000000000000000000000061ffff8516908102919091179091556040519081527f7af0ac740036ffb1c97b03697859d729e80a44ae5030543d64971c313565ab4d906020016112b6565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611b7c81611c6c565b600180547fffffffffffffffffffffff0000000000000000000000000000000000000000ff1661010073ffffffffffffffffffffffffffffffffffffffff8516908102919091179091556040519081527f1399be28223800f8669b3ba5f8721d9fc16fc4e8d0bbf98378791c8c5a3015e0906020016112b6565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611c2081611c6c565b63ffffffff84166000908152600360205260409020611c40908484612f31565b5050505050565b600082815260208190526040902060010154611c6281611c6c565b610ec083836121bf565b610b2e8133612284565b73ffffffffffffffffffffffffffffffffffffffff8316611c9b57610ec0828261233c565b610ec0838383612442565b6040517ffaaebd2100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff84169063faaebd2190602401602060405180830381865afa158015611d13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d379190613b7c565b90508015610ec0576040517ffd9be52200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063fd9be52290604401600060405180830381600087803b158015611daf57600080fd5b505af1158015611dc3573d6000803e3d6000fd5b50506040805173ffffffffffffffffffffffffffffffffffffffff8088168252861660208201529081018490527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb92506060019050610912565b611e256124b0565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b611ea461251f565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33611e72565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca82148015611f50575060008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16155b15611faf5760018054601590611f88907501000000000000000000000000000000000000000000900467ffffffffffffffff1661416d565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b610c01828261258b565b600060058787604051611fcd92919061393c565b908152604080519182900360209081018320838301909252815463ffffffff16835260018201805491840191612002906138e9565b80601f016020809104026020016040519081016040528092919081815260200182805461202e906138e9565b801561207b5780601f106120505761010080835404028352916020019161207b565b820191906000526020600020905b81548152906001019060200180831161205e57829003601f168201915b50505050508152505090506120fd87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b018190048102820181019092528981529250899150889081908401838280828437600092019190915250505050602084015161267b565b805161210a9084846126c6565b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260046020908152604080832063ffffffff851684529091529020548061083e576040517ff25127e600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015263ffffffff831660248201526044015b60405180910390fd5b60606121b78484846127e5565b949350505050565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca8214801561221b575060008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff165b1561227a5760018054601590612253907501000000000000000000000000000000000000000000900467ffffffffffffffff16614194565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b610c018282612814565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610c01576122c2816128cb565b6122cd8360206128ea565b6040516020016122de9291906141d6565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526121a191600401614257565b73ffffffffffffffffffffffffffffffffffffffff8216612389576040517f6b7a931000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146123e3576040519150601f19603f3d011682016040523d82523d6000602084013e6123e8565b606091505b5050905080610ec0576040517f465bc83400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602481018390526044016121a1565b73ffffffffffffffffffffffffffffffffffffffff821661248f576040517f6b7a931000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ec073ffffffffffffffffffffffffffffffffffffffff84168383612b34565b60015460ff161561251d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016121a1565b565b60015460ff1661251d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016121a1565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610c015760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561261d3390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b8080519060200120828051906020012014610ec05782826040517f5cc0c62a0000000000000000000000000000000000000000000000000000000081526004016121a192919061426a565b8263ffffffff166175306126da8484612bc1565b6126e4919061384b565b63ffffffff1614612751576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f44564e41646170746572426173653a20696e76616c696420737263456964000060448201526064016121a1565b60008060006127608585612bf2565b9250925092508273ffffffffffffffffffffffffffffffffffffffff16630223536e838367ffffffffffffffff6040518463ffffffff1660e01b81526004016127ab93929190614298565b600060405180830381600087803b1580156127c557600080fd5b505af11580156127d9573d6000803e3d6000fd5b50505050505050505050565b60608382846040516020016127fc939291906142cb565b60405160208183030381529060405290509392505050565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610c015760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b606061083e73ffffffffffffffffffffffffffffffffffffffff831660145b606060006128f98360026142f8565b61290490600261430f565b67ffffffffffffffff81111561291c5761291c613121565b6040519080825280601f01601f191660200182016040528015612946576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061297d5761297d61381c565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106129e0576129e061381c565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000612a1c8460026142f8565b612a2790600161430f565b90505b6001811115612ac4577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612a6857612a6861381c565b1a60f81b828281518110612a7e57612a7e61381c565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93612abd81614322565b9050612a2a565b508315612b2d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016121a1565b9392505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610ec0908490612cc1565b600082604983612bd282600461430f565b92612bdf93929190614357565b612be891614381565b60e01c9392505050565b6000606081612c036051604061430f565b8414612c3b576040517ff1d10e0d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612c58612c4c602060008789614357565b612c55916143c9565b90565b9250612c68604060208688614357565b612c71916143c9565b9050612c808460408188614357565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509598929750929550909350505050565b6000612d23826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612dd09092919063ffffffff16565b9050805160001480612d44575080806020019051810190612d4491906139f4565b610ec0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016121a1565b60606121b78484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051612e049190614405565b60006040518083038185875af1925050503d8060008114612e41576040519150601f19603f3d011682016040523d82523d6000602084013e612e46565b606091505b5091509150610fcf8783838760608315612ee8578251600003612ee15773ffffffffffffffffffffffffffffffffffffffff85163b612ee1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016121a1565b50816121b7565b6121b78383815115612efd5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a19190614257565b82805482825590600052602060002090601f01602090048101928215612fca5791602002820160005b83821115612f9b57833560ff1683826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302612f5a565b8015612fc85782816101000a81549060ff0219169055600101602081600001049283019260010302612f9b565b505b50612fd6929150612fda565b5090565b5b80821115612fd65760008155600101612fdb565b803573ffffffffffffffffffffffffffffffffffffffff81168114610e9657600080fd5b60008060006060848603121561302857600080fd5b61303184612fef565b925061303f60208501612fef565b9150604084013590509250925092565b60006020828403121561306157600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114612b2d57600080fd5b600080602083850312156130a457600080fd5b823567ffffffffffffffff808211156130bc57600080fd5b818501915085601f8301126130d057600080fd5b8135818111156130df57600080fd5b8660208260061b85010111156130f457600080fd5b60209290920196919550909350505050565b60006020828403121561311857600080fd5b612b2d82612fef565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561316257600080fd5b813567ffffffffffffffff8082111561317a57600080fd5b818401915084601f83011261318e57600080fd5b8135818111156131a0576131a0613121565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156131e6576131e6613121565b816040528281528760208487010111156131ff57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b8381101561323a578181015183820152602001613222565b50506000910152565b6000815180845261325b81602086016020860161321f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b63ffffffff831681526040602082015260006121b76040830184613243565b8015158114610b2e57600080fd5b6000602082840312156132cc57600080fd5b8135612b2d816132ac565b60008083601f8401126132e957600080fd5b50813567ffffffffffffffff81111561330157600080fd5b60208301915083602082850101111561331957600080fd5b9250929050565b60008060008060008060008060008060c08b8d03121561333f57600080fd5b8a35995060208b013567ffffffffffffffff8082111561335e57600080fd5b61336a8e838f016132d7565b909b50995060408d013591508082111561338357600080fd5b61338f8e838f016132d7565b909950975060608d01359150808211156133a857600080fd5b6133b48e838f016132d7565b909750955060808d01359150808211156133cd57600080fd5b506133da8d828e016132d7565b9150809450508092505060a08b013590509295989b9194979a5092959850565b60006020828403121561340c57600080fd5b5035919050565b803563ffffffff81168114610e9657600080fd5b60006020828403121561343957600080fd5b612b2d82613413565b6020808252825182820181905260009190848201906040850190845b8181101561347d57835160ff168352928401929184019160010161345e565b50909695505050505050565b6000806040838503121561349c57600080fd5b823591506134ac60208401612fef565b90509250929050565b803567ffffffffffffffff81168114610e9657600080fd5b6000806000806000608086880312156134e557600080fd5b6134ee86613413565b94506134fc602087016134b5565b935061350a60408701612fef565b9250606086013567ffffffffffffffff81111561352657600080fd5b613532888289016132d7565b969995985093965092949392505050565b60008060008060008060006080888a03121561355e57600080fd5b87359650602088013567ffffffffffffffff8082111561357d57600080fd5b6135898b838c016132d7565b909850965060408a01359150808211156135a257600080fd5b6135ae8b838c016132d7565b909650945060608a01359150808211156135c757600080fd5b506135d48a828b016132d7565b989b979a50959850939692959293505050565b600080604083850312156135fa57600080fd5b61360383612fef565b91506134ac60208401613413565b6000806020838503121561362457600080fd5b823567ffffffffffffffff8082111561363c57600080fd5b818501915085601f83011261365057600080fd5b81358181111561365f57600080fd5b8660206060830285010111156130f457600080fd5b60008060006040848603121561368957600080fd5b833567ffffffffffffffff808211156136a157600080fd5b9085019060a082880312156136b557600080fd5b909350602085013590808211156136cb57600080fd5b506136d8868287016132d7565b9497909650939450505050565b6080815260006136f86080830187613243565b828103602084015261370a8187613243565b61ffff95909516604084015250506060015292915050565b60008083601f84011261373457600080fd5b50813567ffffffffffffffff81111561374c57600080fd5b6020830191508360208260051b850101111561331957600080fd5b6000806020838503121561377a57600080fd5b823567ffffffffffffffff81111561379157600080fd5b61379d85828601613722565b90969095509350505050565b803561ffff81168114610e9657600080fd5b6000602082840312156137cd57600080fd5b612b2d826137a9565b6000806000604084860312156137eb57600080fd5b6137f484613413565b9250602084013567ffffffffffffffff81111561381057600080fd5b6136d886828701613722565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600063ffffffff80841680613889577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b92169190910692915050565b6020808252818101839052600090604080840186845b878110156138dc5763ffffffff6138c183613413565b168352818501358584015291830191908301906001016138ab565b5090979650505050505050565b600181811c908216806138fd57607f821691505b602082108103613936577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b8183823760009101908152919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b89815260c0602082015260006139af60c083018a8c61394c565b82810360408401526139c281898b61394c565b905086606084015282810360808401526139dd81868861394c565b9150508260a08301529a9950505050505050505050565b600060208284031215613a0657600080fd5b8151612b2d816132ac565b60008154613a1e816138e9565b808552602060018381168015613a3b5760018114613a7357613aa1565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008516838901528284151560051b8901019550613aa1565b866000528260002060005b85811015613a995781548a8201860152908301908401613a7e565b890184019650505b505050505092915050565b845163ffffffff16815260208086015167ffffffffffffffff169082015260408086015173ffffffffffffffffffffffffffffffffffffffff169082015260608086015161ffff169082015260c06080820152608060c08201526000613b16610140830186613a11565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff408382030160e0840152613b4d8160018801613a11565b905061ffff600287015416610100840152600386015461012084015282810360a0840152610fcf81858761394c565b600060208284031215613b8e57600080fd5b5051919050565b868152608060208201526000613baf60808301878961394c565b8281036040840152613bc281868861394c565b915050826060830152979650505050505050565b6020808252818101839052600090604080840186845b878110156138dc5773ffffffffffffffffffffffffffffffffffffffff613c1283612fef565b16835263ffffffff613c25868401613413565b1683860152818401358484015260609283019290910190600101613bec565b600060208284031215613c5657600080fd5b612b2d826134b5565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613c9457600080fd5b83018035915067ffffffffffffffff821115613caf57600080fd5b60200191503681900382131561331957600080fd5b865163ffffffff16815260208088015167ffffffffffffffff169082015260408088015173ffffffffffffffffffffffffffffffffffffffff169082015260608088015161ffff169082015260006101008060808401528751608082850152613d31610180850182613243565b91505060208801517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0084830301610120850152613d6e8282613243565b91505061ffff604089015116610140840152606088015161016084015282810360a0840152613d9d8188613243565b905082810360c0840152613db281868861394c565b915050610fcf60e083018473ffffffffffffffffffffffffffffffffffffffff169052565b606081526000613dea6060830186613243565b8281036020840152613dfc8186613243565b90508281036040840152613e108185613243565b9695505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61833603018112613e4e57600080fd5b9190910192915050565b601f821115610ec0576000816000526020600020601f850160051c81016020861015613e815750805b601f850160051c820191505b81811015613ea057828155600101613e8d565b505050505050565b67ffffffffffffffff831115613ec057613ec0613121565b613ed483613ece83546138e9565b83613e58565b6000601f841160018114613f265760008515613ef05750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355611c40565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015613f755786850135825560209485019460019092019101613f55565b5086821015613fb0577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613ff757600080fd5b830160208101925035905067ffffffffffffffff81111561401757600080fd5b80360382131561331957600080fd5b60208082528181018390526000906040808401600586901b850182018785805b8981101561412f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc089850301855282357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff618c36030181126140a6578283fd5b8b0160a063ffffffff6140b883613413565b1686526140c789830183613fc2565b828b8901526140d9838901828461394c565b925050506140e988830183613fc2565b8783038a8901526140fb83828461394c565b92505050606061ffff61410f8285016137a9565b169087015260809182013591909501529386019391860191600101614046565b50919998505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600067ffffffffffffffff80831681810361418a5761418a61413e565b6001019392505050565b600067ffffffffffffffff8216806141ae576141ae61413e565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161420e81601785016020880161321f565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161424b81602884016020880161321f565b01602801949350505050565b602081526000612b2d6020830184613243565b60408152600061427d6040830185613243565b828103602084015261428f8185613243565b95945050505050565b6060815260006142ab6060830186613243565b905083602083015267ffffffffffffffff83166040830152949350505050565b838152826020820152600082516142e981604085016020870161321f565b91909101604001949350505050565b808202811582820484141761083e5761083e61413e565b8082018082111561083e5761083e61413e565b6000816143315761433161413e565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b6000808585111561436757600080fd5b8386111561437457600080fd5b5050820193919092039150565b7fffffffff0000000000000000000000000000000000000000000000000000000081358181169160048510156143c15780818660040360031b1b83161692505b505092915050565b8035602083101561083e577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b60008251613e4e81846020870161321f56fea264697066735822122098045e2a27b0abbb0a2d6bfa13ea35ffec5f32cb48745a42ae1db161b8269afd64736f6c6343000816003300000000000000000000000000000000000000000000000000000000000000400000000000000000000000004f4495243837681061c4743b74b3eedf548d56a500000000000000000000000000000000000000000000000000000000000000010000000000000000000000009f403140bc0574d7d36ea472b82daa1bbd4ef327

Deployed Bytecode

0x6080604052600436106102015760003560e01c8063491606581161011d5780639e944965116100b0578063c416aa511161007f578063cd88b90311610064578063cd88b903146106dd578063d2ae2104146106fd578063d547741f1461075057600080fd5b8063c416aa511461068b578063c7b2370b146106bd57600080fd5b80639e94496514610606578063a217fddf14610636578063af896a3b1461064b578063c358de0a1461066b57600080fd5b8063724e78da116100ec578063724e78da14610555578063741bef1a1461057557806391d14854146105a257806395d376d7146105f357600080fd5b806349160658146104c55780634cfa6d2c146104e557806351b6a0fd1461051d5780635c975abb1461053d57600080fd5b806316c38b3c116101955780632de11376116101645780632de11376146104455780632f2ff15d1461046557806330bb3aac1461048557806336568abe146104a557600080fd5b806316c38b3c1461039a5780631a98b2e0146103ba578063248a9ca3146103da57806326e67a371461041857600080fd5b80631095b6d7116101d15780631095b6d7146102d3578063116191b6146102f3578063127124171461034c578063143b165f1461036c57600080fd5b8062bf2e801461020d57806301e336671461026157806301ffc9a71461028357806302d6e8b0146102b357600080fd5b3661020857005b600080fd5b34801561021957600080fd5b50600154610249907d010000000000000000000000000000000000000000000000000000000000900461ffff1681565b60405161ffff90911681526020015b60405180910390f35b34801561026d57600080fd5b5061028161027c366004613013565b610770565b005b34801561028f57600080fd5b506102a361029e36600461304f565b6107ab565b6040519015158152602001610258565b3480156102bf57600080fd5b506102816102ce366004613091565b610844565b3480156102df57600080fd5b506102816102ee366004613013565b61091f565b3480156102ff57600080fd5b506103277f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a581565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610258565b34801561035857600080fd5b50610281610367366004613106565b610aae565b34801561037857600080fd5b5061038c610387366004613150565b610b31565b60405161025892919061328d565b3480156103a657600080fd5b506102816103b53660046132ba565b610be8565b3480156103c657600080fd5b506102816103d5366004613320565b610c0d565b3480156103e657600080fd5b5061040a6103f53660046133fa565b60009081526020819052604090206001015490565b604051908152602001610258565b34801561042457600080fd5b50610438610433366004613427565b610d2f565b6040516102589190613442565b34801561045157600080fd5b506102a3610460366004613106565b610db6565b34801561047157600080fd5b50610281610480366004613489565b610e9b565b34801561049157600080fd5b5061040a6104a03660046134cd565b610ec5565b3480156104b157600080fd5b506102816104c0366004613489565b610fda565b3480156104d157600080fd5b506102816104e0366004613543565b61100c565b3480156104f157600080fd5b5061040a6105003660046135e7565b600460209081526000928352604080842090915290825290205481565b34801561052957600080fd5b50610281610538366004613611565b611133565b34801561054957600080fd5b5060015460ff166102a3565b34801561056157600080fd5b50610281610570366004613106565b61121d565b34801561058157600080fd5b506002546103279073ffffffffffffffffffffffffffffffffffffffff1681565b3480156105ae57600080fd5b506102a36105bd366004613489565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b61040a610601366004613674565b6112c2565b34801561061257600080fd5b50610626610621366004613427565b611710565b60405161025894939291906136e5565b34801561064257600080fd5b5061040a600081565b34801561065757600080fd5b50610281610666366004613767565b61184d565b34801561067757600080fd5b506102816106863660046137bb565b611aa4565b34801561069757600080fd5b5060015461032790610100900473ffffffffffffffffffffffffffffffffffffffff1681565b3480156106c957600080fd5b506102816106d8366004613106565b611b52565b3480156106e957600080fd5b506102816106f83660046137d6565b611bf6565b34801561070957600080fd5b50600154610737907501000000000000000000000000000000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610258565b34801561075c57600080fd5b5061028161076b366004613489565b611c47565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561079a81611c6c565b6107a5848484611c76565b50505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061083e57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561086e81611c6c565b60005b828110156108e0573684848381811061088c5761088c61381c565b90506040020190508060200135600660006175308460000160208101906108b39190613427565b6108bd919061384b565b63ffffffff16815260208101919091526040016000206003015550600101610871565b507fd6dac4a884ac5f80781f154f28ed88464b2097f6b866143bb77e46736572136a8383604051610912929190613895565b60405180910390a1505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561094981611c6c565b73ffffffffffffffffffffffffffffffffffffffff841660009081527f9b50f4667d2d24216ccbf0dce3a90c0f620fa4d895e7b069d80ff6247fd25620602052604090205460ff166109c7576040517f5ee08b9700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517ffd9be52200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820184905285169063fd9be52290604401600060405180830381600087803b158015610a3757600080fd5b505af1158015610a4b573d6000803e3d6000fd5b50506040805173ffffffffffffffffffffffffffffffffffffffff8089168252871660208201529081018590527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9250606001905060405180910390a150505050565b600154610100900473ffffffffffffffffffffffffffffffffffffffff163314610b04576040517f611136c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b2e8160018054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611ca6565b50565b80516020818301810180516005825292820191909301209152805460018201805463ffffffff9092169291610b65906138e9565b80601f0160208091040260200160405190810160405280929190818152602001828054610b91906138e9565b8015610bde5780601f10610bb357610100808354040283529160200191610bde565b820191906000526020600020905b815481529060010190602001808311610bc157829003601f168201915b5050505050905082565b6000610bf381611c6c565b8115610c0557610c01611e1d565b5050565b610c01611e9c565b60008585604051610c1f92919061393c565b6040519081900381207f1876eed9000000000000000000000000000000000000000000000000000000008252915073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a51690631876eed990610ca9908e908e908e908e908e9089908d908d908d90600401613995565b6020604051808303816000875af1158015610cc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cec91906139f4565b610d22576040517f500c44b400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050505050505050565b63ffffffff8116600090815260036020908152604091829020805483518184028101840190945280845260609392830182828015610daa57602002820191906000526020600020906000905b825461010083900a900460ff16815260206001928301818104948501949093039092029101808411610d7b5790505b50505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff811660009081527f93c430521711328044ae92d0f1f1286cf040bc4a382f1642bd89984e86630553602052604081205460ff1615610e0b57506000919050565b6001547501000000000000000000000000000000000000000000900467ffffffffffffffff161580610e81575073ffffffffffffffffffffffffffffffffffffffff821660009081527f4ac82e3087b7dedf7f532cbc6915c722df8c1e31f1388c318a617b52760eaf8b602052604090205460ff165b15610e8e57506001919050565b506000919050565b919050565b600082815260208190526040902060010154610eb681611c6c565b610ec08383611ef3565b505050565b6040805160808101825263ffffffff8716815267ffffffffffffffff8616602082015273ffffffffffffffffffffffffffffffffffffffff8086169282019290925260015461ffff7d01000000000000000000000000000000000000000000000000000000000082041660608301526000926101009091041663f0b81bb482600685610f536175308d61384b565b63ffffffff1663ffffffff16815260200190815260200160002087876040518563ffffffff1660e01b8152600401610f8e9493929190613aac565b602060405180830381865afa158015610fab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcf9190613b7c565b979650505050505050565b6040517fdec9f03100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828260405161101e92919061393c565b6040519081900381207f5f6970c3000000000000000000000000000000000000000000000000000000008252915073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a51690635f6970c3906110a2908b908b908b908b908b908990600401613b95565b6020604051808303816000875af11580156110c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e591906139f4565b61111b576040517f500c44b400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611129878787878787611fb9565b5050505050505050565b600061113e81611c6c565b60005b828110156111eb573684848381811061115c5761115c61381c565b6060029190910191505060408101356004600061117c6020850185613106565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360200160208101906111cb9190613427565b63ffffffff16815260208101919091526040016000205550600101611141565b507f360a0efdea8fcc9a11ee20a2099e314ddcf49a941d66790cd4e5adea30faa0748383604051610912929190613bd6565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561124781611c6c565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040519081527ff724a45d041687842411f2b977ef22ab8f43c8f1104f4592b42a00f9b34a643d906020015b60405180910390a15050565b60006112d460a0850160808601613106565b6112dd81610db6565b611313576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061132b336113266020890189613427565b612113565b60408051608081019091529091506000908061134a60208a018a613427565b63ffffffff16815260200161136560808a0160608b01613c44565b67ffffffffffffffff16815260200161138460a08a0160808b01613106565b73ffffffffffffffffffffffffffffffffffffffff1681526001547d010000000000000000000000000000000000000000000000000000000000900461ffff166020918201529091506000906006908290617530906113e5908c018c613427565b6113ef919061384b565b63ffffffff1663ffffffff168152602001908152602001600020604051806080016040529081600082018054611424906138e9565b80601f0160208091040260200160405190810160405280929190818152602001828054611450906138e9565b801561149d5780601f106114725761010080835404028352916020019161149d565b820191906000526020600020905b81548152906001019060200180831161148057829003601f168201915b505050505081526020016001820180546114b6906138e9565b80601f01602080910402602001604051908101604052809291908181526020018280546114e2906138e9565b801561152f5780601f106115045761010080835404028352916020019161152f565b820191906000526020600020905b81548152906001019060200180831161151257829003601f168201915b5050509183525050600282015461ffff166020808301919091526003909201546040909101529091506000906115ab90859061156d908c018c613c5f565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050505060408c01356121aa565b6001546040517fd135ca93000000000000000000000000000000000000000000000000000000008152919250610100900473ffffffffffffffffffffffffffffffffffffffff169063d135ca9390611611908690869086908e908e903390600401613cc4565b6020604051808303816000875af1158015611630573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116549190613b7c565b825160208401516040517f1c92115f00000000000000000000000000000000000000000000000000000000815292985073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a51692631c92115f926116d29290918690600401613dd7565b600060405180830381600087803b1580156116ec57600080fd5b505af1158015611700573d6000803e3d6000fd5b5050505050505050509392505050565b60066020526000908152604090208054819061172b906138e9565b80601f0160208091040260200160405190810160405280929190818152602001828054611757906138e9565b80156117a45780601f10611779576101008083540402835291602001916117a4565b820191906000526020600020905b81548152906001019060200180831161178757829003601f168201915b5050505050908060010180546117b9906138e9565b80601f01602080910402602001604051908101604052809291908181526020018280546117e5906138e9565b80156118325780601f1061180757610100808354040283529160200191611832565b820191906000526020600020905b81548152906001019060200180831161181557829003601f168201915b505050506002830154600390930154919261ffff1691905084565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561187781611c6c565b60005b82811015611a7257368484838181106118955761189561381c565b90506020028101906118a79190613e1a565b905060006175306118bb6020840184613427565b6118c5919061384b565b63ffffffff811660009081526006602052604090208054919250906118e9906138e9565b9050600003611a01576118ff6020830183613c5f565b63ffffffff8316600090815260066020526040902091611920919083613ea8565b5061192e6040830183613c5f565b63ffffffff8316600090815260066020526040902060010191611952919083613ea8565b508060056119636020850185613c5f565b60405161197192919061393c565b9081526040805191829003602001909120805463ffffffff939093167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000909316929092179091556119c490830183613c5f565b60056119d36020860186613c5f565b6040516119e192919061393c565b908152602001604051809103902060010191826119ff929190613ea8565b505b611a1160808301606084016137bb565b63ffffffff9190911660009081526006602052604090206002810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff909316929092179091556080919091013560039091015560010161187a565b507f53ede267f8a00cf87be90c85641900454b96a922b10a82a0d5f5b4d93b16b38a8383604051610912929190614026565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611ace81611c6c565b600180547fff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167d01000000000000000000000000000000000000000000000000000000000061ffff8516908102919091179091556040519081527f7af0ac740036ffb1c97b03697859d729e80a44ae5030543d64971c313565ab4d906020016112b6565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611b7c81611c6c565b600180547fffffffffffffffffffffff0000000000000000000000000000000000000000ff1661010073ffffffffffffffffffffffffffffffffffffffff8516908102919091179091556040519081527f1399be28223800f8669b3ba5f8721d9fc16fc4e8d0bbf98378791c8c5a3015e0906020016112b6565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611c2081611c6c565b63ffffffff84166000908152600360205260409020611c40908484612f31565b5050505050565b600082815260208190526040902060010154611c6281611c6c565b610ec083836121bf565b610b2e8133612284565b73ffffffffffffffffffffffffffffffffffffffff8316611c9b57610ec0828261233c565b610ec0838383612442565b6040517ffaaebd2100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff84169063faaebd2190602401602060405180830381865afa158015611d13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d379190613b7c565b90508015610ec0576040517ffd9be52200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063fd9be52290604401600060405180830381600087803b158015611daf57600080fd5b505af1158015611dc3573d6000803e3d6000fd5b50506040805173ffffffffffffffffffffffffffffffffffffffff8088168252861660208201529081018490527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb92506060019050610912565b611e256124b0565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b611ea461251f565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33611e72565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca82148015611f50575060008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16155b15611faf5760018054601590611f88907501000000000000000000000000000000000000000000900467ffffffffffffffff1661416d565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b610c01828261258b565b600060058787604051611fcd92919061393c565b908152604080519182900360209081018320838301909252815463ffffffff16835260018201805491840191612002906138e9565b80601f016020809104026020016040519081016040528092919081815260200182805461202e906138e9565b801561207b5780601f106120505761010080835404028352916020019161207b565b820191906000526020600020905b81548152906001019060200180831161205e57829003601f168201915b50505050508152505090506120fd87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b018190048102820181019092528981529250899150889081908401838280828437600092019190915250505050602084015161267b565b805161210a9084846126c6565b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260046020908152604080832063ffffffff851684529091529020548061083e576040517ff25127e600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015263ffffffff831660248201526044015b60405180910390fd5b60606121b78484846127e5565b949350505050565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca8214801561221b575060008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff165b1561227a5760018054601590612253907501000000000000000000000000000000000000000000900467ffffffffffffffff16614194565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b610c018282612814565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610c01576122c2816128cb565b6122cd8360206128ea565b6040516020016122de9291906141d6565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526121a191600401614257565b73ffffffffffffffffffffffffffffffffffffffff8216612389576040517f6b7a931000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146123e3576040519150601f19603f3d011682016040523d82523d6000602084013e6123e8565b606091505b5050905080610ec0576040517f465bc83400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602481018390526044016121a1565b73ffffffffffffffffffffffffffffffffffffffff821661248f576040517f6b7a931000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ec073ffffffffffffffffffffffffffffffffffffffff84168383612b34565b60015460ff161561251d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016121a1565b565b60015460ff1661251d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016121a1565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610c015760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561261d3390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b8080519060200120828051906020012014610ec05782826040517f5cc0c62a0000000000000000000000000000000000000000000000000000000081526004016121a192919061426a565b8263ffffffff166175306126da8484612bc1565b6126e4919061384b565b63ffffffff1614612751576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f44564e41646170746572426173653a20696e76616c696420737263456964000060448201526064016121a1565b60008060006127608585612bf2565b9250925092508273ffffffffffffffffffffffffffffffffffffffff16630223536e838367ffffffffffffffff6040518463ffffffff1660e01b81526004016127ab93929190614298565b600060405180830381600087803b1580156127c557600080fd5b505af11580156127d9573d6000803e3d6000fd5b50505050505050505050565b60608382846040516020016127fc939291906142cb565b60405160208183030381529060405290509392505050565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610c015760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b606061083e73ffffffffffffffffffffffffffffffffffffffff831660145b606060006128f98360026142f8565b61290490600261430f565b67ffffffffffffffff81111561291c5761291c613121565b6040519080825280601f01601f191660200182016040528015612946576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061297d5761297d61381c565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106129e0576129e061381c565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000612a1c8460026142f8565b612a2790600161430f565b90505b6001811115612ac4577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612a6857612a6861381c565b1a60f81b828281518110612a7e57612a7e61381c565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93612abd81614322565b9050612a2a565b508315612b2d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016121a1565b9392505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610ec0908490612cc1565b600082604983612bd282600461430f565b92612bdf93929190614357565b612be891614381565b60e01c9392505050565b6000606081612c036051604061430f565b8414612c3b576040517ff1d10e0d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612c58612c4c602060008789614357565b612c55916143c9565b90565b9250612c68604060208688614357565b612c71916143c9565b9050612c808460408188614357565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509598929750929550909350505050565b6000612d23826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612dd09092919063ffffffff16565b9050805160001480612d44575080806020019051810190612d4491906139f4565b610ec0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016121a1565b60606121b78484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051612e049190614405565b60006040518083038185875af1925050503d8060008114612e41576040519150601f19603f3d011682016040523d82523d6000602084013e612e46565b606091505b5091509150610fcf8783838760608315612ee8578251600003612ee15773ffffffffffffffffffffffffffffffffffffffff85163b612ee1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016121a1565b50816121b7565b6121b78383815115612efd5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a19190614257565b82805482825590600052602060002090601f01602090048101928215612fca5791602002820160005b83821115612f9b57833560ff1683826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302612f5a565b8015612fc85782816101000a81549060ff0219169055600101602081600001049283019260010302612f9b565b505b50612fd6929150612fda565b5090565b5b80821115612fd65760008155600101612fdb565b803573ffffffffffffffffffffffffffffffffffffffff81168114610e9657600080fd5b60008060006060848603121561302857600080fd5b61303184612fef565b925061303f60208501612fef565b9150604084013590509250925092565b60006020828403121561306157600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114612b2d57600080fd5b600080602083850312156130a457600080fd5b823567ffffffffffffffff808211156130bc57600080fd5b818501915085601f8301126130d057600080fd5b8135818111156130df57600080fd5b8660208260061b85010111156130f457600080fd5b60209290920196919550909350505050565b60006020828403121561311857600080fd5b612b2d82612fef565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561316257600080fd5b813567ffffffffffffffff8082111561317a57600080fd5b818401915084601f83011261318e57600080fd5b8135818111156131a0576131a0613121565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156131e6576131e6613121565b816040528281528760208487010111156131ff57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b8381101561323a578181015183820152602001613222565b50506000910152565b6000815180845261325b81602086016020860161321f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b63ffffffff831681526040602082015260006121b76040830184613243565b8015158114610b2e57600080fd5b6000602082840312156132cc57600080fd5b8135612b2d816132ac565b60008083601f8401126132e957600080fd5b50813567ffffffffffffffff81111561330157600080fd5b60208301915083602082850101111561331957600080fd5b9250929050565b60008060008060008060008060008060c08b8d03121561333f57600080fd5b8a35995060208b013567ffffffffffffffff8082111561335e57600080fd5b61336a8e838f016132d7565b909b50995060408d013591508082111561338357600080fd5b61338f8e838f016132d7565b909950975060608d01359150808211156133a857600080fd5b6133b48e838f016132d7565b909750955060808d01359150808211156133cd57600080fd5b506133da8d828e016132d7565b9150809450508092505060a08b013590509295989b9194979a5092959850565b60006020828403121561340c57600080fd5b5035919050565b803563ffffffff81168114610e9657600080fd5b60006020828403121561343957600080fd5b612b2d82613413565b6020808252825182820181905260009190848201906040850190845b8181101561347d57835160ff168352928401929184019160010161345e565b50909695505050505050565b6000806040838503121561349c57600080fd5b823591506134ac60208401612fef565b90509250929050565b803567ffffffffffffffff81168114610e9657600080fd5b6000806000806000608086880312156134e557600080fd5b6134ee86613413565b94506134fc602087016134b5565b935061350a60408701612fef565b9250606086013567ffffffffffffffff81111561352657600080fd5b613532888289016132d7565b969995985093965092949392505050565b60008060008060008060006080888a03121561355e57600080fd5b87359650602088013567ffffffffffffffff8082111561357d57600080fd5b6135898b838c016132d7565b909850965060408a01359150808211156135a257600080fd5b6135ae8b838c016132d7565b909650945060608a01359150808211156135c757600080fd5b506135d48a828b016132d7565b989b979a50959850939692959293505050565b600080604083850312156135fa57600080fd5b61360383612fef565b91506134ac60208401613413565b6000806020838503121561362457600080fd5b823567ffffffffffffffff8082111561363c57600080fd5b818501915085601f83011261365057600080fd5b81358181111561365f57600080fd5b8660206060830285010111156130f457600080fd5b60008060006040848603121561368957600080fd5b833567ffffffffffffffff808211156136a157600080fd5b9085019060a082880312156136b557600080fd5b909350602085013590808211156136cb57600080fd5b506136d8868287016132d7565b9497909650939450505050565b6080815260006136f86080830187613243565b828103602084015261370a8187613243565b61ffff95909516604084015250506060015292915050565b60008083601f84011261373457600080fd5b50813567ffffffffffffffff81111561374c57600080fd5b6020830191508360208260051b850101111561331957600080fd5b6000806020838503121561377a57600080fd5b823567ffffffffffffffff81111561379157600080fd5b61379d85828601613722565b90969095509350505050565b803561ffff81168114610e9657600080fd5b6000602082840312156137cd57600080fd5b612b2d826137a9565b6000806000604084860312156137eb57600080fd5b6137f484613413565b9250602084013567ffffffffffffffff81111561381057600080fd5b6136d886828701613722565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600063ffffffff80841680613889577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b92169190910692915050565b6020808252818101839052600090604080840186845b878110156138dc5763ffffffff6138c183613413565b168352818501358584015291830191908301906001016138ab565b5090979650505050505050565b600181811c908216806138fd57607f821691505b602082108103613936577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b8183823760009101908152919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b89815260c0602082015260006139af60c083018a8c61394c565b82810360408401526139c281898b61394c565b905086606084015282810360808401526139dd81868861394c565b9150508260a08301529a9950505050505050505050565b600060208284031215613a0657600080fd5b8151612b2d816132ac565b60008154613a1e816138e9565b808552602060018381168015613a3b5760018114613a7357613aa1565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008516838901528284151560051b8901019550613aa1565b866000528260002060005b85811015613a995781548a8201860152908301908401613a7e565b890184019650505b505050505092915050565b845163ffffffff16815260208086015167ffffffffffffffff169082015260408086015173ffffffffffffffffffffffffffffffffffffffff169082015260608086015161ffff169082015260c06080820152608060c08201526000613b16610140830186613a11565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff408382030160e0840152613b4d8160018801613a11565b905061ffff600287015416610100840152600386015461012084015282810360a0840152610fcf81858761394c565b600060208284031215613b8e57600080fd5b5051919050565b868152608060208201526000613baf60808301878961394c565b8281036040840152613bc281868861394c565b915050826060830152979650505050505050565b6020808252818101839052600090604080840186845b878110156138dc5773ffffffffffffffffffffffffffffffffffffffff613c1283612fef565b16835263ffffffff613c25868401613413565b1683860152818401358484015260609283019290910190600101613bec565b600060208284031215613c5657600080fd5b612b2d826134b5565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613c9457600080fd5b83018035915067ffffffffffffffff821115613caf57600080fd5b60200191503681900382131561331957600080fd5b865163ffffffff16815260208088015167ffffffffffffffff169082015260408088015173ffffffffffffffffffffffffffffffffffffffff169082015260608088015161ffff169082015260006101008060808401528751608082850152613d31610180850182613243565b91505060208801517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0084830301610120850152613d6e8282613243565b91505061ffff604089015116610140840152606088015161016084015282810360a0840152613d9d8188613243565b905082810360c0840152613db281868861394c565b915050610fcf60e083018473ffffffffffffffffffffffffffffffffffffffff169052565b606081526000613dea6060830186613243565b8281036020840152613dfc8186613243565b90508281036040840152613e108185613243565b9695505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61833603018112613e4e57600080fd5b9190910192915050565b601f821115610ec0576000816000526020600020601f850160051c81016020861015613e815750805b601f850160051c820191505b81811015613ea057828155600101613e8d565b505050505050565b67ffffffffffffffff831115613ec057613ec0613121565b613ed483613ece83546138e9565b83613e58565b6000601f841160018114613f265760008515613ef05750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355611c40565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015613f755786850135825560209485019460019092019101613f55565b5086821015613fb0577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613ff757600080fd5b830160208101925035905067ffffffffffffffff81111561401757600080fd5b80360382131561331957600080fd5b60208082528181018390526000906040808401600586901b850182018785805b8981101561412f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc089850301855282357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff618c36030181126140a6578283fd5b8b0160a063ffffffff6140b883613413565b1686526140c789830183613fc2565b828b8901526140d9838901828461394c565b925050506140e988830183613fc2565b8783038a8901526140fb83828461394c565b92505050606061ffff61410f8285016137a9565b169087015260809182013591909501529386019391860191600101614046565b50919998505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600067ffffffffffffffff80831681810361418a5761418a61413e565b6001019392505050565b600067ffffffffffffffff8216806141ae576141ae61413e565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161420e81601785016020880161321f565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161424b81602884016020880161321f565b01602801949350505050565b602081526000612b2d6020830184613243565b60408152600061427d6040830185613243565b828103602084015261428f8185613243565b95945050505050565b6060815260006142ab6060830186613243565b905083602083015267ffffffffffffffff83166040830152949350505050565b838152826020820152600082516142e981604085016020870161321f565b91909101604001949350505050565b808202811582820484141761083e5761083e61413e565b8082018082111561083e5761083e61413e565b6000816143315761433161413e565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b6000808585111561436757600080fd5b8386111561437457600080fd5b5050820193919092039150565b7fffffffff0000000000000000000000000000000000000000000000000000000081358181169160048510156143c15780818660040360031b1b83161692505b505092915050565b8035602083101561083e577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b60008251613e4e81846020870161321f56fea264697066735822122098045e2a27b0abbb0a2d6bfa13ea35ffec5f32cb48745a42ae1db161b8269afd64736f6c63430008160033

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

00000000000000000000000000000000000000000000000000000000000000400000000000000000000000004f4495243837681061c4743b74b3eedf548d56a500000000000000000000000000000000000000000000000000000000000000010000000000000000000000009f403140bc0574d7d36ea472b82daa1bbd4ef327

-----Decoded View---------------
Arg [0] : _admins (address[]): 0x9F403140Bc0574D7d36eA472b82DAa1Bbd4eF327
Arg [1] : _gateway (address): 0x4F4495243837681061C4743b74B3eEdf548D56A5

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a5
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [3] : 0000000000000000000000009f403140bc0574d7d36ea472b82daa1bbd4ef327


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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