{"file_path":"contracts/uln/dvn/DVN.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { ILayerZeroUltraLightNodeV2 } from \"@layerzerolabs/lz-evm-v1-0.7/contracts/interfaces/ILayerZeroUltraLightNodeV2.sol\";\n\nimport { Worker } from \"../../Worker.sol\";\nimport { MultiSig } from \"./MultiSig.sol\";\nimport { ReadLib1002 } from \"../readlib/ReadLib1002.sol\";\nimport { IDVN } from \"../interfaces/IDVN.sol\";\nimport { IDVNFeeLib } from \"../interfaces/IDVNFeeLib.sol\";\nimport { IReceiveUlnE2 } from \"../interfaces/IReceiveUlnE2.sol\";\n\nstruct ExecuteParam {\n    uint32 vid;\n    address target;\n    bytes callData;\n    uint256 expiration;\n    bytes signatures;\n}\n\ncontract DVN is Worker, MultiSig, IDVN {\n    // to uniquely identify this DVN instance\n    // set to endpoint v1 eid if available OR endpoint v2 eid % 30_000\n    uint32 public immutable vid;\n    uint32 public immutable localEidV2; // endpoint-v2 only, for read call\n\n    mapping(uint32 dstEid => DstConfig) public dstConfig;\n    mapping(bytes32 executableHash => bool used) public usedHashes;\n\n    error DVN_OnlySelf();\n    error DVN_InvalidRole(bytes32 role);\n    error DVN_InstructionExpired();\n    error DVN_InvalidTarget(address target);\n    error DVN_InvalidVid(uint32 vid);\n    error DVN_InvalidSignatures();\n    error DVN_DuplicatedHash(bytes32 executableHash);\n\n    event VerifySignaturesFailed(uint256 idx);\n    event ExecuteFailed(uint256 _index, bytes _data);\n    event HashAlreadyUsed(ExecuteParam param, bytes32 _hash);\n    // same as DVNFeePaid, but for ULNv2\n    event VerifierFeePaid(uint256 fee);\n\n    // ========================= Constructor =========================\n\n    /// @dev DVN doesn't have a roleAdmin (address(0x0))\n    /// @dev Supports all of ULNv2, ULN301, ULN302 and more\n    /// @param _localEidV2 local endpoint-v2 eid\n    /// @param _vid unique identifier for this DVN instance\n    /// @param _messageLibs array of message lib addresses that are granted the MESSAGE_LIB_ROLE\n    /// @param _priceFeed price feed address\n    /// @param _signers array of signer addresses for multisig\n    /// @param _quorum quorum for multisig\n    /// @param _admins array of admin addresses that are granted the ADMIN_ROLE\n    constructor(\n        uint32 _localEidV2,\n        uint32 _vid,\n        address[] memory _messageLibs,\n        address _priceFeed,\n        address[] memory _signers,\n        uint64 _quorum,\n        address[] memory _admins\n    ) Worker(_messageLibs, _priceFeed, 12000, address(0x0), _admins) MultiSig(_signers, _quorum) {\n        vid = _vid;\n        localEidV2 = _localEidV2;\n    }\n\n    // ========================= Modifier =========================\n\n    /// @dev depending on role, restrict access to only self or admin\n    /// @dev ALLOWLIST, DENYLIST, MESSAGE_LIB_ROLE can only be granted/revoked by self\n    /// @dev ADMIN_ROLE can only be granted/revoked by admin\n    /// @dev reverts if not one of the above roles\n    /// @param _role role to check\n    modifier onlySelfOrAdmin(bytes32 _role) {\n        if (_role == ALLOWLIST || _role == DENYLIST || _role == MESSAGE_LIB_ROLE) {\n            // self required\n            if (address(this) != msg.sender) {\n                revert DVN_OnlySelf();\n            }\n        } else if (_role == ADMIN_ROLE) {\n            // admin required\n            _checkRole(ADMIN_ROLE);\n        } else {\n            revert DVN_InvalidRole(_role);\n        }\n        _;\n    }\n\n    modifier onlySelf() {\n        if (address(this) != msg.sender) {\n            revert DVN_OnlySelf();\n        }\n        _;\n    }\n\n    // ========================= OnlySelf =========================\n\n    /// @dev set signers for multisig\n    /// @dev function sig 0x31cb6105\n    /// @param _signer signer address\n    /// @param _active true to add, false to remove\n    function setSigner(address _signer, bool _active) external onlySelf {\n        _setSigner(_signer, _active);\n    }\n\n    /// @dev set quorum for multisig\n    /// @dev function sig 0x8585c945\n    /// @param _quorum to set\n    function setQuorum(uint64 _quorum) external onlySelf {\n        _setQuorum(_quorum);\n    }\n\n    // ========================= OnlySelf / OnlyAdmin =========================\n\n    /// @dev overrides AccessControl to allow self/admin to grant role'\n    /// @dev function sig 0x2f2ff15d\n    /// @param _role role to grant\n    /// @param _account account to grant role to\n    function grantRole(bytes32 _role, address _account) public override onlySelfOrAdmin(_role) {\n        _grantRole(_role, _account);\n    }\n\n    /// @dev overrides AccessControl to allow self/admin to revoke role\n    /// @dev function sig 0xd547741f\n    /// @param _role role to revoke\n    /// @param _account account to revoke role from\n    function revokeRole(bytes32 _role, address _account) public override onlySelfOrAdmin(_role) {\n        _revokeRole(_role, _account);\n    }\n\n    // ========================= OnlyQuorum =========================\n\n    /// @notice function for quorum to change admin without going through execute function\n    /// @dev calldata in the case is abi.encode new admin address\n    function quorumChangeAdmin(ExecuteParam calldata _param) external {\n        if (_param.expiration <= block.timestamp) {\n            revert DVN_InstructionExpired();\n        }\n        if (_param.target != address(this)) {\n            revert DVN_InvalidTarget(_param.target);\n        }\n        if (_param.vid != vid) {\n            revert DVN_InvalidVid(_param.vid);\n        }\n\n        // generate and validate hash\n        bytes32 hash = hashCallData(_param.vid, _param.target, _param.callData, _param.expiration);\n        (bool sigsValid, ) = verifySignatures(hash, _param.signatures);\n        if (!sigsValid) {\n            revert DVN_InvalidSignatures();\n        }\n        if (usedHashes[hash]) {\n            revert DVN_DuplicatedHash(hash);\n        }\n\n        usedHashes[hash] = true;\n        _grantRole(ADMIN_ROLE, abi.decode(_param.callData, (address)));\n    }\n\n    // ========================= OnlyAdmin =========================\n\n    /// @param _params array of DstConfigParam\n    function setDstConfig(DstConfigParam[] calldata _params) external onlyRole(ADMIN_ROLE) {\n        for (uint256 i = 0; i < _params.length; ++i) {\n            DstConfigParam calldata param = _params[i];\n            dstConfig[param.dstEid] = DstConfig(param.gas, param.multiplierBps, param.floorMarginUSD);\n        }\n        emit SetDstConfig(_params);\n    }\n\n    /// @dev takes a list of instructions and executes them in order\n    /// @dev if any of the instructions fail, it will emit an error event and continue to execute the rest of the instructions\n    /// @param _params array of ExecuteParam, includes target, callData, expiration, signatures\n    function execute(ExecuteParam[] calldata _params) external onlyRole(ADMIN_ROLE) {\n        for (uint256 i = 0; i < _params.length; ++i) {\n            ExecuteParam calldata param = _params[i];\n            // 1. skip if invalid vid\n            if (param.vid != vid) {\n                continue;\n            }\n\n            // 2. skip if expired\n            if (param.expiration <= block.timestamp) {\n                continue;\n            }\n\n            // generate and validate hash\n            bytes32 hash = hashCallData(param.vid, param.target, param.callData, param.expiration);\n\n            // 3. check signatures\n            (bool sigsValid, ) = verifySignatures(hash, param.signatures);\n            if (!sigsValid) {\n                emit VerifySignaturesFailed(i);\n                continue;\n            }\n\n            // 4. should check hash\n            bool shouldCheckHash = _shouldCheckHash(bytes4(param.callData));\n            if (shouldCheckHash) {\n                if (usedHashes[hash]) {\n                    emit HashAlreadyUsed(param, hash);\n                    continue;\n                } else {\n                    usedHashes[hash] = true; // prevent reentry and replay attack\n                }\n            }\n\n            (bool success, bytes memory rtnData) = param.target.call(param.callData);\n            if (!success) {\n                if (shouldCheckHash) {\n                    // need to unset the usedHash otherwise it cant be used\n                    usedHashes[hash] = false;\n                }\n                // emit an event in any case\n                emit ExecuteFailed(i, rtnData);\n            }\n        }\n    }\n\n    /// @dev to support ULNv2\n    /// @dev the withdrawFee function for ULN30X is built in the Worker contract\n    /// @param _lib message lib address\n    /// @param _to address to withdraw to\n    /// @param _amount amount to withdraw\n    function withdrawFeeFromUlnV2(address _lib, address payable _to, uint256 _amount) external onlyRole(ADMIN_ROLE) {\n        if (!hasRole(MESSAGE_LIB_ROLE, _lib)) {\n            revert Worker_OnlyMessageLib();\n        }\n        ILayerZeroUltraLightNodeV2(_lib).withdrawNative(_to, _amount);\n    }\n\n    // ========================= OnlyMessageLib =========================\n\n    /// @dev for ULN301, ULN302 and more to assign job\n    /// @dev dvn network can reject job from _sender by adding/removing them from allowlist/denylist\n    /// @param _param assign job param\n    /// @param _options dvn options\n    function assignJob(\n        AssignJobParam calldata _param,\n        bytes calldata _options\n    ) external payable onlyRole(MESSAGE_LIB_ROLE) onlyAcl(_param.sender) returns (uint256 totalFee) {\n        IDVNFeeLib.FeeParams memory feeParams = IDVNFeeLib.FeeParams(\n            priceFeed,\n            _param.dstEid,\n            _param.confirmations,\n            _param.sender,\n            quorum,\n            defaultMultiplierBps\n        );\n        totalFee = IDVNFeeLib(workerFeeLib).getFeeOnSend(feeParams, dstConfig[_param.dstEid], _options);\n    }\n\n    /// @dev to support ULNv2\n    /// @dev dvn network can reject job from _sender by adding/removing them from allowlist/denylist\n    /// @param _dstEid destination EndpointId\n    /// @param //_outboundProofType outbound proof type\n    /// @param _confirmations block confirmations\n    /// @param _sender message sender address\n    function assignJob(\n        uint16 _dstEid,\n        uint16 /*_outboundProofType*/,\n        uint64 _confirmations,\n        address _sender\n    ) external onlyRole(MESSAGE_LIB_ROLE) onlyAcl(_sender) returns (uint256 totalFee) {\n        IDVNFeeLib.FeeParams memory params = IDVNFeeLib.FeeParams(\n            priceFeed,\n            _dstEid,\n            _confirmations,\n            _sender,\n            quorum,\n            defaultMultiplierBps\n        );\n        // ULNV2 does not have dvn options\n        totalFee = IDVNFeeLib(workerFeeLib).getFeeOnSend(params, dstConfig[_dstEid], bytes(\"\"));\n        emit VerifierFeePaid(totalFee);\n    }\n\n    /// @dev to support ReadLib\n    // @param _packetHeader - version + nonce + path\n    // @param _cmd - the command to be executed to obtain the payload\n    // @param _options - options\n    function assignJob(\n        address _sender,\n        bytes calldata /*_packetHeader*/,\n        bytes calldata _cmd,\n        bytes calldata _options\n    ) external payable onlyRole(MESSAGE_LIB_ROLE) onlyAcl(_sender) returns (uint256 fee) {\n        IDVNFeeLib.FeeParamsForRead memory feeParams = IDVNFeeLib.FeeParamsForRead(\n            priceFeed,\n            _sender,\n            quorum,\n            defaultMultiplierBps\n        );\n        fee = IDVNFeeLib(workerFeeLib).getFeeOnSend(feeParams, dstConfig[localEidV2], _cmd, _options);\n    }\n\n    // ========================= View =========================\n\n    /// @dev getFee can revert if _sender doesn't pass ACL\n    /// @param _dstEid destination EndpointId\n    /// @param _confirmations block confirmations\n    /// @param _sender message sender address\n    /// @param _options dvn options\n    /// @return fee fee in native amount\n    function getFee(\n        uint32 _dstEid,\n        uint64 _confirmations,\n        address _sender,\n        bytes calldata _options\n    ) external view onlyAcl(_sender) returns (uint256 fee) {\n        IDVNFeeLib.FeeParams memory params = IDVNFeeLib.FeeParams(\n            priceFeed,\n            _dstEid,\n            _confirmations,\n            _sender,\n            quorum,\n            defaultMultiplierBps\n        );\n        fee = IDVNFeeLib(workerFeeLib).getFee(params, dstConfig[_dstEid], _options);\n    }\n\n    /// @dev to support ULNv2\n    /// @dev getFee can revert if _sender doesn't pass ACL\n    /// @param _dstEid destination EndpointId\n    /// @param //_outboundProofType outbound proof type\n    /// @param _confirmations block confirmations\n    /// @param _sender message sender address\n    function getFee(\n        uint16 _dstEid,\n        uint16 /*_outboundProofType*/,\n        uint64 _confirmations,\n        address _sender\n    ) public view onlyAcl(_sender) returns (uint256 fee) {\n        IDVNFeeLib.FeeParams memory params = IDVNFeeLib.FeeParams(\n            priceFeed,\n            _dstEid,\n            _confirmations,\n            _sender,\n            quorum,\n            defaultMultiplierBps\n        );\n        fee = IDVNFeeLib(workerFeeLib).getFee(params, dstConfig[_dstEid], bytes(\"\"));\n    }\n\n    /// @dev to support ReadLib\n    // @param _packetHeader - version + nonce + path\n    // @param _cmd - the command to be executed to obtain the payload\n    // @param _options - options\n    function getFee(\n        address _sender,\n        bytes calldata /*_packetHeader*/,\n        bytes calldata _cmd,\n        bytes calldata _options\n    ) external view onlyAcl(_sender) returns (uint256 fee) {\n        IDVNFeeLib.FeeParamsForRead memory feeParams = IDVNFeeLib.FeeParamsForRead(\n            priceFeed,\n            _sender,\n            quorum,\n            defaultMultiplierBps\n        );\n        fee = IDVNFeeLib(workerFeeLib).getFee(feeParams, dstConfig[localEidV2], _cmd, _options);\n    }\n\n    /// @param _target target address\n    /// @param _callData call data\n    /// @param _expiration expiration timestamp\n    /// @return hash of above\n    function hashCallData(\n        uint32 _vid,\n        address _target,\n        bytes calldata _callData,\n        uint256 _expiration\n    ) public pure returns (bytes32) {\n        return keccak256(abi.encodePacked(_vid, _target, _expiration, _callData));\n    }\n\n    // ========================= Internal =========================\n\n    /// @dev to save gas, we don't check hash for some functions (where replaying won't change the state)\n    /// @dev for example, some administrative functions like changing signers, the contract should check hash to double spending\n    /// @dev should ensure that all onlySelf functions have unique functionSig\n    /// @param _functionSig function signature\n    /// @return true if should check hash\n    function _shouldCheckHash(bytes4 _functionSig) internal pure returns (bool) {\n        // never check for these selectors to save gas\n        return\n            _functionSig != IReceiveUlnE2.verify.selector && // 0x0223536e, replaying won't change the state\n            _functionSig != ReadLib1002.verify.selector && // 0xab750e75, replaying won't change the state\n            _functionSig != ILayerZeroUltraLightNodeV2.updateHash.selector; // 0x704316e5, replaying will be revert at uln\n    }\n}\n","deployed_bytecode":"0x6080604052600436106102e65760003560e01c806394cf795e11610184578063cd88b903116100d6578063e395eb5c1161008a578063f42ed2ed11610064578063f42ed2ed146109e7578063fd62e750146109fa578063fdb9b0f114610a0f57600080fd5b8063e395eb5c14610973578063f010cb23146109a7578063f3b4ebd0146109c757600080fd5b8063d2ae2104116100bb578063d2ae2104146108f9578063d547741f14610933578063dafe0ccc1461095357600080fd5b8063cd88b90314610890578063cf34c768146108b057600080fd5b8063b143044b11610138578063c5e193cd11610112578063c5e193cd14610822578063c7a823e014610842578063c7b2370b1461087057600080fd5b8063b143044b146107b0578063c358de0a146107d0578063c416aa51146107f057600080fd5b80639e944965116101695780639e944965146106c6578063a217fddf1461076b578063aef18bf71461078057600080fd5b806394cf795e1461069157806395d376d7146106b357600080fd5b806331cb61051161023d578063724e78da116101f15780637df73e27116101cb5780637df73e27146106005780638585c9451461062057806391d148541461064057600080fd5b8063724e78da1461056e578063736c0d5b1461058e578063741bef1a146105ae57600080fd5b806352d3b8711161022257806352d3b871146105165780635553fb8e146105365780635c975abb1461055657600080fd5b806331cb6105146104d657806336568abe146104f657600080fd5b80631703a0181161029f5780632de11376116102795780632de11376146104765780632f2ff15d1461049657806330bb3aac146104b657600080fd5b80631703a018146103d1578063248a9ca31461040b57806326e67a371461044957600080fd5b806301ffc9a7116102d057806301ffc9a7146103615780631095b6d71461039157806316c38b3c146103b157600080fd5b8062bf2e80146102eb57806301e336671461033f575b600080fd5b3480156102f757600080fd5b50600154610327907d010000000000000000000000000000000000000000000000000000000000900461ffff1681565b60405161ffff90911681526020015b60405180910390f35b34801561034b57600080fd5b5061035f61035a366004613d67565b610a2f565b005b34801561036d57600080fd5b5061038161037c366004613da8565b610a6a565b6040519015158152602001610336565b34801561039d57600080fd5b5061035f6103ac366004613d67565b610b03565b3480156103bd57600080fd5b5061035f6103cc366004613df8565b610c93565b3480156103dd57600080fd5b506006546103f29067ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610336565b34801561041757600080fd5b5061043b610426366004613e15565b60009081526020819052604090206001015490565b604051908152602001610336565b34801561045557600080fd5b50610469610464366004613e42565b610cb8565b6040516103369190613e5d565b34801561048257600080fd5b50610381610491366004613ea4565b610d3f565b3480156104a257600080fd5b5061035f6104b1366004613ec1565b610e24565b3480156104c257600080fd5b5061043b6104d1366004613f4b565b610f78565b3480156104e257600080fd5b5061035f6104f1366004613fc3565b6110e3565b34801561050257600080fd5b5061035f610511366004613ec1565b611126565b34801561052257600080fd5b5061035f610531366004613ff1565b611158565b34801561054257600080fd5b5061043b610551366004614078565b611324565b34801561056257600080fd5b5060015460ff16610381565b34801561057a57600080fd5b5061035f610589366004613ea4565b61148f565b34801561059a57600080fd5b506103816105a9366004613ea4565b611534565b3480156105ba57600080fd5b506002546105db9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610336565b34801561060c57600080fd5b5061038161061b366004613ea4565b61153b565b34801561062c57600080fd5b5061035f61063b3660046140ce565b611548565b34801561064c57600080fd5b5061038161065b366004613ec1565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b34801561069d57600080fd5b506106a661158d565b60405161033691906140e9565b61043b6106c136600461414f565b61159e565b3480156106d257600080fd5b506107306106e1366004613e42565b60076020526000908152604090205467ffffffffffffffff81169068010000000000000000810461ffff16906a010000000000000000000090046fffffffffffffffffffffffffffffffff1683565b6040805167ffffffffffffffff909416845261ffff90921660208401526fffffffffffffffffffffffffffffffff1690820152606001610336565b34801561077757600080fd5b5061043b600081565b34801561078c57600080fd5b5061038161079b366004613e15565b60086020526000908152604090205460ff1681565b3480156107bc57600080fd5b5061035f6107cb3660046141fd565b61176e565b3480156107dc57600080fd5b5061035f6107eb36600461423f565b611a7e565b3480156107fc57600080fd5b506001546105db90610100900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561082e57600080fd5b5061043b61083d366004614078565b611b2c565b34801561084e57600080fd5b5061086261085d36600461425a565b611cfe565b6040516103369291906142c8565b34801561087c57600080fd5b5061035f61088b366004613ea4565b611ed6565b34801561089c57600080fd5b5061035f6108ab366004614315565b611f7a565b3480156108bc57600080fd5b506108e47f000000000000000000000000000000000000000000000000000000000000006581565b60405163ffffffff9091168152602001610336565b34801561090557600080fd5b506001546103f2907501000000000000000000000000000000000000000000900467ffffffffffffffff1681565b34801561093f57600080fd5b5061035f61094e366004613ec1565b611fcb565b34801561095f57600080fd5b5061035f61096e366004613d67565b6120e0565b34801561097f57600080fd5b506108e47f000000000000000000000000000000000000000000000000000000000000759581565b3480156109b357600080fd5b5061043b6109c236600461435b565b612216565b3480156109d357600080fd5b5061035f6109e23660046143c6565b612252565b61043b6109f53660046143fb565b6124c7565b348015610a0657600080fd5b5061043b612679565b348015610a1b57600080fd5b5061043b610a2a3660046143fb565b612685565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610a598161280a565b610a64848484612814565b50505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b000000000000000000000000000000000000000000000000000000001480610afd57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610b2d8161280a565b73ffffffffffffffffffffffffffffffffffffffff841660009081527f9b50f4667d2d24216ccbf0dce3a90c0f620fa4d895e7b069d80ff6247fd25620602052604090205460ff16610bab576040517f5ee08b9700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517ffd9be52200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820184905285169063fd9be52290604401600060405180830381600087803b158015610c1b57600080fd5b505af1158015610c2f573d6000803e3d6000fd5b50506040805173ffffffffffffffffffffffffffffffffffffffff8089168252871660208201529081018590527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb925060600190505b60405180910390a150505050565b6000610c9e8161280a565b8115610cb057610cac612844565b5050565b610cac6128c3565b63ffffffff8116600090815260036020908152604091829020805483518184028101840190945280845260609392830182828015610d3357602002820191906000526020600020906000905b825461010083900a900460ff16815260206001928301818104948501949093039092029101808411610d045790505b50505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff811660009081527f93c430521711328044ae92d0f1f1286cf040bc4a382f1642bd89984e86630553602052604081205460ff1615610d9457506000919050565b6001547501000000000000000000000000000000000000000000900467ffffffffffffffff161580610e0a575073ffffffffffffffffffffffffffffffffffffffff821660009081527f4ac82e3087b7dedf7f532cbc6915c722df8c1e31f1388c318a617b52760eaf8b602052604090205460ff165b15610e1757506001919050565b506000919050565b919050565b817f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca811480610e7257507f4270fae16c6d150d00e80b689daca99e8073b1838ff2b6063a37be9d851283e481145b80610e9c57507f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de81145b15610edf57303314610eda576040517ffaba723a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f69565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758103610f2f57610eda7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561280a565b6040517f94fdc372000000000000000000000000000000000000000000000000000000008152600481018290526024015b60405180910390fd5b610f73838361291a565b505050565b600083610f8481610d3f565b610fba576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160c08101825260025473ffffffffffffffffffffffffffffffffffffffff908116825263ffffffff8a16602080840182905267ffffffffffffffff808c16858701528a8416606086015260065416608085015260015461ffff7d01000000000000000000000000000000000000000000000000000000000082041660a0860152600092835260079091529084902093517f7bfa20a9000000000000000000000000000000000000000000000000000000008152929361010090910490911691637bfa20a991611096918591908a908a906004016144f1565b602060405180830381865afa1580156110b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d791906145be565b98975050505050505050565b30331461111c576040517ffaba723a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cac82826129e0565b6040517fdec9f03100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756111828161280a565b60005b828110156112e557368484838181106111a0576111a06145d7565b905060800201905060405180606001604052808260200160208101906111c691906140ce565b67ffffffffffffffff1681526020016111e5606084016040850161423f565b61ffff1681526020016111fe6080840160608501614626565b6fffffffffffffffffffffffffffffffff169052600760006112236020850185613e42565b63ffffffff1681526020808201929092526040908101600020835181549385015194909201516fffffffffffffffffffffffffffffffff166a0100000000000000000000027fffffffffffff00000000000000000000000000000000ffffffffffffffffffff61ffff90951668010000000000000000027fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000090941667ffffffffffffffff90931692909217929092179290921691909117905550600101611185565b507f7dd21e42791b013d1929e86f0c59085e4fca24251f0f1aa81917b3b1611766e08383604051611317929190614641565b60405180910390a1505050565b60008161133081610d3f565b611366576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160c08101825260025473ffffffffffffffffffffffffffffffffffffffff908116825261ffff808a16602080850182905267ffffffffffffffff808b168688015289851660608701526006541660808601526001547d010000000000000000000000000000000000000000000000000000000000810490931660a08601526000918252600781528582208651918201875291815294517f7bfa20a9000000000000000000000000000000000000000000000000000000008152939461010090920490921692637bfa20a99261144392869260040161474d565b602060405180830381865afa158015611460573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148491906145be565b979650505050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756114b98161280a565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040519081527ff724a45d041687842411f2b977ef22ab8f43c8f1104f4592b42a00f9b34a643d906020015b60405180910390a15050565b6000610afd825b6000610afd600483612bb5565b303314611581576040517ffaba723a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61158a81612be7565b50565b60606115996004612d02565b905090565b60007f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de6115ca8161280a565b6115da60a0860160808701613ea4565b6115e381610d3f565b611619576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160c0810190915260025473ffffffffffffffffffffffffffffffffffffffff168152600090602080820190611654908a018a613e42565b63ffffffff16815260200161166f60808a0160608b016140ce565b67ffffffffffffffff16815260200161168e60a08a0160808b01613ea4565b73ffffffffffffffffffffffffffffffffffffffff908116825260065467ffffffffffffffff1660208084019190915260015461ffff7d010000000000000000000000000000000000000000000000000000000000820416604090940193909352929350610100909104169063df2b057e908390600790600090611714908d018d613e42565b63ffffffff1663ffffffff16815260200190815260200160002089896040518563ffffffff1660e01b815260040161174f94939291906144f1565b6020604051808303816000875af1158015611460573d6000803e3d6000fd5b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756117988161280a565b60005b82811015610a6457368484838181106117b6576117b66145d7565b90506020028101906117c89190614823565b905063ffffffff7f0000000000000000000000000000000000000000000000000000000000000065166117fe6020830183613e42565b63ffffffff161461180f5750611a76565b428160600135116118205750611a76565b60006118596118326020840184613e42565b6118426040850160208601613ea4565b61184f6040860186614861565b8660600135612216565b9050600061186e8261085d6080860186614861565b509050806118b1576040518481527fd6d90193101048cc1b6edcdc2348f5acf7a4a4a97d3e7b668b74cb7602ab3ebc9060200160405180910390a1505050611a76565b60006118d16118c36040860186614861565b6118cc916148c6565b612d0f565b9050801561196a5760008381526008602052604090205460ff1615611932577f9bb9bddbdf537a2104255307230b323d7982f4512ee8e5bd15df62ddca50ab978484604051611921929190614972565b60405180910390a150505050611a76565b600083815260086020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b60008061197d6040870160208801613ea4565b73ffffffffffffffffffffffffffffffffffffffff166119a06040880188614861565b6040516119ae929190614a38565b6000604051808303816000865af19150503d80600081146119eb576040519150601f19603f3d011682016040523d82523d6000602084013e6119f0565b606091505b509150915081611a6f578215611a3557600085815260086020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b7fdc8cdd96296241bbefda4a8e18ad2e0985a8da6495b34d409cfc4c886ee3b0cf8782604051611a66929190614a48565b60405180910390a15b5050505050505b60010161179b565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611aa88161280a565b600180547fff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167d01000000000000000000000000000000000000000000000000000000000061ffff8516908102919091179091556040519081527f7af0ac740036ffb1c97b03697859d729e80a44ae5030543d64971c313565ab4d90602001611528565b60007f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de611b588161280a565b82611b6281610d3f565b611b98576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160c08101825260025473ffffffffffffffffffffffffffffffffffffffff908116825261ffff808b16602080850182905267ffffffffffffffff808c16868801528a851660608701526006541660808601526001547d010000000000000000000000000000000000000000000000000000000000810490931660a08601526000918252600781528582208651918201875291815294517fdf2b057e00000000000000000000000000000000000000000000000000000000815293946101009092049092169263df2b057e92611c7592869260040161474d565b6020604051808303816000875af1158015611c94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb891906145be565b93507f87e46b0a6199bc734632187269a103c05714ee0adae5b28f30723955724f37ef84604051611ceb91815260200190565b60405180910390a1505050949350505050565b6006546000908190611d1b9067ffffffffffffffff166041614a90565b8314611d2d5750600090506001611ece565b6000611d86866040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90506000805b60065467ffffffffffffffff16811015611ec2573660008888611db0856041614a90565b90611dbc866001614aa7565b611dc7906041614a90565b92611dd493929190614aba565b91509150600080611e1b8785858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612df892505050565b90925090506000816004811115611e3457611e34614299565b14611e4d57600060019850985050505050505050611ece565b8573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1611611e9457600060029850985050505050505050611ece565b611e9d8261153b565b611eb557600060039850985050505050505050611ece565b5093505050600101611d8c565b50600160009350935050505b935093915050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611f008161280a565b600180547fffffffffffffffffffffff0000000000000000000000000000000000000000ff1661010073ffffffffffffffffffffffffffffffffffffffff8516908102919091179091556040519081527f1399be28223800f8669b3ba5f8721d9fc16fc4e8d0bbf98378791c8c5a3015e090602001611528565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611fa48161280a565b63ffffffff84166000908152600360205260409020611fc4908484613c87565b5050505050565b817f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca81148061201957507f4270fae16c6d150d00e80b689daca99e8073b1838ff2b6063a37be9d851283e481145b8061204357507f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de81145b1561208657303314612081576040517ffaba723a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6120d6565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758103610f2f576120817fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561280a565b610f738383612e3d565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561210a8161280a565b73ffffffffffffffffffffffffffffffffffffffff841660009081527f9b50f4667d2d24216ccbf0dce3a90c0f620fa4d895e7b069d80ff6247fd25620602052604090205460ff16612188576040517f5ee08b9700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f07b18bde00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490528516906307b18bde90604401600060405180830381600087803b1580156121f857600080fd5b505af115801561220c573d6000803e3d6000fd5b5050505050505050565b60008585838686604051602001612231959493929190614ae4565b60405160208183030381529060405280519060200120905095945050505050565b4281606001351161228f576040517f0bbaf26300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b306122a06040830160208401613ea4565b73ffffffffffffffffffffffffffffffffffffffff1614612316576122cb6040820160208301613ea4565b6040517f1ce0bfcd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610f60565b63ffffffff7f00000000000000000000000000000000000000000000000000000000000000651661234a6020830183613e42565b63ffffffff161461239d576123626020820182613e42565b6040517f2697e1c200000000000000000000000000000000000000000000000000000000815263ffffffff9091166004820152602401610f60565b60006123af6118326020840184613e42565b905060006123c48261085d6080860186614861565b509050806123fe576040517f15ecadee00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526008602052604090205460ff161561244a576040517f9d6a45a600000000000000000000000000000000000000000000000000000000815260048101839052602401610f60565b6000828152600860205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610f73907fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775906124b590860186614861565b8101906124c29190613ea4565b61291a565b60007f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de6124f38161280a565b886124fd81610d3f565b612533576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160808101825260025473ffffffffffffffffffffffffffffffffffffffff90811682528c811660208084019190915260065467ffffffffffffffff168385015260015461ffff7d010000000000000000000000000000000000000000000000000000000000820416606085015263ffffffff7f000000000000000000000000000000000000000000000000000000000000759516600090815260079092529084902093517fbbc5a33b00000000000000000000000000000000000000000000000000000000815292936101009091049091169163bbc5a33b91612627918591908d908d908d908d90600401614b56565b6020604051808303816000875af1158015612646573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266a91906145be565b9b9a5050505050505050505050565b60006115996004612f02565b60008761269181610d3f565b6126c7576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160808101825260025473ffffffffffffffffffffffffffffffffffffffff90811682528b811660208084019190915260065467ffffffffffffffff168385015260015461ffff7d010000000000000000000000000000000000000000000000000000000000820416606085015263ffffffff7f000000000000000000000000000000000000000000000000000000000000759516600090815260079092529084902093517fd358b30000000000000000000000000000000000000000000000000000000000815292936101009091049091169163d358b300916127bb918591908c908c908c908c90600401614b56565b602060405180830381865afa1580156127d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127fc91906145be565b9a9950505050505050505050565b61158a8133612f0c565b73ffffffffffffffffffffffffffffffffffffffff831661283957610f738282612fc4565b610f738383836130ca565b61284c613138565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b6128cb6131a7565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612899565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca82148015612977575060008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16155b156129d657600180546015906129af907501000000000000000000000000000000000000000000900467ffffffffffffffff16614c1c565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b610cac8282613213565b8015612a995773ffffffffffffffffffffffffffffffffffffffff8216612a33576040517f5cbf6e2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612a3e600483613303565b612a94576040517f58c8d2a000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201528115156024820152604401610f60565b612afa565b612aa4600483613325565b612afa576040517f7e1e4ae200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201528115156024820152604401610f60565b6000612b066004612f02565b60065490915067ffffffffffffffff908116908216811115612b68576040517ff1c582ae00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff808416600483015282166024820152604401610f60565b6040805173ffffffffffffffffffffffffffffffffffffffff8616815284151560208201527f863d338cad74814b108a06288ad5e0e80d56495e0332238b1d2cdcfa0ca8e5ce9101610c85565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415155b9392505050565b8067ffffffffffffffff16600003612c2b576040517f5f86e17700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612c376004612f02565b90508167ffffffffffffffff168167ffffffffffffffff161015612c9b576040517ff1c582ae00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff808316600483015283166024820152604401610f60565b600680547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff84169081179091556040519081527fb600f3cf7f38a4b49bb0c75f722ef69f7e3e39ef3bb4aa8207fd86e724a2324990602001611528565b60606000612be083613347565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f0223536e0000000000000000000000000000000000000000000000000000000014801590612da557507fffffffff0000000000000000000000000000000000000000000000000000000082167fab750e750000000000000000000000000000000000000000000000000000000014155b8015610afd57507fffffffff0000000000000000000000000000000000000000000000000000000082167f704316e500000000000000000000000000000000000000000000000000000000141592915050565b6000808251604103612e2e5760208301516040840151606085015160001a612e22878285856133a2565b94509450505050612e36565b506000905060025b9250929050565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca82148015612e99575060008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff165b15612ef85760018054601590612ed1907501000000000000000000000000000000000000000000900467ffffffffffffffff16614c43565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b610cac8282613491565b6000610afd825490565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610cac57612f4a81613548565b612f55836020613567565b604051602001612f66929190614c85565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610f6091600401614d06565b73ffffffffffffffffffffffffffffffffffffffff8216613011576040517f6b7a931000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461306b576040519150601f19603f3d011682016040523d82523d6000602084013e613070565b606091505b5050905080610f73576040517f465bc83400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260248101839052604401610f60565b73ffffffffffffffffffffffffffffffffffffffff8216613117576040517f6b7a931000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f7373ffffffffffffffffffffffffffffffffffffffff841683836137aa565b60015460ff16156131a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610f60565b565b60015460ff166131a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610f60565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610cac5760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556132a53390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000612be08373ffffffffffffffffffffffffffffffffffffffff8416613837565b6000612be08373ffffffffffffffffffffffffffffffffffffffff8416613886565b606081600001805480602002602001604051908101604052809291908181526020018280548015610d3357602002820191906000526020600020905b8154815260200190600101908083116133835750505050509050919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156133d95750600090506003613488565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561342d573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661348157600060019250925050613488565b9150600090505b94509492505050565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610cac5760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6060610afd73ffffffffffffffffffffffffffffffffffffffff831660145b60606000613576836002614a90565b613581906002614aa7565b67ffffffffffffffff81111561359957613599614d19565b6040519080825280601f01601f1916602001820160405280156135c3576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106135fa576135fa6145d7565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061365d5761365d6145d7565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000613699846002614a90565b6136a4906001614aa7565b90505b6001811115613741577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106136e5576136e56145d7565b1a60f81b8282815181106136fb576136fb6145d7565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361373a81614d48565b90506136a7565b508315612be0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610f60565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610f73908490613979565b600081815260018301602052604081205461387e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610afd565b506000610afd565b6000818152600183016020526040812054801561396f5760006138aa600183614d7d565b85549091506000906138be90600190614d7d565b90508181146139235760008660000182815481106138de576138de6145d7565b9060005260206000200154905080876000018481548110613901576139016145d7565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061393457613934614d90565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610afd565b6000915050610afd565b60006139db826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613a889092919063ffffffff16565b90508051600014806139fc5750808060200190518101906139fc9190614dbf565b610f73576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610f60565b6060613a978484600085613a9f565b949350505050565b606082471015613b31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610f60565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613b5a9190614ddc565b60006040518083038185875af1925050503d8060008114613b97576040519150601f19603f3d011682016040523d82523d6000602084013e613b9c565b606091505b50915091506114848783838760608315613c3e578251600003613c375773ffffffffffffffffffffffffffffffffffffffff85163b613c37576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610f60565b5081613a97565b613a978383815115613c535781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f609190614d06565b82805482825590600052602060002090601f01602090048101928215613d205791602002820160005b83821115613cf157833560ff1683826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302613cb0565b8015613d1e5782816101000a81549060ff0219169055600101602081600001049283019260010302613cf1565b505b50613d2c929150613d30565b5090565b5b80821115613d2c5760008155600101613d31565b73ffffffffffffffffffffffffffffffffffffffff8116811461158a57600080fd5b600080600060608486031215613d7c57600080fd5b8335613d8781613d45565b92506020840135613d9781613d45565b929592945050506040919091013590565b600060208284031215613dba57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114612be057600080fd5b801515811461158a57600080fd5b600060208284031215613e0a57600080fd5b8135612be081613dea565b600060208284031215613e2757600080fd5b5035919050565b803563ffffffff81168114610e1f57600080fd5b600060208284031215613e5457600080fd5b612be082613e2e565b6020808252825182820181905260009190848201906040850190845b81811015613e9857835160ff1683529284019291840191600101613e79565b50909695505050505050565b600060208284031215613eb657600080fd5b8135612be081613d45565b60008060408385031215613ed457600080fd5b823591506020830135613ee681613d45565b809150509250929050565b803567ffffffffffffffff81168114610e1f57600080fd5b60008083601f840112613f1b57600080fd5b50813567ffffffffffffffff811115613f3357600080fd5b602083019150836020828501011115612e3657600080fd5b600080600080600060808688031215613f6357600080fd5b613f6c86613e2e565b9450613f7a60208701613ef1565b93506040860135613f8a81613d45565b9250606086013567ffffffffffffffff811115613fa657600080fd5b613fb288828901613f09565b969995985093965092949392505050565b60008060408385031215613fd657600080fd5b8235613fe181613d45565b91506020830135613ee681613dea565b6000806020838503121561400457600080fd5b823567ffffffffffffffff8082111561401c57600080fd5b818501915085601f83011261403057600080fd5b81358181111561403f57600080fd5b8660208260071b850101111561405457600080fd5b60209290920196919550909350505050565b803561ffff81168114610e1f57600080fd5b6000806000806080858703121561408e57600080fd5b61409785614066565b93506140a560208601614066565b92506140b360408601613ef1565b915060608501356140c381613d45565b939692955090935050565b6000602082840312156140e057600080fd5b612be082613ef1565b6020808252825182820181905260009190848201906040850190845b81811015613e9857835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101614105565b600060a0828403121561414957600080fd5b50919050565b60008060006040848603121561416457600080fd5b833567ffffffffffffffff8082111561417c57600080fd5b61418887838801614137565b9450602086013591508082111561419e57600080fd5b506141ab86828701613f09565b9497909650939450505050565b60008083601f8401126141ca57600080fd5b50813567ffffffffffffffff8111156141e257600080fd5b6020830191508360208260051b8501011115612e3657600080fd5b6000806020838503121561421057600080fd5b823567ffffffffffffffff81111561422757600080fd5b614233858286016141b8565b90969095509350505050565b60006020828403121561425157600080fd5b612be082614066565b60008060006040848603121561426f57600080fd5b83359250602084013567ffffffffffffffff81111561428d57600080fd5b6141ab86828701613f09565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b82151581526040810160048310614308577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8260208301529392505050565b60008060006040848603121561432a57600080fd5b61433384613e2e565b9250602084013567ffffffffffffffff81111561434f57600080fd5b6141ab868287016141b8565b60008060008060006080868803121561437357600080fd5b61437c86613e2e565b9450602086013561438c81613d45565b9350604086013567ffffffffffffffff8111156143a857600080fd5b6143b488828901613f09565b96999598509660600135949350505050565b6000602082840312156143d857600080fd5b813567ffffffffffffffff8111156143ef57600080fd5b613a9784828501614137565b60008060008060008060006080888a03121561441657600080fd5b873561442181613d45565b9650602088013567ffffffffffffffff8082111561443e57600080fd5b61444a8b838c01613f09565b909850965060408a013591508082111561446357600080fd5b61446f8b838c01613f09565b909650945060608a013591508082111561448857600080fd5b506144958a828b01613f09565b989b979a50959850939692959293505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b6000610140614569838873ffffffffffffffffffffffffffffffffffffffff80825116835263ffffffff6020830151166020840152604082015167ffffffffffffffff808216604086015282606085015116606086015280608085015116608086015250505061ffff60a08201511660a08301525050565b6145aa60c08401875467ffffffffffffffff81168252604081811c61ffff16602084015260509190911c6fffffffffffffffffffffffffffffffff16910152565b8061012084015261148481840185876144a8565b6000602082840312156145d057600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b80356fffffffffffffffffffffffffffffffff81168114610e1f57600080fd5b60006020828403121561463857600080fd5b612be082614606565b6020808252818101839052600090604080840186845b878110156146d25763ffffffff61466d83613e2e565b16835267ffffffffffffffff614684868401613ef1565b168584015261ffff614697858401614066565b168484015260606fffffffffffffffffffffffffffffffff6146ba828501614606565b16908401526080928301929190910190600101614657565b5090979650505050505050565b60005b838110156146fa5781810151838201526020016146e2565b50506000910152565b6000815180845261471b8160208601602086016146df565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006101406147c5838773ffffffffffffffffffffffffffffffffffffffff80825116835263ffffffff6020830151166020840152604082015167ffffffffffffffff808216604086015282606085015116606086015280608085015116608086015250505061ffff60a08201511660a08301525050565b61480660c08401865467ffffffffffffffff81168252604081811c61ffff16602084015260509190911c6fffffffffffffffffffffffffffffffff16910152565b8061012084015261481981840185614703565b9695505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6183360301811261485757600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261489657600080fd5b83018035915067ffffffffffffffff8211156148b157600080fd5b602001915036819003821315612e3657600080fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081358181169160048510156149065780818660040360031b1b83161692505b505092915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261494357600080fd5b830160208101925035905067ffffffffffffffff81111561496357600080fd5b803603821315612e3657600080fd5b6040815263ffffffff61498484613e2e565b1660408201526000602084013561499a81613d45565b73ffffffffffffffffffffffffffffffffffffffff1660608301526149c2604085018561490e565b60a060808501526149d760e0850182846144a8565b915050606085013560a08401526149f1608086018661490e565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08584030160c0860152614a268382846144a8565b93505050508260208301529392505050565b8183823760009101908152919050565b828152604060208201526000613a976040830184614703565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610afd57610afd614a61565b80820180821115610afd57610afd614a61565b60008085851115614aca57600080fd5b83861115614ad757600080fd5b5050820193919092039150565b7fffffffff000000000000000000000000000000000000000000000000000000008660e01b1681527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008560601b1660048201528360188201528183603883013760009101603801908152949350505050565b600061012073ffffffffffffffffffffffffffffffffffffffff808a511684528060208b01511660208501525067ffffffffffffffff60408a015116604084015261ffff60608a0151166060840152614be660808401895467ffffffffffffffff81168252604081811c61ffff16602084015260509190911c6fffffffffffffffffffffffffffffffff16910152565b8060e0840152614bf981840187896144a8565b9050828103610100840152614c0f8185876144a8565b9998505050505050505050565b600067ffffffffffffffff808316818103614c3957614c39614a61565b6001019392505050565b600067ffffffffffffffff821680614c5d57614c5d614a61565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614cbd8160178501602088016146df565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351614cfa8160288401602088016146df565b01602801949350505050565b602081526000612be06020830184614703565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600081614d5757614d57614a61565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b81810381811115610afd57610afd614a61565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600060208284031215614dd157600080fd5b8151612be081613dea565b600082516148578184602087016146df56fea2646970667358221220198a6ed2fc72043001b01d1b1945eeab857e3b52b5e2dd6f3d5106e342b43a0e64736f6c63430008160033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"paris","libraries":{},"optimizer":{"enabled":true,"runs":20000},"outputSelection":{"*":{"*":["evm.bytecode","evm.deployedBytecode","devdoc","userdoc","metadata","abi"]}}},"optimization_runs":20000,"sourcify_repo_url":null,"decoded_constructor_args":[["30101",{"internalType":"uint32","name":"_localEidV2","type":"uint32"}],["101",{"internalType":"uint32","name":"_vid","type":"uint32"}],[["0x4D73AdB72bC3DD368966edD0f0b2148401A178E2","0xD231084BfB234C107D3eE2b22F97F3346fDAF705","0xbB2Ea70C9E858123480642Cf96acbcCE1372dCe1","0x74F55Bc2a79A27A0bF1D1A35dB5d0Fc36b9FDB9D"],{"internalType":"address[]","name":"_messageLibs","type":"address[]"}],["0xC03f31fD86a9077785b7bCf6598Ce3598Fa91113",{"internalType":"address","name":"_priceFeed","type":"address"}],[["0xD031f474f7e6e28845e1D4856B9B1Aef28970397"],{"internalType":"address[]","name":"_signers","type":"address[]"}],["1",{"internalType":"uint64","name":"_quorum","type":"uint64"}],[["0xB52Fa54FC261398058c3Ac7B8dD442D7d8B9F0B6","0xB8FF877ed78Ba520Ece21B1de7843A8a57cA47Cb"],{"internalType":"address[]","name":"_admins","type":"address[]"}]],"compiler_version":"v0.8.22+commit.4fc1097e","is_verified_via_verifier_alliance":false,"verified_at":"2025-06-05T07:33:17.184554Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60c06040523480156200001157600080fd5b50604051620054c9380380620054c983398101604081905262000034916200052c565b6001805460ff61ffff60e81b01191661017760ed1b179055600280546001600160a01b0319166001600160a01b03861617905582828686612ee060008660005b8551811015620000d557620000cc7f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de878381518110620000b857620000b862000610565b60200260200101516200026960201b60201c565b60010162000074565b5060005b815181101562000126576200011d7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775838381518110620000b857620000b862000610565b600101620000d9565b505050505050806001600160401b03166000036200015757604051635f86e17760e01b815260040160405180910390fd5b60005b8251811015620001d15760008382815181106200017b576200017b62000610565b6020026020010151905060006001600160a01b0316816001600160a01b031603620001b957604051632e5fb71360e11b815260040160405180910390fd5b620001c660048262000317565b50506001016200015a565b506000620001e0600462000337565b9050816001600160401b0316816001600160401b031610156200022d576040516378e2c15760e11b81526001600160401b0380831660048301528316602482015260440160405180910390fd5b50600680546001600160401b0319166001600160401b03929092169190911790555050505063ffffffff92831660805250501660a05262000663565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca82148015620002ba57506000828152602081815260408083206001600160a01b038516845290915290205460ff16155b15620003075760018054601590620002e290600160a81b90046001600160401b031662000626565b91906101000a8154816001600160401b0302191690836001600160401b031602179055505b62000313828262000342565b5050565b60006200032e836001600160a01b038416620003e2565b90505b92915050565b600062000331825490565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000313576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200039e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008181526001830160205260408120546200042b5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000331565b50600062000331565b805163ffffffff811681146200044957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200044957600080fd5b600082601f8301126200048e57600080fd5b815160206001600160401b0380831115620004ad57620004ad6200044e565b8260051b604051601f19603f83011681018181108482111715620004d557620004d56200044e565b6040529384526020818701810194908101925087851115620004f657600080fd5b6020870191505b848210156200052157620005118262000464565b83529183019190830190620004fd565b979650505050505050565b600080600080600080600060e0888a0312156200054857600080fd5b620005538862000434565b9650620005636020890162000434565b60408901519096506001600160401b03808211156200058157600080fd5b6200058f8b838c016200047c565b96506200059f60608b0162000464565b955060808a0151915080821115620005b657600080fd5b620005c48b838c016200047c565b945060a08a015191508082168214620005dc57600080fd5b60c08a015191935080821115620005f257600080fd5b50620006018a828b016200047c565b91505092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b60006001600160401b038281166002600160401b031981016200065957634e487b7160e01b600052601160045260246000fd5b6001019392505050565b60805160a051614e24620006a560003960008181610985015281816125ab015261273f0152600081816108c2015281816117d1015261231d0152614e246000f3fe6080604052600436106102e65760003560e01c806394cf795e11610184578063cd88b903116100d6578063e395eb5c1161008a578063f42ed2ed11610064578063f42ed2ed146109e7578063fd62e750146109fa578063fdb9b0f114610a0f57600080fd5b8063e395eb5c14610973578063f010cb23146109a7578063f3b4ebd0146109c757600080fd5b8063d2ae2104116100bb578063d2ae2104146108f9578063d547741f14610933578063dafe0ccc1461095357600080fd5b8063cd88b90314610890578063cf34c768146108b057600080fd5b8063b143044b11610138578063c5e193cd11610112578063c5e193cd14610822578063c7a823e014610842578063c7b2370b1461087057600080fd5b8063b143044b146107b0578063c358de0a146107d0578063c416aa51146107f057600080fd5b80639e944965116101695780639e944965146106c6578063a217fddf1461076b578063aef18bf71461078057600080fd5b806394cf795e1461069157806395d376d7146106b357600080fd5b806331cb61051161023d578063724e78da116101f15780637df73e27116101cb5780637df73e27146106005780638585c9451461062057806391d148541461064057600080fd5b8063724e78da1461056e578063736c0d5b1461058e578063741bef1a146105ae57600080fd5b806352d3b8711161022257806352d3b871146105165780635553fb8e146105365780635c975abb1461055657600080fd5b806331cb6105146104d657806336568abe146104f657600080fd5b80631703a0181161029f5780632de11376116102795780632de11376146104765780632f2ff15d1461049657806330bb3aac146104b657600080fd5b80631703a018146103d1578063248a9ca31461040b57806326e67a371461044957600080fd5b806301ffc9a7116102d057806301ffc9a7146103615780631095b6d71461039157806316c38b3c146103b157600080fd5b8062bf2e80146102eb57806301e336671461033f575b600080fd5b3480156102f757600080fd5b50600154610327907d010000000000000000000000000000000000000000000000000000000000900461ffff1681565b60405161ffff90911681526020015b60405180910390f35b34801561034b57600080fd5b5061035f61035a366004613d67565b610a2f565b005b34801561036d57600080fd5b5061038161037c366004613da8565b610a6a565b6040519015158152602001610336565b34801561039d57600080fd5b5061035f6103ac366004613d67565b610b03565b3480156103bd57600080fd5b5061035f6103cc366004613df8565b610c93565b3480156103dd57600080fd5b506006546103f29067ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610336565b34801561041757600080fd5b5061043b610426366004613e15565b60009081526020819052604090206001015490565b604051908152602001610336565b34801561045557600080fd5b50610469610464366004613e42565b610cb8565b6040516103369190613e5d565b34801561048257600080fd5b50610381610491366004613ea4565b610d3f565b3480156104a257600080fd5b5061035f6104b1366004613ec1565b610e24565b3480156104c257600080fd5b5061043b6104d1366004613f4b565b610f78565b3480156104e257600080fd5b5061035f6104f1366004613fc3565b6110e3565b34801561050257600080fd5b5061035f610511366004613ec1565b611126565b34801561052257600080fd5b5061035f610531366004613ff1565b611158565b34801561054257600080fd5b5061043b610551366004614078565b611324565b34801561056257600080fd5b5060015460ff16610381565b34801561057a57600080fd5b5061035f610589366004613ea4565b61148f565b34801561059a57600080fd5b506103816105a9366004613ea4565b611534565b3480156105ba57600080fd5b506002546105db9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610336565b34801561060c57600080fd5b5061038161061b366004613ea4565b61153b565b34801561062c57600080fd5b5061035f61063b3660046140ce565b611548565b34801561064c57600080fd5b5061038161065b366004613ec1565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b34801561069d57600080fd5b506106a661158d565b60405161033691906140e9565b61043b6106c136600461414f565b61159e565b3480156106d257600080fd5b506107306106e1366004613e42565b60076020526000908152604090205467ffffffffffffffff81169068010000000000000000810461ffff16906a010000000000000000000090046fffffffffffffffffffffffffffffffff1683565b6040805167ffffffffffffffff909416845261ffff90921660208401526fffffffffffffffffffffffffffffffff1690820152606001610336565b34801561077757600080fd5b5061043b600081565b34801561078c57600080fd5b5061038161079b366004613e15565b60086020526000908152604090205460ff1681565b3480156107bc57600080fd5b5061035f6107cb3660046141fd565b61176e565b3480156107dc57600080fd5b5061035f6107eb36600461423f565b611a7e565b3480156107fc57600080fd5b506001546105db90610100900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561082e57600080fd5b5061043b61083d366004614078565b611b2c565b34801561084e57600080fd5b5061086261085d36600461425a565b611cfe565b6040516103369291906142c8565b34801561087c57600080fd5b5061035f61088b366004613ea4565b611ed6565b34801561089c57600080fd5b5061035f6108ab366004614315565b611f7a565b3480156108bc57600080fd5b506108e47f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff9091168152602001610336565b34801561090557600080fd5b506001546103f2907501000000000000000000000000000000000000000000900467ffffffffffffffff1681565b34801561093f57600080fd5b5061035f61094e366004613ec1565b611fcb565b34801561095f57600080fd5b5061035f61096e366004613d67565b6120e0565b34801561097f57600080fd5b506108e47f000000000000000000000000000000000000000000000000000000000000000081565b3480156109b357600080fd5b5061043b6109c236600461435b565b612216565b3480156109d357600080fd5b5061035f6109e23660046143c6565b612252565b61043b6109f53660046143fb565b6124c7565b348015610a0657600080fd5b5061043b612679565b348015610a1b57600080fd5b5061043b610a2a3660046143fb565b612685565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610a598161280a565b610a64848484612814565b50505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b000000000000000000000000000000000000000000000000000000001480610afd57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610b2d8161280a565b73ffffffffffffffffffffffffffffffffffffffff841660009081527f9b50f4667d2d24216ccbf0dce3a90c0f620fa4d895e7b069d80ff6247fd25620602052604090205460ff16610bab576040517f5ee08b9700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517ffd9be52200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820184905285169063fd9be52290604401600060405180830381600087803b158015610c1b57600080fd5b505af1158015610c2f573d6000803e3d6000fd5b50506040805173ffffffffffffffffffffffffffffffffffffffff8089168252871660208201529081018590527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb925060600190505b60405180910390a150505050565b6000610c9e8161280a565b8115610cb057610cac612844565b5050565b610cac6128c3565b63ffffffff8116600090815260036020908152604091829020805483518184028101840190945280845260609392830182828015610d3357602002820191906000526020600020906000905b825461010083900a900460ff16815260206001928301818104948501949093039092029101808411610d045790505b50505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff811660009081527f93c430521711328044ae92d0f1f1286cf040bc4a382f1642bd89984e86630553602052604081205460ff1615610d9457506000919050565b6001547501000000000000000000000000000000000000000000900467ffffffffffffffff161580610e0a575073ffffffffffffffffffffffffffffffffffffffff821660009081527f4ac82e3087b7dedf7f532cbc6915c722df8c1e31f1388c318a617b52760eaf8b602052604090205460ff165b15610e1757506001919050565b506000919050565b919050565b817f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca811480610e7257507f4270fae16c6d150d00e80b689daca99e8073b1838ff2b6063a37be9d851283e481145b80610e9c57507f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de81145b15610edf57303314610eda576040517ffaba723a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f69565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758103610f2f57610eda7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561280a565b6040517f94fdc372000000000000000000000000000000000000000000000000000000008152600481018290526024015b60405180910390fd5b610f73838361291a565b505050565b600083610f8481610d3f565b610fba576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160c08101825260025473ffffffffffffffffffffffffffffffffffffffff908116825263ffffffff8a16602080840182905267ffffffffffffffff808c16858701528a8416606086015260065416608085015260015461ffff7d01000000000000000000000000000000000000000000000000000000000082041660a0860152600092835260079091529084902093517f7bfa20a9000000000000000000000000000000000000000000000000000000008152929361010090910490911691637bfa20a991611096918591908a908a906004016144f1565b602060405180830381865afa1580156110b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d791906145be565b98975050505050505050565b30331461111c576040517ffaba723a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cac82826129e0565b6040517fdec9f03100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756111828161280a565b60005b828110156112e557368484838181106111a0576111a06145d7565b905060800201905060405180606001604052808260200160208101906111c691906140ce565b67ffffffffffffffff1681526020016111e5606084016040850161423f565b61ffff1681526020016111fe6080840160608501614626565b6fffffffffffffffffffffffffffffffff169052600760006112236020850185613e42565b63ffffffff1681526020808201929092526040908101600020835181549385015194909201516fffffffffffffffffffffffffffffffff166a0100000000000000000000027fffffffffffff00000000000000000000000000000000ffffffffffffffffffff61ffff90951668010000000000000000027fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000090941667ffffffffffffffff90931692909217929092179290921691909117905550600101611185565b507f7dd21e42791b013d1929e86f0c59085e4fca24251f0f1aa81917b3b1611766e08383604051611317929190614641565b60405180910390a1505050565b60008161133081610d3f565b611366576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160c08101825260025473ffffffffffffffffffffffffffffffffffffffff908116825261ffff808a16602080850182905267ffffffffffffffff808b168688015289851660608701526006541660808601526001547d010000000000000000000000000000000000000000000000000000000000810490931660a08601526000918252600781528582208651918201875291815294517f7bfa20a9000000000000000000000000000000000000000000000000000000008152939461010090920490921692637bfa20a99261144392869260040161474d565b602060405180830381865afa158015611460573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148491906145be565b979650505050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756114b98161280a565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040519081527ff724a45d041687842411f2b977ef22ab8f43c8f1104f4592b42a00f9b34a643d906020015b60405180910390a15050565b6000610afd825b6000610afd600483612bb5565b303314611581576040517ffaba723a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61158a81612be7565b50565b60606115996004612d02565b905090565b60007f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de6115ca8161280a565b6115da60a0860160808701613ea4565b6115e381610d3f565b611619576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160c0810190915260025473ffffffffffffffffffffffffffffffffffffffff168152600090602080820190611654908a018a613e42565b63ffffffff16815260200161166f60808a0160608b016140ce565b67ffffffffffffffff16815260200161168e60a08a0160808b01613ea4565b73ffffffffffffffffffffffffffffffffffffffff908116825260065467ffffffffffffffff1660208084019190915260015461ffff7d010000000000000000000000000000000000000000000000000000000000820416604090940193909352929350610100909104169063df2b057e908390600790600090611714908d018d613e42565b63ffffffff1663ffffffff16815260200190815260200160002089896040518563ffffffff1660e01b815260040161174f94939291906144f1565b6020604051808303816000875af1158015611460573d6000803e3d6000fd5b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756117988161280a565b60005b82811015610a6457368484838181106117b6576117b66145d7565b90506020028101906117c89190614823565b905063ffffffff7f0000000000000000000000000000000000000000000000000000000000000000166117fe6020830183613e42565b63ffffffff161461180f5750611a76565b428160600135116118205750611a76565b60006118596118326020840184613e42565b6118426040850160208601613ea4565b61184f6040860186614861565b8660600135612216565b9050600061186e8261085d6080860186614861565b509050806118b1576040518481527fd6d90193101048cc1b6edcdc2348f5acf7a4a4a97d3e7b668b74cb7602ab3ebc9060200160405180910390a1505050611a76565b60006118d16118c36040860186614861565b6118cc916148c6565b612d0f565b9050801561196a5760008381526008602052604090205460ff1615611932577f9bb9bddbdf537a2104255307230b323d7982f4512ee8e5bd15df62ddca50ab978484604051611921929190614972565b60405180910390a150505050611a76565b600083815260086020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b60008061197d6040870160208801613ea4565b73ffffffffffffffffffffffffffffffffffffffff166119a06040880188614861565b6040516119ae929190614a38565b6000604051808303816000865af19150503d80600081146119eb576040519150601f19603f3d011682016040523d82523d6000602084013e6119f0565b606091505b509150915081611a6f578215611a3557600085815260086020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b7fdc8cdd96296241bbefda4a8e18ad2e0985a8da6495b34d409cfc4c886ee3b0cf8782604051611a66929190614a48565b60405180910390a15b5050505050505b60010161179b565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611aa88161280a565b600180547fff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167d01000000000000000000000000000000000000000000000000000000000061ffff8516908102919091179091556040519081527f7af0ac740036ffb1c97b03697859d729e80a44ae5030543d64971c313565ab4d90602001611528565b60007f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de611b588161280a565b82611b6281610d3f565b611b98576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160c08101825260025473ffffffffffffffffffffffffffffffffffffffff908116825261ffff808b16602080850182905267ffffffffffffffff808c16868801528a851660608701526006541660808601526001547d010000000000000000000000000000000000000000000000000000000000810490931660a08601526000918252600781528582208651918201875291815294517fdf2b057e00000000000000000000000000000000000000000000000000000000815293946101009092049092169263df2b057e92611c7592869260040161474d565b6020604051808303816000875af1158015611c94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb891906145be565b93507f87e46b0a6199bc734632187269a103c05714ee0adae5b28f30723955724f37ef84604051611ceb91815260200190565b60405180910390a1505050949350505050565b6006546000908190611d1b9067ffffffffffffffff166041614a90565b8314611d2d5750600090506001611ece565b6000611d86866040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90506000805b60065467ffffffffffffffff16811015611ec2573660008888611db0856041614a90565b90611dbc866001614aa7565b611dc7906041614a90565b92611dd493929190614aba565b91509150600080611e1b8785858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612df892505050565b90925090506000816004811115611e3457611e34614299565b14611e4d57600060019850985050505050505050611ece565b8573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1611611e9457600060029850985050505050505050611ece565b611e9d8261153b565b611eb557600060039850985050505050505050611ece565b5093505050600101611d8c565b50600160009350935050505b935093915050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611f008161280a565b600180547fffffffffffffffffffffff0000000000000000000000000000000000000000ff1661010073ffffffffffffffffffffffffffffffffffffffff8516908102919091179091556040519081527f1399be28223800f8669b3ba5f8721d9fc16fc4e8d0bbf98378791c8c5a3015e090602001611528565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611fa48161280a565b63ffffffff84166000908152600360205260409020611fc4908484613c87565b5050505050565b817f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca81148061201957507f4270fae16c6d150d00e80b689daca99e8073b1838ff2b6063a37be9d851283e481145b8061204357507f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de81145b1561208657303314612081576040517ffaba723a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6120d6565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758103610f2f576120817fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561280a565b610f738383612e3d565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561210a8161280a565b73ffffffffffffffffffffffffffffffffffffffff841660009081527f9b50f4667d2d24216ccbf0dce3a90c0f620fa4d895e7b069d80ff6247fd25620602052604090205460ff16612188576040517f5ee08b9700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f07b18bde00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490528516906307b18bde90604401600060405180830381600087803b1580156121f857600080fd5b505af115801561220c573d6000803e3d6000fd5b5050505050505050565b60008585838686604051602001612231959493929190614ae4565b60405160208183030381529060405280519060200120905095945050505050565b4281606001351161228f576040517f0bbaf26300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b306122a06040830160208401613ea4565b73ffffffffffffffffffffffffffffffffffffffff1614612316576122cb6040820160208301613ea4565b6040517f1ce0bfcd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610f60565b63ffffffff7f00000000000000000000000000000000000000000000000000000000000000001661234a6020830183613e42565b63ffffffff161461239d576123626020820182613e42565b6040517f2697e1c200000000000000000000000000000000000000000000000000000000815263ffffffff9091166004820152602401610f60565b60006123af6118326020840184613e42565b905060006123c48261085d6080860186614861565b509050806123fe576040517f15ecadee00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526008602052604090205460ff161561244a576040517f9d6a45a600000000000000000000000000000000000000000000000000000000815260048101839052602401610f60565b6000828152600860205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610f73907fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775906124b590860186614861565b8101906124c29190613ea4565b61291a565b60007f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de6124f38161280a565b886124fd81610d3f565b612533576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160808101825260025473ffffffffffffffffffffffffffffffffffffffff90811682528c811660208084019190915260065467ffffffffffffffff168385015260015461ffff7d010000000000000000000000000000000000000000000000000000000000820416606085015263ffffffff7f000000000000000000000000000000000000000000000000000000000000000016600090815260079092529084902093517fbbc5a33b00000000000000000000000000000000000000000000000000000000815292936101009091049091169163bbc5a33b91612627918591908d908d908d908d90600401614b56565b6020604051808303816000875af1158015612646573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266a91906145be565b9b9a5050505050505050505050565b60006115996004612f02565b60008761269181610d3f565b6126c7576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160808101825260025473ffffffffffffffffffffffffffffffffffffffff90811682528b811660208084019190915260065467ffffffffffffffff168385015260015461ffff7d010000000000000000000000000000000000000000000000000000000000820416606085015263ffffffff7f000000000000000000000000000000000000000000000000000000000000000016600090815260079092529084902093517fd358b30000000000000000000000000000000000000000000000000000000000815292936101009091049091169163d358b300916127bb918591908c908c908c908c90600401614b56565b602060405180830381865afa1580156127d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127fc91906145be565b9a9950505050505050505050565b61158a8133612f0c565b73ffffffffffffffffffffffffffffffffffffffff831661283957610f738282612fc4565b610f738383836130ca565b61284c613138565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b6128cb6131a7565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612899565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca82148015612977575060008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16155b156129d657600180546015906129af907501000000000000000000000000000000000000000000900467ffffffffffffffff16614c1c565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b610cac8282613213565b8015612a995773ffffffffffffffffffffffffffffffffffffffff8216612a33576040517f5cbf6e2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612a3e600483613303565b612a94576040517f58c8d2a000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201528115156024820152604401610f60565b612afa565b612aa4600483613325565b612afa576040517f7e1e4ae200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201528115156024820152604401610f60565b6000612b066004612f02565b60065490915067ffffffffffffffff908116908216811115612b68576040517ff1c582ae00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff808416600483015282166024820152604401610f60565b6040805173ffffffffffffffffffffffffffffffffffffffff8616815284151560208201527f863d338cad74814b108a06288ad5e0e80d56495e0332238b1d2cdcfa0ca8e5ce9101610c85565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415155b9392505050565b8067ffffffffffffffff16600003612c2b576040517f5f86e17700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612c376004612f02565b90508167ffffffffffffffff168167ffffffffffffffff161015612c9b576040517ff1c582ae00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff808316600483015283166024820152604401610f60565b600680547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff84169081179091556040519081527fb600f3cf7f38a4b49bb0c75f722ef69f7e3e39ef3bb4aa8207fd86e724a2324990602001611528565b60606000612be083613347565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f0223536e0000000000000000000000000000000000000000000000000000000014801590612da557507fffffffff0000000000000000000000000000000000000000000000000000000082167fab750e750000000000000000000000000000000000000000000000000000000014155b8015610afd57507fffffffff0000000000000000000000000000000000000000000000000000000082167f704316e500000000000000000000000000000000000000000000000000000000141592915050565b6000808251604103612e2e5760208301516040840151606085015160001a612e22878285856133a2565b94509450505050612e36565b506000905060025b9250929050565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca82148015612e99575060008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff165b15612ef85760018054601590612ed1907501000000000000000000000000000000000000000000900467ffffffffffffffff16614c43565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b610cac8282613491565b6000610afd825490565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610cac57612f4a81613548565b612f55836020613567565b604051602001612f66929190614c85565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610f6091600401614d06565b73ffffffffffffffffffffffffffffffffffffffff8216613011576040517f6b7a931000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461306b576040519150601f19603f3d011682016040523d82523d6000602084013e613070565b606091505b5050905080610f73576040517f465bc83400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260248101839052604401610f60565b73ffffffffffffffffffffffffffffffffffffffff8216613117576040517f6b7a931000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f7373ffffffffffffffffffffffffffffffffffffffff841683836137aa565b60015460ff16156131a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610f60565b565b60015460ff166131a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610f60565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610cac5760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556132a53390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000612be08373ffffffffffffffffffffffffffffffffffffffff8416613837565b6000612be08373ffffffffffffffffffffffffffffffffffffffff8416613886565b606081600001805480602002602001604051908101604052809291908181526020018280548015610d3357602002820191906000526020600020905b8154815260200190600101908083116133835750505050509050919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156133d95750600090506003613488565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561342d573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661348157600060019250925050613488565b9150600090505b94509492505050565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610cac5760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6060610afd73ffffffffffffffffffffffffffffffffffffffff831660145b60606000613576836002614a90565b613581906002614aa7565b67ffffffffffffffff81111561359957613599614d19565b6040519080825280601f01601f1916602001820160405280156135c3576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106135fa576135fa6145d7565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061365d5761365d6145d7565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000613699846002614a90565b6136a4906001614aa7565b90505b6001811115613741577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106136e5576136e56145d7565b1a60f81b8282815181106136fb576136fb6145d7565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361373a81614d48565b90506136a7565b508315612be0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610f60565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610f73908490613979565b600081815260018301602052604081205461387e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610afd565b506000610afd565b6000818152600183016020526040812054801561396f5760006138aa600183614d7d565b85549091506000906138be90600190614d7d565b90508181146139235760008660000182815481106138de576138de6145d7565b9060005260206000200154905080876000018481548110613901576139016145d7565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061393457613934614d90565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610afd565b6000915050610afd565b60006139db826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613a889092919063ffffffff16565b90508051600014806139fc5750808060200190518101906139fc9190614dbf565b610f73576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610f60565b6060613a978484600085613a9f565b949350505050565b606082471015613b31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610f60565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613b5a9190614ddc565b60006040518083038185875af1925050503d8060008114613b97576040519150601f19603f3d011682016040523d82523d6000602084013e613b9c565b606091505b50915091506114848783838760608315613c3e578251600003613c375773ffffffffffffffffffffffffffffffffffffffff85163b613c37576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610f60565b5081613a97565b613a978383815115613c535781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f609190614d06565b82805482825590600052602060002090601f01602090048101928215613d205791602002820160005b83821115613cf157833560ff1683826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302613cb0565b8015613d1e5782816101000a81549060ff0219169055600101602081600001049283019260010302613cf1565b505b50613d2c929150613d30565b5090565b5b80821115613d2c5760008155600101613d31565b73ffffffffffffffffffffffffffffffffffffffff8116811461158a57600080fd5b600080600060608486031215613d7c57600080fd5b8335613d8781613d45565b92506020840135613d9781613d45565b929592945050506040919091013590565b600060208284031215613dba57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114612be057600080fd5b801515811461158a57600080fd5b600060208284031215613e0a57600080fd5b8135612be081613dea565b600060208284031215613e2757600080fd5b5035919050565b803563ffffffff81168114610e1f57600080fd5b600060208284031215613e5457600080fd5b612be082613e2e565b6020808252825182820181905260009190848201906040850190845b81811015613e9857835160ff1683529284019291840191600101613e79565b50909695505050505050565b600060208284031215613eb657600080fd5b8135612be081613d45565b60008060408385031215613ed457600080fd5b823591506020830135613ee681613d45565b809150509250929050565b803567ffffffffffffffff81168114610e1f57600080fd5b60008083601f840112613f1b57600080fd5b50813567ffffffffffffffff811115613f3357600080fd5b602083019150836020828501011115612e3657600080fd5b600080600080600060808688031215613f6357600080fd5b613f6c86613e2e565b9450613f7a60208701613ef1565b93506040860135613f8a81613d45565b9250606086013567ffffffffffffffff811115613fa657600080fd5b613fb288828901613f09565b969995985093965092949392505050565b60008060408385031215613fd657600080fd5b8235613fe181613d45565b91506020830135613ee681613dea565b6000806020838503121561400457600080fd5b823567ffffffffffffffff8082111561401c57600080fd5b818501915085601f83011261403057600080fd5b81358181111561403f57600080fd5b8660208260071b850101111561405457600080fd5b60209290920196919550909350505050565b803561ffff81168114610e1f57600080fd5b6000806000806080858703121561408e57600080fd5b61409785614066565b93506140a560208601614066565b92506140b360408601613ef1565b915060608501356140c381613d45565b939692955090935050565b6000602082840312156140e057600080fd5b612be082613ef1565b6020808252825182820181905260009190848201906040850190845b81811015613e9857835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101614105565b600060a0828403121561414957600080fd5b50919050565b60008060006040848603121561416457600080fd5b833567ffffffffffffffff8082111561417c57600080fd5b61418887838801614137565b9450602086013591508082111561419e57600080fd5b506141ab86828701613f09565b9497909650939450505050565b60008083601f8401126141ca57600080fd5b50813567ffffffffffffffff8111156141e257600080fd5b6020830191508360208260051b8501011115612e3657600080fd5b6000806020838503121561421057600080fd5b823567ffffffffffffffff81111561422757600080fd5b614233858286016141b8565b90969095509350505050565b60006020828403121561425157600080fd5b612be082614066565b60008060006040848603121561426f57600080fd5b83359250602084013567ffffffffffffffff81111561428d57600080fd5b6141ab86828701613f09565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b82151581526040810160048310614308577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8260208301529392505050565b60008060006040848603121561432a57600080fd5b61433384613e2e565b9250602084013567ffffffffffffffff81111561434f57600080fd5b6141ab868287016141b8565b60008060008060006080868803121561437357600080fd5b61437c86613e2e565b9450602086013561438c81613d45565b9350604086013567ffffffffffffffff8111156143a857600080fd5b6143b488828901613f09565b96999598509660600135949350505050565b6000602082840312156143d857600080fd5b813567ffffffffffffffff8111156143ef57600080fd5b613a9784828501614137565b60008060008060008060006080888a03121561441657600080fd5b873561442181613d45565b9650602088013567ffffffffffffffff8082111561443e57600080fd5b61444a8b838c01613f09565b909850965060408a013591508082111561446357600080fd5b61446f8b838c01613f09565b909650945060608a013591508082111561448857600080fd5b506144958a828b01613f09565b989b979a50959850939692959293505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b6000610140614569838873ffffffffffffffffffffffffffffffffffffffff80825116835263ffffffff6020830151166020840152604082015167ffffffffffffffff808216604086015282606085015116606086015280608085015116608086015250505061ffff60a08201511660a08301525050565b6145aa60c08401875467ffffffffffffffff81168252604081811c61ffff16602084015260509190911c6fffffffffffffffffffffffffffffffff16910152565b8061012084015261148481840185876144a8565b6000602082840312156145d057600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b80356fffffffffffffffffffffffffffffffff81168114610e1f57600080fd5b60006020828403121561463857600080fd5b612be082614606565b6020808252818101839052600090604080840186845b878110156146d25763ffffffff61466d83613e2e565b16835267ffffffffffffffff614684868401613ef1565b168584015261ffff614697858401614066565b168484015260606fffffffffffffffffffffffffffffffff6146ba828501614606565b16908401526080928301929190910190600101614657565b5090979650505050505050565b60005b838110156146fa5781810151838201526020016146e2565b50506000910152565b6000815180845261471b8160208601602086016146df565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006101406147c5838773ffffffffffffffffffffffffffffffffffffffff80825116835263ffffffff6020830151166020840152604082015167ffffffffffffffff808216604086015282606085015116606086015280608085015116608086015250505061ffff60a08201511660a08301525050565b61480660c08401865467ffffffffffffffff81168252604081811c61ffff16602084015260509190911c6fffffffffffffffffffffffffffffffff16910152565b8061012084015261481981840185614703565b9695505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6183360301811261485757600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261489657600080fd5b83018035915067ffffffffffffffff8211156148b157600080fd5b602001915036819003821315612e3657600080fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081358181169160048510156149065780818660040360031b1b83161692505b505092915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261494357600080fd5b830160208101925035905067ffffffffffffffff81111561496357600080fd5b803603821315612e3657600080fd5b6040815263ffffffff61498484613e2e565b1660408201526000602084013561499a81613d45565b73ffffffffffffffffffffffffffffffffffffffff1660608301526149c2604085018561490e565b60a060808501526149d760e0850182846144a8565b915050606085013560a08401526149f1608086018661490e565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08584030160c0860152614a268382846144a8565b93505050508260208301529392505050565b8183823760009101908152919050565b828152604060208201526000613a976040830184614703565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610afd57610afd614a61565b80820180821115610afd57610afd614a61565b60008085851115614aca57600080fd5b83861115614ad757600080fd5b5050820193919092039150565b7fffffffff000000000000000000000000000000000000000000000000000000008660e01b1681527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008560601b1660048201528360188201528183603883013760009101603801908152949350505050565b600061012073ffffffffffffffffffffffffffffffffffffffff808a511684528060208b01511660208501525067ffffffffffffffff60408a015116604084015261ffff60608a0151166060840152614be660808401895467ffffffffffffffff81168252604081811c61ffff16602084015260509190911c6fffffffffffffffffffffffffffffffff16910152565b8060e0840152614bf981840187896144a8565b9050828103610100840152614c0f8185876144a8565b9998505050505050505050565b600067ffffffffffffffff808316818103614c3957614c39614a61565b6001019392505050565b600067ffffffffffffffff821680614c5d57614c5d614a61565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614cbd8160178501602088016146df565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351614cfa8160288401602088016146df565b01602801949350505050565b602081526000612be06020830184614703565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600081614d5757614d57614a61565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b81810381811115610afd57610afd614a61565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600060208284031215614dd157600080fd5b8151612be081613dea565b600082516148578184602087016146df56fea2646970667358221220198a6ed2fc72043001b01d1b1945eeab857e3b52b5e2dd6f3d5106e342b43a0e64736f6c634300081600330000000000000000000000000000000000000000000000000000000000007595000000000000000000000000000000000000000000000000000000000000006500000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000c03f31fd86a9077785b7bcf6598ce3598fa911130000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000040000000000000000000000004d73adb72bc3dd368966edd0f0b2148401a178e2000000000000000000000000d231084bfb234c107d3ee2b22f97f3346fdaf705000000000000000000000000bb2ea70c9e858123480642cf96acbcce1372dce100000000000000000000000074f55bc2a79a27a0bf1d1a35db5d0fc36b9fdb9d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d031f474f7e6e28845e1d4856b9b1aef289703970000000000000000000000000000000000000000000000000000000000000002000000000000000000000000b52fa54fc261398058c3ac7b8dd442d7d8b9f0b6000000000000000000000000b8ff877ed78ba520ece21b1de7843a8a57ca47cb","name":"DVN","is_blueprint":false,"license_type":"none","is_fully_verified":false,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"paris","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"@openzeppelin/contracts/utils/structs/EnumerableSet.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n *     // Add the library methods\n *     using EnumerableSet for EnumerableSet.AddressSet;\n *\n *     // Declare a set state variable\n *     EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n    // To implement this library for multiple types with as little code\n    // repetition as possible, we write it in terms of a generic Set type with\n    // bytes32 values.\n    // The Set implementation uses private functions, and user-facing\n    // implementations (such as AddressSet) are just wrappers around the\n    // underlying Set.\n    // This means that we can only create new EnumerableSets for types that fit\n    // in bytes32.\n\n    struct Set {\n        // Storage of set values\n        bytes32[] _values;\n        // Position of the value in the `values` array, plus 1 because index 0\n        // means a value is not in the set.\n        mapping(bytes32 => uint256) _indexes;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function _add(Set storage set, bytes32 value) private returns (bool) {\n        if (!_contains(set, value)) {\n            set._values.push(value);\n            // The value is stored at length-1, but we add 1 to all indexes\n            // and use 0 as a sentinel value\n            set._indexes[value] = set._values.length;\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function _remove(Set storage set, bytes32 value) private returns (bool) {\n        // We read and store the value's index to prevent multiple reads from the same storage slot\n        uint256 valueIndex = set._indexes[value];\n\n        if (valueIndex != 0) {\n            // Equivalent to contains(set, value)\n            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n            // the array, and then remove the last element (sometimes called as 'swap and pop').\n            // This modifies the order of the array, as noted in {at}.\n\n            uint256 toDeleteIndex = valueIndex - 1;\n            uint256 lastIndex = set._values.length - 1;\n\n            if (lastIndex != toDeleteIndex) {\n                bytes32 lastValue = set._values[lastIndex];\n\n                // Move the last value to the index where the value to delete is\n                set._values[toDeleteIndex] = lastValue;\n                // Update the index for the moved value\n                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n            }\n\n            // Delete the slot where the moved value was stored\n            set._values.pop();\n\n            // Delete the index for the deleted slot\n            delete set._indexes[value];\n\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function _contains(Set storage set, bytes32 value) private view returns (bool) {\n        return set._indexes[value] != 0;\n    }\n\n    /**\n     * @dev Returns the number of values on the set. O(1).\n     */\n    function _length(Set storage set) private view returns (uint256) {\n        return set._values.length;\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function _at(Set storage set, uint256 index) private view returns (bytes32) {\n        return set._values[index];\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function _values(Set storage set) private view returns (bytes32[] memory) {\n        return set._values;\n    }\n\n    // Bytes32Set\n\n    struct Bytes32Set {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _add(set._inner, value);\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _remove(set._inner, value);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n        return _contains(set._inner, value);\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(Bytes32Set storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n        return _at(set._inner, index);\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        bytes32[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // AddressSet\n\n    struct AddressSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(AddressSet storage set, address value) internal returns (bool) {\n        return _add(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(AddressSet storage set, address value) internal returns (bool) {\n        return _remove(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(AddressSet storage set, address value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(AddressSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(AddressSet storage set, uint256 index) internal view returns (address) {\n        return address(uint160(uint256(_at(set._inner, index))));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(AddressSet storage set) internal view returns (address[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        address[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // UintSet\n\n    struct UintSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(UintSet storage set, uint256 value) internal returns (bool) {\n        return _add(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(UintSet storage set, uint256 value) internal returns (bool) {\n        return _remove(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(UintSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n        return uint256(_at(set._inner, index));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(UintSet storage set) internal view returns (uint256[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        uint256[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n}\n"},{"file_path":"contracts/uln/interfaces/IDVN.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IWorker } from \"../../interfaces/IWorker.sol\";\nimport { ILayerZeroDVN } from \"./ILayerZeroDVN.sol\";\nimport { ILayerZeroReadDVN } from \"./ILayerZeroReadDVN.sol\";\n\ninterface IDVN is IWorker, ILayerZeroDVN, ILayerZeroReadDVN {\n    struct DstConfigParam {\n        uint32 dstEid;\n        uint64 gas;\n        uint16 multiplierBps;\n        uint128 floorMarginUSD;\n    }\n\n    struct DstConfig {\n        uint64 gas;\n        uint16 multiplierBps;\n        uint128 floorMarginUSD; // uses priceFeed PRICE_RATIO_DENOMINATOR\n    }\n\n    event SetDstConfig(DstConfigParam[] params);\n\n    function dstConfig(uint32 _dstEid) external view returns (uint64, uint16, uint128);\n}\n"},{"file_path":"contracts/interfaces/ILayerZeroReadExecutor.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface ILayerZeroReadExecutor {\n    // @notice query price and assign jobs at the same time\n    // @param _sender - the source sending contract address. executors may apply price discrimination to senders\n    // @param _options - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain\n    function assignJob(address _sender, bytes calldata _options) external returns (uint256 fee);\n\n    // @notice query the executor price for executing the payload on this chain\n    // @param _sender - the source sending contract address. executors may apply price discrimination to senders\n    // @param _options - optional parameters for extra service plugins, e.g. sending dust tokens\n    function getFee(address _sender, bytes calldata _options) external view returns (uint256 fee);\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nstruct SetConfigParam {\n    uint32 eid;\n    uint32 configType;\n    bytes config;\n}\n\ninterface IMessageLibManager {\n    struct Timeout {\n        address lib;\n        uint256 expiry;\n    }\n\n    event LibraryRegistered(address newLib);\n    event DefaultSendLibrarySet(uint32 eid, address newLib);\n    event DefaultReceiveLibrarySet(uint32 eid, address newLib);\n    event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry);\n    event SendLibrarySet(address sender, uint32 eid, address newLib);\n    event ReceiveLibrarySet(address receiver, uint32 eid, address newLib);\n    event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout);\n\n    function registerLibrary(address _lib) external;\n\n    function isRegisteredLibrary(address _lib) external view returns (bool);\n\n    function getRegisteredLibraries() external view returns (address[] memory);\n\n    function setDefaultSendLibrary(uint32 _eid, address _newLib) external;\n\n    function defaultSendLibrary(uint32 _eid) external view returns (address);\n\n    function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _gracePeriod) external;\n\n    function defaultReceiveLibrary(uint32 _eid) external view returns (address);\n\n    function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external;\n\n    function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry);\n\n    function isSupportedEid(uint32 _eid) external view returns (bool);\n\n    function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool);\n\n    /// ------------------- OApp interfaces -------------------\n    function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external;\n\n    function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib);\n\n    function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool);\n\n    function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external;\n\n    function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault);\n\n    function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _expiry) external;\n\n    function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry);\n\n    function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external;\n\n    function getConfig(\n        address _oapp,\n        address _lib,\n        uint32 _eid,\n        uint32 _configType\n    ) external view returns (bytes memory config);\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/ExecutorOptions.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { CalldataBytesLib } from \"../../libs/CalldataBytesLib.sol\";\n\nlibrary ExecutorOptions {\n    using CalldataBytesLib for bytes;\n\n    uint8 internal constant WORKER_ID = 1;\n\n    uint8 internal constant OPTION_TYPE_LZRECEIVE = 1;\n    uint8 internal constant OPTION_TYPE_NATIVE_DROP = 2;\n    uint8 internal constant OPTION_TYPE_LZCOMPOSE = 3;\n    uint8 internal constant OPTION_TYPE_ORDERED_EXECUTION = 4;\n\n    error Executor_InvalidLzReceiveOption();\n    error Executor_InvalidNativeDropOption();\n    error Executor_InvalidLzComposeOption();\n\n    /// @dev decode the next executor option from the options starting from the specified cursor\n    /// @param _options [executor_id][executor_option][executor_id][executor_option]...\n    ///        executor_option = [option_size][option_type][option]\n    ///        option_size = len(option_type) + len(option)\n    ///        executor_id: uint8, option_size: uint16, option_type: uint8, option: bytes\n    /// @param _cursor the cursor to start decoding from\n    /// @return optionType the type of the option\n    /// @return option the option of the executor\n    /// @return cursor the cursor to start decoding the next executor option\n    function nextExecutorOption(\n        bytes calldata _options,\n        uint256 _cursor\n    ) internal pure returns (uint8 optionType, bytes calldata option, uint256 cursor) {\n        unchecked {\n            // skip worker id\n            cursor = _cursor + 1;\n\n            // read option size\n            uint16 size = _options.toU16(cursor);\n            cursor += 2;\n\n            // read option type\n            optionType = _options.toU8(cursor);\n\n            // startCursor and endCursor are used to slice the option from _options\n            uint256 startCursor = cursor + 1; // skip option type\n            uint256 endCursor = cursor + size;\n            option = _options[startCursor:endCursor];\n            cursor += size;\n        }\n    }\n\n    function decodeLzReceiveOption(bytes calldata _option) internal pure returns (uint128 gas, uint128 value) {\n        if (_option.length != 16 && _option.length != 32) revert Executor_InvalidLzReceiveOption();\n        gas = _option.toU128(0);\n        value = _option.length == 32 ? _option.toU128(16) : 0;\n    }\n\n    function decodeNativeDropOption(bytes calldata _option) internal pure returns (uint128 amount, bytes32 receiver) {\n        if (_option.length != 48) revert Executor_InvalidNativeDropOption();\n        amount = _option.toU128(0);\n        receiver = _option.toB32(16);\n    }\n\n    function decodeLzComposeOption(\n        bytes calldata _option\n    ) internal pure returns (uint16 index, uint128 gas, uint128 value) {\n        if (_option.length != 18 && _option.length != 34) revert Executor_InvalidLzComposeOption();\n        index = _option.toU16(0);\n        gas = _option.toU128(2);\n        value = _option.length == 34 ? _option.toU128(18) : 0;\n    }\n\n    function encodeLzReceiveOption(uint128 _gas, uint128 _value) internal pure returns (bytes memory) {\n        return _value == 0 ? abi.encodePacked(_gas) : abi.encodePacked(_gas, _value);\n    }\n\n    function encodeNativeDropOption(uint128 _amount, bytes32 _receiver) internal pure returns (bytes memory) {\n        return abi.encodePacked(_amount, _receiver);\n    }\n\n    function encodeLzComposeOption(uint16 _index, uint128 _gas, uint128 _value) internal pure returns (bytes memory) {\n        return _value == 0 ? abi.encodePacked(_index, _gas) : abi.encodePacked(_index, _gas, _value);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/Address.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     *\n     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n     *\n     * _Available since v4.8._\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        if (success) {\n            if (returndata.length == 0) {\n                // only check isContract if the call was successful and the return data is empty\n                // otherwise we already know that it was a contract\n                require(isContract(target), \"Address: call to non-contract\");\n            }\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason or using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert(errorMessage);\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/cryptography/ECDSA.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Strings.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n    enum RecoverError {\n        NoError,\n        InvalidSignature,\n        InvalidSignatureLength,\n        InvalidSignatureS,\n        InvalidSignatureV // Deprecated in v4.8\n    }\n\n    function _throwError(RecoverError error) private pure {\n        if (error == RecoverError.NoError) {\n            return; // no error: do nothing\n        } else if (error == RecoverError.InvalidSignature) {\n            revert(\"ECDSA: invalid signature\");\n        } else if (error == RecoverError.InvalidSignatureLength) {\n            revert(\"ECDSA: invalid signature length\");\n        } else if (error == RecoverError.InvalidSignatureS) {\n            revert(\"ECDSA: invalid signature 's' value\");\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature` or error string. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {toEthSignedMessageHash} on it.\n     *\n     * Documentation for signature generation:\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n     *\n     * _Available since v4.3._\n     */\n    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n        if (signature.length == 65) {\n            bytes32 r;\n            bytes32 s;\n            uint8 v;\n            // ecrecover takes the signature parameters, and the only way to get them\n            // currently is to use assembly.\n            /// @solidity memory-safe-assembly\n            assembly {\n                r := mload(add(signature, 0x20))\n                s := mload(add(signature, 0x40))\n                v := byte(0, mload(add(signature, 0x60)))\n            }\n            return tryRecover(hash, v, r, s);\n        } else {\n            return (address(0), RecoverError.InvalidSignatureLength);\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature`. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {toEthSignedMessageHash} on it.\n     */\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n        (address recovered, RecoverError error) = tryRecover(hash, signature);\n        _throwError(error);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n     *\n     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n     *\n     * _Available since v4.3._\n     */\n    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {\n        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n        uint8 v = uint8((uint256(vs) >> 255) + 27);\n        return tryRecover(hash, v, r, s);\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n     *\n     * _Available since v4.2._\n     */\n    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n        (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n        _throwError(error);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     *\n     * _Available since v4.3._\n     */\n    function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n        //\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n        // these malleable signatures as well.\n        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n            return (address(0), RecoverError.InvalidSignatureS);\n        }\n\n        // If the signature is valid (and not malleable), return the signer address\n        address signer = ecrecover(hash, v, r, s);\n        if (signer == address(0)) {\n            return (address(0), RecoverError.InvalidSignature);\n        }\n\n        return (signer, RecoverError.NoError);\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n        _throwError(error);\n        return recovered;\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n     * produces hash corresponding to the one signed with the\n     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n     * JSON-RPC method as part of EIP-191.\n     *\n     * See {recover}.\n     */\n    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {\n        // 32 is the length in bytes of hash,\n        // enforced by the type signature above\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\")\n            mstore(0x1c, hash)\n            message := keccak256(0x00, 0x3c)\n        }\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Message, created from `s`. This\n     * produces hash corresponding to the one signed with the\n     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n     * JSON-RPC method as part of EIP-191.\n     *\n     * See {recover}.\n     */\n    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", Strings.toString(s.length), s));\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Typed Data, created from a\n     * `domainSeparator` and a `structHash`. This produces hash corresponding\n     * to the one signed with the\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n     * JSON-RPC method as part of EIP-712.\n     *\n     * See {recover}.\n     */\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let ptr := mload(0x40)\n            mstore(ptr, \"\\x19\\x01\")\n            mstore(add(ptr, 0x02), domainSeparator)\n            mstore(add(ptr, 0x22), structHash)\n            data := keccak256(ptr, 0x42)\n        }\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Data with intended validator, created from a\n     * `validator` and `data` according to the version 0 of EIP-191.\n     *\n     * See {recover}.\n     */\n    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(\"\\x19\\x00\", validator, data));\n    }\n}\n"},{"file_path":"contracts/uln/interfaces/ILayerZeroDVN.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface ILayerZeroDVN {\n    struct AssignJobParam {\n        uint32 dstEid;\n        bytes packetHeader;\n        bytes32 payloadHash;\n        uint64 confirmations;\n        address sender;\n    }\n\n    // @notice query price and assign jobs at the same time\n    // @param _dstEid - the destination endpoint identifier\n    // @param _packetHeader - version + nonce + path\n    // @param _payloadHash - hash of guid + message\n    // @param _confirmations - block confirmation delay before relaying blocks\n    // @param _sender - the source sending contract address\n    // @param _options - options\n    function assignJob(AssignJobParam calldata _param, bytes calldata _options) external payable returns (uint256 fee);\n\n    // @notice query the dvn fee for relaying block information to the destination chain\n    // @param _dstEid the destination endpoint identifier\n    // @param _confirmations - block confirmation delay before relaying blocks\n    // @param _sender - the source sending contract address\n    // @param _options - options\n    function getFee(\n        uint32 _dstEid,\n        uint64 _confirmations,\n        address _sender,\n        bytes calldata _options\n    ) external view returns (uint256 fee);\n}\n"},{"file_path":"@openzeppelin/contracts/access/IAccessControl.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted signaling this.\n     *\n     * _Available since v3.1._\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call, an admin role\n     * bearer except when using {AccessControl-_setupRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) external view returns (bool);\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     */\n    function renounceRole(bytes32 role, address account) external;\n}\n"},{"file_path":"contracts/uln/interfaces/IReceiveUlnE2.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\n/// @dev should be implemented by the ReceiveUln302 contract and future ReceiveUln contracts on EndpointV2\ninterface IReceiveUlnE2 {\n    /// @notice for each dvn to verify the payload\n    /// @dev this function signature 0x0223536e\n    function verify(bytes calldata _packetHeader, bytes32 _payloadHash, uint64 _confirmations) external;\n\n    /// @notice verify the payload at endpoint, will check if all DVNs verified\n    function commitVerification(bytes calldata _packetHeader, bytes32 _payloadHash) external;\n}\n"},{"file_path":"solidity-bytes-utils/contracts/BytesLib.sol","source_code":"// SPDX-License-Identifier: Unlicense\n/*\n * @title Solidity Bytes Arrays Utils\n * @author Gonçalo Sá <goncalo.sa@consensys.net>\n *\n * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.\n *      The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.\n */\npragma solidity >=0.8.0 <0.9.0;\n\n\nlibrary BytesLib {\n    function concat(\n        bytes memory _preBytes,\n        bytes memory _postBytes\n    )\n        internal\n        pure\n        returns (bytes memory)\n    {\n        bytes memory tempBytes;\n\n        assembly {\n            // Get a location of some free memory and store it in tempBytes as\n            // Solidity does for memory variables.\n            tempBytes := mload(0x40)\n\n            // Store the length of the first bytes array at the beginning of\n            // the memory for tempBytes.\n            let length := mload(_preBytes)\n            mstore(tempBytes, length)\n\n            // Maintain a memory counter for the current write location in the\n            // temp bytes array by adding the 32 bytes for the array length to\n            // the starting location.\n            let mc := add(tempBytes, 0x20)\n            // Stop copying when the memory counter reaches the length of the\n            // first bytes array.\n            let end := add(mc, length)\n\n            for {\n                // Initialize a copy counter to the start of the _preBytes data,\n                // 32 bytes into its memory.\n                let cc := add(_preBytes, 0x20)\n            } lt(mc, end) {\n                // Increase both counters by 32 bytes each iteration.\n                mc := add(mc, 0x20)\n                cc := add(cc, 0x20)\n            } {\n                // Write the _preBytes data into the tempBytes memory 32 bytes\n                // at a time.\n                mstore(mc, mload(cc))\n            }\n\n            // Add the length of _postBytes to the current length of tempBytes\n            // and store it as the new length in the first 32 bytes of the\n            // tempBytes memory.\n            length := mload(_postBytes)\n            mstore(tempBytes, add(length, mload(tempBytes)))\n\n            // Move the memory counter back from a multiple of 0x20 to the\n            // actual end of the _preBytes data.\n            mc := end\n            // Stop copying when the memory counter reaches the new combined\n            // length of the arrays.\n            end := add(mc, length)\n\n            for {\n                let cc := add(_postBytes, 0x20)\n            } lt(mc, end) {\n                mc := add(mc, 0x20)\n                cc := add(cc, 0x20)\n            } {\n                mstore(mc, mload(cc))\n            }\n\n            // Update the free-memory pointer by padding our last write location\n            // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\n            // next 32 byte block, then round down to the nearest multiple of\n            // 32. If the sum of the length of the two arrays is zero then add\n            // one before rounding down to leave a blank 32 bytes (the length block with 0).\n            mstore(0x40, and(\n              add(add(end, iszero(add(length, mload(_preBytes)))), 31),\n              not(31) // Round down to the nearest 32 bytes.\n            ))\n        }\n\n        return tempBytes;\n    }\n\n    function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\n        assembly {\n            // Read the first 32 bytes of _preBytes storage, which is the length\n            // of the array. (We don't need to use the offset into the slot\n            // because arrays use the entire slot.)\n            let fslot := sload(_preBytes.slot)\n            // Arrays of 31 bytes or less have an even value in their slot,\n            // while longer arrays have an odd value. The actual length is\n            // the slot divided by two for odd values, and the lowest order\n            // byte divided by two for even values.\n            // If the slot is even, bitwise and the slot with 255 and divide by\n            // two to get the length. If the slot is odd, bitwise and the slot\n            // with -1 and divide by two.\n            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n            let mlength := mload(_postBytes)\n            let newlength := add(slength, mlength)\n            // slength can contain both the length and contents of the array\n            // if length < 32 bytes so let's prepare for that\n            // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n            switch add(lt(slength, 32), lt(newlength, 32))\n            case 2 {\n                // Since the new array still fits in the slot, we just need to\n                // update the contents of the slot.\n                // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\n                sstore(\n                    _preBytes.slot,\n                    // all the modifications to the slot are inside this\n                    // next block\n                    add(\n                        // we can just add to the slot contents because the\n                        // bytes we want to change are the LSBs\n                        fslot,\n                        add(\n                            mul(\n                                div(\n                                    // load the bytes from memory\n                                    mload(add(_postBytes, 0x20)),\n                                    // zero all bytes to the right\n                                    exp(0x100, sub(32, mlength))\n                                ),\n                                // and now shift left the number of bytes to\n                                // leave space for the length in the slot\n                                exp(0x100, sub(32, newlength))\n                            ),\n                            // increase length by the double of the memory\n                            // bytes length\n                            mul(mlength, 2)\n                        )\n                    )\n                )\n            }\n            case 1 {\n                // The stored value fits in the slot, but the combined value\n                // will exceed it.\n                // get the keccak hash to get the contents of the array\n                mstore(0x0, _preBytes.slot)\n                let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n                // save new length\n                sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n                // The contents of the _postBytes array start 32 bytes into\n                // the structure. Our first read should obtain the `submod`\n                // bytes that can fit into the unused space in the last word\n                // of the stored array. To get this, we read 32 bytes starting\n                // from `submod`, so the data we read overlaps with the array\n                // contents by `submod` bytes. Masking the lowest-order\n                // `submod` bytes allows us to add that value directly to the\n                // stored value.\n\n                let submod := sub(32, slength)\n                let mc := add(_postBytes, submod)\n                let end := add(_postBytes, mlength)\n                let mask := sub(exp(0x100, submod), 1)\n\n                sstore(\n                    sc,\n                    add(\n                        and(\n                            fslot,\n                            0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\n                        ),\n                        and(mload(mc), mask)\n                    )\n                )\n\n                for {\n                    mc := add(mc, 0x20)\n                    sc := add(sc, 1)\n                } lt(mc, end) {\n                    sc := add(sc, 1)\n                    mc := add(mc, 0x20)\n                } {\n                    sstore(sc, mload(mc))\n                }\n\n                mask := exp(0x100, sub(mc, end))\n\n                sstore(sc, mul(div(mload(mc), mask), mask))\n            }\n            default {\n                // get the keccak hash to get the contents of the array\n                mstore(0x0, _preBytes.slot)\n                // Start copying to the last used word of the stored array.\n                let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n                // save new length\n                sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n                // Copy over the first `submod` bytes of the new data as in\n                // case 1 above.\n                let slengthmod := mod(slength, 32)\n                let mlengthmod := mod(mlength, 32)\n                let submod := sub(32, slengthmod)\n                let mc := add(_postBytes, submod)\n                let end := add(_postBytes, mlength)\n                let mask := sub(exp(0x100, submod), 1)\n\n                sstore(sc, add(sload(sc), and(mload(mc), mask)))\n\n                for {\n                    sc := add(sc, 1)\n                    mc := add(mc, 0x20)\n                } lt(mc, end) {\n                    sc := add(sc, 1)\n                    mc := add(mc, 0x20)\n                } {\n                    sstore(sc, mload(mc))\n                }\n\n                mask := exp(0x100, sub(mc, end))\n\n                sstore(sc, mul(div(mload(mc), mask), mask))\n            }\n        }\n    }\n\n    function slice(\n        bytes memory _bytes,\n        uint256 _start,\n        uint256 _length\n    )\n        internal\n        pure\n        returns (bytes memory)\n    {\n        require(_length + 31 >= _length, \"slice_overflow\");\n        require(_bytes.length >= _start + _length, \"slice_outOfBounds\");\n\n        bytes memory tempBytes;\n\n        assembly {\n            switch iszero(_length)\n            case 0 {\n                // Get a location of some free memory and store it in tempBytes as\n                // Solidity does for memory variables.\n                tempBytes := mload(0x40)\n\n                // The first word of the slice result is potentially a partial\n                // word read from the original array. To read it, we calculate\n                // the length of that partial word and start copying that many\n                // bytes into the array. The first word we copy will start with\n                // data we don't care about, but the last `lengthmod` bytes will\n                // land at the beginning of the contents of the new array. When\n                // we're done copying, we overwrite the full first word with\n                // the actual length of the slice.\n                let lengthmod := and(_length, 31)\n\n                // The multiplication in the next line is necessary\n                // because when slicing multiples of 32 bytes (lengthmod == 0)\n                // the following copy loop was copying the origin's length\n                // and then ending prematurely not copying everything it should.\n                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\n                let end := add(mc, _length)\n\n                for {\n                    // The multiplication in the next line has the same exact purpose\n                    // as the one above.\n                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\n                } lt(mc, end) {\n                    mc := add(mc, 0x20)\n                    cc := add(cc, 0x20)\n                } {\n                    mstore(mc, mload(cc))\n                }\n\n                mstore(tempBytes, _length)\n\n                //update free-memory pointer\n                //allocating the array padded to 32 bytes like the compiler does now\n                mstore(0x40, and(add(mc, 31), not(31)))\n            }\n            //if we want a zero-length slice let's just return a zero-length array\n            default {\n                tempBytes := mload(0x40)\n                //zero out the 32 bytes slice we are about to return\n                //we need to do it because Solidity does not garbage collect\n                mstore(tempBytes, 0)\n\n                mstore(0x40, add(tempBytes, 0x20))\n            }\n        }\n\n        return tempBytes;\n    }\n\n    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\n        require(_bytes.length >= _start + 20, \"toAddress_outOfBounds\");\n        address tempAddress;\n\n        assembly {\n            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\n        }\n\n        return tempAddress;\n    }\n\n    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {\n        require(_bytes.length >= _start + 1 , \"toUint8_outOfBounds\");\n        uint8 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0x1), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {\n        require(_bytes.length >= _start + 2, \"toUint16_outOfBounds\");\n        uint16 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0x2), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {\n        require(_bytes.length >= _start + 4, \"toUint32_outOfBounds\");\n        uint32 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0x4), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {\n        require(_bytes.length >= _start + 8, \"toUint64_outOfBounds\");\n        uint64 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0x8), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {\n        require(_bytes.length >= _start + 12, \"toUint96_outOfBounds\");\n        uint96 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0xc), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {\n        require(_bytes.length >= _start + 16, \"toUint128_outOfBounds\");\n        uint128 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0x10), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {\n        require(_bytes.length >= _start + 32, \"toUint256_outOfBounds\");\n        uint256 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0x20), _start))\n        }\n\n        return tempUint;\n    }\n\n    function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {\n        require(_bytes.length >= _start + 32, \"toBytes32_outOfBounds\");\n        bytes32 tempBytes32;\n\n        assembly {\n            tempBytes32 := mload(add(add(_bytes, 0x20), _start))\n        }\n\n        return tempBytes32;\n    }\n\n    function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\n        bool success = true;\n\n        assembly {\n            let length := mload(_preBytes)\n\n            // if lengths don't match the arrays are not equal\n            switch eq(length, mload(_postBytes))\n            case 1 {\n                // cb is a circuit breaker in the for loop since there's\n                //  no said feature for inline assembly loops\n                // cb = 1 - don't breaker\n                // cb = 0 - break\n                let cb := 1\n\n                let mc := add(_preBytes, 0x20)\n                let end := add(mc, length)\n\n                for {\n                    let cc := add(_postBytes, 0x20)\n                // the next line is the loop condition:\n                // while(uint256(mc < end) + cb == 2)\n                } eq(add(lt(mc, end), cb), 2) {\n                    mc := add(mc, 0x20)\n                    cc := add(cc, 0x20)\n                } {\n                    // if any of these checks fails then arrays are not equal\n                    if iszero(eq(mload(mc), mload(cc))) {\n                        // unsuccess:\n                        success := 0\n                        cb := 0\n                    }\n                }\n            }\n            default {\n                // unsuccess:\n                success := 0\n            }\n        }\n\n        return success;\n    }\n\n    function equalStorage(\n        bytes storage _preBytes,\n        bytes memory _postBytes\n    )\n        internal\n        view\n        returns (bool)\n    {\n        bool success = true;\n\n        assembly {\n            // we know _preBytes_offset is 0\n            let fslot := sload(_preBytes.slot)\n            // Decode the length of the stored array like in concatStorage().\n            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n            let mlength := mload(_postBytes)\n\n            // if lengths don't match the arrays are not equal\n            switch eq(slength, mlength)\n            case 1 {\n                // slength can contain both the length and contents of the array\n                // if length < 32 bytes so let's prepare for that\n                // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n                if iszero(iszero(slength)) {\n                    switch lt(slength, 32)\n                    case 1 {\n                        // blank the last byte which is the length\n                        fslot := mul(div(fslot, 0x100), 0x100)\n\n                        if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\n                            // unsuccess:\n                            success := 0\n                        }\n                    }\n                    default {\n                        // cb is a circuit breaker in the for loop since there's\n                        //  no said feature for inline assembly loops\n                        // cb = 1 - don't breaker\n                        // cb = 0 - break\n                        let cb := 1\n\n                        // get the keccak hash to get the contents of the array\n                        mstore(0x0, _preBytes.slot)\n                        let sc := keccak256(0x0, 0x20)\n\n                        let mc := add(_postBytes, 0x20)\n                        let end := add(mc, mlength)\n\n                        // the next line is the loop condition:\n                        // while(uint256(mc < end) + cb == 2)\n                        for {} eq(add(lt(mc, end), cb), 2) {\n                            sc := add(sc, 1)\n                            mc := add(mc, 0x20)\n                        } {\n                            if iszero(eq(sload(sc), mload(mc))) {\n                                // unsuccess:\n                                success := 0\n                                cb := 0\n                            }\n                        }\n                    }\n                }\n            }\n            default {\n                // unsuccess:\n                success := 0\n            }\n        }\n\n        return success;\n    }\n}\n"},{"file_path":"contracts/uln/libs/UlnOptions.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { SafeCast } from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\n\nimport { ExecutorOptions } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/ExecutorOptions.sol\";\n\nimport { DVNOptions } from \"./DVNOptions.sol\";\n\nlibrary UlnOptions {\n    using SafeCast for uint256;\n\n    uint16 internal constant TYPE_1 = 1; // legacy options type 1\n    uint16 internal constant TYPE_2 = 2; // legacy options type 2\n    uint16 internal constant TYPE_3 = 3;\n\n    error LZ_ULN_InvalidWorkerOptions(uint256 cursor);\n    error LZ_ULN_InvalidWorkerId(uint8 workerId);\n    error LZ_ULN_InvalidLegacyType1Option();\n    error LZ_ULN_InvalidLegacyType2Option();\n    error LZ_ULN_UnsupportedOptionType(uint16 optionType);\n\n    /// @dev decode the options into executorOptions and dvnOptions\n    /// @param _options the options can be either legacy options (type 1 or 2) or type 3 options\n    /// @return executorOptions the executor options, share the same format of type 3 options\n    /// @return dvnOptions the dvn options, share the same format of type 3 options\n    function decode(\n        bytes calldata _options\n    ) internal pure returns (bytes memory executorOptions, bytes memory dvnOptions) {\n        // at least 2 bytes for the option type, but can have no options\n        if (_options.length < 2) revert LZ_ULN_InvalidWorkerOptions(0);\n\n        uint16 optionsType = uint16(bytes2(_options[0:2]));\n        uint256 cursor = 2;\n\n        // type3 options: [worker_option][worker_option]...\n        // worker_option: [worker_id][option_size][option]\n        // worker_id: uint8, option_size: uint16, option: bytes\n        if (optionsType == TYPE_3) {\n            unchecked {\n                uint256 start = cursor;\n                uint8 lastWorkerId; // worker_id starts from 1, so 0 is an invalid worker_id\n\n                // heuristic: we assume that the options are mostly EXECUTOR options only\n                // checking the workerID can reduce gas usage for most cases\n                while (cursor < _options.length) {\n                    uint8 workerId = uint8(bytes1(_options[cursor:cursor + 1]));\n                    if (workerId == 0) revert LZ_ULN_InvalidWorkerId(0);\n\n                    // workerId must equal to the lastWorkerId for the first option\n                    // so it is always skipped in the first option\n                    // this operation slices out options whenever the the scan finds a different workerId\n                    if (lastWorkerId == 0) {\n                        lastWorkerId = workerId;\n                    } else if (workerId != lastWorkerId) {\n                        bytes calldata op = _options[start:cursor]; // slice out the last worker's options\n                        (executorOptions, dvnOptions) = _insertWorkerOptions(\n                            executorOptions,\n                            dvnOptions,\n                            lastWorkerId,\n                            op\n                        );\n\n                        // reset the start cursor and lastWorkerId\n                        start = cursor;\n                        lastWorkerId = workerId;\n                    }\n\n                    ++cursor; // for workerId\n\n                    uint16 size = uint16(bytes2(_options[cursor:cursor + 2]));\n                    if (size == 0) revert LZ_ULN_InvalidWorkerOptions(cursor);\n                    cursor += size + 2;\n                }\n\n                // the options length must be the same as the cursor at the end\n                if (cursor != _options.length) revert LZ_ULN_InvalidWorkerOptions(cursor);\n\n                // if we have reached the end of the options and the options are not empty\n                // we need to process the last worker's options\n                if (_options.length > 2) {\n                    bytes calldata op = _options[start:cursor];\n                    (executorOptions, dvnOptions) = _insertWorkerOptions(executorOptions, dvnOptions, lastWorkerId, op);\n                }\n            }\n        } else {\n            executorOptions = decodeLegacyOptions(optionsType, _options);\n        }\n    }\n\n    function _insertWorkerOptions(\n        bytes memory _executorOptions,\n        bytes memory _dvnOptions,\n        uint8 _workerId,\n        bytes calldata _newOptions\n    ) private pure returns (bytes memory, bytes memory) {\n        if (_workerId == ExecutorOptions.WORKER_ID) {\n            _executorOptions = _executorOptions.length == 0\n                ? _newOptions\n                : abi.encodePacked(_executorOptions, _newOptions);\n        } else if (_workerId == DVNOptions.WORKER_ID) {\n            _dvnOptions = _dvnOptions.length == 0 ? _newOptions : abi.encodePacked(_dvnOptions, _newOptions);\n        } else {\n            revert LZ_ULN_InvalidWorkerId(_workerId);\n        }\n        return (_executorOptions, _dvnOptions);\n    }\n\n    /// @dev decode the legacy options (type 1 or 2) into executorOptions\n    /// @param _optionType the legacy option type\n    /// @param _options the legacy options, which still has the option type in the first 2 bytes\n    /// @return executorOptions the executor options, share the same format of type 3 options\n    /// Data format:\n    /// legacy type 1: [extraGas]\n    /// legacy type 2: [extraGas][dstNativeAmt][dstNativeAddress]\n    /// extraGas: uint256, dstNativeAmt: uint256, dstNativeAddress: bytes\n    function decodeLegacyOptions(\n        uint16 _optionType,\n        bytes calldata _options\n    ) internal pure returns (bytes memory executorOptions) {\n        if (_optionType == TYPE_1) {\n            if (_options.length != 34) revert LZ_ULN_InvalidLegacyType1Option();\n\n            // execution gas\n            uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n            // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n            // the result is a lzReceive option: [executor_id][option_size][option_type][execution_gas]\n            // option_type: uint8, execution_gas: uint128\n            // option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n            executorOptions = abi.encodePacked(\n                ExecutorOptions.WORKER_ID,\n                uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n                ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n                executionGas\n            );\n        } else if (_optionType == TYPE_2) {\n            // receiver size <= 32\n            if (_options.length <= 66 || _options.length > 98) revert LZ_ULN_InvalidLegacyType2Option();\n\n            // execution gas\n            uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n            // nativeDrop (amount + receiver)\n            uint128 amount = uint256(bytes32(_options[34:34 + 32])).toUint128(); // offset 2 + 32\n            bytes32 receiver;\n            unchecked {\n                uint256 receiverLen = _options.length - 66; // offset 2 + 32 + 32\n                receiver = bytes32(_options[66:]);\n                receiver = receiver >> (8 * (32 - receiverLen)); // padding 0 to the left\n            }\n\n            // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n            // the result has one lzReceive option and one nativeDrop option:\n            //      [executor_id][lzReceive_option_size][option_type][execution_gas] +\n            //      [executor_id][nativeDrop_option_size][option_type][nativeDrop_amount][receiver]\n            // option_type: uint8, execution_gas: uint128, nativeDrop_amount: uint128, receiver: bytes32\n            // lzReceive_option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n            // nativeDrop_option_size = len(option_type) + len(nativeDrop_amount) + len(receiver) = 1 + 16 + 32 = 49\n            executorOptions = abi.encodePacked(\n                ExecutorOptions.WORKER_ID,\n                uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n                ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n                executionGas,\n                ExecutorOptions.WORKER_ID,\n                uint16(49), // 48 + 1, 32 + 16 for option_length, + 1 for option_type\n                ExecutorOptions.OPTION_TYPE_NATIVE_DROP,\n                amount,\n                receiver\n            );\n        } else {\n            revert LZ_ULN_UnsupportedOptionType(_optionType);\n        }\n    }\n}\n"},{"file_path":"contracts/uln/interfaces/ILayerZeroReadDVN.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface ILayerZeroReadDVN {\n    // @notice query price and assign jobs at the same time\n    // @param _packetHeader - version + nonce + path\n    // @param _cmd - the command to be executed to obtain the payload\n    // @param _options - options\n    function assignJob(\n        address _sender,\n        bytes calldata _packetHeader,\n        bytes calldata _cmd,\n        bytes calldata _options\n    ) external payable returns (uint256 fee);\n\n    // @notice query the dvn fee for relaying block information to the destination chain\n    // @param _packetHeader - version + nonce + path\n    // @param _cmd - the command to be executed to obtain the payload\n    // @param _options - options\n    function getFee(\n        address _sender,\n        bytes calldata _packetHeader,\n        bytes calldata _cmd,\n        bytes calldata _options\n    ) external view returns (uint256 fee);\n}\n"},{"file_path":"contracts/uln/libs/DVNOptions.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { BytesLib } from \"solidity-bytes-utils/contracts/BytesLib.sol\";\n\nimport { BitMap256 } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/BitMaps.sol\";\nimport { CalldataBytesLib } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/CalldataBytesLib.sol\";\n\nlibrary DVNOptions {\n    using CalldataBytesLib for bytes;\n    using BytesLib for bytes;\n\n    uint8 internal constant WORKER_ID = 2;\n    uint8 internal constant OPTION_TYPE_PRECRIME = 1;\n\n    error DVN_InvalidDVNIdx();\n    error DVN_InvalidDVNOptions(uint256 cursor);\n\n    /// @dev group dvn options by its idx\n    /// @param _options [dvn_id][dvn_option][dvn_id][dvn_option]...\n    ///        dvn_option = [option_size][dvn_idx][option_type][option]\n    ///        option_size = len(dvn_idx) + len(option_type) + len(option)\n    ///        dvn_id: uint8, dvn_idx: uint8, option_size: uint16, option_type: uint8, option: bytes\n    /// @return dvnOptions the grouped options, still share the same format of _options\n    /// @return dvnIndices the dvn indices\n    function groupDVNOptionsByIdx(\n        bytes memory _options\n    ) internal pure returns (bytes[] memory dvnOptions, uint8[] memory dvnIndices) {\n        if (_options.length == 0) return (dvnOptions, dvnIndices);\n\n        uint8 numDVNs = getNumDVNs(_options);\n\n        // if there is only 1 dvn, we can just return the whole options\n        if (numDVNs == 1) {\n            dvnOptions = new bytes[](1);\n            dvnOptions[0] = _options;\n\n            dvnIndices = new uint8[](1);\n            dvnIndices[0] = _options.toUint8(3); // dvn idx\n            return (dvnOptions, dvnIndices);\n        }\n\n        // otherwise, we need to group the options by dvn_idx\n        dvnIndices = new uint8[](numDVNs);\n        dvnOptions = new bytes[](numDVNs);\n        unchecked {\n            uint256 cursor = 0;\n            uint256 start = 0;\n            uint8 lastDVNIdx = 255; // 255 is an invalid dvn_idx\n\n            while (cursor < _options.length) {\n                ++cursor; // skip worker_id\n\n                // optionLength asserted in getNumDVNs (skip check)\n                uint16 optionLength = _options.toUint16(cursor);\n                cursor += 2;\n\n                // dvnIdx asserted in getNumDVNs (skip check)\n                uint8 dvnIdx = _options.toUint8(cursor);\n\n                // dvnIdx must equal to the lastDVNIdx for the first option\n                // so it is always skipped in the first option\n                // this operation slices out options whenever the scan finds a different lastDVNIdx\n                if (lastDVNIdx == 255) {\n                    lastDVNIdx = dvnIdx;\n                } else if (dvnIdx != lastDVNIdx) {\n                    uint256 len = cursor - start - 3; // 3 is for worker_id and option_length\n                    bytes memory opt = _options.slice(start, len);\n                    _insertDVNOptions(dvnOptions, dvnIndices, lastDVNIdx, opt);\n\n                    // reset the start and lastDVNIdx\n                    start += len;\n                    lastDVNIdx = dvnIdx;\n                }\n\n                cursor += optionLength;\n            }\n\n            // skip check the cursor here because the cursor is asserted in getNumDVNs\n            // if we have reached the end of the options, we need to process the last dvn\n            uint256 size = cursor - start;\n            bytes memory op = _options.slice(start, size);\n            _insertDVNOptions(dvnOptions, dvnIndices, lastDVNIdx, op);\n\n            // revert dvnIndices to start from 0\n            for (uint8 i = 0; i < numDVNs; ++i) {\n                --dvnIndices[i];\n            }\n        }\n    }\n\n    function _insertDVNOptions(\n        bytes[] memory _dvnOptions,\n        uint8[] memory _dvnIndices,\n        uint8 _dvnIdx,\n        bytes memory _newOptions\n    ) internal pure {\n        // dvnIdx starts from 0 but default value of dvnIndices is 0,\n        // so we tell if the slot is empty by adding 1 to dvnIdx\n        if (_dvnIdx == 255) revert DVN_InvalidDVNIdx();\n        uint8 dvnIdxAdj = _dvnIdx + 1;\n\n        for (uint256 j = 0; j < _dvnIndices.length; ++j) {\n            uint8 index = _dvnIndices[j];\n            if (dvnIdxAdj == index) {\n                _dvnOptions[j] = abi.encodePacked(_dvnOptions[j], _newOptions);\n                break;\n            } else if (index == 0) {\n                // empty slot, that means it is the first time we see this dvn\n                _dvnIndices[j] = dvnIdxAdj;\n                _dvnOptions[j] = _newOptions;\n                break;\n            }\n        }\n    }\n\n    /// @dev get the number of unique dvns\n    /// @param _options the format is the same as groupDVNOptionsByIdx\n    function getNumDVNs(bytes memory _options) internal pure returns (uint8 numDVNs) {\n        uint256 cursor = 0;\n        BitMap256 bitmap;\n\n        // find number of unique dvn_idx\n        unchecked {\n            while (cursor < _options.length) {\n                ++cursor; // skip worker_id\n\n                uint16 optionLength = _options.toUint16(cursor);\n                cursor += 2;\n                if (optionLength < 2) revert DVN_InvalidDVNOptions(cursor); // at least 1 byte for dvn_idx and 1 byte for option_type\n\n                uint8 dvnIdx = _options.toUint8(cursor);\n\n                // if dvnIdx is not set, increment numDVNs\n                // max num of dvns is 255, 255 is an invalid dvn_idx\n                // The order of the dvnIdx is not required to be sequential, as enforcing the order may weaken\n                // the composability of the options. e.g. if we refrain from enforcing the order, an OApp that has\n                // already enforced certain options can append additional options to the end of the enforced\n                // ones without restrictions.\n                if (dvnIdx == 255) revert DVN_InvalidDVNIdx();\n                if (!bitmap.get(dvnIdx)) {\n                    ++numDVNs;\n                    bitmap = bitmap.set(dvnIdx);\n                }\n\n                cursor += optionLength;\n            }\n        }\n        if (cursor != _options.length) revert DVN_InvalidDVNOptions(cursor);\n    }\n\n    /// @dev decode the next dvn option from _options starting from the specified cursor\n    /// @param _options the format is the same as groupDVNOptionsByIdx\n    /// @param _cursor the cursor to start decoding\n    /// @return optionType the type of the option\n    /// @return option the option\n    /// @return cursor the cursor to start decoding the next option\n    function nextDVNOption(\n        bytes calldata _options,\n        uint256 _cursor\n    ) internal pure returns (uint8 optionType, bytes calldata option, uint256 cursor) {\n        unchecked {\n            // skip worker id\n            cursor = _cursor + 1;\n\n            // read option size\n            uint16 size = _options.toU16(cursor);\n            cursor += 2;\n\n            // read option type\n            optionType = _options.toU8(cursor + 1); // skip dvn_idx\n\n            // startCursor and endCursor are used to slice the option from _options\n            uint256 startCursor = cursor + 2; // skip option type and dvn_idx\n            uint256 endCursor = cursor + size;\n            option = _options[startCursor:endCursor];\n            cursor += size;\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/math/SafeCast.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\n    /**\n     * @dev Returns the downcasted uint248 from uint256, reverting on\n     * overflow (when the input is greater than largest uint248).\n     *\n     * Counterpart to Solidity's `uint248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint248(uint256 value) internal pure returns (uint248) {\n        require(value <= type(uint248).max, \"SafeCast: value doesn't fit in 248 bits\");\n        return uint248(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint240 from uint256, reverting on\n     * overflow (when the input is greater than largest uint240).\n     *\n     * Counterpart to Solidity's `uint240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint240(uint256 value) internal pure returns (uint240) {\n        require(value <= type(uint240).max, \"SafeCast: value doesn't fit in 240 bits\");\n        return uint240(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint232 from uint256, reverting on\n     * overflow (when the input is greater than largest uint232).\n     *\n     * Counterpart to Solidity's `uint232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint232(uint256 value) internal pure returns (uint232) {\n        require(value <= type(uint232).max, \"SafeCast: value doesn't fit in 232 bits\");\n        return uint232(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint224 from uint256, reverting on\n     * overflow (when the input is greater than largest uint224).\n     *\n     * Counterpart to Solidity's `uint224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     *\n     * _Available since v4.2._\n     */\n    function toUint224(uint256 value) internal pure returns (uint224) {\n        require(value <= type(uint224).max, \"SafeCast: value doesn't fit in 224 bits\");\n        return uint224(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint216 from uint256, reverting on\n     * overflow (when the input is greater than largest uint216).\n     *\n     * Counterpart to Solidity's `uint216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint216(uint256 value) internal pure returns (uint216) {\n        require(value <= type(uint216).max, \"SafeCast: value doesn't fit in 216 bits\");\n        return uint216(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint208 from uint256, reverting on\n     * overflow (when the input is greater than largest uint208).\n     *\n     * Counterpart to Solidity's `uint208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint208(uint256 value) internal pure returns (uint208) {\n        require(value <= type(uint208).max, \"SafeCast: value doesn't fit in 208 bits\");\n        return uint208(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint200 from uint256, reverting on\n     * overflow (when the input is greater than largest uint200).\n     *\n     * Counterpart to Solidity's `uint200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint200(uint256 value) internal pure returns (uint200) {\n        require(value <= type(uint200).max, \"SafeCast: value doesn't fit in 200 bits\");\n        return uint200(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint192 from uint256, reverting on\n     * overflow (when the input is greater than largest uint192).\n     *\n     * Counterpart to Solidity's `uint192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint192(uint256 value) internal pure returns (uint192) {\n        require(value <= type(uint192).max, \"SafeCast: value doesn't fit in 192 bits\");\n        return uint192(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint184 from uint256, reverting on\n     * overflow (when the input is greater than largest uint184).\n     *\n     * Counterpart to Solidity's `uint184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint184(uint256 value) internal pure returns (uint184) {\n        require(value <= type(uint184).max, \"SafeCast: value doesn't fit in 184 bits\");\n        return uint184(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint176 from uint256, reverting on\n     * overflow (when the input is greater than largest uint176).\n     *\n     * Counterpart to Solidity's `uint176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint176(uint256 value) internal pure returns (uint176) {\n        require(value <= type(uint176).max, \"SafeCast: value doesn't fit in 176 bits\");\n        return uint176(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint168 from uint256, reverting on\n     * overflow (when the input is greater than largest uint168).\n     *\n     * Counterpart to Solidity's `uint168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint168(uint256 value) internal pure returns (uint168) {\n        require(value <= type(uint168).max, \"SafeCast: value doesn't fit in 168 bits\");\n        return uint168(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint160 from uint256, reverting on\n     * overflow (when the input is greater than largest uint160).\n     *\n     * Counterpart to Solidity's `uint160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint160(uint256 value) internal pure returns (uint160) {\n        require(value <= type(uint160).max, \"SafeCast: value doesn't fit in 160 bits\");\n        return uint160(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint152 from uint256, reverting on\n     * overflow (when the input is greater than largest uint152).\n     *\n     * Counterpart to Solidity's `uint152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint152(uint256 value) internal pure returns (uint152) {\n        require(value <= type(uint152).max, \"SafeCast: value doesn't fit in 152 bits\");\n        return uint152(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint144 from uint256, reverting on\n     * overflow (when the input is greater than largest uint144).\n     *\n     * Counterpart to Solidity's `uint144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint144(uint256 value) internal pure returns (uint144) {\n        require(value <= type(uint144).max, \"SafeCast: value doesn't fit in 144 bits\");\n        return uint144(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint136 from uint256, reverting on\n     * overflow (when the input is greater than largest uint136).\n     *\n     * Counterpart to Solidity's `uint136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint136(uint256 value) internal pure returns (uint136) {\n        require(value <= type(uint136).max, \"SafeCast: value doesn't fit in 136 bits\");\n        return uint136(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint128 from uint256, reverting on\n     * overflow (when the input is greater than largest uint128).\n     *\n     * Counterpart to Solidity's `uint128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     *\n     * _Available since v2.5._\n     */\n    function toUint128(uint256 value) internal pure returns (uint128) {\n        require(value <= type(uint128).max, \"SafeCast: value doesn't fit in 128 bits\");\n        return uint128(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint120 from uint256, reverting on\n     * overflow (when the input is greater than largest uint120).\n     *\n     * Counterpart to Solidity's `uint120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint120(uint256 value) internal pure returns (uint120) {\n        require(value <= type(uint120).max, \"SafeCast: value doesn't fit in 120 bits\");\n        return uint120(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint112 from uint256, reverting on\n     * overflow (when the input is greater than largest uint112).\n     *\n     * Counterpart to Solidity's `uint112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint112(uint256 value) internal pure returns (uint112) {\n        require(value <= type(uint112).max, \"SafeCast: value doesn't fit in 112 bits\");\n        return uint112(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint104 from uint256, reverting on\n     * overflow (when the input is greater than largest uint104).\n     *\n     * Counterpart to Solidity's `uint104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint104(uint256 value) internal pure returns (uint104) {\n        require(value <= type(uint104).max, \"SafeCast: value doesn't fit in 104 bits\");\n        return uint104(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint96 from uint256, reverting on\n     * overflow (when the input is greater than largest uint96).\n     *\n     * Counterpart to Solidity's `uint96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     *\n     * _Available since v4.2._\n     */\n    function toUint96(uint256 value) internal pure returns (uint96) {\n        require(value <= type(uint96).max, \"SafeCast: value doesn't fit in 96 bits\");\n        return uint96(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint88 from uint256, reverting on\n     * overflow (when the input is greater than largest uint88).\n     *\n     * Counterpart to Solidity's `uint88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint88(uint256 value) internal pure returns (uint88) {\n        require(value <= type(uint88).max, \"SafeCast: value doesn't fit in 88 bits\");\n        return uint88(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint80 from uint256, reverting on\n     * overflow (when the input is greater than largest uint80).\n     *\n     * Counterpart to Solidity's `uint80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint80(uint256 value) internal pure returns (uint80) {\n        require(value <= type(uint80).max, \"SafeCast: value doesn't fit in 80 bits\");\n        return uint80(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint72 from uint256, reverting on\n     * overflow (when the input is greater than largest uint72).\n     *\n     * Counterpart to Solidity's `uint72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint72(uint256 value) internal pure returns (uint72) {\n        require(value <= type(uint72).max, \"SafeCast: value doesn't fit in 72 bits\");\n        return uint72(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint64 from uint256, reverting on\n     * overflow (when the input is greater than largest uint64).\n     *\n     * Counterpart to Solidity's `uint64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     *\n     * _Available since v2.5._\n     */\n    function toUint64(uint256 value) internal pure returns (uint64) {\n        require(value <= type(uint64).max, \"SafeCast: value doesn't fit in 64 bits\");\n        return uint64(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint56 from uint256, reverting on\n     * overflow (when the input is greater than largest uint56).\n     *\n     * Counterpart to Solidity's `uint56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint56(uint256 value) internal pure returns (uint56) {\n        require(value <= type(uint56).max, \"SafeCast: value doesn't fit in 56 bits\");\n        return uint56(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint48 from uint256, reverting on\n     * overflow (when the input is greater than largest uint48).\n     *\n     * Counterpart to Solidity's `uint48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint48(uint256 value) internal pure returns (uint48) {\n        require(value <= type(uint48).max, \"SafeCast: value doesn't fit in 48 bits\");\n        return uint48(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint40 from uint256, reverting on\n     * overflow (when the input is greater than largest uint40).\n     *\n     * Counterpart to Solidity's `uint40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint40(uint256 value) internal pure returns (uint40) {\n        require(value <= type(uint40).max, \"SafeCast: value doesn't fit in 40 bits\");\n        return uint40(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint32 from uint256, reverting on\n     * overflow (when the input is greater than largest uint32).\n     *\n     * Counterpart to Solidity's `uint32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     *\n     * _Available since v2.5._\n     */\n    function toUint32(uint256 value) internal pure returns (uint32) {\n        require(value <= type(uint32).max, \"SafeCast: value doesn't fit in 32 bits\");\n        return uint32(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint24 from uint256, reverting on\n     * overflow (when the input is greater than largest uint24).\n     *\n     * Counterpart to Solidity's `uint24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     *\n     * _Available since v4.7._\n     */\n    function toUint24(uint256 value) internal pure returns (uint24) {\n        require(value <= type(uint24).max, \"SafeCast: value doesn't fit in 24 bits\");\n        return uint24(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint16 from uint256, reverting on\n     * overflow (when the input is greater than largest uint16).\n     *\n     * Counterpart to Solidity's `uint16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     *\n     * _Available since v2.5._\n     */\n    function toUint16(uint256 value) internal pure returns (uint16) {\n        require(value <= type(uint16).max, \"SafeCast: value doesn't fit in 16 bits\");\n        return uint16(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint8 from uint256, reverting on\n     * overflow (when the input is greater than largest uint8).\n     *\n     * Counterpart to Solidity's `uint8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     *\n     * _Available since v2.5._\n     */\n    function toUint8(uint256 value) internal pure returns (uint8) {\n        require(value <= type(uint8).max, \"SafeCast: value doesn't fit in 8 bits\");\n        return uint8(value);\n    }\n\n    /**\n     * @dev Converts a signed int256 into an unsigned uint256.\n     *\n     * Requirements:\n     *\n     * - input must be greater than or equal to 0.\n     *\n     * _Available since v3.0._\n     */\n    function toUint256(int256 value) internal pure returns (uint256) {\n        require(value >= 0, \"SafeCast: value must be positive\");\n        return uint256(value);\n    }\n\n    /**\n     * @dev Returns the downcasted int248 from int256, reverting on\n     * overflow (when the input is less than smallest int248 or\n     * greater than largest int248).\n     *\n     * Counterpart to Solidity's `int248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt248(int256 value) internal pure returns (int248 downcasted) {\n        downcasted = int248(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 248 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int240 from int256, reverting on\n     * overflow (when the input is less than smallest int240 or\n     * greater than largest int240).\n     *\n     * Counterpart to Solidity's `int240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt240(int256 value) internal pure returns (int240 downcasted) {\n        downcasted = int240(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 240 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int232 from int256, reverting on\n     * overflow (when the input is less than smallest int232 or\n     * greater than largest int232).\n     *\n     * Counterpart to Solidity's `int232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt232(int256 value) internal pure returns (int232 downcasted) {\n        downcasted = int232(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 232 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int224 from int256, reverting on\n     * overflow (when the input is less than smallest int224 or\n     * greater than largest int224).\n     *\n     * Counterpart to Solidity's `int224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt224(int256 value) internal pure returns (int224 downcasted) {\n        downcasted = int224(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 224 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int216 from int256, reverting on\n     * overflow (when the input is less than smallest int216 or\n     * greater than largest int216).\n     *\n     * Counterpart to Solidity's `int216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt216(int256 value) internal pure returns (int216 downcasted) {\n        downcasted = int216(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 216 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int208 from int256, reverting on\n     * overflow (when the input is less than smallest int208 or\n     * greater than largest int208).\n     *\n     * Counterpart to Solidity's `int208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt208(int256 value) internal pure returns (int208 downcasted) {\n        downcasted = int208(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 208 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int200 from int256, reverting on\n     * overflow (when the input is less than smallest int200 or\n     * greater than largest int200).\n     *\n     * Counterpart to Solidity's `int200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt200(int256 value) internal pure returns (int200 downcasted) {\n        downcasted = int200(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 200 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int192 from int256, reverting on\n     * overflow (when the input is less than smallest int192 or\n     * greater than largest int192).\n     *\n     * Counterpart to Solidity's `int192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt192(int256 value) internal pure returns (int192 downcasted) {\n        downcasted = int192(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 192 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int184 from int256, reverting on\n     * overflow (when the input is less than smallest int184 or\n     * greater than largest int184).\n     *\n     * Counterpart to Solidity's `int184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt184(int256 value) internal pure returns (int184 downcasted) {\n        downcasted = int184(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 184 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int176 from int256, reverting on\n     * overflow (when the input is less than smallest int176 or\n     * greater than largest int176).\n     *\n     * Counterpart to Solidity's `int176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt176(int256 value) internal pure returns (int176 downcasted) {\n        downcasted = int176(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 176 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int168 from int256, reverting on\n     * overflow (when the input is less than smallest int168 or\n     * greater than largest int168).\n     *\n     * Counterpart to Solidity's `int168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt168(int256 value) internal pure returns (int168 downcasted) {\n        downcasted = int168(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 168 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int160 from int256, reverting on\n     * overflow (when the input is less than smallest int160 or\n     * greater than largest int160).\n     *\n     * Counterpart to Solidity's `int160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt160(int256 value) internal pure returns (int160 downcasted) {\n        downcasted = int160(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 160 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int152 from int256, reverting on\n     * overflow (when the input is less than smallest int152 or\n     * greater than largest int152).\n     *\n     * Counterpart to Solidity's `int152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt152(int256 value) internal pure returns (int152 downcasted) {\n        downcasted = int152(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 152 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int144 from int256, reverting on\n     * overflow (when the input is less than smallest int144 or\n     * greater than largest int144).\n     *\n     * Counterpart to Solidity's `int144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt144(int256 value) internal pure returns (int144 downcasted) {\n        downcasted = int144(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 144 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int136 from int256, reverting on\n     * overflow (when the input is less than smallest int136 or\n     * greater than largest int136).\n     *\n     * Counterpart to Solidity's `int136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt136(int256 value) internal pure returns (int136 downcasted) {\n        downcasted = int136(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 136 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int128 from int256, reverting on\n     * overflow (when the input is less than smallest int128 or\n     * greater than largest int128).\n     *\n     * Counterpart to Solidity's `int128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     *\n     * _Available since v3.1._\n     */\n    function toInt128(int256 value) internal pure returns (int128 downcasted) {\n        downcasted = int128(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 128 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int120 from int256, reverting on\n     * overflow (when the input is less than smallest int120 or\n     * greater than largest int120).\n     *\n     * Counterpart to Solidity's `int120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt120(int256 value) internal pure returns (int120 downcasted) {\n        downcasted = int120(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 120 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int112 from int256, reverting on\n     * overflow (when the input is less than smallest int112 or\n     * greater than largest int112).\n     *\n     * Counterpart to Solidity's `int112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt112(int256 value) internal pure returns (int112 downcasted) {\n        downcasted = int112(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 112 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int104 from int256, reverting on\n     * overflow (when the input is less than smallest int104 or\n     * greater than largest int104).\n     *\n     * Counterpart to Solidity's `int104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt104(int256 value) internal pure returns (int104 downcasted) {\n        downcasted = int104(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 104 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int96 from int256, reverting on\n     * overflow (when the input is less than smallest int96 or\n     * greater than largest int96).\n     *\n     * Counterpart to Solidity's `int96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt96(int256 value) internal pure returns (int96 downcasted) {\n        downcasted = int96(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 96 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int88 from int256, reverting on\n     * overflow (when the input is less than smallest int88 or\n     * greater than largest int88).\n     *\n     * Counterpart to Solidity's `int88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt88(int256 value) internal pure returns (int88 downcasted) {\n        downcasted = int88(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 88 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int80 from int256, reverting on\n     * overflow (when the input is less than smallest int80 or\n     * greater than largest int80).\n     *\n     * Counterpart to Solidity's `int80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt80(int256 value) internal pure returns (int80 downcasted) {\n        downcasted = int80(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 80 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int72 from int256, reverting on\n     * overflow (when the input is less than smallest int72 or\n     * greater than largest int72).\n     *\n     * Counterpart to Solidity's `int72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt72(int256 value) internal pure returns (int72 downcasted) {\n        downcasted = int72(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 72 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int64 from int256, reverting on\n     * overflow (when the input is less than smallest int64 or\n     * greater than largest int64).\n     *\n     * Counterpart to Solidity's `int64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     *\n     * _Available since v3.1._\n     */\n    function toInt64(int256 value) internal pure returns (int64 downcasted) {\n        downcasted = int64(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 64 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int56 from int256, reverting on\n     * overflow (when the input is less than smallest int56 or\n     * greater than largest int56).\n     *\n     * Counterpart to Solidity's `int56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt56(int256 value) internal pure returns (int56 downcasted) {\n        downcasted = int56(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 56 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int48 from int256, reverting on\n     * overflow (when the input is less than smallest int48 or\n     * greater than largest int48).\n     *\n     * Counterpart to Solidity's `int48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt48(int256 value) internal pure returns (int48 downcasted) {\n        downcasted = int48(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 48 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int40 from int256, reverting on\n     * overflow (when the input is less than smallest int40 or\n     * greater than largest int40).\n     *\n     * Counterpart to Solidity's `int40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt40(int256 value) internal pure returns (int40 downcasted) {\n        downcasted = int40(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 40 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int32 from int256, reverting on\n     * overflow (when the input is less than smallest int32 or\n     * greater than largest int32).\n     *\n     * Counterpart to Solidity's `int32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     *\n     * _Available since v3.1._\n     */\n    function toInt32(int256 value) internal pure returns (int32 downcasted) {\n        downcasted = int32(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 32 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int24 from int256, reverting on\n     * overflow (when the input is less than smallest int24 or\n     * greater than largest int24).\n     *\n     * Counterpart to Solidity's `int24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     *\n     * _Available since v4.7._\n     */\n    function toInt24(int256 value) internal pure returns (int24 downcasted) {\n        downcasted = int24(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 24 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int16 from int256, reverting on\n     * overflow (when the input is less than smallest int16 or\n     * greater than largest int16).\n     *\n     * Counterpart to Solidity's `int16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     *\n     * _Available since v3.1._\n     */\n    function toInt16(int256 value) internal pure returns (int16 downcasted) {\n        downcasted = int16(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 16 bits\");\n    }\n\n    /**\n     * @dev Returns the downcasted int8 from int256, reverting on\n     * overflow (when the input is less than smallest int8 or\n     * greater than largest int8).\n     *\n     * Counterpart to Solidity's `int8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     *\n     * _Available since v3.1._\n     */\n    function toInt8(int256 value) internal pure returns (int8 downcasted) {\n        downcasted = int8(value);\n        require(downcasted == value, \"SafeCast: value doesn't fit in 8 bits\");\n    }\n\n    /**\n     * @dev Converts an unsigned uint256 into a signed int256.\n     *\n     * Requirements:\n     *\n     * - input must be less than or equal to maxInt256.\n     *\n     * _Available since v3.0._\n     */\n    function toInt256(uint256 value) internal pure returns (int256) {\n        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n        require(value <= uint256(type(int256).max), \"SafeCast: value doesn't fit in an int256\");\n        return int256(value);\n    }\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingComposer {\n    event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message);\n    event ComposeDelivered(address from, address to, bytes32 guid, uint16 index);\n    event LzComposeAlert(\n        address indexed from,\n        address indexed to,\n        address indexed executor,\n        bytes32 guid,\n        uint16 index,\n        uint256 gas,\n        uint256 value,\n        bytes message,\n        bytes extraData,\n        bytes reason\n    );\n\n    function composeQueue(\n        address _from,\n        address _to,\n        bytes32 _guid,\n        uint16 _index\n    ) external view returns (bytes32 messageHash);\n\n    function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external;\n\n    function lzCompose(\n        address _from,\n        address _to,\n        bytes32 _guid,\n        uint16 _index,\n        bytes calldata _message,\n        bytes calldata _extraData\n    ) external payable;\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingContext {\n    function isSendingMessage() external view returns (bool);\n\n    function getSendContext() external view returns (uint32 dstEid, address sender);\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLib.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IERC165 } from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\nimport { SetConfigParam } from \"./IMessageLibManager.sol\";\n\nenum MessageLibType {\n    Send,\n    Receive,\n    SendAndReceive\n}\n\ninterface IMessageLib is IERC165 {\n    function setConfig(address _oapp, SetConfigParam[] calldata _config) external;\n\n    function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config);\n\n    function isSupportedEid(uint32 _eid) external view returns (bool);\n\n    // message libs of same major version are compatible\n    function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion);\n\n    function messageLibType() external view returns (MessageLibType);\n}\n"},{"file_path":"@layerzerolabs/lz-evm-v1-0.7/contracts/interfaces/ILayerZeroUltraLightNodeV2.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity >=0.7.0;\npragma abicoder v2;\n\ninterface ILayerZeroUltraLightNodeV2 {\n    // Relayer functions\n    function validateTransactionProof(\n        uint16 _srcChainId,\n        address _dstAddress,\n        uint _gasLimit,\n        bytes32 _lookupHash,\n        bytes32 _blockData,\n        bytes calldata _transactionProof\n    ) external;\n\n    // an Oracle delivers the block data using updateHash()\n    function updateHash(uint16 _srcChainId, bytes32 _lookupHash, uint _confirmations, bytes32 _blockData) external;\n\n    // can only withdraw the receivable of the msg.sender\n    function withdrawNative(address payable _to, uint _amount) external;\n\n    function withdrawZRO(address _to, uint _amount) external;\n\n    // view functions\n    function getAppConfig(\n        uint16 _remoteChainId,\n        address _userApplicationAddress\n    ) external view returns (ApplicationConfiguration memory);\n\n    function accruedNativeFee(address _address) external view returns (uint);\n\n    struct ApplicationConfiguration {\n        uint16 inboundProofLibraryVersion;\n        uint64 inboundBlockConfirmations;\n        address relayer;\n        uint16 outboundProofType;\n        uint64 outboundBlockConfirmations;\n        address oracle;\n    }\n\n    event HashReceived(\n        uint16 indexed srcChainId,\n        address indexed oracle,\n        bytes32 lookupHash,\n        bytes32 blockData,\n        uint confirmations\n    );\n    event RelayerParams(bytes adapterParams, uint16 outboundProofType);\n    event Packet(bytes payload);\n    event InvalidDst(\n        uint16 indexed srcChainId,\n        bytes srcAddress,\n        address indexed dstAddress,\n        uint64 nonce,\n        bytes32 payloadHash\n    );\n    event PacketReceived(\n        uint16 indexed srcChainId,\n        bytes srcAddress,\n        address indexed dstAddress,\n        uint64 nonce,\n        bytes32 payloadHash\n    );\n    event AppConfigUpdated(address indexed userApplication, uint indexed configType, bytes newConfig);\n    event AddInboundProofLibraryForChain(uint16 indexed chainId, address lib);\n    event EnableSupportedOutboundProof(uint16 indexed chainId, uint16 proofType);\n    event SetChainAddressSize(uint16 indexed chainId, uint size);\n    event SetDefaultConfigForChainId(\n        uint16 indexed chainId,\n        uint16 inboundProofLib,\n        uint64 inboundBlockConfirm,\n        address relayer,\n        uint16 outboundProofType,\n        uint64 outboundBlockConfirm,\n        address oracle\n    );\n    event SetDefaultAdapterParamsForChainId(uint16 indexed chainId, uint16 indexed proofType, bytes adapterParams);\n    event SetLayerZeroToken(address indexed tokenAddress);\n    event SetRemoteUln(uint16 indexed chainId, bytes32 uln);\n    event SetTreasury(address indexed treasuryAddress);\n    event WithdrawZRO(address indexed msgSender, address indexed to, uint amount);\n    event WithdrawNative(address indexed msgSender, address indexed to, uint amount);\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../extensions/IERC20Permit.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    using Address for address;\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n    }\n\n    /**\n     * @dev Deprecated. This function has issues similar to the ones found in\n     * {IERC20-approve}, and its usage is discouraged.\n     *\n     * Whenever possible, use {safeIncreaseAllowance} and\n     * {safeDecreaseAllowance} instead.\n     */\n    function safeApprove(IERC20 token, address spender, uint256 value) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n        require(\n            (value == 0) || (token.allowance(address(this), spender) == 0),\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n\n    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 oldAllowance = token.allowance(address(this), spender);\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n    }\n\n    /**\n     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        unchecked {\n            uint256 oldAllowance = token.allowance(address(this), spender);\n            require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n        }\n    }\n\n    /**\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n     * to be set to zero before setting it to a non-zero value, such as USDT.\n     */\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\n        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n        if (!_callOptionalReturnBool(token, approvalCall)) {\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n            _callOptionalReturn(token, approvalCall);\n        }\n    }\n\n    /**\n     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n     * Revert on invalid signature.\n     */\n    function safePermit(\n        IERC20Permit token,\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal {\n        uint256 nonceBefore = token.nonces(owner);\n        token.permit(owner, spender, value, deadline, v, r, s);\n        uint256 nonceAfter = token.nonces(owner);\n        require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n        require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n        // and not revert is the subcall reverts.\n\n        (bool success, bytes memory returndata) = address(token).call(data);\n        return\n            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n    }\n}\n"},{"file_path":"contracts/uln/dvn/MultiSig.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { ECDSA } from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport { EnumerableSet } from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\nabstract contract MultiSig {\n    using EnumerableSet for EnumerableSet.AddressSet;\n\n    enum Errors {\n        NoError,\n        SignatureError,\n        DuplicatedSigner,\n        SignerNotInCommittee\n    }\n\n    EnumerableSet.AddressSet internal signerSet;\n    uint64 public quorum;\n\n    error MultiSig_OnlySigner();\n    error MultiSig_QuorumIsZero();\n    error MultiSig_SignersSizeIsLessThanQuorum(uint64 signersSize, uint64 quorum);\n    error MultiSig_UnorderedSigners();\n    error MultiSig_StateAlreadySet(address signer, bool active);\n    error MultiSig_StateNotSet(address signer, bool active);\n    error MultiSig_InvalidSigner();\n\n    event UpdateSigner(address _signer, bool _active);\n    event UpdateQuorum(uint64 _quorum);\n\n    modifier onlySigner() {\n        if (!isSigner(msg.sender)) {\n            revert MultiSig_OnlySigner();\n        }\n        _;\n    }\n\n    constructor(address[] memory _signers, uint64 _quorum) {\n        if (_quorum == 0) {\n            revert MultiSig_QuorumIsZero();\n        }\n        for (uint256 i = 0; i < _signers.length; i++) {\n            address signer = _signers[i];\n            if (signer == address(0)) {\n                revert MultiSig_InvalidSigner();\n            }\n            signerSet.add(signer);\n        }\n\n        uint64 _signerSize = uint64(signerSet.length());\n        if (_signerSize < _quorum) {\n            revert MultiSig_SignersSizeIsLessThanQuorum(_signerSize, _quorum);\n        }\n\n        quorum = _quorum;\n    }\n\n    function _setSigner(address _signer, bool _active) internal {\n        if (_active) {\n            if (_signer == address(0)) {\n                revert MultiSig_InvalidSigner();\n            }\n            if (!signerSet.add(_signer)) {\n                revert MultiSig_StateAlreadySet(_signer, _active);\n            }\n        } else {\n            if (!signerSet.remove(_signer)) {\n                revert MultiSig_StateNotSet(_signer, _active);\n            }\n        }\n\n        uint64 _signerSize = uint64(signerSet.length());\n        uint64 _quorum = quorum;\n        if (_signerSize < _quorum) {\n            revert MultiSig_SignersSizeIsLessThanQuorum(_signerSize, _quorum);\n        }\n        emit UpdateSigner(_signer, _active);\n    }\n\n    function _setQuorum(uint64 _quorum) internal {\n        if (_quorum == 0) {\n            revert MultiSig_QuorumIsZero();\n        }\n        uint64 _signerSize = uint64(signerSet.length());\n        if (_signerSize < _quorum) {\n            revert MultiSig_SignersSizeIsLessThanQuorum(_signerSize, _quorum);\n        }\n        quorum = _quorum;\n        emit UpdateQuorum(_quorum);\n    }\n\n    function verifySignatures(bytes32 _hash, bytes calldata _signatures) public view returns (bool, Errors) {\n        if (_signatures.length != uint256(quorum) * 65) {\n            return (false, Errors.SignatureError);\n        }\n\n        bytes32 messageDigest = _getEthSignedMessageHash(_hash);\n\n        address lastSigner = address(0); // There cannot be a signer with address 0.\n        for (uint256 i = 0; i < quorum; i++) {\n            // the quorum is guaranteed not to be zero in the constructor and setter\n            bytes calldata signature = _signatures[i * 65:(i + 1) * 65];\n            (address currentSigner, ECDSA.RecoverError error) = ECDSA.tryRecover(messageDigest, signature);\n\n            if (error != ECDSA.RecoverError.NoError) return (false, Errors.SignatureError);\n            if (currentSigner <= lastSigner) return (false, Errors.DuplicatedSigner); // prevent duplicate signatures, the signers must be ordered to sign the digest\n            if (!isSigner(currentSigner)) return (false, Errors.SignerNotInCommittee); // signature is not in committee\n            lastSigner = currentSigner;\n        }\n        return (true, Errors.NoError);\n    }\n\n    function _getEthSignedMessageHash(bytes32 _messageHash) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", _messageHash));\n    }\n\n    // ============================================== View ==============================================\n    function getSigners() public view returns (address[] memory) {\n        return signerSet.values();\n    }\n\n    // compatibility with the previous version\n    function signers(address _signer) public view returns (bool) {\n        return isSigner(_signer);\n    }\n\n    function isSigner(address _signer) public view returns (bool) {\n        return signerSet.contains(_signer);\n    }\n\n    function signerSize() public view returns (uint256) {\n        return signerSet.length();\n    }\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/CalldataBytesLib.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary CalldataBytesLib {\n    function toU8(bytes calldata _bytes, uint256 _start) internal pure returns (uint8) {\n        return uint8(_bytes[_start]);\n    }\n\n    function toU16(bytes calldata _bytes, uint256 _start) internal pure returns (uint16) {\n        unchecked {\n            uint256 end = _start + 2;\n            return uint16(bytes2(_bytes[_start:end]));\n        }\n    }\n\n    function toU32(bytes calldata _bytes, uint256 _start) internal pure returns (uint32) {\n        unchecked {\n            uint256 end = _start + 4;\n            return uint32(bytes4(_bytes[_start:end]));\n        }\n    }\n\n    function toU64(bytes calldata _bytes, uint256 _start) internal pure returns (uint64) {\n        unchecked {\n            uint256 end = _start + 8;\n            return uint64(bytes8(_bytes[_start:end]));\n        }\n    }\n\n    function toU128(bytes calldata _bytes, uint256 _start) internal pure returns (uint128) {\n        unchecked {\n            uint256 end = _start + 16;\n            return uint128(bytes16(_bytes[_start:end]));\n        }\n    }\n\n    function toU256(bytes calldata _bytes, uint256 _start) internal pure returns (uint256) {\n        unchecked {\n            uint256 end = _start + 32;\n            return uint256(bytes32(_bytes[_start:end]));\n        }\n    }\n\n    function toAddr(bytes calldata _bytes, uint256 _start) internal pure returns (address) {\n        unchecked {\n            uint256 end = _start + 20;\n            return address(bytes20(_bytes[_start:end]));\n        }\n    }\n\n    function toB32(bytes calldata _bytes, uint256 _start) internal pure returns (bytes32) {\n        unchecked {\n            uint256 end = _start + 32;\n            return bytes32(_bytes[_start:end]);\n        }\n    }\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { MessagingFee } from \"./ILayerZeroEndpointV2.sol\";\nimport { IMessageLib } from \"./IMessageLib.sol\";\n\nstruct Packet {\n    uint64 nonce;\n    uint32 srcEid;\n    address sender;\n    uint32 dstEid;\n    bytes32 receiver;\n    bytes32 guid;\n    bytes message;\n}\n\ninterface ISendLib is IMessageLib {\n    function send(\n        Packet calldata _packet,\n        bytes calldata _options,\n        bool _payInLzToken\n    ) external returns (MessagingFee memory, bytes memory encodedPacket);\n\n    function quote(\n        Packet calldata _packet,\n        bytes calldata _options,\n        bool _payInLzToken\n    ) external view returns (MessagingFee memory);\n\n    function setTreasury(address _treasury) external;\n\n    function withdrawFee(address _to, uint256 _amount) external;\n\n    function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external;\n}\n"},{"file_path":"@openzeppelin/contracts/utils/introspection/ERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IERC165).interfaceId;\n    }\n}\n"},{"file_path":"contracts/interfaces/IWorker.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IWorker {\n    event SetWorkerLib(address workerLib);\n    event SetPriceFeed(address priceFeed);\n    event SetDefaultMultiplierBps(uint16 multiplierBps);\n    event SetSupportedOptionTypes(uint32 dstEid, uint8[] optionTypes);\n    event Withdraw(address lib, address to, uint256 amount);\n\n    error Worker_NotAllowed();\n    error Worker_OnlyMessageLib();\n    error Worker_RoleRenouncingDisabled();\n\n    function setPriceFeed(address _priceFeed) external;\n\n    function priceFeed() external view returns (address);\n\n    function setDefaultMultiplierBps(uint16 _multiplierBps) external;\n\n    function defaultMultiplierBps() external view returns (uint16);\n\n    function withdrawFee(address _lib, address _to, uint256 _amount) external;\n\n    function setSupportedOptionTypes(uint32 _eid, uint8[] calldata _optionTypes) external;\n\n    function getSupportedOptionTypes(uint32 _eid) external view returns (uint8[] memory);\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary AddressCast {\n    error AddressCast_InvalidSizeForAddress();\n    error AddressCast_InvalidAddress();\n\n    function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) {\n        if (_addressBytes.length > 32) revert AddressCast_InvalidAddress();\n        result = bytes32(_addressBytes);\n        unchecked {\n            uint256 offset = 32 - _addressBytes.length;\n            result = result >> (offset * 8);\n        }\n    }\n\n    function toBytes32(address _address) internal pure returns (bytes32 result) {\n        result = bytes32(uint256(uint160(_address)));\n    }\n\n    function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) {\n        if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress();\n        result = new bytes(_size);\n        unchecked {\n            uint256 offset = 256 - _size * 8;\n            assembly {\n                mstore(add(result, 32), shl(offset, _addressBytes32))\n            }\n        }\n    }\n\n    function toAddress(bytes32 _addressBytes32) internal pure returns (address result) {\n        result = address(uint160(uint256(_addressBytes32)));\n    }\n\n    function toAddress(bytes calldata _addressBytes) internal pure returns (address result) {\n        if (_addressBytes.length != 20) revert AddressCast_InvalidAddress();\n        result = address(bytes20(_addressBytes));\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/Strings.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\nimport \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n    uint8 private constant _ADDRESS_LENGTH = 20;\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            uint256 length = Math.log10(value) + 1;\n            string memory buffer = new string(length);\n            uint256 ptr;\n            /// @solidity memory-safe-assembly\n            assembly {\n                ptr := add(buffer, add(32, length))\n            }\n            while (true) {\n                ptr--;\n                /// @solidity memory-safe-assembly\n                assembly {\n                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n                }\n                value /= 10;\n                if (value == 0) break;\n            }\n            return buffer;\n        }\n    }\n\n    /**\n     * @dev Converts a `int256` to its ASCII `string` decimal representation.\n     */\n    function toString(int256 value) internal pure returns (string memory) {\n        return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value))));\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            return toHexString(value, Math.log256(value) + 1);\n        }\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = _SYMBOLS[value & 0xf];\n            value >>= 4;\n        }\n        require(value == 0, \"Strings: hex length insufficient\");\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n     */\n    function toHexString(address addr) internal pure returns (string memory) {\n        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n    }\n\n    /**\n     * @dev Returns true if the two strings are equal.\n     */\n    function equal(string memory a, string memory b) internal pure returns (bool) {\n        return keccak256(bytes(a)) == keccak256(bytes(b));\n    }\n}\n"},{"file_path":"contracts/uln/readlib/ReadLib1002.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { ERC165, IERC165 } from \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\n\nimport { ILayerZeroEndpointV2, MessagingFee, Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { IMessageLib, MessageLibType, SetConfigParam } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLib.sol\";\nimport { ISendLib, Packet } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol\";\nimport { PacketV1Codec } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\";\nimport { Transfer } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Transfer.sol\";\nimport { AddressCast } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol\";\n\nimport { ILayerZeroReadExecutor } from \"../../interfaces/ILayerZeroReadExecutor.sol\";\nimport { ILayerZeroReadDVN } from \"../interfaces/ILayerZeroReadDVN.sol\";\nimport { ILayerZeroTreasury } from \"../../interfaces/ILayerZeroTreasury.sol\";\n\nimport { UlnOptions } from \"../libs/UlnOptions.sol\";\nimport { DVNOptions } from \"../libs/DVNOptions.sol\";\nimport { SafeCall } from \"../../libs/SafeCall.sol\";\n\nimport { MessageLibBase } from \"../../MessageLibBase.sol\";\nimport { ReadLibBase, ReadLibConfig } from \"./ReadLibBase.sol\";\n\ncontract ReadLib1002 is ISendLib, ERC165, ReadLibBase, MessageLibBase {\n    using PacketV1Codec for bytes;\n    using SafeCall for address;\n\n    uint32 internal constant CONFIG_TYPE_READ_LID_CONFIG = 1;\n\n    uint16 internal constant TREASURY_MAX_COPY = 32;\n\n    uint256 internal immutable treasuryGasLimit;\n\n    mapping(address oapp => mapping(uint32 eid => mapping(uint64 nonce => bytes32 cmdHash))) public cmdHashLookup;\n    mapping(bytes32 headerHash => mapping(bytes32 cmdHash => mapping(address dvn => bytes32 payloadHash)))\n        public hashLookup;\n\n    // accumulated fees for workers and treasury\n    mapping(address worker => uint256 fee) public fees;\n    uint256 internal treasuryNativeFeeCap;\n    address internal treasury;\n\n    event PayloadVerified(address dvn, bytes header, bytes32 cmdHash, bytes32 payloadHash);\n    event ExecutorFeePaid(address executor, uint256 fee);\n    event DVNFeePaid(address[] requiredDVNs, address[] optionalDVNs, uint256[] fees);\n    event NativeFeeWithdrawn(address worker, address receiver, uint256 amount);\n    event LzTokenFeeWithdrawn(address lzToken, address receiver, uint256 amount);\n    event TreasurySet(address treasury);\n    event TreasuryNativeFeeCapSet(uint256 newTreasuryNativeFeeCap);\n\n    error LZ_RL_InvalidReceiver();\n    error LZ_RL_InvalidPacketHeader();\n    error LZ_RL_InvalidCmdHash();\n    error LZ_RL_InvalidPacketVersion();\n    error LZ_RL_InvalidEid();\n    error LZ_RL_Verifying();\n    error LZ_RL_InvalidConfigType(uint32 configType);\n    error LZ_RL_InvalidAmount(uint256 requested, uint256 available);\n    error LZ_RL_NotTreasury();\n    error LZ_RL_CannotWithdrawAltToken();\n\n    constructor(\n        address _endpoint,\n        uint256 _treasuryGasLimit,\n        uint256 _treasuryGasForFeeCap\n    ) MessageLibBase(_endpoint, ILayerZeroEndpointV2(_endpoint).eid()) {\n        treasuryGasLimit = _treasuryGasLimit;\n        treasuryNativeFeeCap = _treasuryGasForFeeCap;\n    }\n\n    function supportsInterface(bytes4 _interfaceId) public view override(ERC165, IERC165) returns (bool) {\n        return\n            _interfaceId == type(IMessageLib).interfaceId ||\n            _interfaceId == type(ISendLib).interfaceId ||\n            super.supportsInterface(_interfaceId);\n    }\n\n    // ============================ OnlyOwner ===================================\n\n    function setTreasury(address _treasury) external onlyOwner {\n        treasury = _treasury;\n        emit TreasurySet(_treasury);\n    }\n\n    /// @dev the new value can not be greater than the old value, i.e. down only\n    function setTreasuryNativeFeeCap(uint256 _newTreasuryNativeFeeCap) external onlyOwner {\n        // assert the new value is no greater than the old value\n        if (_newTreasuryNativeFeeCap > treasuryNativeFeeCap)\n            revert LZ_RL_InvalidAmount(_newTreasuryNativeFeeCap, treasuryNativeFeeCap);\n        treasuryNativeFeeCap = _newTreasuryNativeFeeCap;\n        emit TreasuryNativeFeeCapSet(_newTreasuryNativeFeeCap);\n    }\n\n    // ============================ OnlyEndpoint ===================================\n\n    function send(\n        Packet calldata _packet,\n        bytes calldata _options,\n        bool _payInLzToken\n    ) external onlyEndpoint returns (MessagingFee memory, bytes memory) {\n        // the receiver must be the same as the sender\n        if (AddressCast.toBytes32(_packet.sender) != _packet.receiver) revert LZ_RL_InvalidReceiver();\n\n        // pay worker and treasury\n        (bytes memory encodedPacket, uint256 totalNativeFee) = _payWorkers(_packet, _options);\n        (uint256 treasuryNativeFee, uint256 lzTokenFee) = _payTreasury(\n            _packet.sender,\n            _packet.dstEid,\n            totalNativeFee,\n            _payInLzToken\n        );\n        totalNativeFee += treasuryNativeFee;\n\n        // store the cmdHash for verification in order to prevent reorg attack\n        cmdHashLookup[_packet.sender][_packet.dstEid][_packet.nonce] = keccak256(_packet.message);\n\n        return (MessagingFee(totalNativeFee, lzTokenFee), encodedPacket);\n    }\n\n    function setConfig(address _oapp, SetConfigParam[] calldata _params) external onlyEndpoint {\n        for (uint256 i = 0; i < _params.length; i++) {\n            SetConfigParam calldata param = _params[i];\n            _assertSupportedEid(param.eid);\n            if (param.configType == CONFIG_TYPE_READ_LID_CONFIG) {\n                _setReadLibConfig(param.eid, _oapp, abi.decode(param.config, (ReadLibConfig)));\n            } else {\n                revert LZ_RL_InvalidConfigType(param.configType);\n            }\n        }\n    }\n\n    // ============================ External ===================================\n    /// @dev The verification will be done in the same chain where the packet is sent.\n    /// @dev dont need to check endpoint verifiable here to save gas, as it will reverts if not verifiable.\n    /// @param _packetHeader - the srcEid should be the localEid and the dstEid should be the channel id.\n    ///        The original packet header in PacketSent event should be processed to flip the srcEid and dstEid.\n    function commitVerification(bytes calldata _packetHeader, bytes32 _cmdHash, bytes32 _payloadHash) external {\n        // assert packet header is of right size 81\n        if (_packetHeader.length != 81) revert LZ_RL_InvalidPacketHeader();\n        // assert packet header version is the same\n        if (_packetHeader.version() != PacketV1Codec.PACKET_VERSION) revert LZ_RL_InvalidPacketVersion();\n        // assert the packet is for this endpoint\n        if (_packetHeader.dstEid() != localEid) revert LZ_RL_InvalidEid();\n\n        // cache these values to save gas\n        address receiver = _packetHeader.receiverB20();\n        uint32 srcEid = _packetHeader.srcEid(); // channel id\n        uint64 nonce = _packetHeader.nonce();\n\n        // reorg protection. to allow reverification, the cmdHash cant be removed\n        if (cmdHashLookup[receiver][srcEid][nonce] != _cmdHash) revert LZ_RL_InvalidCmdHash();\n\n        ReadLibConfig memory config = getReadLibConfig(receiver, srcEid);\n        _verifyAndReclaimStorage(config, keccak256(_packetHeader), _cmdHash, _payloadHash);\n\n        // endpoint will revert if nonce <= lazyInboundNonce\n        Origin memory origin = Origin(srcEid, _packetHeader.sender(), nonce);\n        ILayerZeroEndpointV2(endpoint).verify(origin, receiver, _payloadHash);\n    }\n\n    /// @dev DVN verifies the payload with the packet header and command hash\n    /// @param _packetHeader - the packet header is needed for event only, which can be conveniently for off-chain to track the packet state.\n    function verify(bytes calldata _packetHeader, bytes32 _cmdHash, bytes32 _payloadHash) external {\n        hashLookup[keccak256(_packetHeader)][_cmdHash][msg.sender] = _payloadHash;\n        emit PayloadVerified(msg.sender, _packetHeader, _cmdHash, _payloadHash);\n    }\n\n    function withdrawFee(address _to, uint256 _amount) external {\n        uint256 fee = fees[msg.sender];\n        if (_amount > fee) revert LZ_RL_InvalidAmount(_amount, fee);\n        unchecked {\n            fees[msg.sender] = fee - _amount;\n        }\n\n        // transfers native if nativeToken == address(0x0)\n        address nativeToken = ILayerZeroEndpointV2(endpoint).nativeToken();\n        Transfer.nativeOrToken(nativeToken, _to, _amount);\n        emit NativeFeeWithdrawn(msg.sender, _to, _amount);\n    }\n\n    // ============================ Treasury ===================================\n\n    /// @dev _lzToken is a user-supplied value because lzToken might change in the endpoint before all lzToken can be taken out\n    function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external {\n        if (msg.sender != treasury) revert LZ_RL_NotTreasury();\n\n        // lz token cannot be the same as the native token\n        if (ILayerZeroEndpointV2(endpoint).nativeToken() == _lzToken) revert LZ_RL_CannotWithdrawAltToken();\n\n        Transfer.token(_lzToken, _to, _amount);\n\n        emit LzTokenFeeWithdrawn(_lzToken, _to, _amount);\n    }\n\n    // ============================ View ===================================\n\n    function quote(\n        Packet calldata _packet,\n        bytes calldata _options,\n        bool _payInLzToken\n    ) external view returns (MessagingFee memory) {\n        // split workers options\n        (bytes memory executorOptions, bytes memory dvnOptions) = UlnOptions.decode(_options);\n\n        address sender = _packet.sender;\n        uint32 dstEid = _packet.dstEid;\n\n        // quote the executor and dvns\n        ReadLibConfig memory config = getReadLibConfig(sender, dstEid);\n        uint256 nativeFee = _quoteDVNs(\n            config,\n            sender,\n            PacketV1Codec.encodePacketHeader(_packet),\n            _packet.message,\n            dvnOptions\n        );\n        nativeFee += ILayerZeroReadExecutor(config.executor).getFee(sender, executorOptions);\n\n        // quote treasury\n        (uint256 treasuryNativeFee, uint256 lzTokenFee) = _quoteTreasury(sender, dstEid, nativeFee, _payInLzToken);\n        nativeFee += treasuryNativeFee;\n\n        return MessagingFee(nativeFee, lzTokenFee);\n    }\n\n    function verifiable(\n        ReadLibConfig calldata _config,\n        bytes32 _headerHash,\n        bytes32 _cmdHash,\n        bytes32 _payloadHash\n    ) external view returns (bool) {\n        return _checkVerifiable(_config, _headerHash, _cmdHash, _payloadHash);\n    }\n\n    function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory) {\n        if (_configType == CONFIG_TYPE_READ_LID_CONFIG) {\n            return abi.encode(getReadLibConfig(_oapp, _eid));\n        } else {\n            revert LZ_RL_InvalidConfigType(_configType);\n        }\n    }\n\n    function getTreasuryAndNativeFeeCap() external view returns (address, uint256) {\n        return (treasury, treasuryNativeFeeCap);\n    }\n\n    function isSupportedEid(uint32 _eid) external view returns (bool) {\n        return _isSupportedEid(_eid);\n    }\n\n    function messageLibType() external pure returns (MessageLibType) {\n        return MessageLibType.SendAndReceive;\n    }\n\n    function version() external pure returns (uint64 major, uint8 minor, uint8 endpointVersion) {\n        return (10, 0, 2);\n    }\n\n    // ============================ Internal ===================================\n\n    /// 1/ handle executor\n    /// 2/ handle other workers\n    function _payWorkers(\n        Packet calldata _packet,\n        bytes calldata _options\n    ) internal returns (bytes memory encodedPacket, uint256 totalNativeFee) {\n        // split workers options\n        (bytes memory executorOptions, bytes memory dvnOptions) = UlnOptions.decode(_options);\n\n        // handle executor\n        ReadLibConfig memory config = getReadLibConfig(_packet.sender, _packet.dstEid);\n        totalNativeFee = _payExecutor(config.executor, _packet.sender, executorOptions);\n\n        // handle dvns\n        (uint256 dvnFee, bytes memory packetBytes) = _payDVNs(config, _packet, dvnOptions);\n        totalNativeFee += dvnFee;\n\n        encodedPacket = packetBytes;\n    }\n\n    function _payDVNs(\n        ReadLibConfig memory _config,\n        Packet calldata _packet,\n        bytes memory _options\n    ) internal returns (uint256 totalFee, bytes memory encodedPacket) {\n        bytes memory packetHeader = PacketV1Codec.encodePacketHeader(_packet);\n        bytes memory payload = PacketV1Codec.encodePayload(_packet);\n\n        uint256[] memory dvnFees;\n        (totalFee, dvnFees) = _assignDVNJobs(_config, _packet.sender, packetHeader, _packet.message, _options);\n\n        encodedPacket = abi.encodePacked(packetHeader, payload);\n        emit DVNFeePaid(_config.requiredDVNs, _config.optionalDVNs, dvnFees);\n    }\n\n    function _assignDVNJobs(\n        ReadLibConfig memory _config,\n        address _sender,\n        bytes memory _packetHeader,\n        bytes calldata _cmd,\n        bytes memory _options\n    ) internal returns (uint256 totalFee, uint256[] memory dvnFees) {\n        (bytes[] memory optionsArray, uint8[] memory dvnIds) = DVNOptions.groupDVNOptionsByIdx(_options);\n\n        uint8 dvnsLength = _config.requiredDVNCount + _config.optionalDVNCount;\n        dvnFees = new uint256[](dvnsLength);\n        for (uint8 i = 0; i < dvnsLength; ++i) {\n            address dvn = i < _config.requiredDVNCount\n                ? _config.requiredDVNs[i]\n                : _config.optionalDVNs[i - _config.requiredDVNCount];\n\n            bytes memory options = \"\";\n            for (uint256 j = 0; j < dvnIds.length; ++j) {\n                if (dvnIds[j] == i) {\n                    options = optionsArray[j];\n                    break;\n                }\n            }\n\n            dvnFees[i] = ILayerZeroReadDVN(dvn).assignJob(_sender, _packetHeader, _cmd, options);\n            if (dvnFees[i] > 0) {\n                fees[dvn] += dvnFees[i];\n                totalFee += dvnFees[i];\n            }\n        }\n    }\n\n    function _quoteDVNs(\n        ReadLibConfig memory _config,\n        address _sender,\n        bytes memory _packetHeader,\n        bytes calldata _cmd,\n        bytes memory _options\n    ) internal view returns (uint256 totalFee) {\n        (bytes[] memory optionsArray, uint8[] memory dvnIndices) = DVNOptions.groupDVNOptionsByIdx(_options);\n\n        // here we merge 2 list of dvns into 1 to allocate the indexed dvn options to the right dvn\n        uint8 dvnsLength = _config.requiredDVNCount + _config.optionalDVNCount;\n        for (uint8 i = 0; i < dvnsLength; ++i) {\n            address dvn = i < _config.requiredDVNCount\n                ? _config.requiredDVNs[i]\n                : _config.optionalDVNs[i - _config.requiredDVNCount];\n\n            bytes memory options = \"\";\n            // it is a double loop here. however, if the list is short, the cost is very acceptable.\n            for (uint256 j = 0; j < dvnIndices.length; ++j) {\n                if (dvnIndices[j] == i) {\n                    options = optionsArray[j];\n                    break;\n                }\n            }\n            totalFee += ILayerZeroReadDVN(dvn).getFee(_sender, _packetHeader, _cmd, options);\n        }\n    }\n\n    function _payTreasury(\n        address _sender,\n        uint32 _dstEid,\n        uint256 _totalNativeFee,\n        bool _payInLzToken\n    ) internal returns (uint256 treasuryNativeFee, uint256 lzTokenFee) {\n        if (treasury != address(0x0)) {\n            bytes memory callData = abi.encodeCall(\n                ILayerZeroTreasury.payFee,\n                (_sender, _dstEid, _totalNativeFee, _payInLzToken)\n            );\n            (bool success, bytes memory result) = treasury.safeCall(treasuryGasLimit, 0, TREASURY_MAX_COPY, callData);\n\n            (treasuryNativeFee, lzTokenFee) = _parseTreasuryResult(_totalNativeFee, _payInLzToken, success, result);\n            // fee should be in lzTokenFee if payInLzToken, otherwise in native\n            if (treasuryNativeFee > 0) {\n                fees[treasury] += treasuryNativeFee;\n            }\n        }\n    }\n\n    /// @dev this interface should be DoS-free if the user is paying with native. properties\n    /// 1/ treasury can return an overly high lzToken fee\n    /// 2/ if treasury returns an overly high native fee, it will be capped by maxNativeFee,\n    ///    which can be reasoned with the configurations\n    /// 3/ the owner can not configure the treasury in a way that force this function to revert\n    function _quoteTreasury(\n        address _sender,\n        uint32 _dstEid,\n        uint256 _totalNativeFee,\n        bool _payInLzToken\n    ) internal view returns (uint256 nativeFee, uint256 lzTokenFee) {\n        // treasury must be set, and it has to be a contract\n        if (treasury != address(0x0)) {\n            bytes memory callData = abi.encodeCall(\n                ILayerZeroTreasury.getFee,\n                (_sender, _dstEid, _totalNativeFee, _payInLzToken)\n            );\n            (bool success, bytes memory result) = treasury.safeStaticCall(\n                treasuryGasLimit,\n                TREASURY_MAX_COPY,\n                callData\n            );\n\n            return _parseTreasuryResult(_totalNativeFee, _payInLzToken, success, result);\n        }\n    }\n\n    function _parseTreasuryResult(\n        uint256 _totalNativeFee,\n        bool _payInLzToken,\n        bool _success,\n        bytes memory _result\n    ) internal view returns (uint256 nativeFee, uint256 lzTokenFee) {\n        // failure, charges nothing\n        if (!_success || _result.length < TREASURY_MAX_COPY) return (0, 0);\n\n        // parse the result\n        uint256 treasureFeeQuote = abi.decode(_result, (uint256));\n        if (_payInLzToken) {\n            lzTokenFee = treasureFeeQuote;\n        } else {\n            // pay in native\n            // we must prevent high-treasuryFee Dos attack\n            // nativeFee = min(treasureFeeQuote, maxNativeFee)\n            // opportunistically raise the maxNativeFee to be the same as _totalNativeFee\n            // can't use the _totalNativeFee alone because the oapp can use custom workers to force the fee to 0.\n            // maxNativeFee = max (_totalNativeFee, treasuryNativeFeeCap)\n            uint256 maxNativeFee = _totalNativeFee > treasuryNativeFeeCap ? _totalNativeFee : treasuryNativeFeeCap;\n\n            // min (treasureFeeQuote, nativeFeeCap)\n            nativeFee = treasureFeeQuote > maxNativeFee ? maxNativeFee : treasureFeeQuote;\n        }\n    }\n\n    function _verifyAndReclaimStorage(\n        ReadLibConfig memory _config,\n        bytes32 _headerHash,\n        bytes32 _cmdHash,\n        bytes32 _payloadHash\n    ) internal {\n        if (!_checkVerifiable(_config, _headerHash, _cmdHash, _payloadHash)) {\n            revert LZ_RL_Verifying();\n        }\n\n        // iterate the required DVNs\n        if (_config.requiredDVNCount > 0) {\n            for (uint8 i = 0; i < _config.requiredDVNCount; ++i) {\n                delete hashLookup[_headerHash][_cmdHash][_config.requiredDVNs[i]];\n            }\n        }\n\n        // iterate the optional DVNs\n        if (_config.optionalDVNCount > 0) {\n            for (uint8 i = 0; i < _config.optionalDVNCount; ++i) {\n                delete hashLookup[_headerHash][_cmdHash][_config.optionalDVNs[i]];\n            }\n        }\n    }\n\n    /// @dev for verifiable view function\n    /// @dev checks if this verification is ready to be committed to the endpoint\n    function _checkVerifiable(\n        ReadLibConfig memory _config,\n        bytes32 _headerHash,\n        bytes32 _cmdHash,\n        bytes32 _payloadHash\n    ) internal view returns (bool) {\n        // iterate the required DVNs\n        if (_config.requiredDVNCount > 0) {\n            for (uint8 i = 0; i < _config.requiredDVNCount; ++i) {\n                if (!_verified(_config.requiredDVNs[i], _headerHash, _cmdHash, _payloadHash)) {\n                    // return if any of the required DVNs haven't signed\n                    return false;\n                }\n            }\n            if (_config.optionalDVNCount == 0) {\n                // returns early if all required DVNs have signed and there are no optional DVNs\n                return true;\n            }\n        }\n\n        // then it must require optional validations\n        uint8 threshold = _config.optionalDVNThreshold;\n        for (uint8 i = 0; i < _config.optionalDVNCount; ++i) {\n            if (_verified(_config.optionalDVNs[i], _headerHash, _cmdHash, _payloadHash)) {\n                // increment the optional count if the optional DVN has signed\n                threshold--;\n                if (threshold == 0) {\n                    // early return if the optional threshold has hit\n                    return true;\n                }\n            }\n        }\n\n        // return false as a catch-all\n        return false;\n    }\n\n    function _verified(\n        address _dvn,\n        bytes32 _headerHash,\n        bytes32 _cmdHash,\n        bytes32 _expectedPayloadHash\n    ) internal view returns (bool verified) {\n        verified = hashLookup[_headerHash][_cmdHash][_dvn] == _expectedPayloadHash;\n    }\n\n    function _payExecutor(\n        address _executor,\n        address _sender,\n        bytes memory _executorOptions\n    ) internal returns (uint256 executorFee) {\n        executorFee = ILayerZeroReadExecutor(_executor).assignJob(_sender, _executorOptions);\n        if (executorFee > 0) {\n            fees[_executor] += executorFee;\n        }\n        emit ExecutorFeePaid(_executor, executorFee);\n    }\n\n    receive() external payable {}\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/BitMaps.sol","source_code":"// SPDX-License-Identifier: MIT\n\n// modified from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/BitMaps.sol\npragma solidity ^0.8.20;\n\ntype BitMap256 is uint256;\n\nusing BitMaps for BitMap256 global;\n\nlibrary BitMaps {\n    /**\n     * @dev Returns whether the bit at `index` is set.\n     */\n    function get(BitMap256 bitmap, uint8 index) internal pure returns (bool) {\n        uint256 mask = 1 << index;\n        return BitMap256.unwrap(bitmap) & mask != 0;\n    }\n\n    /**\n     * @dev Sets the bit at `index`.\n     */\n    function set(BitMap256 bitmap, uint8 index) internal pure returns (BitMap256) {\n        uint256 mask = 1 << index;\n        return BitMap256.wrap(BitMap256.unwrap(bitmap) | mask);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n *     doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n *     token.safeTransferFrom(msg.sender, address(this), value);\n *     ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n    /**\n     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n     * given ``owner``'s signed approval.\n     *\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also apply here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     *\n     * CAUTION: See Security Considerations above.\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    /**\n     * @dev Returns the current nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     */\n    function nonces(address owner) external view returns (uint256);\n\n    /**\n     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"},{"file_path":"contracts/uln/interfaces/IDVNFeeLib.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IDVN } from \"./IDVN.sol\";\n\ninterface IDVNFeeLib {\n    struct FeeParams {\n        address priceFeed;\n        uint32 dstEid;\n        uint64 confirmations;\n        address sender;\n        uint64 quorum;\n        uint16 defaultMultiplierBps;\n    }\n\n    struct FeeParamsForRead {\n        address priceFeed;\n        address sender;\n        uint64 quorum;\n        uint16 defaultMultiplierBps;\n    }\n\n    error DVN_UnsupportedOptionType(uint8 optionType);\n    error DVN_EidNotSupported(uint32 eid);\n    error DVN_TimestampOutOfRange(uint32 eid, uint64 timestamp);\n    error DVN_INVALID_INPUT_LENGTH();\n\n    function getFeeOnSend(\n        FeeParams calldata _params,\n        IDVN.DstConfig calldata _dstConfig,\n        bytes calldata _options\n    ) external payable returns (uint256 fee);\n\n    function getFee(\n        FeeParams calldata _params,\n        IDVN.DstConfig calldata _dstConfig,\n        bytes calldata _options\n    ) external view returns (uint256 fee);\n\n    function getFeeOnSend(\n        FeeParamsForRead calldata _params,\n        IDVN.DstConfig calldata _dstConfig,\n        bytes calldata _cmd,\n        bytes calldata _options\n    ) external payable returns (uint256 fee);\n\n    function getFee(\n        FeeParamsForRead calldata _params,\n        IDVN.DstConfig calldata _dstConfig,\n        bytes calldata _cmd,\n        bytes calldata _options\n    ) external view returns (uint256 fee);\n\n    function version() external view returns (uint64 major, uint8 minor);\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Transfer.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nlibrary Transfer {\n    using SafeERC20 for IERC20;\n\n    address internal constant ADDRESS_ZERO = address(0);\n\n    error Transfer_NativeFailed(address _to, uint256 _value);\n    error Transfer_ToAddressIsZero();\n\n    function native(address _to, uint256 _value) internal {\n        if (_to == ADDRESS_ZERO) revert Transfer_ToAddressIsZero();\n        (bool success, ) = _to.call{ value: _value }(\"\");\n        if (!success) revert Transfer_NativeFailed(_to, _value);\n    }\n\n    function token(address _token, address _to, uint256 _value) internal {\n        if (_to == ADDRESS_ZERO) revert Transfer_ToAddressIsZero();\n        IERC20(_token).safeTransfer(_to, _value);\n    }\n\n    function nativeOrToken(address _token, address _to, uint256 _value) internal {\n        if (_token == ADDRESS_ZERO) {\n            native(_to, _value);\n        } else {\n            token(_token, _to, _value);\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/Context.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},{"file_path":"contracts/MessageLibBase.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\n/// @dev simply a container of endpoint address and local eid\nabstract contract MessageLibBase {\n    address internal immutable endpoint;\n    uint32 internal immutable localEid;\n\n    error LZ_MessageLib_OnlyEndpoint();\n\n    modifier onlyEndpoint() {\n        if (endpoint != msg.sender) revert LZ_MessageLib_OnlyEndpoint();\n        _;\n    }\n\n    constructor(address _endpoint, uint32 _localEid) {\n        endpoint = _endpoint;\n        localEid = _localEid;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"},{"file_path":"@openzeppelin/contracts/utils/math/SignedMath.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n    /**\n     * @dev Returns the largest of two signed numbers.\n     */\n    function max(int256 a, int256 b) internal pure returns (int256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two signed numbers.\n     */\n    function min(int256 a, int256 b) internal pure returns (int256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two signed numbers without overflow.\n     * The result is rounded towards zero.\n     */\n    function average(int256 a, int256 b) internal pure returns (int256) {\n        // Formula from the book \"Hacker's Delight\"\n        int256 x = (a & b) + ((a ^ b) >> 1);\n        return x + (int256(uint256(x) >> 255) & (a ^ b));\n    }\n\n    /**\n     * @dev Returns the absolute unsigned value of a signed value.\n     */\n    function abs(int256 n) internal pure returns (uint256) {\n        unchecked {\n            // must be unchecked in order to support `n = type(int256).min`\n            return uint256(n >= 0 ? n : -n);\n        }\n    }\n}\n"},{"file_path":"contracts/interfaces/ILayerZeroTreasury.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface ILayerZeroTreasury {\n    function getFee(\n        address _sender,\n        uint32 _dstEid,\n        uint256 _totalNativeFee,\n        bool _payInLzToken\n    ) external view returns (uint256 fee);\n\n    function payFee(\n        address _sender,\n        uint32 _dstEid,\n        uint256 _totalNativeFee,\n        bool _payInLzToken\n    ) external payable returns (uint256 fee);\n}\n"},{"file_path":"contracts/uln/readlib/ReadLibBase.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\nstruct ReadLibConfig {\n    address executor;\n    // we store the length of required DVNs and optional DVNs instead of using DVN.length directly to save gas\n    uint8 requiredDVNCount; // 0 indicate DEFAULT, NIL_DVN_COUNT indicate NONE (to override the value of default)\n    uint8 optionalDVNCount; // 0 indicate DEFAULT, NIL_DVN_COUNT indicate NONE (to override the value of default)\n    uint8 optionalDVNThreshold; // (0, optionalDVNCount]\n    address[] requiredDVNs; // no duplicates. sorted an an ascending order. allowed overlap with optionalDVNs\n    address[] optionalDVNs; // no duplicates. sorted an an ascending order. allowed overlap with requiredDVNs\n}\n\nstruct SetDefaultReadLibConfigParam {\n    uint32 eid;\n    ReadLibConfig config;\n}\n\n/// @dev includes the utility functions for checking ReadLib states and logics\nabstract contract ReadLibBase is Ownable {\n    address internal constant DEFAULT_CONFIG = address(0);\n    // reserved values for\n    uint8 internal constant DEFAULT = 0;\n    uint8 internal constant NIL_DVN_COUNT = type(uint8).max;\n    // 127 to prevent total number of DVNs (127 * 2) exceeding uint8.max (255)\n    // by limiting the total size, it would help constraint the design of DVNOptions\n    uint8 private constant MAX_COUNT = (type(uint8).max - 1) / 2;\n\n    mapping(address oapp => mapping(uint32 eid => ReadLibConfig config)) internal readLibConfigs;\n\n    error LZ_RL_Unsorted();\n    error LZ_RL_InvalidRequiredDVNCount();\n    error LZ_RL_InvalidOptionalDVNCount();\n    error LZ_RL_AtLeastOneDVN();\n    error LZ_RL_InvalidOptionalDVNThreshold();\n    error LZ_RL_UnsupportedEid(uint32 eid);\n    error LZ_RL_InvalidExecutor();\n\n    event DefaultReadLibConfigsSet(SetDefaultReadLibConfigParam[] params);\n    event ReadLibConfigSet(address oapp, uint32 eid, ReadLibConfig config);\n\n    // ============================ OnlyOwner ===================================\n\n    /// @dev about the DEFAULT ReadLib config\n    /// 1) its values are all LITERAL (e.g. 0 is 0). whereas in the oapp ReadLib config, 0 (default value) points to the default ReadLib config\n    ///     this design enables the oapp to point to DEFAULT config without explicitly setting the config\n    /// 2) its configuration is more restrictive than the oapp ReadLib config that\n    ///     a) it must not use NIL value, where NIL is used only by oapps to indicate the LITERAL 0\n    ///     b) it must have at least one DVN and executor\n    function setDefaultReadLibConfigs(SetDefaultReadLibConfigParam[] calldata _params) external onlyOwner {\n        for (uint256 i = 0; i < _params.length; ++i) {\n            SetDefaultReadLibConfigParam calldata param = _params[i];\n\n            // 2.a must not use NIL\n            if (param.config.requiredDVNCount == NIL_DVN_COUNT) revert LZ_RL_InvalidRequiredDVNCount();\n            if (param.config.optionalDVNCount == NIL_DVN_COUNT) revert LZ_RL_InvalidOptionalDVNCount();\n\n            // 2.b must have at least one dvn and executor\n            _assertAtLeastOneDVN(param.config);\n            if (param.config.executor == address(0x0)) revert LZ_RL_InvalidExecutor();\n\n            _setConfig(DEFAULT_CONFIG, param.eid, param.config);\n        }\n        emit DefaultReadLibConfigsSet(_params);\n    }\n\n    // ============================ View ===================================\n    // @dev assuming most oapps use default, we get default as memory and custom as storage to save gas\n    function getReadLibConfig(address _oapp, uint32 _remoteEid) public view returns (ReadLibConfig memory rtnConfig) {\n        ReadLibConfig storage defaultConfig = readLibConfigs[DEFAULT_CONFIG][_remoteEid];\n        ReadLibConfig storage customConfig = readLibConfigs[_oapp][_remoteEid];\n\n        address executor = customConfig.executor;\n        rtnConfig.executor = executor != address(0x0) ? executor : defaultConfig.executor;\n\n        if (customConfig.requiredDVNCount == DEFAULT) {\n            if (defaultConfig.requiredDVNCount > 0) {\n                // copy only if count > 0. save gas\n                rtnConfig.requiredDVNs = defaultConfig.requiredDVNs;\n                rtnConfig.requiredDVNCount = defaultConfig.requiredDVNCount;\n            } // else, do nothing\n        } else {\n            if (customConfig.requiredDVNCount != NIL_DVN_COUNT) {\n                rtnConfig.requiredDVNs = customConfig.requiredDVNs;\n                rtnConfig.requiredDVNCount = customConfig.requiredDVNCount;\n            } // else, do nothing\n        }\n\n        if (customConfig.optionalDVNCount == DEFAULT) {\n            if (defaultConfig.optionalDVNCount > 0) {\n                // copy only if count > 0. save gas\n                rtnConfig.optionalDVNs = defaultConfig.optionalDVNs;\n                rtnConfig.optionalDVNCount = defaultConfig.optionalDVNCount;\n                rtnConfig.optionalDVNThreshold = defaultConfig.optionalDVNThreshold;\n            }\n        } else {\n            if (customConfig.optionalDVNCount != NIL_DVN_COUNT) {\n                rtnConfig.optionalDVNs = customConfig.optionalDVNs;\n                rtnConfig.optionalDVNCount = customConfig.optionalDVNCount;\n                rtnConfig.optionalDVNThreshold = customConfig.optionalDVNThreshold;\n            }\n        }\n\n        // the final value must have at least one dvn\n        // it is possible that some default config result into 0 dvns\n        _assertAtLeastOneDVN(rtnConfig);\n    }\n\n    /// @dev Get the readLib config without the default config for the given remoteEid.\n    function getAppReadLibConfig(address _oapp, uint32 _remoteEid) external view returns (ReadLibConfig memory) {\n        return readLibConfigs[_oapp][_remoteEid];\n    }\n\n    // ============================ Internal ===================================\n    function _setReadLibConfig(uint32 _remoteEid, address _oapp, ReadLibConfig memory _param) internal {\n        _setConfig(_oapp, _remoteEid, _param);\n\n        // get ReadLib config again as a catch all to ensure the config is valid\n        getReadLibConfig(_oapp, _remoteEid);\n        emit ReadLibConfigSet(_oapp, _remoteEid, _param);\n    }\n\n    /// @dev a supported Eid must have a valid default readLib config, which has at least one dvn\n    function _isSupportedEid(uint32 _remoteEid) internal view returns (bool) {\n        ReadLibConfig storage defaultConfig = readLibConfigs[DEFAULT_CONFIG][_remoteEid];\n        return defaultConfig.requiredDVNCount > 0 || defaultConfig.optionalDVNThreshold > 0;\n    }\n\n    function _assertSupportedEid(uint32 _remoteEid) internal view {\n        if (!_isSupportedEid(_remoteEid)) revert LZ_RL_UnsupportedEid(_remoteEid);\n    }\n\n    // ============================ Private ===================================\n\n    function _assertAtLeastOneDVN(ReadLibConfig memory _config) private pure {\n        if (_config.requiredDVNCount == 0 && _config.optionalDVNThreshold == 0) revert LZ_RL_AtLeastOneDVN();\n    }\n\n    /// @dev this private function is used in both setDefaultReadLibConfigs and setReadLibConfig\n    function _setConfig(address _oapp, uint32 _eid, ReadLibConfig memory _param) private {\n        // @dev required dvns\n        // if dvnCount == NONE, dvns list must be empty\n        // if dvnCount == DEFAULT, dvn list must be empty\n        // otherwise, dvnList.length == dvnCount and assert the list is valid\n        if (_param.requiredDVNCount == NIL_DVN_COUNT || _param.requiredDVNCount == DEFAULT) {\n            if (_param.requiredDVNs.length != 0) revert LZ_RL_InvalidRequiredDVNCount();\n        } else {\n            if (_param.requiredDVNs.length != _param.requiredDVNCount || _param.requiredDVNCount > MAX_COUNT)\n                revert LZ_RL_InvalidRequiredDVNCount();\n            _assertNoDuplicates(_param.requiredDVNs);\n        }\n\n        // @dev optional dvns\n        // if optionalDVNCount == NONE, optionalDVNs list must be empty and threshold must be 0\n        // if optionalDVNCount == DEFAULT, optionalDVNs list must be empty and threshold must be 0\n        // otherwise, optionalDVNs.length == optionalDVNCount, threshold > 0 && threshold <= optionalDVNCount and assert the list is valid\n\n        // example use case: an oapp uses the DEFAULT 'required' but\n        //     a) use a custom 1/1 dvn (practically a required dvn), or\n        //     b) use a custom 2/3 dvn\n        if (_param.optionalDVNCount == NIL_DVN_COUNT || _param.optionalDVNCount == DEFAULT) {\n            if (_param.optionalDVNs.length != 0) revert LZ_RL_InvalidOptionalDVNCount();\n            if (_param.optionalDVNThreshold != 0) revert LZ_RL_InvalidOptionalDVNThreshold();\n        } else {\n            if (_param.optionalDVNs.length != _param.optionalDVNCount || _param.optionalDVNCount > MAX_COUNT)\n                revert LZ_RL_InvalidOptionalDVNCount();\n            if (_param.optionalDVNThreshold == 0 || _param.optionalDVNThreshold > _param.optionalDVNCount)\n                revert LZ_RL_InvalidOptionalDVNThreshold();\n            _assertNoDuplicates(_param.optionalDVNs);\n        }\n        // don't assert valid count here, as it needs to be validated along side default config\n\n        readLibConfigs[_oapp][_eid] = _param;\n    }\n\n    function _assertNoDuplicates(address[] memory _dvns) private pure {\n        address lastDVN = address(0);\n        for (uint256 i = 0; i < _dvns.length; i++) {\n            address dvn = _dvns[i];\n            if (dvn <= lastDVN) revert LZ_RL_Unsorted(); // to ensure no duplicates\n            lastDVN = dvn;\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/access/AccessControl.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n *     require(hasRole(MY_ROLE, msg.sender));\n *     ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n    struct RoleData {\n        mapping(address => bool) members;\n        bytes32 adminRole;\n    }\n\n    mapping(bytes32 => RoleData) private _roles;\n\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n    /**\n     * @dev Modifier that checks that an account has a specific role. Reverts\n     * with a standardized message including the required role.\n     *\n     * The format of the revert reason is given by the following regular expression:\n     *\n     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n     *\n     * _Available since v4.1._\n     */\n    modifier onlyRole(bytes32 role) {\n        _checkRole(role);\n        _;\n    }\n\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n        return _roles[role].members[account];\n    }\n\n    /**\n     * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n     * Overriding this function changes the behavior of the {onlyRole} modifier.\n     *\n     * Format of the revert message is described in {_checkRole}.\n     *\n     * _Available since v4.6._\n     */\n    function _checkRole(bytes32 role) internal view virtual {\n        _checkRole(role, _msgSender());\n    }\n\n    /**\n     * @dev Revert with a standard message if `account` is missing `role`.\n     *\n     * The format of the revert reason is given by the following regular expression:\n     *\n     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n     */\n    function _checkRole(bytes32 role, address account) internal view virtual {\n        if (!hasRole(role, account)) {\n            revert(\n                string(\n                    abi.encodePacked(\n                        \"AccessControl: account \",\n                        Strings.toHexString(account),\n                        \" is missing role \",\n                        Strings.toHexString(uint256(role), 32)\n                    )\n                )\n            );\n        }\n    }\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n        return _roles[role].adminRole;\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     *\n     * May emit a {RoleGranted} event.\n     */\n    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been revoked `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function renounceRole(bytes32 role, address account) public virtual override {\n        require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event. Note that unlike {grantRole}, this function doesn't perform any\n     * checks on the calling account.\n     *\n     * May emit a {RoleGranted} event.\n     *\n     * [WARNING]\n     * ====\n     * This function should only be called from the constructor when setting\n     * up the initial roles for the system.\n     *\n     * Using this function in any other way is effectively circumventing the admin\n     * system imposed by {AccessControl}.\n     * ====\n     *\n     * NOTE: This function is deprecated in favor of {_grantRole}.\n     */\n    function _setupRole(bytes32 role, address account) internal virtual {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Sets `adminRole` as ``role``'s admin role.\n     *\n     * Emits a {RoleAdminChanged} event.\n     */\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n        bytes32 previousAdminRole = getRoleAdmin(role);\n        _roles[role].adminRole = adminRole;\n        emit RoleAdminChanged(role, previousAdminRole, adminRole);\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleGranted} event.\n     */\n    function _grantRole(bytes32 role, address account) internal virtual {\n        if (!hasRole(role, account)) {\n            _roles[role].members[account] = true;\n            emit RoleGranted(role, account, _msgSender());\n        }\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function _revokeRole(bytes32 role, address account) internal virtual {\n        if (hasRole(role, account)) {\n            _roles[role].members[account] = false;\n            emit RoleRevoked(role, account, _msgSender());\n        }\n    }\n}\n"},{"file_path":"contracts/Worker.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Pausable } from \"@openzeppelin/contracts/security/Pausable.sol\";\nimport { AccessControl } from \"@openzeppelin/contracts/access/AccessControl.sol\";\n\nimport { ISendLib } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol\";\nimport { Transfer } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Transfer.sol\";\n\nimport { IWorker } from \"./interfaces/IWorker.sol\";\n\nabstract contract Worker is AccessControl, Pausable, IWorker {\n    bytes32 internal constant MESSAGE_LIB_ROLE = keccak256(\"MESSAGE_LIB_ROLE\");\n    bytes32 internal constant ALLOWLIST = keccak256(\"ALLOWLIST\");\n    bytes32 internal constant DENYLIST = keccak256(\"DENYLIST\");\n    bytes32 internal constant ADMIN_ROLE = keccak256(\"ADMIN_ROLE\");\n\n    address public workerFeeLib;\n\n    uint64 public allowlistSize;\n    uint16 public defaultMultiplierBps;\n    address public priceFeed;\n\n    mapping(uint32 eid => uint8[] optionTypes) internal supportedOptionTypes;\n\n    // ========================= Constructor =========================\n\n    /// @param _messageLibs array of message lib addresses that are granted the MESSAGE_LIB_ROLE\n    /// @param _priceFeed price feed address\n    /// @param _defaultMultiplierBps default multiplier for worker fee\n    /// @param _roleAdmin address that is granted the DEFAULT_ADMIN_ROLE (can grant and revoke all roles)\n    /// @param _admins array of admin addresses that are granted the ADMIN_ROLE\n    constructor(\n        address[] memory _messageLibs,\n        address _priceFeed,\n        uint16 _defaultMultiplierBps,\n        address _roleAdmin,\n        address[] memory _admins\n    ) {\n        defaultMultiplierBps = _defaultMultiplierBps;\n        priceFeed = _priceFeed;\n\n        if (_roleAdmin != address(0x0)) {\n            _grantRole(DEFAULT_ADMIN_ROLE, _roleAdmin); // _roleAdmin can grant and revoke all roles\n        }\n\n        for (uint256 i = 0; i < _messageLibs.length; ++i) {\n            _grantRole(MESSAGE_LIB_ROLE, _messageLibs[i]);\n        }\n\n        for (uint256 i = 0; i < _admins.length; ++i) {\n            _grantRole(ADMIN_ROLE, _admins[i]);\n        }\n    }\n\n    // ========================= Modifier =========================\n\n    modifier onlyAcl(address _sender) {\n        if (!hasAcl(_sender)) {\n            revert Worker_NotAllowed();\n        }\n        _;\n    }\n\n    /// @dev Access control list using allowlist and denylist\n    /// @dev 1) if one address is in the denylist -> deny\n    /// @dev 2) else if address in the allowlist OR allowlist is empty (allows everyone)-> allow\n    /// @dev 3) else deny\n    /// @param _sender address to check\n    function hasAcl(address _sender) public view returns (bool) {\n        if (hasRole(DENYLIST, _sender)) {\n            return false;\n        } else if (allowlistSize == 0 || hasRole(ALLOWLIST, _sender)) {\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    // ========================= OnyDefaultAdmin =========================\n\n    /// @dev flag to pause execution of workers (if used with whenNotPaused modifier)\n    /// @param _paused true to pause, false to unpause\n    function setPaused(bool _paused) external onlyRole(DEFAULT_ADMIN_ROLE) {\n        if (_paused) {\n            _pause();\n        } else {\n            _unpause();\n        }\n    }\n\n    // ========================= OnlyAdmin =========================\n\n    /// @param _priceFeed price feed address\n    function setPriceFeed(address _priceFeed) external onlyRole(ADMIN_ROLE) {\n        priceFeed = _priceFeed;\n        emit SetPriceFeed(_priceFeed);\n    }\n\n    /// @param _workerFeeLib worker fee lib address\n    function setWorkerFeeLib(address _workerFeeLib) external onlyRole(ADMIN_ROLE) {\n        workerFeeLib = _workerFeeLib;\n        emit SetWorkerLib(_workerFeeLib);\n    }\n\n    /// @param _multiplierBps default multiplier for worker fee\n    function setDefaultMultiplierBps(uint16 _multiplierBps) external onlyRole(ADMIN_ROLE) {\n        defaultMultiplierBps = _multiplierBps;\n        emit SetDefaultMultiplierBps(_multiplierBps);\n    }\n\n    /// @dev supports withdrawing fee from ULN301, ULN302 and more\n    /// @param _lib message lib address\n    /// @param _to address to withdraw fee to\n    /// @param _amount amount to withdraw\n    function withdrawFee(address _lib, address _to, uint256 _amount) external onlyRole(ADMIN_ROLE) {\n        if (!hasRole(MESSAGE_LIB_ROLE, _lib)) revert Worker_OnlyMessageLib();\n        ISendLib(_lib).withdrawFee(_to, _amount);\n        emit Withdraw(_lib, _to, _amount);\n    }\n\n    /// @dev supports withdrawing token from the contract\n    /// @param _token token address\n    /// @param _to address to withdraw token to\n    /// @param _amount amount to withdraw\n    function withdrawToken(address _token, address _to, uint256 _amount) external onlyRole(ADMIN_ROLE) {\n        // transfers native if _token is address(0x0)\n        Transfer.nativeOrToken(_token, _to, _amount);\n    }\n\n    function setSupportedOptionTypes(uint32 _eid, uint8[] calldata _optionTypes) external onlyRole(ADMIN_ROLE) {\n        supportedOptionTypes[_eid] = _optionTypes;\n    }\n\n    // ========================= View Functions =========================\n    function getSupportedOptionTypes(uint32 _eid) external view returns (uint8[] memory) {\n        return supportedOptionTypes[_eid];\n    }\n\n    // ========================= Internal Functions =========================\n\n    /// @dev overrides AccessControl to allow for counting of allowlistSize\n    /// @param _role role to grant\n    /// @param _account address to grant role to\n    function _grantRole(bytes32 _role, address _account) internal override {\n        if (_role == ALLOWLIST && !hasRole(_role, _account)) {\n            ++allowlistSize;\n        }\n        super._grantRole(_role, _account);\n    }\n\n    /// @dev overrides AccessControl to allow for counting of allowlistSize\n    /// @param _role role to revoke\n    /// @param _account address to revoke role from\n    function _revokeRole(bytes32 _role, address _account) internal override {\n        if (_role == ALLOWLIST && hasRole(_role, _account)) {\n            --allowlistSize;\n        }\n        super._revokeRole(_role, _account);\n    }\n\n    /// @dev overrides AccessControl to disable renouncing of roles\n    function renounceRole(bytes32 /*role*/, address /*account*/) public pure override {\n        revert Worker_RoleRenouncingDisabled();\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/math/Math.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    enum Rounding {\n        Down, // Toward negative infinity\n        Up, // Toward infinity\n        Zero // Toward zero\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds up instead\n     * of rounding down.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b - 1) / b can overflow on addition, so we distribute.\n        return a == 0 ? 0 : (a - 1) / b + 1;\n    }\n\n    /**\n     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n     * with further edits by Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n            // variables such that product = prod1 * 2^256 + prod0.\n            uint256 prod0; // Least significant 256 bits of the product\n            uint256 prod1; // Most significant 256 bits of the product\n            assembly {\n                let mm := mulmod(x, y, not(0))\n                prod0 := mul(x, y)\n                prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n            }\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (prod1 == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return prod0 / denominator;\n            }\n\n            // Make sure the result is less than 2^256. Also prevents denominator == 0.\n            require(denominator > prod1, \"Math: mulDiv overflow\");\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [prod1 prod0].\n            uint256 remainder;\n            assembly {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                prod1 := sub(prod1, gt(remainder, prod0))\n                prod0 := sub(prod0, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n            // See https://cs.stackexchange.com/q/138556/92363.\n\n            // Does not overflow because the denominator cannot be zero at this stage in the function.\n            uint256 twos = denominator & (~denominator + 1);\n            assembly {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [prod1 prod0] by twos.\n                prod0 := div(prod0, twos)\n\n                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from prod1 into prod0.\n            prod0 |= prod1 * twos;\n\n            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv = 1 mod 2^4.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n            // in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2^8\n            inverse *= 2 - denominator * inverse; // inverse mod 2^16\n            inverse *= 2 - denominator * inverse; // inverse mod 2^32\n            inverse *= 2 - denominator * inverse; // inverse mod 2^64\n            inverse *= 2 - denominator * inverse; // inverse mod 2^128\n            inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n            // is no longer required.\n            result = prod0 * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        uint256 result = mulDiv(x, y, denominator);\n        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n            result += 1;\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n     *\n     * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        if (a == 0) {\n            return 0;\n        }\n\n        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n        //\n        // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n        //\n        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n        //\n        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n        uint256 result = 1 << (log2(a) >> 1);\n\n        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n        // into the expected uint128 result.\n        unchecked {\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            return min(result, a / result);\n        }\n    }\n\n    /**\n     * @notice Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 128;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 64;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 32;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 16;\n            }\n            if (value >> 8 > 0) {\n                value >>= 8;\n                result += 8;\n            }\n            if (value >> 4 > 0) {\n                value >>= 4;\n                result += 4;\n            }\n            if (value >> 2 > 0) {\n                value >>= 2;\n                result += 2;\n            }\n            if (value >> 1 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 16;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 8;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 4;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 2;\n            }\n            if (value >> 8 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/access/Ownable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    constructor() {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IMessageLibManager } from \"./IMessageLibManager.sol\";\nimport { IMessagingComposer } from \"./IMessagingComposer.sol\";\nimport { IMessagingChannel } from \"./IMessagingChannel.sol\";\nimport { IMessagingContext } from \"./IMessagingContext.sol\";\n\nstruct MessagingParams {\n    uint32 dstEid;\n    bytes32 receiver;\n    bytes message;\n    bytes options;\n    bool payInLzToken;\n}\n\nstruct MessagingReceipt {\n    bytes32 guid;\n    uint64 nonce;\n    MessagingFee fee;\n}\n\nstruct MessagingFee {\n    uint256 nativeFee;\n    uint256 lzTokenFee;\n}\n\nstruct Origin {\n    uint32 srcEid;\n    bytes32 sender;\n    uint64 nonce;\n}\n\ninterface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext {\n    event PacketSent(bytes encodedPayload, bytes options, address sendLibrary);\n\n    event PacketVerified(Origin origin, address receiver, bytes32 payloadHash);\n\n    event PacketDelivered(Origin origin, address receiver);\n\n    event LzReceiveAlert(\n        address indexed receiver,\n        address indexed executor,\n        Origin origin,\n        bytes32 guid,\n        uint256 gas,\n        uint256 value,\n        bytes message,\n        bytes extraData,\n        bytes reason\n    );\n\n    event LzTokenSet(address token);\n\n    event DelegateSet(address sender, address delegate);\n\n    function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory);\n\n    function send(\n        MessagingParams calldata _params,\n        address _refundAddress\n    ) external payable returns (MessagingReceipt memory);\n\n    function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external;\n\n    function verifiable(Origin calldata _origin, address _receiver) external view returns (bool);\n\n    function initializable(Origin calldata _origin, address _receiver) external view returns (bool);\n\n    function lzReceive(\n        Origin calldata _origin,\n        address _receiver,\n        bytes32 _guid,\n        bytes calldata _message,\n        bytes calldata _extraData\n    ) external payable;\n\n    // oapp can burn messages partially by calling this function with its own business logic if messages are verified in order\n    function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;\n\n    function setLzToken(address _lzToken) external;\n\n    function lzToken() external view returns (address);\n\n    function nativeToken() external view returns (address);\n\n    function setDelegate(address _delegate) external;\n}\n"},{"file_path":"contracts/libs/SafeCall.sol","source_code":"// SPDX-License-Identifier: MIT OR Apache-2.0\n\npragma solidity ^0.8.20;\n\n/// @dev copied from https://github.com/nomad-xyz/ExcessivelySafeCall/blob/main/src/ExcessivelySafeCall.sol.\nlibrary SafeCall {\n    /// @notice calls a contract with a specified gas limit and value and captures the return data\n    /// @param _target The address to call\n    /// @param _gas The amount of gas to forward to the remote contract\n    /// @param _value The value in wei to send to the remote contract\n    /// to memory.\n    /// @param _maxCopy The maximum number of bytes of returndata to copy\n    /// to memory.\n    /// @param _calldata The data to send to the remote contract\n    /// @return success and returndata, as `.call()`. Returndata is capped to\n    /// `_maxCopy` bytes.\n    function safeCall(\n        address _target,\n        uint256 _gas,\n        uint256 _value,\n        uint16 _maxCopy,\n        bytes memory _calldata\n    ) internal returns (bool, bytes memory) {\n        // check that target has code\n        uint size;\n        assembly {\n            size := extcodesize(_target)\n        }\n        if (size == 0) {\n            return (false, new bytes(0));\n        }\n\n        // set up for assembly call\n        uint256 _toCopy;\n        bool _success;\n        bytes memory _returnData = new bytes(_maxCopy);\n        // dispatch message to recipient\n        // by assembly calling \"handle\" function\n        // we call via assembly to avoid memcopying a very large returndata\n        // returned by a malicious contract\n        assembly {\n            _success := call(\n                _gas, // gas\n                _target, // recipient\n                _value, // ether value\n                add(_calldata, 0x20), // inloc\n                mload(_calldata), // inlen\n                0, // outloc\n                0 // outlen\n            )\n            // limit our copy to 100 bytes\n            _toCopy := returndatasize()\n            if gt(_toCopy, _maxCopy) {\n                _toCopy := _maxCopy\n            }\n            // Store the length of the copied bytes\n            mstore(_returnData, _toCopy)\n            // copy the bytes from returndata[0:_toCopy]\n            returndatacopy(add(_returnData, 0x20), 0, _toCopy)\n        }\n        return (_success, _returnData);\n    }\n\n    /// @notice Use when you _really_ really _really_ don't trust the called\n    /// contract. This prevents the called contract from causing reversion of\n    /// the caller in as many ways as we can.\n    /// @dev The main difference between this and a solidity low-level call is\n    /// that we limit the number of bytes that the callee can cause to be\n    /// copied to caller memory. This prevents stupid things like malicious\n    /// contracts returning 10,000,000 bytes causing a local OOG when copying\n    /// to memory.\n    /// @param _target The address to call\n    /// @param _gas The amount of gas to forward to the remote contract\n    /// @param _maxCopy The maximum number of bytes of returndata to copy\n    /// to memory.\n    /// @param _calldata The data to send to the remote contract\n    /// @return success and returndata, as `.call()`. Returndata is capped to\n    /// `_maxCopy` bytes.\n    function safeStaticCall(\n        address _target,\n        uint256 _gas,\n        uint16 _maxCopy,\n        bytes memory _calldata\n    ) internal view returns (bool, bytes memory) {\n        // check that target has code\n        uint size;\n        assembly {\n            size := extcodesize(_target)\n        }\n        if (size == 0) {\n            return (false, new bytes(0));\n        }\n\n        // set up for assembly call\n        uint256 _toCopy;\n        bool _success;\n        bytes memory _returnData = new bytes(_maxCopy);\n        // dispatch message to recipient\n        // by assembly calling \"handle\" function\n        // we call via assembly to avoid memcopying a very large returndata\n        // returned by a malicious contract\n        assembly {\n            _success := staticcall(\n                _gas, // gas\n                _target, // recipient\n                add(_calldata, 0x20), // inloc\n                mload(_calldata), // inlen\n                0, // outloc\n                0 // outlen\n            )\n            // limit our copy to 256 bytes\n            _toCopy := returndatasize()\n            if gt(_toCopy, _maxCopy) {\n                _toCopy := _maxCopy\n            }\n            // Store the length of the copied bytes\n            mstore(_returnData, _toCopy)\n            // copy the bytes from returndata[0:_toCopy]\n            returndatacopy(add(_returnData, 0x20), 0, _toCopy)\n        }\n        return (_success, _returnData);\n    }\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol","source_code":"// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Packet } from \"../../interfaces/ISendLib.sol\";\nimport { AddressCast } from \"../../libs/AddressCast.sol\";\n\nlibrary PacketV1Codec {\n    using AddressCast for address;\n    using AddressCast for bytes32;\n\n    uint8 internal constant PACKET_VERSION = 1;\n\n    // header (version + nonce + path)\n    // version\n    uint256 private constant PACKET_VERSION_OFFSET = 0;\n    //    nonce\n    uint256 private constant NONCE_OFFSET = 1;\n    //    path\n    uint256 private constant SRC_EID_OFFSET = 9;\n    uint256 private constant SENDER_OFFSET = 13;\n    uint256 private constant DST_EID_OFFSET = 45;\n    uint256 private constant RECEIVER_OFFSET = 49;\n    // payload (guid + message)\n    uint256 private constant GUID_OFFSET = 81; // keccak256(nonce + path)\n    uint256 private constant MESSAGE_OFFSET = 113;\n\n    function encode(Packet memory _packet) internal pure returns (bytes memory encodedPacket) {\n        encodedPacket = abi.encodePacked(\n            PACKET_VERSION,\n            _packet.nonce,\n            _packet.srcEid,\n            _packet.sender.toBytes32(),\n            _packet.dstEid,\n            _packet.receiver,\n            _packet.guid,\n            _packet.message\n        );\n    }\n\n    function encodePacketHeader(Packet memory _packet) internal pure returns (bytes memory) {\n        return\n            abi.encodePacked(\n                PACKET_VERSION,\n                _packet.nonce,\n                _packet.srcEid,\n                _packet.sender.toBytes32(),\n                _packet.dstEid,\n                _packet.receiver\n            );\n    }\n\n    function encodePayload(Packet memory _packet) internal pure returns (bytes memory) {\n        return abi.encodePacked(_packet.guid, _packet.message);\n    }\n\n    function header(bytes calldata _packet) internal pure returns (bytes calldata) {\n        return _packet[0:GUID_OFFSET];\n    }\n\n    function version(bytes calldata _packet) internal pure returns (uint8) {\n        return uint8(bytes1(_packet[PACKET_VERSION_OFFSET:NONCE_OFFSET]));\n    }\n\n    function nonce(bytes calldata _packet) internal pure returns (uint64) {\n        return uint64(bytes8(_packet[NONCE_OFFSET:SRC_EID_OFFSET]));\n    }\n\n    function srcEid(bytes calldata _packet) internal pure returns (uint32) {\n        return uint32(bytes4(_packet[SRC_EID_OFFSET:SENDER_OFFSET]));\n    }\n\n    function sender(bytes calldata _packet) internal pure returns (bytes32) {\n        return bytes32(_packet[SENDER_OFFSET:DST_EID_OFFSET]);\n    }\n\n    function senderAddressB20(bytes calldata _packet) internal pure returns (address) {\n        return sender(_packet).toAddress();\n    }\n\n    function dstEid(bytes calldata _packet) internal pure returns (uint32) {\n        return uint32(bytes4(_packet[DST_EID_OFFSET:RECEIVER_OFFSET]));\n    }\n\n    function receiver(bytes calldata _packet) internal pure returns (bytes32) {\n        return bytes32(_packet[RECEIVER_OFFSET:GUID_OFFSET]);\n    }\n\n    function receiverB20(bytes calldata _packet) internal pure returns (address) {\n        return receiver(_packet).toAddress();\n    }\n\n    function guid(bytes calldata _packet) internal pure returns (bytes32) {\n        return bytes32(_packet[GUID_OFFSET:MESSAGE_OFFSET]);\n    }\n\n    function message(bytes calldata _packet) internal pure returns (bytes calldata) {\n        return bytes(_packet[MESSAGE_OFFSET:]);\n    }\n\n    function payload(bytes calldata _packet) internal pure returns (bytes calldata) {\n        return bytes(_packet[GUID_OFFSET:]);\n    }\n\n    function payloadHash(bytes calldata _packet) internal pure returns (bytes32) {\n        return keccak256(payload(_packet));\n    }\n}\n"},{"file_path":"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingChannel {\n    event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);\n    event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\n    event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\n\n    function eid() external view returns (uint32);\n\n    // this is an emergency function if a message cannot be verified for some reasons\n    // required to provide _nextNonce to avoid race condition\n    function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;\n\n    function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\n\n    function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\n\n    function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);\n\n    function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\n\n    function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);\n\n    function inboundPayloadHash(\n        address _receiver,\n        uint32 _srcEid,\n        bytes32 _sender,\n        uint64 _nonce\n    ) external view returns (bytes32);\n\n    function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\n}\n"},{"file_path":"@openzeppelin/contracts/security/Pausable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n    /**\n     * @dev Emitted when the pause is triggered by `account`.\n     */\n    event Paused(address account);\n\n    /**\n     * @dev Emitted when the pause is lifted by `account`.\n     */\n    event Unpaused(address account);\n\n    bool private _paused;\n\n    /**\n     * @dev Initializes the contract in unpaused state.\n     */\n    constructor() {\n        _paused = false;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    modifier whenNotPaused() {\n        _requireNotPaused();\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is paused.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    modifier whenPaused() {\n        _requirePaused();\n        _;\n    }\n\n    /**\n     * @dev Returns true if the contract is paused, and false otherwise.\n     */\n    function paused() public view virtual returns (bool) {\n        return _paused;\n    }\n\n    /**\n     * @dev Throws if the contract is paused.\n     */\n    function _requireNotPaused() internal view virtual {\n        require(!paused(), \"Pausable: paused\");\n    }\n\n    /**\n     * @dev Throws if the contract is not paused.\n     */\n    function _requirePaused() internal view virtual {\n        require(paused(), \"Pausable: not paused\");\n    }\n\n    /**\n     * @dev Triggers stopped state.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    function _pause() internal virtual whenNotPaused {\n        _paused = true;\n        emit Paused(_msgSender());\n    }\n\n    /**\n     * @dev Returns to normal state.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    function _unpause() internal virtual whenPaused {\n        _paused = false;\n        emit Unpaused(_msgSender());\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/introspection/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[{"internalType":"uint32","name":"_localEidV2","type":"uint32"},{"internalType":"uint32","name":"_vid","type":"uint32"},{"internalType":"address[]","name":"_messageLibs","type":"address[]"},{"internalType":"address","name":"_priceFeed","type":"address"},{"internalType":"address[]","name":"_signers","type":"address[]"},{"internalType":"uint64","name":"_quorum","type":"uint64"},{"internalType":"address[]","name":"_admins","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes32","name":"executableHash","type":"bytes32"}],"name":"DVN_DuplicatedHash","type":"error"},{"inputs":[],"name":"DVN_InstructionExpired","type":"error"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"DVN_InvalidRole","type":"error"},{"inputs":[],"name":"DVN_InvalidSignatures","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"DVN_InvalidTarget","type":"error"},{"inputs":[{"internalType":"uint32","name":"vid","type":"uint32"}],"name":"DVN_InvalidVid","type":"error"},{"inputs":[],"name":"DVN_OnlySelf","type":"error"},{"inputs":[],"name":"MultiSig_InvalidSigner","type":"error"},{"inputs":[],"name":"MultiSig_OnlySigner","type":"error"},{"inputs":[],"name":"MultiSig_QuorumIsZero","type":"error"},{"inputs":[{"internalType":"uint64","name":"signersSize","type":"uint64"},{"internalType":"uint64","name":"quorum","type":"uint64"}],"name":"MultiSig_SignersSizeIsLessThanQuorum","type":"error"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"bool","name":"active","type":"bool"}],"name":"MultiSig_StateAlreadySet","type":"error"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"bool","name":"active","type":"bool"}],"name":"MultiSig_StateNotSet","type":"error"},{"inputs":[],"name":"MultiSig_UnorderedSigners","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":[{"indexed":false,"internalType":"uint256","name":"_index","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_data","type":"bytes"}],"name":"ExecuteFailed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"vid","type":"uint32"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"expiration","type":"uint256"},{"internalType":"bytes","name":"signatures","type":"bytes"}],"indexed":false,"internalType":"struct ExecuteParam","name":"param","type":"tuple"},{"indexed":false,"internalType":"bytes32","name":"_hash","type":"bytes32"}],"name":"HashAlreadyUsed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"multiplierBps","type":"uint16"}],"name":"SetDefaultMultiplierBps","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"uint64","name":"gas","type":"uint64"},{"internalType":"uint16","name":"multiplierBps","type":"uint16"},{"internalType":"uint128","name":"floorMarginUSD","type":"uint128"}],"indexed":false,"internalType":"struct IDVN.DstConfigParam[]","name":"params","type":"tuple[]"}],"name":"SetDstConfig","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":"uint64","name":"_quorum","type":"uint64"}],"name":"UpdateQuorum","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_signer","type":"address"},{"indexed":false,"internalType":"bool","name":"_active","type":"bool"}],"name":"UpdateSigner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"VerifierFeePaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"idx","type":"uint256"}],"name":"VerifySignaturesFailed","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":[{"internalType":"uint16","name":"_dstEid","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint64","name":"_confirmations","type":"uint64"},{"internalType":"address","name":"_sender","type":"address"}],"name":"assignJob","outputs":[{"internalType":"uint256","name":"totalFee","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"bytes","name":"_cmd","type":"bytes"},{"internalType":"bytes","name":"_options","type":"bytes"}],"name":"assignJob","outputs":[{"internalType":"uint256","name":"fee","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":"uint64","name":"gas","type":"uint64"},{"internalType":"uint16","name":"multiplierBps","type":"uint16"},{"internalType":"uint128","name":"floorMarginUSD","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"vid","type":"uint32"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"expiration","type":"uint256"},{"internalType":"bytes","name":"signatures","type":"bytes"}],"internalType":"struct ExecuteParam[]","name":"_params","type":"tuple[]"}],"name":"execute","outputs":[],"stateMutability":"nonpayable","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":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstEid","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint64","name":"_confirmations","type":"uint64"},{"internalType":"address","name":"_sender","type":"address"}],"name":"getFee","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"bytes","name":"_cmd","type":"bytes"},{"internalType":"bytes","name":"_options","type":"bytes"}],"name":"getFee","outputs":[{"internalType":"uint256","name":"fee","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":[],"name":"getSigners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"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":[{"internalType":"uint32","name":"_vid","type":"uint32"},{"internalType":"address","name":"_target","type":"address"},{"internalType":"bytes","name":"_callData","type":"bytes"},{"internalType":"uint256","name":"_expiration","type":"uint256"}],"name":"hashCallData","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"isSigner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"localEidV2","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"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":[],"name":"quorum","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"vid","type":"uint32"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"expiration","type":"uint256"},{"internalType":"bytes","name":"signatures","type":"bytes"}],"internalType":"struct ExecuteParam","name":"_param","type":"tuple"}],"name":"quorumChangeAdmin","outputs":[],"stateMutability":"nonpayable","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":"dstEid","type":"uint32"},{"internalType":"uint64","name":"gas","type":"uint64"},{"internalType":"uint16","name":"multiplierBps","type":"uint16"},{"internalType":"uint128","name":"floorMarginUSD","type":"uint128"}],"internalType":"struct IDVN.DstConfigParam[]","name":"_params","type":"tuple[]"}],"name":"setDstConfig","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":[{"internalType":"uint64","name":"_quorum","type":"uint64"}],"name":"setQuorum","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"},{"internalType":"bool","name":"_active","type":"bool"}],"name":"setSigner","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":[],"name":"signerSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"signers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"bytes32","name":"executableHash","type":"bytes32"}],"name":"usedHashes","outputs":[{"internalType":"bool","name":"used","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"},{"internalType":"bytes","name":"_signatures","type":"bytes"}],"name":"verifySignatures","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"enum MultiSig.Errors","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vid","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"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":"_lib","type":"address"},{"internalType":"address payable","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFeeFromUlnV2","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"}],"is_changed_bytecode":false,"is_partially_verified":true,"constructor_args":"0000000000000000000000000000000000000000000000000000000000007595000000000000000000000000000000000000000000000000000000000000006500000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000c03f31fd86a9077785b7bcf6598ce3598fa911130000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000040000000000000000000000004d73adb72bc3dd368966edd0f0b2148401a178e2000000000000000000000000d231084bfb234c107d3ee2b22f97f3346fdaf705000000000000000000000000bb2ea70c9e858123480642cf96acbcce1372dce100000000000000000000000074f55bc2a79a27a0bf1d1a35db5d0fc36b9fdb9d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d031f474f7e6e28845e1d4856b9b1aef289703970000000000000000000000000000000000000000000000000000000000000002000000000000000000000000b52fa54fc261398058c3ac7b8dd442d7d8b9f0b6000000000000000000000000b8ff877ed78ba520ece21b1de7843a8a57ca47cb"}