false
false

Contract Address Details

0x15e51701F245F6D5bd0FEE87bCAf55B0841451B3

Contract Name
ReceiveUln301
Creator
0x9f4031–4ef327 at 0xd8df47–782715
Balance
0 ( )
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
181847
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been partially verified via Sourcify.
Contract name:
ReceiveUln301




Optimization enabled
true
Compiler version
v0.8.22+commit.4fc1097e




Optimization runs
20000
EVM Version
paris




Verified at
2024-09-20T12:15:00.732868Z

Constructor Arguments

0x000000000000000000000000b6319cc6c8c27a8f5daf0dd3df91ea35c4720dd7000000000000000000000000000000000000000000000000000000000000013b

Arg [0] (address) : 0xb6319cc6c8c27a8f5daf0dd3df91ea35c4720dd7
Arg [1] (uint32) : 315

              

contracts/uln/uln301/ReceiveUln301.sol

Sol2uml
new
// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";
import { PacketV1Codec } from "@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol";

import { IUltraLightNode301 } from "./interfaces/IUltraLightNode301.sol";
import { ReceiveLibBaseE1 } from "./ReceiveLibBaseE1.sol";
import { ReceiveUlnBase } from "../ReceiveUlnBase.sol";
import { UlnConfig } from "../UlnBase.sol";

/// @dev ULN301 will be deployed on EndpointV1 and is for backward compatibility with ULN302 on EndpointV2. 301 can talk to both 301 and 302
/// @dev This is a gluing contract. It simply parses the requests and forward to the super.impl() accordingly.
/// @dev In this case, it combines the logic of ReceiveUlnBase and ReceiveLibBaseE1
contract ReceiveUln301 is IUltraLightNode301, ReceiveUlnBase, ReceiveLibBaseE1 {
    using PacketV1Codec for bytes;
    using SafeCast for uint32; // for chain ID uint32 to uint16 conversion

    uint256 internal constant CONFIG_TYPE_EXECUTOR = 1;
    uint256 internal constant CONFIG_TYPE_ULN = 2;

    error LZ_ULN_InvalidConfigType(uint256 configType);

    constructor(address _endpoint, uint32 _localEid) ReceiveLibBaseE1(_endpoint, _localEid) {}

    // ============================ OnlyEndpoint ===================================

    function setConfig(
        uint16 _eid,
        address _oapp,
        uint256 _configType,
        bytes calldata _config
    ) external override onlyEndpoint {
        _assertSupportedEid(_eid);
        if (_configType == CONFIG_TYPE_EXECUTOR) {
            _setExecutor(_eid, _oapp, abi.decode(_config, (address)));
        } else if (_configType == CONFIG_TYPE_ULN) {
            _setUlnConfig(_eid, _oapp, abi.decode(_config, (UlnConfig)));
        } else {
            revert LZ_ULN_InvalidConfigType(_configType);
        }
    }

    // ============================ External ===================================

    /// @dev in 301, this is equivalent to execution as in Endpoint V2
    /// @dev dont need to check endpoint verifiable here to save gas, as it will reverts if not verifiable.
    function commitVerification(bytes calldata _packet, uint256 _gasLimit) external {
        bytes calldata header = _packet.header();
        _assertHeader(header, localEid);

        // cache these values to save gas
        address receiver = _packet.receiverB20();
        uint16 srcEid = _packet.srcEid().toUint16();

        UlnConfig memory config = getUlnConfig(receiver, srcEid);
        _verifyAndReclaimStorage(config, keccak256(header), _packet.payloadHash());

        // endpoint will revert if nonce != ++inboundNonce
        _execute(srcEid, _packet.sender(), receiver, _packet.nonce(), _packet.message(), _gasLimit);
    }

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

    // ============================ View ===================================

    function getConfig(uint16 _eid, address _oapp, uint256 _configType) external view override returns (bytes memory) {
        if (_configType == CONFIG_TYPE_EXECUTOR) {
            return abi.encode(getExecutor(_oapp, _eid));
        } else if (_configType == CONFIG_TYPE_ULN) {
            return abi.encode(getUlnConfig(_oapp, _eid));
        } else {
            revert LZ_ULN_InvalidConfigType(_configType);
        }
    }

    function version() external pure returns (uint64 major, uint8 minor, uint8 endpointVersion) {
        return (3, 0, 1);
    }
}
        

@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

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

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

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

struct MessagingFee {
    uint256 nativeFee;
    uint256 lzTokenFee;
}

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

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

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

    event PacketDelivered(Origin origin, address receiver);

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

    event LzTokenSet(address token);

    event DelegateSet(address sender, address delegate);

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

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

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

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

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

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

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

    function setLzToken(address _lzToken) external;

    function lzToken() external view returns (address);

    function nativeToken() external view returns (address);

    function setDelegate(address _delegate) external;
}
          

@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLib.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

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

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

enum MessageLibType {
    Send,
    Receive,
    SendAndReceive
}

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

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

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

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

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

@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

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

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

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

    function registerLibrary(address _lib) external;

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

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

    function setDefaultSendLibrary(uint32 _eid, address _newLib) external;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

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

    function eid() external view returns (uint32);

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

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

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

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

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

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

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

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

@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

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

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

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

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

@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

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

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

@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

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

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

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

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

    function setTreasury(address _treasury) external;

    function withdrawFee(address _to, uint256 _amount) external;

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

@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol

// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

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

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

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

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

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

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

@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol

// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

import { Packet } from "../../interfaces/ISendLib.sol";
import { AddressCast } from "../../libs/AddressCast.sol";

library PacketV1Codec {
    using AddressCast for address;
    using AddressCast for bytes32;

    uint8 internal constant PACKET_VERSION = 1;

    // header (version + nonce + path)
    // version
    uint256 private constant PACKET_VERSION_OFFSET = 0;
    //    nonce
    uint256 private constant NONCE_OFFSET = 1;
    //    path
    uint256 private constant SRC_EID_OFFSET = 9;
    uint256 private constant SENDER_OFFSET = 13;
    uint256 private constant DST_EID_OFFSET = 45;
    uint256 private constant RECEIVER_OFFSET = 49;
    // payload (guid + message)
    uint256 private constant GUID_OFFSET = 81; // keccak256(nonce + path)
    uint256 private constant MESSAGE_OFFSET = 113;

    function encode(Packet memory _packet) internal pure returns (bytes memory encodedPacket) {
        encodedPacket = abi.encodePacked(
            PACKET_VERSION,
            _packet.nonce,
            _packet.srcEid,
            _packet.sender.toBytes32(),
            _packet.dstEid,
            _packet.receiver,
            _packet.guid,
            _packet.message
        );
    }

    function encodePacketHeader(Packet memory _packet) internal pure returns (bytes memory) {
        return
            abi.encodePacked(
                PACKET_VERSION,
                _packet.nonce,
                _packet.srcEid,
                _packet.sender.toBytes32(),
                _packet.dstEid,
                _packet.receiver
            );
    }

    function encodePayload(Packet memory _packet) internal pure returns (bytes memory) {
        return abi.encodePacked(_packet.guid, _packet.message);
    }

    function header(bytes calldata _packet) internal pure returns (bytes calldata) {
        return _packet[0:GUID_OFFSET];
    }

    function version(bytes calldata _packet) internal pure returns (uint8) {
        return uint8(bytes1(_packet[PACKET_VERSION_OFFSET:NONCE_OFFSET]));
    }

    function nonce(bytes calldata _packet) internal pure returns (uint64) {
        return uint64(bytes8(_packet[NONCE_OFFSET:SRC_EID_OFFSET]));
    }

    function srcEid(bytes calldata _packet) internal pure returns (uint32) {
        return uint32(bytes4(_packet[SRC_EID_OFFSET:SENDER_OFFSET]));
    }

    function sender(bytes calldata _packet) internal pure returns (bytes32) {
        return bytes32(_packet[SENDER_OFFSET:DST_EID_OFFSET]);
    }

    function senderAddressB20(bytes calldata _packet) internal pure returns (address) {
        return sender(_packet).toAddress();
    }

    function dstEid(bytes calldata _packet) internal pure returns (uint32) {
        return uint32(bytes4(_packet[DST_EID_OFFSET:RECEIVER_OFFSET]));
    }

    function receiver(bytes calldata _packet) internal pure returns (bytes32) {
        return bytes32(_packet[RECEIVER_OFFSET:GUID_OFFSET]);
    }

    function receiverB20(bytes calldata _packet) internal pure returns (address) {
        return receiver(_packet).toAddress();
    }

    function guid(bytes calldata _packet) internal pure returns (bytes32) {
        return bytes32(_packet[GUID_OFFSET:MESSAGE_OFFSET]);
    }

    function message(bytes calldata _packet) internal pure returns (bytes calldata) {
        return bytes(_packet[MESSAGE_OFFSET:]);
    }

    function payload(bytes calldata _packet) internal pure returns (bytes calldata) {
        return bytes(_packet[GUID_OFFSET:]);
    }

    function payloadHash(bytes calldata _packet) internal pure returns (bytes32) {
        return keccak256(payload(_packet));
    }
}
          

@layerzerolabs/lz-evm-v1-0.7/contracts/interfaces/ILayerZeroEndpoint.sol

// SPDX-License-Identifier: BUSL-1.1

pragma solidity >=0.5.0;

import "./ILayerZeroUserApplicationConfig.sol";

interface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig {
    // @notice send a LayerZero message to the specified address at a LayerZero endpoint.
    // @param _dstChainId - the destination chain identifier
    // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains
    // @param _payload - a custom bytes payload to send to the destination contract
    // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address
    // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction
    // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination
    function send(
        uint16 _dstChainId,
        bytes calldata _destination,
        bytes calldata _payload,
        address payable _refundAddress,
        address _zroPaymentAddress,
        bytes calldata _adapterParams
    ) external payable;

    // @notice used by the messaging library to publish verified payload
    // @param _srcChainId - the source chain identifier
    // @param _srcAddress - the source contract (as bytes) at the source chain
    // @param _dstAddress - the address on destination chain
    // @param _nonce - the unbound message ordering nonce
    // @param _gasLimit - the gas limit for external contract execution
    // @param _payload - verified payload to send to the destination contract
    function receivePayload(
        uint16 _srcChainId,
        bytes calldata _srcAddress,
        address _dstAddress,
        uint64 _nonce,
        uint _gasLimit,
        bytes calldata _payload
    ) external;

    // @notice get the inboundNonce of a receiver from a source chain which could be EVM or non-EVM chain
    // @param _srcChainId - the source chain identifier
    // @param _srcAddress - the source chain contract address
    function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);

    // @notice get the outboundNonce from this source chain which, consequently, is always an EVM
    // @param _srcAddress - the source chain contract address
    function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);

    // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery
    // @param _dstChainId - the destination chain identifier
    // @param _userApplication - the user app address on this EVM chain
    // @param _payload - the custom message to send over LayerZero
    // @param _payInZRO - if false, user app pays the protocol fee in native token
    // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain
    function estimateFees(
        uint16 _dstChainId,
        address _userApplication,
        bytes calldata _payload,
        bool _payInZRO,
        bytes calldata _adapterParam
    ) external view returns (uint nativeFee, uint zroFee);

    // @notice get this Endpoint's immutable source identifier
    function getChainId() external view returns (uint16);

    // @notice the interface to retry failed message on this Endpoint destination
    // @param _srcChainId - the source chain identifier
    // @param _srcAddress - the source chain contract address
    // @param _payload - the payload to be retried
    function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external;

    // @notice query if any STORED payload (message blocking) at the endpoint.
    // @param _srcChainId - the source chain identifier
    // @param _srcAddress - the source chain contract address
    function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);

    // @notice query if the _libraryAddress is valid for sending msgs.
    // @param _userApplication - the user app address on this EVM chain
    function getSendLibraryAddress(address _userApplication) external view returns (address);

    // @notice query if the _libraryAddress is valid for receiving msgs.
    // @param _userApplication - the user app address on this EVM chain
    function getReceiveLibraryAddress(address _userApplication) external view returns (address);

    // @notice query if the non-reentrancy guard for send() is on
    // @return true if the guard is on. false otherwise
    function isSendingPayload() external view returns (bool);

    // @notice query if the non-reentrancy guard for receive() is on
    // @return true if the guard is on. false otherwise
    function isReceivingPayload() external view returns (bool);

    // @notice get the configuration of the LayerZero messaging library of the specified version
    // @param _version - messaging library version
    // @param _chainId - the chainId for the pending config change
    // @param _userApplication - the contract address of the user application
    // @param _configType - type of configuration. every messaging library has its own convention.
    function getConfig(
        uint16 _version,
        uint16 _chainId,
        address _userApplication,
        uint _configType
    ) external view returns (bytes memory);

    // @notice get the send() LayerZero messaging library version
    // @param _userApplication - the contract address of the user application
    function getSendVersion(address _userApplication) external view returns (uint16);

    // @notice get the lzReceive() LayerZero messaging library version
    // @param _userApplication - the contract address of the user application
    function getReceiveVersion(address _userApplication) external view returns (uint16);
}
          

@layerzerolabs/lz-evm-v1-0.7/contracts/interfaces/ILayerZeroUserApplicationConfig.sol

// SPDX-License-Identifier: BUSL-1.1

pragma solidity >=0.5.0;

interface ILayerZeroUserApplicationConfig {
    // @notice set the configuration of the LayerZero messaging library of the specified version
    // @param _version - messaging library version
    // @param _chainId - the chainId for the pending config change
    // @param _configType - type of configuration. every messaging library has its own convention.
    // @param _config - configuration in the bytes. can encode arbitrary content.
    function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external;

    // @notice set the send() LayerZero messaging library version to _version
    // @param _version - new messaging library version
    function setSendVersion(uint16 _version) external;

    // @notice set the lzReceive() LayerZero messaging library version to _version
    // @param _version - new messaging library version
    function setReceiveVersion(uint16 _version) external;

    // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload
    // @param _srcChainId - the chainId of the source chain
    // @param _srcAddress - the contract address of the source contract at the source chain
    function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;
}
          

@openzeppelin/contracts/access/Ownable.sol

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

@openzeppelin/contracts/utils/Context.sol

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

pragma solidity ^0.8.0;

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

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

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

@openzeppelin/contracts/utils/introspection/IERC165.sol

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

pragma solidity ^0.8.0;

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

@openzeppelin/contracts/utils/math/SafeCast.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.

pragma solidity ^0.8.0;

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {
    /**
     * @dev Returns the downcasted uint248 from uint256, reverting on
     * overflow (when the input is greater than largest uint248).
     *
     * Counterpart to Solidity's `uint248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     *
     * _Available since v4.7._
     */
    function toUint248(uint256 value) internal pure returns (uint248) {
        require(value <= type(uint248).max, "SafeCast: value doesn't fit in 248 bits");
        return uint248(value);
    }

    /**
     * @dev Returns the downcasted uint240 from uint256, reverting on
     * overflow (when the input is greater than largest uint240).
     *
     * Counterpart to Solidity's `uint240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     *
     * _Available since v4.7._
     */
    function toUint240(uint256 value) internal pure returns (uint240) {
        require(value <= type(uint240).max, "SafeCast: value doesn't fit in 240 bits");
        return uint240(value);
    }

    /**
     * @dev Returns the downcasted uint232 from uint256, reverting on
     * overflow (when the input is greater than largest uint232).
     *
     * Counterpart to Solidity's `uint232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     *
     * _Available since v4.7._
     */
    function toUint232(uint256 value) internal pure returns (uint232) {
        require(value <= type(uint232).max, "SafeCast: value doesn't fit in 232 bits");
        return uint232(value);
    }

    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     *
     * _Available since v4.2._
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits");
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint216 from uint256, reverting on
     * overflow (when the input is greater than largest uint216).
     *
     * Counterpart to Solidity's `uint216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     *
     * _Available since v4.7._
     */
    function toUint216(uint256 value) internal pure returns (uint216) {
        require(value <= type(uint216).max, "SafeCast: value doesn't fit in 216 bits");
        return uint216(value);
    }

    /**
     * @dev Returns the downcasted uint208 from uint256, reverting on
     * overflow (when the input is greater than largest uint208).
     *
     * Counterpart to Solidity's `uint208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     *
     * _Available since v4.7._
     */
    function toUint208(uint256 value) internal pure returns (uint208) {
        require(value <= type(uint208).max, "SafeCast: value doesn't fit in 208 bits");
        return uint208(value);
    }

    /**
     * @dev Returns the downcasted uint200 from uint256, reverting on
     * overflow (when the input is greater than largest uint200).
     *
     * Counterpart to Solidity's `uint200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     *
     * _Available since v4.7._
     */
    function toUint200(uint256 value) internal pure returns (uint200) {
        require(value <= type(uint200).max, "SafeCast: value doesn't fit in 200 bits");
        return uint200(value);
    }

    /**
     * @dev Returns the downcasted uint192 from uint256, reverting on
     * overflow (when the input is greater than largest uint192).
     *
     * Counterpart to Solidity's `uint192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     *
     * _Available since v4.7._
     */
    function toUint192(uint256 value) internal pure returns (uint192) {
        require(value <= type(uint192).max, "SafeCast: value doesn't fit in 192 bits");
        return uint192(value);
    }

    /**
     * @dev Returns the downcasted uint184 from uint256, reverting on
     * overflow (when the input is greater than largest uint184).
     *
     * Counterpart to Solidity's `uint184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     *
     * _Available since v4.7._
     */
    function toUint184(uint256 value) internal pure returns (uint184) {
        require(value <= type(uint184).max, "SafeCast: value doesn't fit in 184 bits");
        return uint184(value);
    }

    /**
     * @dev Returns the downcasted uint176 from uint256, reverting on
     * overflow (when the input is greater than largest uint176).
     *
     * Counterpart to Solidity's `uint176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     *
     * _Available since v4.7._
     */
    function toUint176(uint256 value) internal pure returns (uint176) {
        require(value <= type(uint176).max, "SafeCast: value doesn't fit in 176 bits");
        return uint176(value);
    }

    /**
     * @dev Returns the downcasted uint168 from uint256, reverting on
     * overflow (when the input is greater than largest uint168).
     *
     * Counterpart to Solidity's `uint168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     *
     * _Available since v4.7._
     */
    function toUint168(uint256 value) internal pure returns (uint168) {
        require(value <= type(uint168).max, "SafeCast: value doesn't fit in 168 bits");
        return uint168(value);
    }

    /**
     * @dev Returns the downcasted uint160 from uint256, reverting on
     * overflow (when the input is greater than largest uint160).
     *
     * Counterpart to Solidity's `uint160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     *
     * _Available since v4.7._
     */
    function toUint160(uint256 value) internal pure returns (uint160) {
        require(value <= type(uint160).max, "SafeCast: value doesn't fit in 160 bits");
        return uint160(value);
    }

    /**
     * @dev Returns the downcasted uint152 from uint256, reverting on
     * overflow (when the input is greater than largest uint152).
     *
     * Counterpart to Solidity's `uint152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     *
     * _Available since v4.7._
     */
    function toUint152(uint256 value) internal pure returns (uint152) {
        require(value <= type(uint152).max, "SafeCast: value doesn't fit in 152 bits");
        return uint152(value);
    }

    /**
     * @dev Returns the downcasted uint144 from uint256, reverting on
     * overflow (when the input is greater than largest uint144).
     *
     * Counterpart to Solidity's `uint144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     *
     * _Available since v4.7._
     */
    function toUint144(uint256 value) internal pure returns (uint144) {
        require(value <= type(uint144).max, "SafeCast: value doesn't fit in 144 bits");
        return uint144(value);
    }

    /**
     * @dev Returns the downcasted uint136 from uint256, reverting on
     * overflow (when the input is greater than largest uint136).
     *
     * Counterpart to Solidity's `uint136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     *
     * _Available since v4.7._
     */
    function toUint136(uint256 value) internal pure returns (uint136) {
        require(value <= type(uint136).max, "SafeCast: value doesn't fit in 136 bits");
        return uint136(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v2.5._
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint120 from uint256, reverting on
     * overflow (when the input is greater than largest uint120).
     *
     * Counterpart to Solidity's `uint120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     *
     * _Available since v4.7._
     */
    function toUint120(uint256 value) internal pure returns (uint120) {
        require(value <= type(uint120).max, "SafeCast: value doesn't fit in 120 bits");
        return uint120(value);
    }

    /**
     * @dev Returns the downcasted uint112 from uint256, reverting on
     * overflow (when the input is greater than largest uint112).
     *
     * Counterpart to Solidity's `uint112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     *
     * _Available since v4.7._
     */
    function toUint112(uint256 value) internal pure returns (uint112) {
        require(value <= type(uint112).max, "SafeCast: value doesn't fit in 112 bits");
        return uint112(value);
    }

    /**
     * @dev Returns the downcasted uint104 from uint256, reverting on
     * overflow (when the input is greater than largest uint104).
     *
     * Counterpart to Solidity's `uint104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     *
     * _Available since v4.7._
     */
    function toUint104(uint256 value) internal pure returns (uint104) {
        require(value <= type(uint104).max, "SafeCast: value doesn't fit in 104 bits");
        return uint104(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     *
     * _Available since v4.2._
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits");
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint88 from uint256, reverting on
     * overflow (when the input is greater than largest uint88).
     *
     * Counterpart to Solidity's `uint88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     *
     * _Available since v4.7._
     */
    function toUint88(uint256 value) internal pure returns (uint88) {
        require(value <= type(uint88).max, "SafeCast: value doesn't fit in 88 bits");
        return uint88(value);
    }

    /**
     * @dev Returns the downcasted uint80 from uint256, reverting on
     * overflow (when the input is greater than largest uint80).
     *
     * Counterpart to Solidity's `uint80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     *
     * _Available since v4.7._
     */
    function toUint80(uint256 value) internal pure returns (uint80) {
        require(value <= type(uint80).max, "SafeCast: value doesn't fit in 80 bits");
        return uint80(value);
    }

    /**
     * @dev Returns the downcasted uint72 from uint256, reverting on
     * overflow (when the input is greater than largest uint72).
     *
     * Counterpart to Solidity's `uint72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     *
     * _Available since v4.7._
     */
    function toUint72(uint256 value) internal pure returns (uint72) {
        require(value <= type(uint72).max, "SafeCast: value doesn't fit in 72 bits");
        return uint72(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v2.5._
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint56 from uint256, reverting on
     * overflow (when the input is greater than largest uint56).
     *
     * Counterpart to Solidity's `uint56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     *
     * _Available since v4.7._
     */
    function toUint56(uint256 value) internal pure returns (uint56) {
        require(value <= type(uint56).max, "SafeCast: value doesn't fit in 56 bits");
        return uint56(value);
    }

    /**
     * @dev Returns the downcasted uint48 from uint256, reverting on
     * overflow (when the input is greater than largest uint48).
     *
     * Counterpart to Solidity's `uint48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     *
     * _Available since v4.7._
     */
    function toUint48(uint256 value) internal pure returns (uint48) {
        require(value <= type(uint48).max, "SafeCast: value doesn't fit in 48 bits");
        return uint48(value);
    }

    /**
     * @dev Returns the downcasted uint40 from uint256, reverting on
     * overflow (when the input is greater than largest uint40).
     *
     * Counterpart to Solidity's `uint40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     *
     * _Available since v4.7._
     */
    function toUint40(uint256 value) internal pure returns (uint40) {
        require(value <= type(uint40).max, "SafeCast: value doesn't fit in 40 bits");
        return uint40(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v2.5._
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint24 from uint256, reverting on
     * overflow (when the input is greater than largest uint24).
     *
     * Counterpart to Solidity's `uint24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     *
     * _Available since v4.7._
     */
    function toUint24(uint256 value) internal pure returns (uint24) {
        require(value <= type(uint24).max, "SafeCast: value doesn't fit in 24 bits");
        return uint24(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v2.5._
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     *
     * _Available since v2.5._
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     *
     * _Available since v3.0._
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int248 from int256, reverting on
     * overflow (when the input is less than smallest int248 or
     * greater than largest int248).
     *
     * Counterpart to Solidity's `int248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     *
     * _Available since v4.7._
     */
    function toInt248(int256 value) internal pure returns (int248 downcasted) {
        downcasted = int248(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 248 bits");
    }

    /**
     * @dev Returns the downcasted int240 from int256, reverting on
     * overflow (when the input is less than smallest int240 or
     * greater than largest int240).
     *
     * Counterpart to Solidity's `int240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     *
     * _Available since v4.7._
     */
    function toInt240(int256 value) internal pure returns (int240 downcasted) {
        downcasted = int240(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 240 bits");
    }

    /**
     * @dev Returns the downcasted int232 from int256, reverting on
     * overflow (when the input is less than smallest int232 or
     * greater than largest int232).
     *
     * Counterpart to Solidity's `int232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     *
     * _Available since v4.7._
     */
    function toInt232(int256 value) internal pure returns (int232 downcasted) {
        downcasted = int232(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 232 bits");
    }

    /**
     * @dev Returns the downcasted int224 from int256, reverting on
     * overflow (when the input is less than smallest int224 or
     * greater than largest int224).
     *
     * Counterpart to Solidity's `int224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     *
     * _Available since v4.7._
     */
    function toInt224(int256 value) internal pure returns (int224 downcasted) {
        downcasted = int224(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 224 bits");
    }

    /**
     * @dev Returns the downcasted int216 from int256, reverting on
     * overflow (when the input is less than smallest int216 or
     * greater than largest int216).
     *
     * Counterpart to Solidity's `int216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     *
     * _Available since v4.7._
     */
    function toInt216(int256 value) internal pure returns (int216 downcasted) {
        downcasted = int216(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 216 bits");
    }

    /**
     * @dev Returns the downcasted int208 from int256, reverting on
     * overflow (when the input is less than smallest int208 or
     * greater than largest int208).
     *
     * Counterpart to Solidity's `int208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     *
     * _Available since v4.7._
     */
    function toInt208(int256 value) internal pure returns (int208 downcasted) {
        downcasted = int208(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 208 bits");
    }

    /**
     * @dev Returns the downcasted int200 from int256, reverting on
     * overflow (when the input is less than smallest int200 or
     * greater than largest int200).
     *
     * Counterpart to Solidity's `int200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     *
     * _Available since v4.7._
     */
    function toInt200(int256 value) internal pure returns (int200 downcasted) {
        downcasted = int200(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 200 bits");
    }

    /**
     * @dev Returns the downcasted int192 from int256, reverting on
     * overflow (when the input is less than smallest int192 or
     * greater than largest int192).
     *
     * Counterpart to Solidity's `int192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     *
     * _Available since v4.7._
     */
    function toInt192(int256 value) internal pure returns (int192 downcasted) {
        downcasted = int192(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 192 bits");
    }

    /**
     * @dev Returns the downcasted int184 from int256, reverting on
     * overflow (when the input is less than smallest int184 or
     * greater than largest int184).
     *
     * Counterpart to Solidity's `int184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     *
     * _Available since v4.7._
     */
    function toInt184(int256 value) internal pure returns (int184 downcasted) {
        downcasted = int184(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 184 bits");
    }

    /**
     * @dev Returns the downcasted int176 from int256, reverting on
     * overflow (when the input is less than smallest int176 or
     * greater than largest int176).
     *
     * Counterpart to Solidity's `int176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     *
     * _Available since v4.7._
     */
    function toInt176(int256 value) internal pure returns (int176 downcasted) {
        downcasted = int176(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 176 bits");
    }

    /**
     * @dev Returns the downcasted int168 from int256, reverting on
     * overflow (when the input is less than smallest int168 or
     * greater than largest int168).
     *
     * Counterpart to Solidity's `int168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     *
     * _Available since v4.7._
     */
    function toInt168(int256 value) internal pure returns (int168 downcasted) {
        downcasted = int168(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 168 bits");
    }

    /**
     * @dev Returns the downcasted int160 from int256, reverting on
     * overflow (when the input is less than smallest int160 or
     * greater than largest int160).
     *
     * Counterpart to Solidity's `int160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     *
     * _Available since v4.7._
     */
    function toInt160(int256 value) internal pure returns (int160 downcasted) {
        downcasted = int160(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 160 bits");
    }

    /**
     * @dev Returns the downcasted int152 from int256, reverting on
     * overflow (when the input is less than smallest int152 or
     * greater than largest int152).
     *
     * Counterpart to Solidity's `int152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     *
     * _Available since v4.7._
     */
    function toInt152(int256 value) internal pure returns (int152 downcasted) {
        downcasted = int152(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 152 bits");
    }

    /**
     * @dev Returns the downcasted int144 from int256, reverting on
     * overflow (when the input is less than smallest int144 or
     * greater than largest int144).
     *
     * Counterpart to Solidity's `int144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     *
     * _Available since v4.7._
     */
    function toInt144(int256 value) internal pure returns (int144 downcasted) {
        downcasted = int144(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 144 bits");
    }

    /**
     * @dev Returns the downcasted int136 from int256, reverting on
     * overflow (when the input is less than smallest int136 or
     * greater than largest int136).
     *
     * Counterpart to Solidity's `int136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     *
     * _Available since v4.7._
     */
    function toInt136(int256 value) internal pure returns (int136 downcasted) {
        downcasted = int136(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 136 bits");
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128 downcasted) {
        downcasted = int128(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 128 bits");
    }

    /**
     * @dev Returns the downcasted int120 from int256, reverting on
     * overflow (when the input is less than smallest int120 or
     * greater than largest int120).
     *
     * Counterpart to Solidity's `int120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     *
     * _Available since v4.7._
     */
    function toInt120(int256 value) internal pure returns (int120 downcasted) {
        downcasted = int120(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 120 bits");
    }

    /**
     * @dev Returns the downcasted int112 from int256, reverting on
     * overflow (when the input is less than smallest int112 or
     * greater than largest int112).
     *
     * Counterpart to Solidity's `int112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     *
     * _Available since v4.7._
     */
    function toInt112(int256 value) internal pure returns (int112 downcasted) {
        downcasted = int112(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 112 bits");
    }

    /**
     * @dev Returns the downcasted int104 from int256, reverting on
     * overflow (when the input is less than smallest int104 or
     * greater than largest int104).
     *
     * Counterpart to Solidity's `int104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     *
     * _Available since v4.7._
     */
    function toInt104(int256 value) internal pure returns (int104 downcasted) {
        downcasted = int104(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 104 bits");
    }

    /**
     * @dev Returns the downcasted int96 from int256, reverting on
     * overflow (when the input is less than smallest int96 or
     * greater than largest int96).
     *
     * Counterpart to Solidity's `int96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     *
     * _Available since v4.7._
     */
    function toInt96(int256 value) internal pure returns (int96 downcasted) {
        downcasted = int96(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 96 bits");
    }

    /**
     * @dev Returns the downcasted int88 from int256, reverting on
     * overflow (when the input is less than smallest int88 or
     * greater than largest int88).
     *
     * Counterpart to Solidity's `int88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     *
     * _Available since v4.7._
     */
    function toInt88(int256 value) internal pure returns (int88 downcasted) {
        downcasted = int88(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 88 bits");
    }

    /**
     * @dev Returns the downcasted int80 from int256, reverting on
     * overflow (when the input is less than smallest int80 or
     * greater than largest int80).
     *
     * Counterpart to Solidity's `int80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     *
     * _Available since v4.7._
     */
    function toInt80(int256 value) internal pure returns (int80 downcasted) {
        downcasted = int80(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 80 bits");
    }

    /**
     * @dev Returns the downcasted int72 from int256, reverting on
     * overflow (when the input is less than smallest int72 or
     * greater than largest int72).
     *
     * Counterpart to Solidity's `int72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     *
     * _Available since v4.7._
     */
    function toInt72(int256 value) internal pure returns (int72 downcasted) {
        downcasted = int72(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 72 bits");
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64 downcasted) {
        downcasted = int64(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 64 bits");
    }

    /**
     * @dev Returns the downcasted int56 from int256, reverting on
     * overflow (when the input is less than smallest int56 or
     * greater than largest int56).
     *
     * Counterpart to Solidity's `int56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     *
     * _Available since v4.7._
     */
    function toInt56(int256 value) internal pure returns (int56 downcasted) {
        downcasted = int56(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 56 bits");
    }

    /**
     * @dev Returns the downcasted int48 from int256, reverting on
     * overflow (when the input is less than smallest int48 or
     * greater than largest int48).
     *
     * Counterpart to Solidity's `int48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     *
     * _Available since v4.7._
     */
    function toInt48(int256 value) internal pure returns (int48 downcasted) {
        downcasted = int48(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 48 bits");
    }

    /**
     * @dev Returns the downcasted int40 from int256, reverting on
     * overflow (when the input is less than smallest int40 or
     * greater than largest int40).
     *
     * Counterpart to Solidity's `int40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     *
     * _Available since v4.7._
     */
    function toInt40(int256 value) internal pure returns (int40 downcasted) {
        downcasted = int40(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 40 bits");
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32 downcasted) {
        downcasted = int32(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 32 bits");
    }

    /**
     * @dev Returns the downcasted int24 from int256, reverting on
     * overflow (when the input is less than smallest int24 or
     * greater than largest int24).
     *
     * Counterpart to Solidity's `int24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     *
     * _Available since v4.7._
     */
    function toInt24(int256 value) internal pure returns (int24 downcasted) {
        downcasted = int24(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 24 bits");
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16 downcasted) {
        downcasted = int16(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 16 bits");
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8 downcasted) {
        downcasted = int8(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 8 bits");
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     *
     * _Available since v3.0._
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}
          

contracts/MessageLibBase.sol

// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

/// @dev simply a container of endpoint address and local eid
abstract contract MessageLibBase {
    address internal immutable endpoint;
    uint32 internal immutable localEid;

    error LZ_MessageLib_OnlyEndpoint();

    modifier onlyEndpoint() {
        if (endpoint != msg.sender) revert LZ_MessageLib_OnlyEndpoint();
        _;
    }

    constructor(address _endpoint, uint32 _localEid) {
        endpoint = _endpoint;
        localEid = _localEid;
    }
}
          

contracts/uln/ReceiveUlnBase.sol

// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

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

import { UlnBase, UlnConfig } from "./UlnBase.sol";

struct Verification {
    bool submitted;
    uint64 confirmations;
}

/// @dev includes the utility functions for checking ULN states and logics
abstract contract ReceiveUlnBase is UlnBase {
    using PacketV1Codec for bytes;

    mapping(bytes32 headerHash => mapping(bytes32 payloadHash => mapping(address dvn => Verification)))
        public hashLookup;

    event PayloadVerified(address dvn, bytes header, uint256 confirmations, bytes32 proofHash);

    error LZ_ULN_InvalidPacketHeader();
    error LZ_ULN_InvalidPacketVersion();
    error LZ_ULN_InvalidEid();
    error LZ_ULN_Verifying();

    // ============================ External ===================================
    function verifiable(
        UlnConfig memory _config,
        bytes32 _headerHash,
        bytes32 _payloadHash
    ) external view returns (bool) {
        return _checkVerifiable(_config, _headerHash, _payloadHash);
    }

    function assertHeader(bytes calldata _packetHeader, uint32 _localEid) external pure {
        _assertHeader(_packetHeader, _localEid);
    }

    // ============================ Internal ===================================
    /// @dev per DVN signing function
    function _verify(bytes calldata _packetHeader, bytes32 _payloadHash, uint64 _confirmations) internal {
        hashLookup[keccak256(_packetHeader)][_payloadHash][msg.sender] = Verification(true, _confirmations);
        emit PayloadVerified(msg.sender, _packetHeader, _confirmations, _payloadHash);
    }

    function _verified(
        address _dvn,
        bytes32 _headerHash,
        bytes32 _payloadHash,
        uint64 _requiredConfirmation
    ) internal view returns (bool verified) {
        Verification memory verification = hashLookup[_headerHash][_payloadHash][_dvn];
        // return true if the dvn has signed enough confirmations
        verified = verification.submitted && verification.confirmations >= _requiredConfirmation;
    }

    function _verifyAndReclaimStorage(UlnConfig memory _config, bytes32 _headerHash, bytes32 _payloadHash) internal {
        if (!_checkVerifiable(_config, _headerHash, _payloadHash)) {
            revert LZ_ULN_Verifying();
        }

        // iterate the required DVNs
        if (_config.requiredDVNCount > 0) {
            for (uint8 i = 0; i < _config.requiredDVNCount; ++i) {
                delete hashLookup[_headerHash][_payloadHash][_config.requiredDVNs[i]];
            }
        }

        // iterate the optional DVNs
        if (_config.optionalDVNCount > 0) {
            for (uint8 i = 0; i < _config.optionalDVNCount; ++i) {
                delete hashLookup[_headerHash][_payloadHash][_config.optionalDVNs[i]];
            }
        }
    }

    function _assertHeader(bytes calldata _packetHeader, uint32 _localEid) internal pure {
        // assert packet header is of right size 81
        if (_packetHeader.length != 81) revert LZ_ULN_InvalidPacketHeader();
        // assert packet header version is the same as ULN
        if (_packetHeader.version() != PacketV1Codec.PACKET_VERSION) revert LZ_ULN_InvalidPacketVersion();
        // assert the packet is for this endpoint
        if (_packetHeader.dstEid() != _localEid) revert LZ_ULN_InvalidEid();
    }

    /// @dev for verifiable view function
    /// @dev checks if this verification is ready to be committed to the endpoint
    function _checkVerifiable(
        UlnConfig memory _config,
        bytes32 _headerHash,
        bytes32 _payloadHash
    ) internal view returns (bool) {
        // iterate the required DVNs
        if (_config.requiredDVNCount > 0) {
            for (uint8 i = 0; i < _config.requiredDVNCount; ++i) {
                if (!_verified(_config.requiredDVNs[i], _headerHash, _payloadHash, _config.confirmations)) {
                    // return if any of the required DVNs haven't signed
                    return false;
                }
            }
            if (_config.optionalDVNCount == 0) {
                // returns early if all required DVNs have signed and there are no optional DVNs
                return true;
            }
        }

        // then it must require optional validations
        uint8 threshold = _config.optionalDVNThreshold;
        for (uint8 i = 0; i < _config.optionalDVNCount; ++i) {
            if (_verified(_config.optionalDVNs[i], _headerHash, _payloadHash, _config.confirmations)) {
                // increment the optional count if the optional DVN has signed
                threshold--;
                if (threshold == 0) {
                    // early return if the optional threshold has hit
                    return true;
                }
            }
        }

        // return false as a catch-all
        return false;
    }
}
          

contracts/uln/UlnBase.sol

// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";

// the formal properties are documented in the setter functions
struct UlnConfig {
    uint64 confirmations;
    // we store the length of required DVNs and optional DVNs instead of using DVN.length directly to save gas
    uint8 requiredDVNCount; // 0 indicate DEFAULT, NIL_DVN_COUNT indicate NONE (to override the value of default)
    uint8 optionalDVNCount; // 0 indicate DEFAULT, NIL_DVN_COUNT indicate NONE (to override the value of default)
    uint8 optionalDVNThreshold; // (0, optionalDVNCount]
    address[] requiredDVNs; // no duplicates. sorted an an ascending order. allowed overlap with optionalDVNs
    address[] optionalDVNs; // no duplicates. sorted an an ascending order. allowed overlap with requiredDVNs
}

struct SetDefaultUlnConfigParam {
    uint32 eid;
    UlnConfig config;
}

/// @dev includes the utility functions for checking ULN states and logics
abstract contract UlnBase is Ownable {
    address private constant DEFAULT_CONFIG = address(0);
    // reserved values for
    uint8 internal constant DEFAULT = 0;
    uint8 internal constant NIL_DVN_COUNT = type(uint8).max;
    uint64 internal constant NIL_CONFIRMATIONS = type(uint64).max;
    // 127 to prevent total number of DVNs (127 * 2) exceeding uint8.max (255)
    // by limiting the total size, it would help constraint the design of DVNOptions
    uint8 private constant MAX_COUNT = (type(uint8).max - 1) / 2;

    mapping(address oapp => mapping(uint32 eid => UlnConfig)) internal ulnConfigs;

    error LZ_ULN_Unsorted();
    error LZ_ULN_InvalidRequiredDVNCount();
    error LZ_ULN_InvalidOptionalDVNCount();
    error LZ_ULN_AtLeastOneDVN();
    error LZ_ULN_InvalidOptionalDVNThreshold();
    error LZ_ULN_InvalidConfirmations();
    error LZ_ULN_UnsupportedEid(uint32 eid);

    event DefaultUlnConfigsSet(SetDefaultUlnConfigParam[] params);
    event UlnConfigSet(address oapp, uint32 eid, UlnConfig config);

    // ============================ OnlyOwner ===================================

    /// @dev about the DEFAULT ULN config
    /// 1) its values are all LITERAL (e.g. 0 is 0). whereas in the oapp ULN config, 0 (default value) points to the default ULN config
    ///     this design enables the oapp to point to DEFAULT config without explicitly setting the config
    /// 2) its configuration is more restrictive than the oapp ULN config that
    ///     a) it must not use NIL value, where NIL is used only by oapps to indicate the LITERAL 0
    ///     b) it must have at least one DVN
    function setDefaultUlnConfigs(SetDefaultUlnConfigParam[] calldata _params) external onlyOwner {
        for (uint256 i = 0; i < _params.length; ++i) {
            SetDefaultUlnConfigParam calldata param = _params[i];

            // 2.a must not use NIL
            if (param.config.requiredDVNCount == NIL_DVN_COUNT) revert LZ_ULN_InvalidRequiredDVNCount();
            if (param.config.optionalDVNCount == NIL_DVN_COUNT) revert LZ_ULN_InvalidOptionalDVNCount();
            if (param.config.confirmations == NIL_CONFIRMATIONS) revert LZ_ULN_InvalidConfirmations();

            // 2.b must have at least one dvn
            _assertAtLeastOneDVN(param.config);

            _setConfig(DEFAULT_CONFIG, param.eid, param.config);
        }
        emit DefaultUlnConfigsSet(_params);
    }

    // ============================ View ===================================
    // @dev assuming most oapps use default, we get default as memory and custom as storage to save gas
    function getUlnConfig(address _oapp, uint32 _remoteEid) public view returns (UlnConfig memory rtnConfig) {
        UlnConfig storage defaultConfig = ulnConfigs[DEFAULT_CONFIG][_remoteEid];
        UlnConfig storage customConfig = ulnConfigs[_oapp][_remoteEid];

        // if confirmations is 0, use default
        uint64 confirmations = customConfig.confirmations;
        if (confirmations == DEFAULT) {
            rtnConfig.confirmations = defaultConfig.confirmations;
        } else if (confirmations != NIL_CONFIRMATIONS) {
            // if confirmations is uint64.max, no block confirmations required
            rtnConfig.confirmations = confirmations;
        } // else do nothing, rtnConfig.confirmation is 0

        if (customConfig.requiredDVNCount == DEFAULT) {
            if (defaultConfig.requiredDVNCount > 0) {
                // copy only if count > 0. save gas
                rtnConfig.requiredDVNs = defaultConfig.requiredDVNs;
                rtnConfig.requiredDVNCount = defaultConfig.requiredDVNCount;
            } // else, do nothing
        } else {
            if (customConfig.requiredDVNCount != NIL_DVN_COUNT) {
                rtnConfig.requiredDVNs = customConfig.requiredDVNs;
                rtnConfig.requiredDVNCount = customConfig.requiredDVNCount;
            } // else, do nothing
        }

        if (customConfig.optionalDVNCount == DEFAULT) {
            if (defaultConfig.optionalDVNCount > 0) {
                // copy only if count > 0. save gas
                rtnConfig.optionalDVNs = defaultConfig.optionalDVNs;
                rtnConfig.optionalDVNCount = defaultConfig.optionalDVNCount;
                rtnConfig.optionalDVNThreshold = defaultConfig.optionalDVNThreshold;
            }
        } else {
            if (customConfig.optionalDVNCount != NIL_DVN_COUNT) {
                rtnConfig.optionalDVNs = customConfig.optionalDVNs;
                rtnConfig.optionalDVNCount = customConfig.optionalDVNCount;
                rtnConfig.optionalDVNThreshold = customConfig.optionalDVNThreshold;
            }
        }

        // the final value must have at least one dvn
        // it is possible that some default config result into 0 dvns
        _assertAtLeastOneDVN(rtnConfig);
    }

    /// @dev Get the uln config without the default config for the given remoteEid.
    function getAppUlnConfig(address _oapp, uint32 _remoteEid) external view returns (UlnConfig memory) {
        return ulnConfigs[_oapp][_remoteEid];
    }

    // ============================ Internal ===================================
    function _setUlnConfig(uint32 _remoteEid, address _oapp, UlnConfig memory _param) internal {
        _setConfig(_oapp, _remoteEid, _param);

        // get ULN config again as a catch all to ensure the config is valid
        getUlnConfig(_oapp, _remoteEid);
        emit UlnConfigSet(_oapp, _remoteEid, _param);
    }

    /// @dev a supported Eid must have a valid default uln config, which has at least one dvn
    function _isSupportedEid(uint32 _remoteEid) internal view returns (bool) {
        UlnConfig storage defaultConfig = ulnConfigs[DEFAULT_CONFIG][_remoteEid];
        return defaultConfig.requiredDVNCount > 0 || defaultConfig.optionalDVNThreshold > 0;
    }

    function _assertSupportedEid(uint32 _remoteEid) internal view {
        if (!_isSupportedEid(_remoteEid)) revert LZ_ULN_UnsupportedEid(_remoteEid);
    }

    // ============================ Private ===================================

    function _assertAtLeastOneDVN(UlnConfig memory _config) private pure {
        if (_config.requiredDVNCount == 0 && _config.optionalDVNThreshold == 0) revert LZ_ULN_AtLeastOneDVN();
    }

    /// @dev this private function is used in both setDefaultUlnConfigs and setUlnConfig
    function _setConfig(address _oapp, uint32 _eid, UlnConfig memory _param) private {
        // @dev required dvns
        // if dvnCount == NONE, dvns list must be empty
        // if dvnCount == DEFAULT, dvn list must be empty
        // otherwise, dvnList.length == dvnCount and assert the list is valid
        if (_param.requiredDVNCount == NIL_DVN_COUNT || _param.requiredDVNCount == DEFAULT) {
            if (_param.requiredDVNs.length != 0) revert LZ_ULN_InvalidRequiredDVNCount();
        } else {
            if (_param.requiredDVNs.length != _param.requiredDVNCount || _param.requiredDVNCount > MAX_COUNT)
                revert LZ_ULN_InvalidRequiredDVNCount();
            _assertNoDuplicates(_param.requiredDVNs);
        }

        // @dev optional dvns
        // if optionalDVNCount == NONE, optionalDVNs list must be empty and threshold must be 0
        // if optionalDVNCount == DEFAULT, optionalDVNs list must be empty and threshold must be 0
        // otherwise, optionalDVNs.length == optionalDVNCount, threshold > 0 && threshold <= optionalDVNCount and assert the list is valid

        // example use case: an oapp uses the DEFAULT 'required' but
        //     a) use a custom 1/1 dvn (practically a required dvn), or
        //     b) use a custom 2/3 dvn
        if (_param.optionalDVNCount == NIL_DVN_COUNT || _param.optionalDVNCount == DEFAULT) {
            if (_param.optionalDVNs.length != 0) revert LZ_ULN_InvalidOptionalDVNCount();
            if (_param.optionalDVNThreshold != 0) revert LZ_ULN_InvalidOptionalDVNThreshold();
        } else {
            if (_param.optionalDVNs.length != _param.optionalDVNCount || _param.optionalDVNCount > MAX_COUNT)
                revert LZ_ULN_InvalidOptionalDVNCount();
            if (_param.optionalDVNThreshold == 0 || _param.optionalDVNThreshold > _param.optionalDVNCount)
                revert LZ_ULN_InvalidOptionalDVNThreshold();
            _assertNoDuplicates(_param.optionalDVNs);
        }
        // don't assert valid count here, as it needs to be validated along side default config

        ulnConfigs[_oapp][_eid] = _param;
    }

    function _assertNoDuplicates(address[] memory _dvns) private pure {
        address lastDVN = address(0);
        for (uint256 i = 0; i < _dvns.length; i++) {
            address dvn = _dvns[i];
            if (dvn <= lastDVN) revert LZ_ULN_Unsorted(); // to ensure no duplicates
            lastDVN = dvn;
        }
    }
}
          

contracts/uln/uln301/AddressSizeConfig.sol

// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";

abstract contract AddressSizeConfig is Ownable {
    // EndpointV1 is using bytes as address. this map is for address length assertion
    mapping(uint32 dstEid => uint256 size) public addressSizes;

    event AddressSizeSet(uint16 eid, uint256 size);

    error AddressSizeConfig_InvalidAddressSize();
    error AddressSizeConfig_AddressSizeAlreadySet();

    function setAddressSize(uint16 _eid, uint256 _size) external onlyOwner {
        if (_size > 32) revert AddressSizeConfig_InvalidAddressSize();
        if (addressSizes[_eid] != 0) revert AddressSizeConfig_AddressSizeAlreadySet();
        addressSizes[_eid] = _size;
        emit AddressSizeSet(_eid, _size);
    }
}
          

contracts/uln/uln301/ReceiveLibBaseE1.sol

// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

import { Origin } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";
import { ILayerZeroEndpoint } from "@layerzerolabs/lz-evm-v1-0.7/contracts/interfaces/ILayerZeroEndpoint.sol";
import { AddressCast } from "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol";

import { AddressSizeConfig } from "./AddressSizeConfig.sol";
import { MessageLibBase } from "../../MessageLibBase.sol";

// only receiver function from "@layerzerolabs/lz-evm-v1-0.7/contracts/interfaces/ILayerZeroMessagingLibrary.sol"
// because we are separating the send and receive libraries
interface ILayerZeroReceiveLibrary {
    // setConfig / getConfig are User Application (UA) functions to specify Oracle, Relayer, blockConfirmations, libraryVersion
    function setConfig(uint16 _chainId, address _userApplication, uint256 _configType, bytes calldata _config) external;

    function getConfig(
        uint16 _chainId,
        address _userApplication,
        uint256 _configType
    ) external view returns (bytes memory);
}

struct SetDefaultExecutorParam {
    uint32 eid;
    address executor;
}

/// @dev receive-side message library base contract on endpoint v1.
/// design:
/// 1/ it provides an internal execute function that calls the endpoint. It enforces the path definition on V1.
/// 2/ it provides interfaces to configure executors that is whitelisted to execute the msg to prevent grieving
abstract contract ReceiveLibBaseE1 is MessageLibBase, AddressSizeConfig, ILayerZeroReceiveLibrary {
    using AddressCast for bytes32;

    mapping(address oapp => mapping(uint32 eid => address executor)) public executors;
    mapping(uint32 eid => address executor) public defaultExecutors;

    // this event is the same as the PacketDelivered event on EndpointV2
    event PacketDelivered(Origin origin, address receiver);
    event InvalidDst(
        uint16 indexed srcChainId,
        bytes32 srcAddress,
        address indexed dstAddress,
        uint64 nonce,
        bytes32 payloadHash
    );
    event DefaultExecutorsSet(SetDefaultExecutorParam[] params);
    event ExecutorSet(address oapp, uint32 eid, address executor);

    error LZ_MessageLib_InvalidExecutor();
    error LZ_MessageLib_OnlyExecutor();

    constructor(address _endpoint, uint32 _localEid) MessageLibBase(_endpoint, _localEid) {}

    function setDefaultExecutors(SetDefaultExecutorParam[] calldata _params) external onlyOwner {
        for (uint256 i = 0; i < _params.length; ++i) {
            SetDefaultExecutorParam calldata param = _params[i];
            if (param.executor == address(0x0)) revert LZ_MessageLib_InvalidExecutor();
            defaultExecutors[param.eid] = param.executor;
        }
        emit DefaultExecutorsSet(_params);
    }

    function getExecutor(address _oapp, uint32 _remoteEid) public view returns (address) {
        address executor = executors[_oapp][_remoteEid];
        return executor != address(0x0) ? executor : defaultExecutors[_remoteEid];
    }

    function _setExecutor(uint32 _remoteEid, address _oapp, address _executor) internal {
        executors[_oapp][_remoteEid] = _executor;
        emit ExecutorSet(_oapp, _remoteEid, _executor);
    }

    /// @dev this function change pack the path as required for EndpointV1
    function _execute(
        uint16 _srcEid,
        bytes32 _sender,
        address _receiver,
        uint64 _nonce,
        bytes memory _message,
        uint256 _gasLimit
    ) internal {
        // if the executor is malicious, it can make the msg as a storedPayload or fail in the nonBlockingApp
        // which might result in unintended behaviour and risks, like grieving.
        // to err on the safe side, we should assert the executor here.
        if (msg.sender != getExecutor(_receiver, _srcEid)) revert LZ_MessageLib_OnlyExecutor();

        if (_receiver.code.length == 0) {
            /// on chains where EOA has no codes, it will early return and emit InvalidDst event
            // on chains where all address have codes, this will be skipped
            emit InvalidDst(_srcEid, _sender, _receiver, _nonce, keccak256(_message));
            return;
        }

        bytes memory pathData = abi.encodePacked(_sender.toBytes(addressSizes[_srcEid]), _receiver);
        ILayerZeroEndpoint(endpoint).receivePayload(_srcEid, pathData, _receiver, _nonce, _gasLimit, _message);

        Origin memory origin = Origin(_srcEid, _sender, _nonce);
        emit PacketDelivered(origin, _receiver);
    }
}
          

contracts/uln/uln301/interfaces/IUltraLightNode301.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

interface IUltraLightNode301 {
    function commitVerification(bytes calldata _packet, uint256 _gasLimit) external;
}
          

Compiler Settings

{"outputSelection":{},"optimizer":{"runs":20000,"enabled":true},"libraries":{},"evmVersion":"paris"}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_endpoint","internalType":"address"},{"type":"uint32","name":"_localEid","internalType":"uint32"}]},{"type":"error","name":"AddressCast_InvalidSizeForAddress","inputs":[]},{"type":"error","name":"AddressSizeConfig_AddressSizeAlreadySet","inputs":[]},{"type":"error","name":"AddressSizeConfig_InvalidAddressSize","inputs":[]},{"type":"error","name":"LZ_MessageLib_InvalidExecutor","inputs":[]},{"type":"error","name":"LZ_MessageLib_OnlyEndpoint","inputs":[]},{"type":"error","name":"LZ_MessageLib_OnlyExecutor","inputs":[]},{"type":"error","name":"LZ_ULN_AtLeastOneDVN","inputs":[]},{"type":"error","name":"LZ_ULN_InvalidConfigType","inputs":[{"type":"uint256","name":"configType","internalType":"uint256"}]},{"type":"error","name":"LZ_ULN_InvalidConfirmations","inputs":[]},{"type":"error","name":"LZ_ULN_InvalidEid","inputs":[]},{"type":"error","name":"LZ_ULN_InvalidOptionalDVNCount","inputs":[]},{"type":"error","name":"LZ_ULN_InvalidOptionalDVNThreshold","inputs":[]},{"type":"error","name":"LZ_ULN_InvalidPacketHeader","inputs":[]},{"type":"error","name":"LZ_ULN_InvalidPacketVersion","inputs":[]},{"type":"error","name":"LZ_ULN_InvalidRequiredDVNCount","inputs":[]},{"type":"error","name":"LZ_ULN_Unsorted","inputs":[]},{"type":"error","name":"LZ_ULN_UnsupportedEid","inputs":[{"type":"uint32","name":"eid","internalType":"uint32"}]},{"type":"error","name":"LZ_ULN_Verifying","inputs":[]},{"type":"event","name":"AddressSizeSet","inputs":[{"type":"uint16","name":"eid","internalType":"uint16","indexed":false},{"type":"uint256","name":"size","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"DefaultExecutorsSet","inputs":[{"type":"tuple[]","name":"params","internalType":"struct SetDefaultExecutorParam[]","indexed":false,"components":[{"type":"uint32","name":"eid","internalType":"uint32"},{"type":"address","name":"executor","internalType":"address"}]}],"anonymous":false},{"type":"event","name":"DefaultUlnConfigsSet","inputs":[{"type":"tuple[]","name":"params","internalType":"struct SetDefaultUlnConfigParam[]","indexed":false,"components":[{"type":"uint32","name":"eid","internalType":"uint32"},{"type":"tuple","name":"config","internalType":"struct UlnConfig","components":[{"type":"uint64","name":"confirmations","internalType":"uint64"},{"type":"uint8","name":"requiredDVNCount","internalType":"uint8"},{"type":"uint8","name":"optionalDVNCount","internalType":"uint8"},{"type":"uint8","name":"optionalDVNThreshold","internalType":"uint8"},{"type":"address[]","name":"requiredDVNs","internalType":"address[]"},{"type":"address[]","name":"optionalDVNs","internalType":"address[]"}]}]}],"anonymous":false},{"type":"event","name":"ExecutorSet","inputs":[{"type":"address","name":"oapp","internalType":"address","indexed":false},{"type":"uint32","name":"eid","internalType":"uint32","indexed":false},{"type":"address","name":"executor","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"InvalidDst","inputs":[{"type":"uint16","name":"srcChainId","internalType":"uint16","indexed":true},{"type":"bytes32","name":"srcAddress","internalType":"bytes32","indexed":false},{"type":"address","name":"dstAddress","internalType":"address","indexed":true},{"type":"uint64","name":"nonce","internalType":"uint64","indexed":false},{"type":"bytes32","name":"payloadHash","internalType":"bytes32","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"PacketDelivered","inputs":[{"type":"tuple","name":"origin","internalType":"struct Origin","indexed":false,"components":[{"type":"uint32","name":"srcEid","internalType":"uint32"},{"type":"bytes32","name":"sender","internalType":"bytes32"},{"type":"uint64","name":"nonce","internalType":"uint64"}]},{"type":"address","name":"receiver","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"PayloadVerified","inputs":[{"type":"address","name":"dvn","internalType":"address","indexed":false},{"type":"bytes","name":"header","internalType":"bytes","indexed":false},{"type":"uint256","name":"confirmations","internalType":"uint256","indexed":false},{"type":"bytes32","name":"proofHash","internalType":"bytes32","indexed":false}],"anonymous":false},{"type":"event","name":"UlnConfigSet","inputs":[{"type":"address","name":"oapp","internalType":"address","indexed":false},{"type":"uint32","name":"eid","internalType":"uint32","indexed":false},{"type":"tuple","name":"config","internalType":"struct UlnConfig","indexed":false,"components":[{"type":"uint64","name":"confirmations","internalType":"uint64"},{"type":"uint8","name":"requiredDVNCount","internalType":"uint8"},{"type":"uint8","name":"optionalDVNCount","internalType":"uint8"},{"type":"uint8","name":"optionalDVNThreshold","internalType":"uint8"},{"type":"address[]","name":"requiredDVNs","internalType":"address[]"},{"type":"address[]","name":"optionalDVNs","internalType":"address[]"}]}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"size","internalType":"uint256"}],"name":"addressSizes","inputs":[{"type":"uint32","name":"dstEid","internalType":"uint32"}]},{"type":"function","stateMutability":"pure","outputs":[],"name":"assertHeader","inputs":[{"type":"bytes","name":"_packetHeader","internalType":"bytes"},{"type":"uint32","name":"_localEid","internalType":"uint32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"commitVerification","inputs":[{"type":"bytes","name":"_packet","internalType":"bytes"},{"type":"uint256","name":"_gasLimit","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"executor","internalType":"address"}],"name":"defaultExecutors","inputs":[{"type":"uint32","name":"eid","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"executor","internalType":"address"}],"name":"executors","inputs":[{"type":"address","name":"oapp","internalType":"address"},{"type":"uint32","name":"eid","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct UlnConfig","components":[{"type":"uint64","name":"confirmations","internalType":"uint64"},{"type":"uint8","name":"requiredDVNCount","internalType":"uint8"},{"type":"uint8","name":"optionalDVNCount","internalType":"uint8"},{"type":"uint8","name":"optionalDVNThreshold","internalType":"uint8"},{"type":"address[]","name":"requiredDVNs","internalType":"address[]"},{"type":"address[]","name":"optionalDVNs","internalType":"address[]"}]}],"name":"getAppUlnConfig","inputs":[{"type":"address","name":"_oapp","internalType":"address"},{"type":"uint32","name":"_remoteEid","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"getConfig","inputs":[{"type":"uint16","name":"_eid","internalType":"uint16"},{"type":"address","name":"_oapp","internalType":"address"},{"type":"uint256","name":"_configType","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getExecutor","inputs":[{"type":"address","name":"_oapp","internalType":"address"},{"type":"uint32","name":"_remoteEid","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"rtnConfig","internalType":"struct UlnConfig","components":[{"type":"uint64","name":"confirmations","internalType":"uint64"},{"type":"uint8","name":"requiredDVNCount","internalType":"uint8"},{"type":"uint8","name":"optionalDVNCount","internalType":"uint8"},{"type":"uint8","name":"optionalDVNThreshold","internalType":"uint8"},{"type":"address[]","name":"requiredDVNs","internalType":"address[]"},{"type":"address[]","name":"optionalDVNs","internalType":"address[]"}]}],"name":"getUlnConfig","inputs":[{"type":"address","name":"_oapp","internalType":"address"},{"type":"uint32","name":"_remoteEid","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"submitted","internalType":"bool"},{"type":"uint64","name":"confirmations","internalType":"uint64"}],"name":"hashLookup","inputs":[{"type":"bytes32","name":"headerHash","internalType":"bytes32"},{"type":"bytes32","name":"payloadHash","internalType":"bytes32"},{"type":"address","name":"dvn","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAddressSize","inputs":[{"type":"uint16","name":"_eid","internalType":"uint16"},{"type":"uint256","name":"_size","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setConfig","inputs":[{"type":"uint16","name":"_eid","internalType":"uint16"},{"type":"address","name":"_oapp","internalType":"address"},{"type":"uint256","name":"_configType","internalType":"uint256"},{"type":"bytes","name":"_config","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDefaultExecutors","inputs":[{"type":"tuple[]","name":"_params","internalType":"struct SetDefaultExecutorParam[]","components":[{"type":"uint32","name":"eid","internalType":"uint32"},{"type":"address","name":"executor","internalType":"address"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDefaultUlnConfigs","inputs":[{"type":"tuple[]","name":"_params","internalType":"struct SetDefaultUlnConfigParam[]","components":[{"type":"uint32","name":"eid","internalType":"uint32"},{"type":"tuple","name":"config","internalType":"struct UlnConfig","components":[{"type":"uint64","name":"confirmations","internalType":"uint64"},{"type":"uint8","name":"requiredDVNCount","internalType":"uint8"},{"type":"uint8","name":"optionalDVNCount","internalType":"uint8"},{"type":"uint8","name":"optionalDVNThreshold","internalType":"uint8"},{"type":"address[]","name":"requiredDVNs","internalType":"address[]"},{"type":"address[]","name":"optionalDVNs","internalType":"address[]"}]}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"verifiable","inputs":[{"type":"tuple","name":"_config","internalType":"struct UlnConfig","components":[{"type":"uint64","name":"confirmations","internalType":"uint64"},{"type":"uint8","name":"requiredDVNCount","internalType":"uint8"},{"type":"uint8","name":"optionalDVNCount","internalType":"uint8"},{"type":"uint8","name":"optionalDVNThreshold","internalType":"uint8"},{"type":"address[]","name":"requiredDVNs","internalType":"address[]"},{"type":"address[]","name":"optionalDVNs","internalType":"address[]"}]},{"type":"bytes32","name":"_headerHash","internalType":"bytes32"},{"type":"bytes32","name":"_payloadHash","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"verify","inputs":[{"type":"bytes","name":"_packetHeader","internalType":"bytes"},{"type":"bytes32","name":"_payloadHash","internalType":"bytes32"},{"type":"uint64","name":"_confirmations","internalType":"uint64"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint64","name":"major","internalType":"uint64"},{"type":"uint8","name":"minor","internalType":"uint8"},{"type":"uint8","name":"endpointVersion","internalType":"uint8"}],"name":"version","inputs":[]}]
              

Contract Creation Code

Verify & Publish
0x60c06040523480156200001157600080fd5b50604051620033ea380380620033ea8339810160408190526200003491620000b2565b6001600160a01b03821660805263ffffffff811660a0528181620000583362000062565b5050505062000104565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060408385031215620000c657600080fd5b82516001600160a01b0381168114620000de57600080fd5b602084015190925063ffffffff81168114620000f957600080fd5b809150509250929050565b60805160a0516132b9620001316000396000610f110152600081816110be0152611e3c01526132b96000f3fe608060405234801561001057600080fd5b506004361061016c5760003560e01c80636d26e5d0116100cd578063c40ff83511610081578063e65106f811610066578063e65106f8146103d5578063f2fde38b146103e8578063f8e1734c146103fb57600080fd5b8063c40ff8351461039f578063e084d952146103b257600080fd5b80638da5cb5b116100b25780638da5cb5b1461032d5780639653a7041461034b57806398678a111461035e57600080fd5b80636d26e5d014610312578063715018a61461032557600080fd5b806339e928a81161012457806343ea4fa91161010957806343ea4fa9146102bf57806352d2871f146102d257806354fd4d50146102f257600080fd5b806339e928a8146102475780633c782a521461025a57600080fd5b806329460b0b1161015557806329460b0b146101b95780632fed39ae146101cc57806339e3f9381461022757600080fd5b80630223536e146101715780630f8355c014610186575b600080fd5b61018461017f3660046123f7565b61040e565b005b6101a6610194366004612468565b60036020526000908152604090205481565b6040519081526020015b60405180910390f35b6101846101c7366004612483565b610420565b6102026101da366004612468565b60056020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b0565b61023a61023536600461251a565b610605565b6040516101b09190612613565b610184610255366004612626565b6107a7565b61029f610268366004612689565b600260209081526000938452604080852082529284528284209052825290205460ff811690610100900467ffffffffffffffff1682565b60408051921515835267ffffffffffffffff9091166020830152016101b0565b61023a6102cd36600461251a565b610902565b6102e56102e03660046126d4565b610cbc565b6040516101b09190612781565b6040805160038152600060208201526001918101919091526060016101b0565b610184610320366004612794565b610d74565b610184610e4d565b60005473ffffffffffffffffffffffffffffffffffffffff16610202565b61020261035936600461251a565b610e61565b61020261036c36600461251a565b600460209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b6101846103ad3660046127be565b610edc565b6103c56103c03660046129f3565b610eec565b60405190151581526020016101b0565b6101846103e3366004612a41565b610ef9565b6101846103f6366004612a8d565b611005565b610184610409366004612aaa565b6110bc565b61041a848484846111bd565b50505050565b6104286112d1565b60005b818110156105c7573683838381811061044657610446612b1b565b90506020028101906104589190612b4a565b905060ff6104696020830183612b88565b61047a906040810190602001612bbc565b60ff16036104b4576040517f83aa17da00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ff6104c36020830183612b88565b6104d4906060810190604001612bbc565b60ff160361050e576040517f4221136600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff6105246020830183612b88565b610532906020810190612bd7565b67ffffffffffffffff1603610573576040517f503667ae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105916105836020830183612b88565b61058c90612bf2565b611352565b6105be60006105a36020840184612468565b6105b06020850185612b88565b6105b990612bf2565b6113a3565b5060010161042b565b507faaf3aaa0c11056e86ac56eb653e25b005ca1a7d4dcd21ba24647f7ab63f3b56082826040516105f9929190612cb0565b60405180910390a15050565b6040805160c0810182526000808252602082018190529181018290526060808201929092526080810182905260a081019190915273ffffffffffffffffffffffffffffffffffffffff8316600090815260016020818152604080842063ffffffff87168552825292839020835160c081018552815467ffffffffffffffff8116825260ff680100000000000000008204811683860152690100000000000000000082048116838801526a0100000000000000000000909104166060820152928101805485518185028101850190965280865293949193608086019383018282801561072657602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116106fb575b505050505081526020016002820180548060200260200160405190810160405280929190818152602001828054801561079557602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161076a575b50505050508152505090505b92915050565b6107af6112d1565b60005b818110156108d057368383838181106107cd576107cd612b1b565b9050604002019050600073ffffffffffffffffffffffffffffffffffffffff168160200160208101906108009190612a8d565b73ffffffffffffffffffffffffffffffffffffffff160361084d576040517f20e9d05a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61085d6040820160208301612a8d565b6005600061086e6020850185612468565b63ffffffff168152602081019190915260400160002080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055506001016107b2565b507f2a2676897ce6724d11fb8016f9bcdfe9fe564bc3524411d5df7914aac78aeeb382826040516105f9929190612e4d565b6040805160c0810182526000808252602080830182905282840182905260608084018390526080840181905260a084015263ffffffff85168083527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49825284832073ffffffffffffffffffffffffffffffffffffffff88168452600183528584209184529152929020805491929167ffffffffffffffff16806109b257825467ffffffffffffffff1684526109d1565b67ffffffffffffffff818116146109d15767ffffffffffffffff811684525b815468010000000000000000900460ff16610a8757825468010000000000000000900460ff1615610a825782600101805480602002602001604051908101604052809291908181526020018280548015610a6157602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610a36575b50505050506080850152825468010000000000000000900460ff1660208501525b610b25565b815468010000000000000000900460ff90811614610b255781600101805480602002602001604051908101604052809291908181526020018280548015610b0457602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610ad9575b50505050506080850152815468010000000000000000900460ff1660208501525b81546901000000000000000000900460ff16610bf45782546901000000000000000000900460ff1615610bef5782600201805480602002602001604051908101604052809291908181526020018280548015610bb757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610b8c575b505050505060a0850152825460ff69010000000000000000008204811660408701526a01000000000000000000009091041660608501525b610caa565b81546901000000000000000000900460ff90811614610caa5781600201805480602002602001604051908101604052809291908181526020018280548015610c7257602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610c47575b505050505060a0850152815460ff69010000000000000000008204811660408701526a01000000000000000000009091041660608501525b610cb384611352565b50505092915050565b606060018203610d0d57610cd4838561ffff16610e61565b6040805173ffffffffffffffffffffffffffffffffffffffff9092166020830152015b6040516020818303038152906040529050610d6d565b60028203610d3357610d23838561ffff16610902565b604051602001610cf79190612613565b6040517f0c509b5b000000000000000000000000000000000000000000000000000000008152600481018390526024015b60405180910390fd5b9392505050565b610d7c6112d1565b6020811115610db7576040517f6f85e1b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff821660009081526003602052604090205415610e02576040517fe4df7bef00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff8216600081815260036020908152604091829020849055815192835282018390527ee9ab3709e58edd0db46318d63673d8ae4681fa3e51d9f9dc07cde5109ff74891016105f9565b610e556112d1565b610e5f6000611737565b565b73ffffffffffffffffffffffffffffffffffffffff808316600090815260046020908152604080832063ffffffff8616845290915281205490911680610ed25763ffffffff831660009081526005602052604090205473ffffffffffffffffffffffffffffffffffffffff16610ed4565b805b949350505050565b610ee78383836117ac565b505050565b6000610ed484848461187a565b366000610f068585611983565b91509150610f3582827f00000000000000000000000000000000000000000000000000000000000000006117ac565b6000610f41868661199f565b90506000610f5d610f5288886119b1565b63ffffffff166119d4565b90506000610f6f838361ffff16610902565b9050610f9c818686604051610f85929190612ec0565b6040518091039020610f978b8b611a6c565b611a96565b610ffb82610faa8a8a611c45565b85610fb58c8c611c5e565b610fbf8d8d611c81565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508e9250611c91915050565b5050505050505050565b61100d6112d1565b73ffffffffffffffffffffffffffffffffffffffff81166110b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d64565b6110b981611737565b50565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16331461112b576040517f467409c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111388561ffff16611f44565b6001830361115f5761115a61ffff86168561115584860186612a8d565b611f8b565b6111b6565b600283036111815761115a61ffff86168561117c84860186612ed0565b612036565b6040517f0c509b5b00000000000000000000000000000000000000000000000000000000815260048101849052602401610d64565b5050505050565b6040805180820182526001815267ffffffffffffffff8316602082015290516002906000906111ef9088908890612ec0565b6040805191829003909120825260208083019390935290810160009081208682528352818120338083529084529082902084518154959094015167ffffffffffffffff16610100027fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000ff941515949094167fffffffffffffffffffffffffffffffffffffffffffffff000000000000000000909516949094179290921790925590517f2cb0eed7538baeae4c6fde038c0fd0384d27de0dd55a228c65847bda6aa1ab56916112c3918790879086908890612f05565b60405180910390a150505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d64565b602081015160ff1615801561136c5750606081015160ff16155b156110b9576040517fce2c375100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602081015160ff90811614806113be5750602081015160ff16155b156114055760808101515115611400576040517f83aa17da00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611484565b806020015160ff1681608001515114158061144057506002611429600160ff612fb9565b6114339190612fd2565b60ff16816020015160ff16115b15611477576040517f83aa17da00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611484816080015161207f565b604081015160ff908116148061149f5750604081015160ff16155b156115255760a081015151156114e1576040517f4221136600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015160ff1615611520576040517f38682fa900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115fc565b806040015160ff168160a001515114158061156057506002611549600160ff612fb9565b6115539190612fd2565b60ff16816040015160ff16115b15611597576040517f4221136600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015160ff1615806115b85750806040015160ff16816060015160ff16115b156115ef576040517f38682fa900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115fc8160a0015161207f565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020818152604080842063ffffffff87168552825292839020845181548684015195870151606088015167ffffffffffffffff9093167fffffffffffffffffffffffffffffffffffffffffffffff000000000000000000909216919091176801000000000000000060ff97881602177fffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffffff166901000000000000000000918716919091027fffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffff16176a010000000000000000000095909116949094029390931783556080840151805185949361171393908501920190612302565b5060a0820151805161172f916002840191602090910190612302565b505050505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b605182146117e6576040517fc9bf37b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016117f28484612119565b60ff161461182c576040517f3a9ae7b900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8063ffffffff1661183d848461213b565b63ffffffff1614610ee7576040517f42d2c97e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602083015160009060ff16156118fd5760005b846020015160ff168160ff1610156118e5576118cf85608001518260ff16815181106118bb576118bb612b1b565b60200260200101518585886000015161214b565b6118dd576000915050610d6d565b60010161188d565b50836040015160ff166000036118fd57506001610d6d565b606084015160005b856040015160ff168160ff161015611977576119478660a001518260ff168151811061193357611933612b1b565b60200260200101518686896000015161214b565b1561196f57816119568161301b565b9250508160ff1660000361196f57600192505050610d6d565b600101611905565b50600095945050505050565b3660006119936051828587613056565b915091505b9250929050565b6000610d6d6119ae84846121da565b90565b60006119c1600d60098486613056565b6119ca91613080565b60e01c9392505050565b600061ffff821115611a68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201527f36206269747300000000000000000000000000000000000000000000000000006064820152608401610d64565b5090565b6000611a7883836121ea565b604051611a86929190612ec0565b6040518091039020905092915050565b611aa183838361187a565b611ad7576040517f4c3118d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602083015160ff1615611b8f5760005b836020015160ff168160ff161015611b8d57600083815260026020908152604080832085845290915281206080860151805191929160ff8516908110611b2f57611b2f612b1b565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffff000000000000000000169055600101611ae7565b505b604083015160ff1615610ee75760005b836040015160ff168160ff16101561041a576000838152600260209081526040808320858452909152812060a0860151805191929160ff8516908110611be757611be7612b1b565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffff000000000000000000169055600101611b9f565b6000611c55602d600d8486613056565b610d6d916130c8565b6000611c6e600960018486613056565b611c7791613104565b60c01c9392505050565b3660006119938360718187613056565b611c9f848761ffff16610e61565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d03576040517fb7386d3200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff163b600003611da0578373ffffffffffffffffffffffffffffffffffffffff168661ffff167feca5e9e3d49c3ee9d9362efa82baa91c668a7f032b3a403638ae65e27368013687868680519060200120604051611d939392919092835267ffffffffffffffff919091166020830152604082015260600190565b60405180910390a361172f565b61ffff8616600090815260036020526040812054611dbf9087906121fa565b85604051602001611dd192919061314a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527fc2fa4813000000000000000000000000000000000000000000000000000000008252915073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063c2fa481390611e7b908a9085908a908a9089908b90600401613194565b600060405180830381600087803b158015611e9557600080fd5b505af1158015611ea9573d6000803e3d6000fd5b5050604080516060808201835261ffff8c1680835260208084018d815267ffffffffffffffff8c8116868801908152875194855291519284019290925251169381019390935273ffffffffffffffffffffffffffffffffffffffff8a169083015292507f3cd5e48f9730b129dc7550f0fcea9c767b7be37837cd10e55eb35f734f4bca04915060800160405180910390a15050505050505050565b611f4d8161229b565b6110b9576040517ff0c10d0400000000000000000000000000000000000000000000000000000000815263ffffffff82166004820152602401610d64565b73ffffffffffffffffffffffffffffffffffffffff828116600081815260046020908152604080832063ffffffff89168085529083529281902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001695871695861790558051938452908301919091528101919091527f2bef5fe6b6383925f8e9893d464521c5fcd4f9d4dc14d32d900849c5ae0af710906060015b60405180910390a1505050565b6120418284836113a3565b61204b8284610902565b507f82118522aa536ac0e96cc5c689407ae42b89d592aa133890a01f1509842f508182848360405161202993929190613202565b6000805b8251811015610ee75760008382815181106120a0576120a0612b1b565b602002602001015190508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161161210f576040517f447516e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b9150600101612083565b60006121286001828486613056565b6121319161323d565b60f81c9392505050565b60006119c16031602d8486613056565b6000838152600260209081526040808320858452825280832073ffffffffffffffffffffffffffffffffffffffff88168452825280832081518083019092525460ff811615801580845261010090920467ffffffffffffffff169383019390935290916121d057508267ffffffffffffffff16816020015167ffffffffffffffff1610155b9695505050505050565b6000611c55605160318486613056565b3660006119938360518187613056565b60608115806122095750602082115b15612240576040517f18456c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8167ffffffffffffffff81111561225957612259612812565b6040519080825280601f01601f191660200182016040528015612283576020820181803683370190505b506008909202610100039290921b6020820152919050565b63ffffffff811660009081527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb4960205260408120805468010000000000000000900460ff16151580610d6d5750546a0100000000000000000000900460ff16151592915050565b82805482825590600052602060002090810192821561237c579160200282015b8281111561237c57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190612322565b50611a689291505b80821115611a685760008155600101612384565b60008083601f8401126123aa57600080fd5b50813567ffffffffffffffff8111156123c257600080fd5b60208301915083602082850101111561199857600080fd5b803567ffffffffffffffff811681146123f257600080fd5b919050565b6000806000806060858703121561240d57600080fd5b843567ffffffffffffffff81111561242457600080fd5b61243087828801612398565b90955093505060208501359150612449604086016123da565b905092959194509250565b803563ffffffff811681146123f257600080fd5b60006020828403121561247a57600080fd5b610d6d82612454565b6000806020838503121561249657600080fd5b823567ffffffffffffffff808211156124ae57600080fd5b818501915085601f8301126124c257600080fd5b8135818111156124d157600080fd5b8660208260051b85010111156124e657600080fd5b60209290920196919550909350505050565b73ffffffffffffffffffffffffffffffffffffffff811681146110b957600080fd5b6000806040838503121561252d57600080fd5b8235612538816124f8565b915061254660208401612454565b90509250929050565b60008151808452602080850194506020840160005b8381101561259657815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612564565b509495945050505050565b67ffffffffffffffff815116825260ff602082015116602083015260ff604082015116604083015260ff60608201511660608301526000608082015160c060808501526125f160c085018261254f565b905060a083015184820360a086015261260a828261254f565b95945050505050565b602081526000610d6d60208301846125a1565b6000806020838503121561263957600080fd5b823567ffffffffffffffff8082111561265157600080fd5b818501915085601f83011261266557600080fd5b81358181111561267457600080fd5b8660208260061b85010111156124e657600080fd5b60008060006060848603121561269e57600080fd5b833592506020840135915060408401356126b7816124f8565b809150509250925092565b803561ffff811681146123f257600080fd5b6000806000606084860312156126e957600080fd5b6126f2846126c2565b92506020840135612702816124f8565b929592945050506040919091013590565b60005b8381101561272e578181015183820152602001612716565b50506000910152565b6000815180845261274f816020860160208601612713565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610d6d6020830184612737565b600080604083850312156127a757600080fd5b6127b0836126c2565b946020939093013593505050565b6000806000604084860312156127d357600080fd5b833567ffffffffffffffff8111156127ea57600080fd5b6127f686828701612398565b9094509250612809905060208501612454565b90509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160c0810167ffffffffffffffff8111828210171561286457612864612812565b60405290565b803560ff811681146123f257600080fd5b600082601f83011261288c57600080fd5b8135602067ffffffffffffffff808311156128a9576128a9612812565b8260051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811084821117156128ec576128ec612812565b604052938452602081870181019490810192508785111561290c57600080fd5b6020870191505b84821015612935578135612926816124f8565b83529183019190830190612913565b979650505050505050565b600060c0828403121561295257600080fd5b61295a612841565b9050612965826123da565b81526129736020830161286a565b60208201526129846040830161286a565b60408201526129956060830161286a565b6060820152608082013567ffffffffffffffff808211156129b557600080fd5b6129c18583860161287b565b608084015260a08401359150808211156129da57600080fd5b506129e78482850161287b565b60a08301525092915050565b600080600060608486031215612a0857600080fd5b833567ffffffffffffffff811115612a1f57600080fd5b612a2b86828701612940565b9660208601359650604090950135949350505050565b600080600060408486031215612a5657600080fd5b833567ffffffffffffffff811115612a6d57600080fd5b612a7986828701612398565b909790965060209590950135949350505050565b600060208284031215612a9f57600080fd5b8135610ed2816124f8565b600080600080600060808688031215612ac257600080fd5b612acb866126c2565b94506020860135612adb816124f8565b935060408601359250606086013567ffffffffffffffff811115612afe57600080fd5b612b0a88828901612398565b969995985093965092949392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112612b7e57600080fd5b9190910192915050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff41833603018112612b7e57600080fd5b600060208284031215612bce57600080fd5b610d6d8261286a565b600060208284031215612be957600080fd5b610d6d826123da565b60006107a13683612940565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612c3357600080fd5b830160208101925035905067ffffffffffffffff811115612c5357600080fd5b8060051b360382131561199857600080fd5b8183526000602080850194508260005b85811015612596578135612c88816124f8565b73ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612c75565b60208082528181018390526000906040808401600586901b8501820187855b88811015612e3f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08089850301855282357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18c3603018112612d3157600080fd5b8b0163ffffffff612d4182612454565b168552878101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff41823603018112612d7857600080fd5b8589018890520167ffffffffffffffff612d91826123da565b1687860152612da188820161286a565b606060ff80831682890152612db78a850161286a565b92506080818416818a0152612dcd83860161286a565b935060a09250818416838a0152612de681860186612bfe565b60c08b81015294509150612e01905061010089018483612c65565b925050612e1081840184612bfe565b93509050838783030160e0880152612e29828483612c65565b978a019796505050928701925050600101612ccf565b509098975050505050505050565b6020808252818101839052600090604080840186845b87811015612eb35763ffffffff612e7983612454565b16835284820135612e89816124f8565b73ffffffffffffffffffffffffffffffffffffffff16838601529183019190830190600101612e63565b5090979650505050505050565b8183823760009101908152919050565b600060208284031215612ee257600080fd5b813567ffffffffffffffff811115612ef957600080fd5b610ed484828501612940565b73ffffffffffffffffffffffffffffffffffffffff8616815260806020820152836080820152838560a0830137600060a08583010152600060a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f870116830101905067ffffffffffffffff841660408301528260608301529695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff82811682821603908111156107a1576107a1612f8a565b600060ff83168061300c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b8060ff84160491505092915050565b600060ff82168061302e5761302e612f8a565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b6000808585111561306657600080fd5b8386111561307357600080fd5b5050820193919092039150565b7fffffffff0000000000000000000000000000000000000000000000000000000081358181169160048510156130c05780818660040360031b1b83161692505b505092915050565b803560208310156107a1577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7fffffffffffffffff00000000000000000000000000000000000000000000000081358181169160088510156130c05760089490940360031b84901b1690921692915050565b6000835161315c818460208801612713565b60609390931b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169190920190815260140192915050565b61ffff8716815260c0602082015260006131b160c0830188612737565b73ffffffffffffffffffffffffffffffffffffffff8716604084015267ffffffffffffffff8616606084015284608084015282810360a08401526131f58185612737565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff8316602082015260606040820152600061260a60608301846125a1565b7fff0000000000000000000000000000000000000000000000000000000000000081358181169160018510156130c05760019490940360031b84901b169092169291505056fea2646970667358221220c8cbc7bdc4db6025dc544e21d83354f8fa98263753cbb096e35561cd5751325364736f6c63430008160033000000000000000000000000b6319cc6c8c27a8f5daf0dd3df91ea35c4720dd7000000000000000000000000000000000000000000000000000000000000013b

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061016c5760003560e01c80636d26e5d0116100cd578063c40ff83511610081578063e65106f811610066578063e65106f8146103d5578063f2fde38b146103e8578063f8e1734c146103fb57600080fd5b8063c40ff8351461039f578063e084d952146103b257600080fd5b80638da5cb5b116100b25780638da5cb5b1461032d5780639653a7041461034b57806398678a111461035e57600080fd5b80636d26e5d014610312578063715018a61461032557600080fd5b806339e928a81161012457806343ea4fa91161010957806343ea4fa9146102bf57806352d2871f146102d257806354fd4d50146102f257600080fd5b806339e928a8146102475780633c782a521461025a57600080fd5b806329460b0b1161015557806329460b0b146101b95780632fed39ae146101cc57806339e3f9381461022757600080fd5b80630223536e146101715780630f8355c014610186575b600080fd5b61018461017f3660046123f7565b61040e565b005b6101a6610194366004612468565b60036020526000908152604090205481565b6040519081526020015b60405180910390f35b6101846101c7366004612483565b610420565b6102026101da366004612468565b60056020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b0565b61023a61023536600461251a565b610605565b6040516101b09190612613565b610184610255366004612626565b6107a7565b61029f610268366004612689565b600260209081526000938452604080852082529284528284209052825290205460ff811690610100900467ffffffffffffffff1682565b60408051921515835267ffffffffffffffff9091166020830152016101b0565b61023a6102cd36600461251a565b610902565b6102e56102e03660046126d4565b610cbc565b6040516101b09190612781565b6040805160038152600060208201526001918101919091526060016101b0565b610184610320366004612794565b610d74565b610184610e4d565b60005473ffffffffffffffffffffffffffffffffffffffff16610202565b61020261035936600461251a565b610e61565b61020261036c36600461251a565b600460209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b6101846103ad3660046127be565b610edc565b6103c56103c03660046129f3565b610eec565b60405190151581526020016101b0565b6101846103e3366004612a41565b610ef9565b6101846103f6366004612a8d565b611005565b610184610409366004612aaa565b6110bc565b61041a848484846111bd565b50505050565b6104286112d1565b60005b818110156105c7573683838381811061044657610446612b1b565b90506020028101906104589190612b4a565b905060ff6104696020830183612b88565b61047a906040810190602001612bbc565b60ff16036104b4576040517f83aa17da00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ff6104c36020830183612b88565b6104d4906060810190604001612bbc565b60ff160361050e576040517f4221136600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff6105246020830183612b88565b610532906020810190612bd7565b67ffffffffffffffff1603610573576040517f503667ae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105916105836020830183612b88565b61058c90612bf2565b611352565b6105be60006105a36020840184612468565b6105b06020850185612b88565b6105b990612bf2565b6113a3565b5060010161042b565b507faaf3aaa0c11056e86ac56eb653e25b005ca1a7d4dcd21ba24647f7ab63f3b56082826040516105f9929190612cb0565b60405180910390a15050565b6040805160c0810182526000808252602082018190529181018290526060808201929092526080810182905260a081019190915273ffffffffffffffffffffffffffffffffffffffff8316600090815260016020818152604080842063ffffffff87168552825292839020835160c081018552815467ffffffffffffffff8116825260ff680100000000000000008204811683860152690100000000000000000082048116838801526a0100000000000000000000909104166060820152928101805485518185028101850190965280865293949193608086019383018282801561072657602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116106fb575b505050505081526020016002820180548060200260200160405190810160405280929190818152602001828054801561079557602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161076a575b50505050508152505090505b92915050565b6107af6112d1565b60005b818110156108d057368383838181106107cd576107cd612b1b565b9050604002019050600073ffffffffffffffffffffffffffffffffffffffff168160200160208101906108009190612a8d565b73ffffffffffffffffffffffffffffffffffffffff160361084d576040517f20e9d05a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61085d6040820160208301612a8d565b6005600061086e6020850185612468565b63ffffffff168152602081019190915260400160002080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055506001016107b2565b507f2a2676897ce6724d11fb8016f9bcdfe9fe564bc3524411d5df7914aac78aeeb382826040516105f9929190612e4d565b6040805160c0810182526000808252602080830182905282840182905260608084018390526080840181905260a084015263ffffffff85168083527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49825284832073ffffffffffffffffffffffffffffffffffffffff88168452600183528584209184529152929020805491929167ffffffffffffffff16806109b257825467ffffffffffffffff1684526109d1565b67ffffffffffffffff818116146109d15767ffffffffffffffff811684525b815468010000000000000000900460ff16610a8757825468010000000000000000900460ff1615610a825782600101805480602002602001604051908101604052809291908181526020018280548015610a6157602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610a36575b50505050506080850152825468010000000000000000900460ff1660208501525b610b25565b815468010000000000000000900460ff90811614610b255781600101805480602002602001604051908101604052809291908181526020018280548015610b0457602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610ad9575b50505050506080850152815468010000000000000000900460ff1660208501525b81546901000000000000000000900460ff16610bf45782546901000000000000000000900460ff1615610bef5782600201805480602002602001604051908101604052809291908181526020018280548015610bb757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610b8c575b505050505060a0850152825460ff69010000000000000000008204811660408701526a01000000000000000000009091041660608501525b610caa565b81546901000000000000000000900460ff90811614610caa5781600201805480602002602001604051908101604052809291908181526020018280548015610c7257602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610c47575b505050505060a0850152815460ff69010000000000000000008204811660408701526a01000000000000000000009091041660608501525b610cb384611352565b50505092915050565b606060018203610d0d57610cd4838561ffff16610e61565b6040805173ffffffffffffffffffffffffffffffffffffffff9092166020830152015b6040516020818303038152906040529050610d6d565b60028203610d3357610d23838561ffff16610902565b604051602001610cf79190612613565b6040517f0c509b5b000000000000000000000000000000000000000000000000000000008152600481018390526024015b60405180910390fd5b9392505050565b610d7c6112d1565b6020811115610db7576040517f6f85e1b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff821660009081526003602052604090205415610e02576040517fe4df7bef00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff8216600081815260036020908152604091829020849055815192835282018390527ee9ab3709e58edd0db46318d63673d8ae4681fa3e51d9f9dc07cde5109ff74891016105f9565b610e556112d1565b610e5f6000611737565b565b73ffffffffffffffffffffffffffffffffffffffff808316600090815260046020908152604080832063ffffffff8616845290915281205490911680610ed25763ffffffff831660009081526005602052604090205473ffffffffffffffffffffffffffffffffffffffff16610ed4565b805b949350505050565b610ee78383836117ac565b505050565b6000610ed484848461187a565b366000610f068585611983565b91509150610f3582827f000000000000000000000000000000000000000000000000000000000000013b6117ac565b6000610f41868661199f565b90506000610f5d610f5288886119b1565b63ffffffff166119d4565b90506000610f6f838361ffff16610902565b9050610f9c818686604051610f85929190612ec0565b6040518091039020610f978b8b611a6c565b611a96565b610ffb82610faa8a8a611c45565b85610fb58c8c611c5e565b610fbf8d8d611c81565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508e9250611c91915050565b5050505050505050565b61100d6112d1565b73ffffffffffffffffffffffffffffffffffffffff81166110b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d64565b6110b981611737565b50565b7f000000000000000000000000b6319cc6c8c27a8f5daf0dd3df91ea35c4720dd773ffffffffffffffffffffffffffffffffffffffff16331461112b576040517f467409c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111388561ffff16611f44565b6001830361115f5761115a61ffff86168561115584860186612a8d565b611f8b565b6111b6565b600283036111815761115a61ffff86168561117c84860186612ed0565b612036565b6040517f0c509b5b00000000000000000000000000000000000000000000000000000000815260048101849052602401610d64565b5050505050565b6040805180820182526001815267ffffffffffffffff8316602082015290516002906000906111ef9088908890612ec0565b6040805191829003909120825260208083019390935290810160009081208682528352818120338083529084529082902084518154959094015167ffffffffffffffff16610100027fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000ff941515949094167fffffffffffffffffffffffffffffffffffffffffffffff000000000000000000909516949094179290921790925590517f2cb0eed7538baeae4c6fde038c0fd0384d27de0dd55a228c65847bda6aa1ab56916112c3918790879086908890612f05565b60405180910390a150505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d64565b602081015160ff1615801561136c5750606081015160ff16155b156110b9576040517fce2c375100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602081015160ff90811614806113be5750602081015160ff16155b156114055760808101515115611400576040517f83aa17da00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611484565b806020015160ff1681608001515114158061144057506002611429600160ff612fb9565b6114339190612fd2565b60ff16816020015160ff16115b15611477576040517f83aa17da00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611484816080015161207f565b604081015160ff908116148061149f5750604081015160ff16155b156115255760a081015151156114e1576040517f4221136600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015160ff1615611520576040517f38682fa900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115fc565b806040015160ff168160a001515114158061156057506002611549600160ff612fb9565b6115539190612fd2565b60ff16816040015160ff16115b15611597576040517f4221136600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015160ff1615806115b85750806040015160ff16816060015160ff16115b156115ef576040517f38682fa900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115fc8160a0015161207f565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020818152604080842063ffffffff87168552825292839020845181548684015195870151606088015167ffffffffffffffff9093167fffffffffffffffffffffffffffffffffffffffffffffff000000000000000000909216919091176801000000000000000060ff97881602177fffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffffff166901000000000000000000918716919091027fffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffff16176a010000000000000000000095909116949094029390931783556080840151805185949361171393908501920190612302565b5060a0820151805161172f916002840191602090910190612302565b505050505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b605182146117e6576040517fc9bf37b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016117f28484612119565b60ff161461182c576040517f3a9ae7b900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8063ffffffff1661183d848461213b565b63ffffffff1614610ee7576040517f42d2c97e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602083015160009060ff16156118fd5760005b846020015160ff168160ff1610156118e5576118cf85608001518260ff16815181106118bb576118bb612b1b565b60200260200101518585886000015161214b565b6118dd576000915050610d6d565b60010161188d565b50836040015160ff166000036118fd57506001610d6d565b606084015160005b856040015160ff168160ff161015611977576119478660a001518260ff168151811061193357611933612b1b565b60200260200101518686896000015161214b565b1561196f57816119568161301b565b9250508160ff1660000361196f57600192505050610d6d565b600101611905565b50600095945050505050565b3660006119936051828587613056565b915091505b9250929050565b6000610d6d6119ae84846121da565b90565b60006119c1600d60098486613056565b6119ca91613080565b60e01c9392505050565b600061ffff821115611a68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201527f36206269747300000000000000000000000000000000000000000000000000006064820152608401610d64565b5090565b6000611a7883836121ea565b604051611a86929190612ec0565b6040518091039020905092915050565b611aa183838361187a565b611ad7576040517f4c3118d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602083015160ff1615611b8f5760005b836020015160ff168160ff161015611b8d57600083815260026020908152604080832085845290915281206080860151805191929160ff8516908110611b2f57611b2f612b1b565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffff000000000000000000169055600101611ae7565b505b604083015160ff1615610ee75760005b836040015160ff168160ff16101561041a576000838152600260209081526040808320858452909152812060a0860151805191929160ff8516908110611be757611be7612b1b565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffff000000000000000000169055600101611b9f565b6000611c55602d600d8486613056565b610d6d916130c8565b6000611c6e600960018486613056565b611c7791613104565b60c01c9392505050565b3660006119938360718187613056565b611c9f848761ffff16610e61565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d03576040517fb7386d3200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff163b600003611da0578373ffffffffffffffffffffffffffffffffffffffff168661ffff167feca5e9e3d49c3ee9d9362efa82baa91c668a7f032b3a403638ae65e27368013687868680519060200120604051611d939392919092835267ffffffffffffffff919091166020830152604082015260600190565b60405180910390a361172f565b61ffff8616600090815260036020526040812054611dbf9087906121fa565b85604051602001611dd192919061314a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527fc2fa4813000000000000000000000000000000000000000000000000000000008252915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000b6319cc6c8c27a8f5daf0dd3df91ea35c4720dd7169063c2fa481390611e7b908a9085908a908a9089908b90600401613194565b600060405180830381600087803b158015611e9557600080fd5b505af1158015611ea9573d6000803e3d6000fd5b5050604080516060808201835261ffff8c1680835260208084018d815267ffffffffffffffff8c8116868801908152875194855291519284019290925251169381019390935273ffffffffffffffffffffffffffffffffffffffff8a169083015292507f3cd5e48f9730b129dc7550f0fcea9c767b7be37837cd10e55eb35f734f4bca04915060800160405180910390a15050505050505050565b611f4d8161229b565b6110b9576040517ff0c10d0400000000000000000000000000000000000000000000000000000000815263ffffffff82166004820152602401610d64565b73ffffffffffffffffffffffffffffffffffffffff828116600081815260046020908152604080832063ffffffff89168085529083529281902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001695871695861790558051938452908301919091528101919091527f2bef5fe6b6383925f8e9893d464521c5fcd4f9d4dc14d32d900849c5ae0af710906060015b60405180910390a1505050565b6120418284836113a3565b61204b8284610902565b507f82118522aa536ac0e96cc5c689407ae42b89d592aa133890a01f1509842f508182848360405161202993929190613202565b6000805b8251811015610ee75760008382815181106120a0576120a0612b1b565b602002602001015190508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161161210f576040517f447516e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b9150600101612083565b60006121286001828486613056565b6121319161323d565b60f81c9392505050565b60006119c16031602d8486613056565b6000838152600260209081526040808320858452825280832073ffffffffffffffffffffffffffffffffffffffff88168452825280832081518083019092525460ff811615801580845261010090920467ffffffffffffffff169383019390935290916121d057508267ffffffffffffffff16816020015167ffffffffffffffff1610155b9695505050505050565b6000611c55605160318486613056565b3660006119938360518187613056565b60608115806122095750602082115b15612240576040517f18456c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8167ffffffffffffffff81111561225957612259612812565b6040519080825280601f01601f191660200182016040528015612283576020820181803683370190505b506008909202610100039290921b6020820152919050565b63ffffffff811660009081527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb4960205260408120805468010000000000000000900460ff16151580610d6d5750546a0100000000000000000000900460ff16151592915050565b82805482825590600052602060002090810192821561237c579160200282015b8281111561237c57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190612322565b50611a689291505b80821115611a685760008155600101612384565b60008083601f8401126123aa57600080fd5b50813567ffffffffffffffff8111156123c257600080fd5b60208301915083602082850101111561199857600080fd5b803567ffffffffffffffff811681146123f257600080fd5b919050565b6000806000806060858703121561240d57600080fd5b843567ffffffffffffffff81111561242457600080fd5b61243087828801612398565b90955093505060208501359150612449604086016123da565b905092959194509250565b803563ffffffff811681146123f257600080fd5b60006020828403121561247a57600080fd5b610d6d82612454565b6000806020838503121561249657600080fd5b823567ffffffffffffffff808211156124ae57600080fd5b818501915085601f8301126124c257600080fd5b8135818111156124d157600080fd5b8660208260051b85010111156124e657600080fd5b60209290920196919550909350505050565b73ffffffffffffffffffffffffffffffffffffffff811681146110b957600080fd5b6000806040838503121561252d57600080fd5b8235612538816124f8565b915061254660208401612454565b90509250929050565b60008151808452602080850194506020840160005b8381101561259657815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612564565b509495945050505050565b67ffffffffffffffff815116825260ff602082015116602083015260ff604082015116604083015260ff60608201511660608301526000608082015160c060808501526125f160c085018261254f565b905060a083015184820360a086015261260a828261254f565b95945050505050565b602081526000610d6d60208301846125a1565b6000806020838503121561263957600080fd5b823567ffffffffffffffff8082111561265157600080fd5b818501915085601f83011261266557600080fd5b81358181111561267457600080fd5b8660208260061b85010111156124e657600080fd5b60008060006060848603121561269e57600080fd5b833592506020840135915060408401356126b7816124f8565b809150509250925092565b803561ffff811681146123f257600080fd5b6000806000606084860312156126e957600080fd5b6126f2846126c2565b92506020840135612702816124f8565b929592945050506040919091013590565b60005b8381101561272e578181015183820152602001612716565b50506000910152565b6000815180845261274f816020860160208601612713565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610d6d6020830184612737565b600080604083850312156127a757600080fd5b6127b0836126c2565b946020939093013593505050565b6000806000604084860312156127d357600080fd5b833567ffffffffffffffff8111156127ea57600080fd5b6127f686828701612398565b9094509250612809905060208501612454565b90509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160c0810167ffffffffffffffff8111828210171561286457612864612812565b60405290565b803560ff811681146123f257600080fd5b600082601f83011261288c57600080fd5b8135602067ffffffffffffffff808311156128a9576128a9612812565b8260051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811084821117156128ec576128ec612812565b604052938452602081870181019490810192508785111561290c57600080fd5b6020870191505b84821015612935578135612926816124f8565b83529183019190830190612913565b979650505050505050565b600060c0828403121561295257600080fd5b61295a612841565b9050612965826123da565b81526129736020830161286a565b60208201526129846040830161286a565b60408201526129956060830161286a565b6060820152608082013567ffffffffffffffff808211156129b557600080fd5b6129c18583860161287b565b608084015260a08401359150808211156129da57600080fd5b506129e78482850161287b565b60a08301525092915050565b600080600060608486031215612a0857600080fd5b833567ffffffffffffffff811115612a1f57600080fd5b612a2b86828701612940565b9660208601359650604090950135949350505050565b600080600060408486031215612a5657600080fd5b833567ffffffffffffffff811115612a6d57600080fd5b612a7986828701612398565b909790965060209590950135949350505050565b600060208284031215612a9f57600080fd5b8135610ed2816124f8565b600080600080600060808688031215612ac257600080fd5b612acb866126c2565b94506020860135612adb816124f8565b935060408601359250606086013567ffffffffffffffff811115612afe57600080fd5b612b0a88828901612398565b969995985093965092949392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112612b7e57600080fd5b9190910192915050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff41833603018112612b7e57600080fd5b600060208284031215612bce57600080fd5b610d6d8261286a565b600060208284031215612be957600080fd5b610d6d826123da565b60006107a13683612940565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612c3357600080fd5b830160208101925035905067ffffffffffffffff811115612c5357600080fd5b8060051b360382131561199857600080fd5b8183526000602080850194508260005b85811015612596578135612c88816124f8565b73ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612c75565b60208082528181018390526000906040808401600586901b8501820187855b88811015612e3f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08089850301855282357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18c3603018112612d3157600080fd5b8b0163ffffffff612d4182612454565b168552878101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff41823603018112612d7857600080fd5b8589018890520167ffffffffffffffff612d91826123da565b1687860152612da188820161286a565b606060ff80831682890152612db78a850161286a565b92506080818416818a0152612dcd83860161286a565b935060a09250818416838a0152612de681860186612bfe565b60c08b81015294509150612e01905061010089018483612c65565b925050612e1081840184612bfe565b93509050838783030160e0880152612e29828483612c65565b978a019796505050928701925050600101612ccf565b509098975050505050505050565b6020808252818101839052600090604080840186845b87811015612eb35763ffffffff612e7983612454565b16835284820135612e89816124f8565b73ffffffffffffffffffffffffffffffffffffffff16838601529183019190830190600101612e63565b5090979650505050505050565b8183823760009101908152919050565b600060208284031215612ee257600080fd5b813567ffffffffffffffff811115612ef957600080fd5b610ed484828501612940565b73ffffffffffffffffffffffffffffffffffffffff8616815260806020820152836080820152838560a0830137600060a08583010152600060a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f870116830101905067ffffffffffffffff841660408301528260608301529695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff82811682821603908111156107a1576107a1612f8a565b600060ff83168061300c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b8060ff84160491505092915050565b600060ff82168061302e5761302e612f8a565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b6000808585111561306657600080fd5b8386111561307357600080fd5b5050820193919092039150565b7fffffffff0000000000000000000000000000000000000000000000000000000081358181169160048510156130c05780818660040360031b1b83161692505b505092915050565b803560208310156107a1577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7fffffffffffffffff00000000000000000000000000000000000000000000000081358181169160088510156130c05760089490940360031b84901b1690921692915050565b6000835161315c818460208801612713565b60609390931b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169190920190815260140192915050565b61ffff8716815260c0602082015260006131b160c0830188612737565b73ffffffffffffffffffffffffffffffffffffffff8716604084015267ffffffffffffffff8616606084015284608084015282810360a08401526131f58185612737565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff8316602082015260606040820152600061260a60608301846125a1565b7fff0000000000000000000000000000000000000000000000000000000000000081358181169160018510156130c05760019490940360031b84901b169092169291505056fea2646970667358221220c8cbc7bdc4db6025dc544e21d83354f8fa98263753cbb096e35561cd5751325364736f6c63430008160033