Smart Contract Repository
UltraLightNodeV2

UltraLightNodeV2

Deploy on Alchemy

Contract Information

Explore the source code, ABI, and bytecode for the UltraLightNodeV2 smart contract.
More Info

UltraLightNodeV2 Source Code

{"Address.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size \u003e 0;\n }\n\n /**\n * @dev Replacement for Solidity\u0027s `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance \u003e= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance \u003e= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n"},"Buffer.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\n// https://github.com/ensdomains/buffer\n\npragma solidity ^0.7.0;\n\n/**\n * @dev A library for working with mutable byte buffers in Solidity.\n *\n * Byte buffers are mutable and expandable, and provide a variety of primitives\n * for writing to them. At any time you can fetch a bytes object containing the\n * current contents of the buffer. The bytes object should not be stored between\n * operations, as it may change due to resizing of the buffer.\n */\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.a co\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns (buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n mstore(0x40, add(32, add(ptr, capacity)))\n }\n return buf;\n }\n\n\n /**\n * @dev Writes a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param off The start offset to write to.\n * @param rawData The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function writeRawBytes(\n buffer memory buf,\n uint off,\n bytes memory rawData,\n uint offData,\n uint len\n ) internal pure returns (buffer memory) {\n if (off + len \u003e buf.capacity) {\n resize(buf, max(buf.capacity, len + off) * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we\u0027re extending it\n if gt(add(len, off), buflen) {\n mstore(bufptr, add(len, off))\n }\n src := add(rawData, offData)\n }\n\n // Copy word-length chunks while possible\n for (; len \u003e= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n uint mask = 256**(32 - len) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n\n return buf;\n }\n\n /**\n * @dev Writes a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param off The start offset to write to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function write(buffer memory buf, uint off, bytes memory data, uint len) internal pure returns (buffer memory) {\n require(len \u003c= data.length);\n\n if (off + len \u003e buf.capacity) {\n resize(buf, max(buf.capacity, len + off) * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we\u0027re extending it\n if gt(add(len, off), buflen) {\n mstore(bufptr, add(len, off))\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len \u003e= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n uint mask = 256**(32 - len) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n\n return buf;\n }\n\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return write(buf, buf.buf.length, data, data.length);\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n function max(uint a, uint b) private pure returns (uint) {\n if (a \u003e b) {\n return a;\n }\n return b;\n }\n}\n"},"Context.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity \u003e=0.6.0 \u003c0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n"},"IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller\u0027s account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller\u0027s tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender\u0027s allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller\u0027s\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"},"ILayerZeroEndpoint.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.5.0;\n\nimport \"./ILayerZeroUserApplicationConfig.sol\";\n\ninterface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig {\n // @notice send a LayerZero message to the specified address at a LayerZero endpoint.\n // @param _dstChainId - the destination chain identifier\n // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains\n // @param _payload - a custom bytes payload to send to the destination contract\n // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address\n // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction\n // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination\n function send(uint16 _dstChainId, bytes calldata _destination, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable;\n\n // @notice used by the messaging library to publish verified payload\n // @param _srcChainId - the source chain identifier\n // @param _srcAddress - the source contract (as bytes) at the source chain\n // @param _dstAddress - the address on destination chain\n // @param _nonce - the unbound message ordering nonce\n // @param _gasLimit - the gas limit for external contract execution\n // @param _payload - verified payload to send to the destination contract\n function receivePayload(uint16 _srcChainId, bytes calldata _srcAddress, address _dstAddress, uint64 _nonce, uint _gasLimit, bytes calldata _payload) external;\n\n // @notice get the inboundNonce of a receiver from a source chain which could be EVM or non-EVM chain\n // @param _srcChainId - the source chain identifier\n // @param _srcAddress - the source chain contract address\n function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);\n\n // @notice get the outboundNonce from this source chain which, consequently, is always an EVM\n // @param _srcAddress - the source chain contract address\n function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);\n\n // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery\n // @param _dstChainId - the destination chain identifier\n // @param _userApplication - the user app address on this EVM chain\n // @param _payload - the custom message to send over LayerZero\n // @param _payInZRO - if false, user app pays the protocol fee in native token\n // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain\n function estimateFees(uint16 _dstChainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam) external view returns (uint nativeFee, uint zroFee);\n\n // @notice get this Endpoint\u0027s immutable source identifier\n function getChainId() external view returns (uint16);\n\n // @notice the interface to retry failed message on this Endpoint destination\n // @param _srcChainId - the source chain identifier\n // @param _srcAddress - the source chain contract address\n // @param _payload - the payload to be retried\n function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external;\n\n // @notice query if any STORED payload (message blocking) at the endpoint.\n // @param _srcChainId - the source chain identifier\n // @param _srcAddress - the source chain contract address\n function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);\n\n // @notice query if the _libraryAddress is valid for sending msgs.\n // @param _userApplication - the user app address on this EVM chain\n function getSendLibraryAddress(address _userApplication) external view returns (address);\n\n // @notice query if the _libraryAddress is valid for receiving msgs.\n // @param _userApplication - the user app address on this EVM chain\n function getReceiveLibraryAddress(address _userApplication) external view returns (address);\n\n // @notice query if the non-reentrancy guard for send() is on\n // @return true if the guard is on. false otherwise\n function isSendingPayload() external view returns (bool);\n\n // @notice query if the non-reentrancy guard for receive() is on\n // @return true if the guard is on. false otherwise\n function isReceivingPayload() external view returns (bool);\n\n // @notice get the configuration of the LayerZero messaging library of the specified version\n // @param _version - messaging library version\n // @param _chainId - the chainId for the pending config change\n // @param _userApplication - the contract address of the user application\n // @param _configType - type of configuration. every messaging library has its own convention.\n function getConfig(uint16 _version, uint16 _chainId, address _userApplication, uint _configType) external view returns (bytes memory);\n\n // @notice get the send() LayerZero messaging library version\n // @param _userApplication - the contract address of the user application\n function getSendVersion(address _userApplication) external view returns (uint16);\n\n // @notice get the lzReceive() LayerZero messaging library version\n // @param _userApplication - the contract address of the user application\n function getReceiveVersion(address _userApplication) external view returns (uint16);\n}\n"},"ILayerZeroMessagingLibrary.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.7.0;\n\nimport \"./ILayerZeroUserApplicationConfig.sol\";\n\ninterface ILayerZeroMessagingLibrary {\n // send(), messages will be inflight.\n function send(address _userApplication, uint64 _lastNonce, uint16 _chainId, bytes calldata _destination, bytes calldata _payload, address payable refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable;\n\n // estimate native fee at the send side\n function estimateFees(uint16 _chainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam) external view returns (uint nativeFee, uint zroFee);\n\n //---------------------------------------------------------------------------\n // setConfig / getConfig are User Application (UA) functions to specify Oracle, Relayer, blockConfirmations, libraryVersion\n function setConfig(uint16 _chainId, address _userApplication, uint _configType, bytes calldata _config) external;\n\n function getConfig(uint16 _chainId, address _userApplication, uint _configType) external view returns (bytes memory);\n}\n"},"ILayerZeroMessagingLibraryV2.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.7.0;\n\nimport \"./ILayerZeroUserApplicationConfig.sol\";\nimport \"./ILayerZeroMessagingLibrary.sol\";\n\ninterface ILayerZeroMessagingLibraryV2 is ILayerZeroMessagingLibrary {\n function getOutboundNonce(uint16 _chainId, bytes calldata _path) external view returns (uint64);\n}\n"},"ILayerZeroOracleV2.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.7.0;\n\ninterface ILayerZeroOracleV2 {\n // @notice query price and assign jobs at the same time\n // @param _dstChainId - the destination endpoint identifier\n // @param _outboundProofType - the proof type identifier to specify proof to be relayed\n // @param _outboundBlockConfirmation - block confirmation delay before relaying blocks\n // @param _userApplication - the source sending contract address\n function assignJob(uint16 _dstChainId, uint16 _outboundProofType, uint64 _outboundBlockConfirmation, address _userApplication) external returns (uint price);\n\n // @notice query the oracle price for relaying block information to the destination chain\n // @param _dstChainId the destination endpoint identifier\n // @param _outboundProofType the proof type identifier to specify the data to be relayed\n // @param _outboundBlockConfirmation - block confirmation delay before relaying blocks\n // @param _userApplication - the source sending contract address\n function getFee(uint16 _dstChainId, uint16 _outboundProofType, uint64 _outboundBlockConfirmation, address _userApplication) external view returns (uint price);\n\n // @notice withdraw the accrued fee in ultra light node\n // @param _to - the fee receiver\n // @param _amount - the withdrawal amount\n function withdrawFee(address payable _to, uint _amount) external;\n}\n"},"ILayerZeroReceiver.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.5.0;\n\ninterface ILayerZeroReceiver {\n // @notice LayerZero endpoint will invoke this function to deliver the message on the destination\n // @param _srcChainId - the source endpoint identifier\n // @param _srcAddress - the source sending contract address from the source chain\n // @param _nonce - the ordered message nonce\n // @param _payload - the signed payload is the UA bytes has encoded to be sent\n function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external;\n}\n"},"ILayerZeroRelayerV2.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.7.0;\n\ninterface ILayerZeroRelayerV2 {\n // @notice query price and assign jobs at the same time\n // @param _dstChainId - the destination endpoint identifier\n // @param _outboundProofType - the proof type identifier to specify proof to be relayed\n // @param _userApplication - the source sending contract address. relayers may apply price discrimination to user apps\n // @param _payloadSize - the length of the payload. it is an indicator of gas usage for relaying cross-chain messages\n // @param _adapterParams - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain\n function assignJob(uint16 _dstChainId, uint16 _outboundProofType, address _userApplication, uint _payloadSize, bytes calldata _adapterParams) external returns (uint price);\n\n // @notice query the relayer price for relaying the payload and its proof to the destination chain\n // @param _dstChainId - the destination endpoint identifier\n // @param _outboundProofType - the proof type identifier to specify proof to be relayed\n // @param _userApplication - the source sending contract address. relayers may apply price discrimination to user apps\n // @param _payloadSize - the length of the payload. it is an indicator of gas usage for relaying cross-chain messages\n // @param _adapterParams - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain\n function getFee(uint16 _dstChainId, uint16 _outboundProofType, address _userApplication, uint _payloadSize, bytes calldata _adapterParams) external view returns (uint price);\n\n // @notice withdraw the accrued fee in ultra light node\n // @param _to - the fee receiver\n // @param _amount - the withdrawal amount\n function withdrawFee(address payable _to, uint _amount) external;\n}\n"},"ILayerZeroTreasury.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.5.0;\n\ninterface ILayerZeroTreasury {\n function getFees(bool payInZro, uint relayerFee, uint oracleFee) external view returns (uint);\n}\n"},"ILayerZeroUltraLightNodeV2.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.7.0;\npragma abicoder v2;\n\ninterface ILayerZeroUltraLightNodeV2 {\n // Relayer functions\n function validateTransactionProof(uint16 _srcChainId, address _dstAddress, uint _gasLimit, bytes32 _lookupHash, bytes32 _blockData, bytes calldata _transactionProof) external;\n\n // an Oracle delivers the block data using updateHash()\n function updateHash(uint16 _srcChainId, bytes32 _lookupHash, uint _confirmations, bytes32 _blockData) external;\n\n // can only withdraw the receivable of the msg.sender\n function withdrawNative(address payable _to, uint _amount) external;\n\n function withdrawZRO(address _to, uint _amount) external;\n\n // view functions\n function getAppConfig(uint16 _remoteChainId, address _userApplicationAddress) external view returns (ApplicationConfiguration memory);\n\n function accruedNativeFee(address _address) external view returns (uint);\n\n struct ApplicationConfiguration {\n uint16 inboundProofLibraryVersion;\n uint64 inboundBlockConfirmations;\n address relayer;\n uint16 outboundProofType;\n uint64 outboundBlockConfirmations;\n address oracle;\n }\n\n event HashReceived(uint16 indexed srcChainId, address indexed oracle, bytes32 lookupHash, bytes32 blockData, uint confirmations);\n event RelayerParams(bytes adapterParams, uint16 outboundProofType);\n event Packet(bytes payload);\n event InvalidDst(uint16 indexed srcChainId, bytes srcAddress, address indexed dstAddress, uint64 nonce, bytes32 payloadHash);\n event PacketReceived(uint16 indexed srcChainId, bytes srcAddress, address indexed dstAddress, uint64 nonce, bytes32 payloadHash);\n event AppConfigUpdated(address indexed userApplication, uint indexed configType, bytes newConfig);\n event AddInboundProofLibraryForChain(uint16 indexed chainId, address lib);\n event EnableSupportedOutboundProof(uint16 indexed chainId, uint16 proofType);\n event SetChainAddressSize(uint16 indexed chainId, uint size);\n event SetDefaultConfigForChainId(uint16 indexed chainId, uint16 inboundProofLib, uint64 inboundBlockConfirm, address relayer, uint16 outboundProofType, uint64 outboundBlockConfirm, address oracle);\n event SetDefaultAdapterParamsForChainId(uint16 indexed chainId, uint16 indexed proofType, bytes adapterParams);\n event SetLayerZeroToken(address indexed tokenAddress);\n event SetRemoteUln(uint16 indexed chainId, bytes32 uln);\n event SetTreasury(address indexed treasuryAddress);\n event WithdrawZRO(address indexed msgSender, address indexed to, uint amount);\n event WithdrawNative(address indexed msgSender, address indexed to, uint amount);\n}\n"},"ILayerZeroUserApplicationConfig.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.5.0;\n\ninterface ILayerZeroUserApplicationConfig {\n // @notice set the configuration of the LayerZero messaging library of the specified version\n // @param _version - messaging library version\n // @param _chainId - the chainId for the pending config change\n // @param _configType - type of configuration. every messaging library has its own convention.\n // @param _config - configuration in the bytes. can encode arbitrary content.\n function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external;\n\n // @notice set the send() LayerZero messaging library version to _version\n // @param _version - new messaging library version\n function setSendVersion(uint16 _version) external;\n\n // @notice set the lzReceive() LayerZero messaging library version to _version\n // @param _version - new messaging library version\n function setReceiveVersion(uint16 _version) external;\n\n // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload\n // @param _srcChainId - the chainId of the source chain\n // @param _srcAddress - the contract address of the source contract at the source chain\n function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;\n}\n"},"ILayerZeroValidationLibrary.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.7.0;\npragma abicoder v2;\n\nimport \"./LayerZeroPacket.sol\";\n\ninterface ILayerZeroValidationLibrary {\n function validateProof(bytes32 blockData, bytes calldata _data, uint _remoteAddressSize) external returns (LayerZeroPacket.Packet memory packet);\n}\n"},"LayerZeroPacket.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.7.6;\n\nimport \"./Buffer.sol\";\nimport \"./SafeMath.sol\";\n\nlibrary LayerZeroPacket {\n using Buffer for Buffer.buffer;\n using SafeMath for uint;\n\n struct Packet {\n uint16 srcChainId;\n uint16 dstChainId;\n uint64 nonce;\n address dstAddress;\n bytes srcAddress;\n bytes32 ulnAddress;\n bytes payload;\n }\n\n function getPacket(\n bytes memory data,\n uint16 srcChain,\n uint sizeOfSrcAddress,\n bytes32 ulnAddress\n ) internal pure returns (LayerZeroPacket.Packet memory) {\n uint16 dstChainId;\n address dstAddress;\n uint size;\n uint64 nonce;\n\n // The log consists of the destination chain id and then a bytes payload\n // 0--------------------------------------------31\n // 0 | total bytes size\n // 32 | destination chain id\n // 64 | bytes offset\n // 96 | bytes array size\n // 128 | payload\n assembly {\n dstChainId := mload(add(data, 32))\n size := mload(add(data, 96)) /// size of the byte array\n nonce := mload(add(data, 104)) // offset to convert to uint64 128 is index -24\n dstAddress := mload(add(data, sub(add(128, sizeOfSrcAddress), 4))) // offset to convert to address 12 -8\n }\n\n Buffer.buffer memory srcAddressBuffer;\n srcAddressBuffer.init(sizeOfSrcAddress);\n srcAddressBuffer.writeRawBytes(0, data, 136, sizeOfSrcAddress); // 128 + 8\n\n uint payloadSize = size.sub(28).sub(sizeOfSrcAddress);\n Buffer.buffer memory payloadBuffer;\n payloadBuffer.init(payloadSize);\n payloadBuffer.writeRawBytes(0, data, sizeOfSrcAddress.add(156), payloadSize); // 148 + 8\n return LayerZeroPacket.Packet(srcChain, dstChainId, nonce, dstAddress, srcAddressBuffer.buf, ulnAddress, payloadBuffer.buf);\n }\n\n function getPacketV2(\n bytes memory data,\n uint sizeOfSrcAddress,\n bytes32 ulnAddress\n ) internal pure returns (LayerZeroPacket.Packet memory) {\n // packet def: abi.encodePacked(nonce, srcChain, srcAddress, dstChain, dstAddress, payload);\n // data def: abi.encode(packet) = offset(32) + length(32) + packet\n // if from EVM\n // 0 - 31 0 - 31 | total bytes size\n // 32 - 63 32 - 63 | location\n // 64 - 95 64 - 95 | size of the packet\n // 96 - 103 96 - 103 | nonce\n // 104 - 105 104 - 105 | srcChainId\n // 106 - P 106 - 125 | srcAddress, where P = 106 + sizeOfSrcAddress - 1,\n // P+1 - P+2 126 - 127 | dstChainId\n // P+3 - P+22 128 - 147 | dstAddress\n // P+23 - END 148 - END | payload\n\n // decode the packet\n uint256 realSize;\n uint64 nonce;\n uint16 srcChain;\n uint16 dstChain;\n address dstAddress;\n assembly {\n realSize := mload(add(data, 64))\n nonce := mload(add(data, 72)) // 104 - 32\n srcChain := mload(add(data, 74)) // 106 - 32\n dstChain := mload(add(data, add(76, sizeOfSrcAddress))) // P + 3 - 32 = 105 + size + 3 - 32 = 76 + size\n dstAddress := mload(add(data, add(96, sizeOfSrcAddress))) // P + 23 - 32 = 105 + size + 23 - 32 = 96 + size\n }\n\n require(srcChain != 0, \"LayerZeroPacket: invalid packet\");\n\n Buffer.buffer memory srcAddressBuffer;\n srcAddressBuffer.init(sizeOfSrcAddress);\n srcAddressBuffer.writeRawBytes(0, data, 106, sizeOfSrcAddress);\n\n uint nonPayloadSize = sizeOfSrcAddress.add(32);// 2 + 2 + 8 + 20, 32 + 20 = 52 if sizeOfSrcAddress == 20\n uint payloadSize = realSize.sub(nonPayloadSize);\n Buffer.buffer memory payloadBuffer;\n payloadBuffer.init(payloadSize);\n payloadBuffer.writeRawBytes(0, data, nonPayloadSize.add(96), payloadSize);\n\n return LayerZeroPacket.Packet(srcChain, dstChain, nonce, dstAddress, srcAddressBuffer.buf, ulnAddress, payloadBuffer.buf);\n }\n\n function getPacketV3(\n bytes memory data,\n uint sizeOfSrcAddress,\n bytes32 ulnAddress\n ) internal pure returns (LayerZeroPacket.Packet memory) {\n // data def: abi.encodePacked(nonce, srcChain, srcAddress, dstChain, dstAddress, payload);\n // if from EVM\n // 0 - 31 0 - 31 | total bytes size\n // 32 - 39 32 - 39 | nonce\n // 40 - 41 40 - 41 | srcChainId\n // 42 - P 42 - 61 | srcAddress, where P = 41 + sizeOfSrcAddress,\n // P+1 - P+2 62 - 63 | dstChainId\n // P+3 - P+22 64 - 83 | dstAddress\n // P+23 - END 84 - END | payload\n\n // decode the packet\n uint256 realSize = data.length;\n uint nonPayloadSize = sizeOfSrcAddress.add(32);// 2 + 2 + 8 + 20, 32 + 20 = 52 if sizeOfSrcAddress == 20\n require(realSize \u003e= nonPayloadSize, \"LayerZeroPacket: invalid packet\");\n uint payloadSize = realSize - nonPayloadSize;\n\n uint64 nonce;\n uint16 srcChain;\n uint16 dstChain;\n address dstAddress;\n assembly {\n nonce := mload(add(data, 8)) // 40 - 32\n srcChain := mload(add(data, 10)) // 42 - 32\n dstChain := mload(add(data, add(12, sizeOfSrcAddress))) // P + 3 - 32 = 41 + size + 3 - 32 = 12 + size\n dstAddress := mload(add(data, add(32, sizeOfSrcAddress))) // P + 23 - 32 = 41 + size + 23 - 32 = 32 + size\n }\n\n require(srcChain != 0, \"LayerZeroPacket: invalid packet\");\n\n Buffer.buffer memory srcAddressBuffer;\n srcAddressBuffer.init(sizeOfSrcAddress);\n srcAddressBuffer.writeRawBytes(0, data, 42, sizeOfSrcAddress);\n\n Buffer.buffer memory payloadBuffer;\n if (payloadSize \u003e 0) {\n payloadBuffer.init(payloadSize);\n payloadBuffer.writeRawBytes(0, data, nonPayloadSize.add(32), payloadSize);\n }\n\n return LayerZeroPacket.Packet(srcChain, dstChain, nonce, dstAddress, srcAddressBuffer.buf, ulnAddress, payloadBuffer.buf);\n }\n}\n"},"NonceContract.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.7.6;\n\nimport \"./ILayerZeroEndpoint.sol\";\n\ncontract NonceContract {\n ILayerZeroEndpoint public immutable endpoint;\n // outboundNonce = [dstChainId][remoteAddress + localAddress]\n mapping(uint16 =\u003e mapping(bytes =\u003e uint64)) public outboundNonce;\n\n constructor(address _endpoint) {\n endpoint = ILayerZeroEndpoint(_endpoint);\n }\n\n function increment(uint16 _chainId, address _ua, bytes calldata _path) external returns (uint64) {\n require(endpoint.getSendLibraryAddress(_ua) == msg.sender, \"NonceContract: msg.sender is not valid sendlibrary\");\n return ++outboundNonce[_chainId][_path];\n }\n}\n"},"Ownable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\nimport \"./Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n"},"ReentrancyGuard.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot\u0027s contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler\u0027s defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction\u0027s gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n constructor () {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n}\n"},"SafeERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\nimport \"./IERC20.sol\";\nimport \"./SafeMath.sol\";\nimport \"./Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // \u0027safeIncreaseAllowance\u0027 and \u0027safeDecreaseAllowance\u0027\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity\u0027s return data size checking mechanism, since\n // we\u0027re implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length \u003e 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n"},"SafeMath.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\n/**\n * @dev Wrappers over Solidity\u0027s arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it\u0027s recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c \u003c a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b \u003e a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring \u0027a\u0027 not being zero, but the\n // benefit is lost if \u0027b\u0027 is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity\u0027s `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c \u003e= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity\u0027s `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b \u003c= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity\u0027s `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity\u0027s `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b \u003e 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity\u0027s `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b \u003e 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity\u0027s `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b \u003c= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity\u0027s `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b \u003e 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity\u0027s `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b \u003e 0, errorMessage);\n return a % b;\n }\n}\n"},"UltraLightNodeV2.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.7.6;\npragma abicoder v2;\n\nimport \"./Ownable.sol\";\nimport \"./SafeMath.sol\";\nimport \"./ReentrancyGuard.sol\";\nimport \"./IERC20.sol\";\nimport \"./SafeERC20.sol\";\n\nimport \"./ILayerZeroValidationLibrary.sol\";\nimport \"./ILayerZeroReceiver.sol\";\nimport \"./ILayerZeroTreasury.sol\";\nimport \"./ILayerZeroEndpoint.sol\";\n// v2\nimport \"./ILayerZeroMessagingLibraryV2.sol\";\nimport \"./ILayerZeroOracleV2.sol\";\nimport \"./ILayerZeroUltraLightNodeV2.sol\";\nimport \"./ILayerZeroRelayerV2.sol\";\nimport \"./NonceContract.sol\";\n\ncontract UltraLightNodeV2 is ILayerZeroMessagingLibraryV2, ILayerZeroUltraLightNodeV2, ReentrancyGuard, Ownable {\n using SafeERC20 for IERC20;\n using SafeMath for uint;\n\n // Application config\n uint public constant CONFIG_TYPE_INBOUND_PROOF_LIBRARY_VERSION = 1;\n uint public constant CONFIG_TYPE_INBOUND_BLOCK_CONFIRMATIONS = 2;\n uint public constant CONFIG_TYPE_RELAYER = 3;\n uint public constant CONFIG_TYPE_OUTBOUND_PROOF_TYPE = 4;\n uint public constant CONFIG_TYPE_OUTBOUND_BLOCK_CONFIRMATIONS = 5;\n uint public constant CONFIG_TYPE_ORACLE = 6;\n\n // Token and Contracts\n IERC20 public layerZeroToken;\n ILayerZeroTreasury public treasuryContract;\n\n mapping(address =\u003e uint) public nativeFees;\n uint public treasuryZROFees;\n\n // User Application\n mapping(address =\u003e mapping(uint16 =\u003e ApplicationConfiguration)) public appConfig; // app address =\u003e chainId =\u003e config\n mapping(uint16 =\u003e ApplicationConfiguration) public defaultAppConfig; // default UA settings if no version specified\n mapping(uint16 =\u003e mapping(uint16 =\u003e bytes)) public defaultAdapterParams;\n\n // Validation\n mapping(uint16 =\u003e mapping(uint16 =\u003e address)) public inboundProofLibrary; // chainId =\u003e library Id =\u003e inboundProofLibrary contract\n mapping(uint16 =\u003e uint16) public maxInboundProofLibrary; // chainId =\u003e inboundProofLibrary\n mapping(uint16 =\u003e mapping(uint16 =\u003e bool)) public supportedOutboundProof; // chainId =\u003e outboundProofType =\u003e enabled\n mapping(uint16 =\u003e uint) public chainAddressSizeMap;\n mapping(address =\u003e mapping(uint16 =\u003e mapping(bytes32 =\u003e mapping(bytes32 =\u003e uint)))) public hashLookup; //[oracle][srcChainId][blockhash][datahash] -\u003e confirmation\n mapping(uint16 =\u003e bytes32) public ulnLookup; // remote ulns\n\n ILayerZeroEndpoint public immutable endpoint;\n uint16 public immutable localChainId;\n NonceContract public immutable nonceContract;\n\n constructor(address _endpoint, address _nonceContract, uint16 _localChainId) {\n require(_endpoint != address(0x0), \"LayerZero: endpoint cannot be zero address\");\n require(_nonceContract != address(0x0), \"LayerZero: nonceContract cannot be zero address\");\n ILayerZeroEndpoint lzEndpoint = ILayerZeroEndpoint(_endpoint);\n localChainId = _localChainId;\n endpoint = lzEndpoint;\n nonceContract = NonceContract(_nonceContract);\n }\n\n // only the endpoint can call SEND() and setConfig()\n modifier onlyEndpoint() {\n require(address(endpoint) == msg.sender, \"LayerZero: only endpoint\");\n _;\n }\n\n //----------------------------------------------------------------------------------\n // PROTOCOL\n function validateTransactionProof(uint16 _srcChainId, address _dstAddress, uint _gasLimit, bytes32 _lookupHash, bytes32 _blockData, bytes calldata _transactionProof) external override {\n // retrieve UA\u0027s configuration using the _dstAddress from arguments.\n ApplicationConfiguration memory uaConfig = _getAppConfig(_srcChainId, _dstAddress);\n\n // assert that the caller == UA\u0027s relayer\n require(uaConfig.relayer == msg.sender, \"LayerZero: invalid relayer\");\n\n LayerZeroPacket.Packet memory _packet;\n uint remoteAddressSize = chainAddressSizeMap[_srcChainId];\n require(remoteAddressSize != 0, \"LayerZero: incorrect remote address size\");\n {\n // assert that the data submitted by UA\u0027s oracle have no fewer confirmations than UA\u0027s configuration\n uint storedConfirmations = hashLookup[uaConfig.oracle][_srcChainId][_lookupHash][_blockData];\n require(storedConfirmations \u003e 0 \u0026\u0026 storedConfirmations \u003e= uaConfig.inboundBlockConfirmations, \"LayerZero: not enough block confirmations\");\n\n // decode\n address inboundProofLib = inboundProofLibrary[_srcChainId][uaConfig.inboundProofLibraryVersion];\n _packet = ILayerZeroValidationLibrary(inboundProofLib).validateProof(_blockData, _transactionProof, remoteAddressSize);\n }\n\n // packet content assertion\n require(ulnLookup[_srcChainId] == _packet.ulnAddress \u0026\u0026 _packet.ulnAddress != bytes32(0), \"LayerZero: invalid _packet.ulnAddress\");\n require(_packet.srcChainId == _srcChainId, \"LayerZero: invalid srcChain Id\");\n // failsafe because the remoteAddress size being passed into validateProof trims the address this should not hit\n require(_packet.srcAddress.length == remoteAddressSize, \"LayerZero: invalid srcAddress size\");\n require(_packet.dstChainId == localChainId, \"LayerZero: invalid dstChain Id\");\n require(_packet.dstAddress == _dstAddress, \"LayerZero: invalid dstAddress\");\n\n // if the dst is not a contract, then emit and return early. This will break inbound nonces, but this particular\n // path is already broken and wont ever be able to deliver anyways\n if (!_isContract(_dstAddress)) {\n emit InvalidDst(_packet.srcChainId, _packet.srcAddress, _packet.dstAddress, _packet.nonce, keccak256(_packet.payload));\n return;\n }\n\n bytes memory pathData = abi.encodePacked(_packet.srcAddress, _packet.dstAddress);\n emit PacketReceived(_packet.srcChainId, _packet.srcAddress, _packet.dstAddress, _packet.nonce, keccak256(_packet.payload));\n endpoint.receivePayload(_srcChainId, pathData, _dstAddress, _packet.nonce, _gasLimit, _packet.payload);\n }\n\n function send(address _ua, uint64, uint16 _dstChainId, bytes calldata _path, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable override onlyEndpoint {\n address ua = _ua;\n uint16 dstChainId = _dstChainId;\n require(ulnLookup[dstChainId] != bytes32(0), \"LayerZero: dstChainId does not exist\");\n\n bytes memory dstAddress;\n uint64 nonce;\n // code block for solving \u0027Stack Too Deep\u0027\n {\n uint chainAddressSize = chainAddressSizeMap[dstChainId];\n // path = remoteAddress + localAddress\n require(chainAddressSize != 0 \u0026\u0026 _path.length == 20 + chainAddressSize, \"LayerZero: incorrect remote address size\");\n address srcInPath;\n bytes memory path = _path; // copy to memory\n assembly {\n srcInPath := mload(add(add(path, 20), chainAddressSize)) // chainAddressSize + 20\n }\n require(ua == srcInPath, \"LayerZero: wrong path data\");\n dstAddress = _path[0:chainAddressSize];\n nonce = nonceContract.increment(dstChainId, ua, path);\n }\n\n bytes memory payload = _payload;\n ApplicationConfiguration memory uaConfig = _getAppConfig(dstChainId, ua);\n\n // compute all the fees\n uint relayerFee = _handleRelayer(dstChainId, uaConfig, ua, payload.length, _adapterParams);\n uint oracleFee = _handleOracle(dstChainId, uaConfig, ua);\n uint nativeProtocolFee = _handleProtocolFee(relayerFee, oracleFee, ua, _zroPaymentAddress);\n\n // total native fee, does not include ZRO protocol fee\n uint totalNativeFee = relayerFee.add(oracleFee).add(nativeProtocolFee);\n\n // assert the user has attached enough native token for this address\n require(totalNativeFee \u003c= msg.value, \"LayerZero: not enough native for fees\");\n // refund if they send too much\n uint amount = msg.value.sub(totalNativeFee);\n if (amount \u003e 0) {\n (bool success, ) = _refundAddress.call{value: amount}(\"\");\n require(success, \"LayerZero: failed to refund\");\n }\n\n // emit the data packet\n bytes memory encodedPayload = abi.encodePacked(nonce, localChainId, ua, dstChainId, dstAddress, payload);\n emit Packet(encodedPayload);\n }\n\n function _handleRelayer(uint16 _dstChainId, ApplicationConfiguration memory _uaConfig, address _ua, uint _payloadSize, bytes memory _adapterParams) internal returns (uint relayerFee) {\n if (_adapterParams.length == 0) {\n _adapterParams = defaultAdapterParams[_dstChainId][_uaConfig.outboundProofType];\n }\n address relayerAddress = _uaConfig.relayer;\n ILayerZeroRelayerV2 relayer = ILayerZeroRelayerV2(relayerAddress);\n relayerFee = relayer.assignJob(_dstChainId, _uaConfig.outboundProofType, _ua, _payloadSize, _adapterParams);\n\n _creditNativeFee(relayerAddress, relayerFee);\n\n // emit the param events\n emit RelayerParams(_adapterParams, _uaConfig.outboundProofType);\n }\n\n function _handleOracle(uint16 _dstChainId, ApplicationConfiguration memory _uaConfig, address _ua) internal returns (uint oracleFee) {\n address oracleAddress = _uaConfig.oracle;\n oracleFee = ILayerZeroOracleV2(oracleAddress).assignJob(_dstChainId, _uaConfig.outboundProofType, _uaConfig.outboundBlockConfirmations, _ua);\n\n _creditNativeFee(oracleAddress, oracleFee);\n }\n\n function _handleProtocolFee(uint _relayerFee, uint _oracleFee, address _ua, address _zroPaymentAddress) internal returns (uint protocolNativeFee) {\n // if no ZRO token or not specifying a payment address, pay in native token\n bool payInNative = _zroPaymentAddress == address(0x0) || address(layerZeroToken) == address(0x0);\n uint protocolFee = treasuryContract.getFees(!payInNative, _relayerFee, _oracleFee);\n\n if (protocolFee \u003e 0) {\n if (payInNative) {\n address treasuryAddress = address(treasuryContract);\n _creditNativeFee(treasuryAddress, protocolFee);\n protocolNativeFee = protocolFee;\n } else {\n // zro payment address must equal the ua or the tx.origin otherwise the transaction reverts\n require(_zroPaymentAddress == _ua || _zroPaymentAddress == tx.origin, \"LayerZero: must be paid by sender or origin\");\n\n // transfer the LayerZero token to this contract from the payee\n layerZeroToken.safeTransferFrom(_zroPaymentAddress, address(this), protocolFee);\n\n treasuryZROFees = treasuryZROFees.add(protocolFee);\n }\n }\n }\n\n function _creditNativeFee(address _receiver, uint _amount) internal {\n nativeFees[_receiver] = nativeFees[_receiver].add(_amount);\n }\n\n // Can be called by any address to update a block header\n // can only upload new block data or the same block data with more confirmations\n function updateHash(uint16 _srcChainId, bytes32 _lookupHash, uint _confirmations, bytes32 _blockData) external override {\n uint storedConfirmations = hashLookup[msg.sender][_srcChainId][_lookupHash][_blockData];\n\n // if it has a record, requires a larger confirmation.\n require(storedConfirmations \u003c _confirmations, \"LayerZero: oracle data can only update if it has more confirmations\");\n\n // set the new information into storage\n hashLookup[msg.sender][_srcChainId][_lookupHash][_blockData] = _confirmations;\n\n emit HashReceived(_srcChainId, msg.sender, _lookupHash, _blockData, _confirmations);\n }\n\n //----------------------------------------------------------------------------------\n // Other Library Interfaces\n\n // default to DEFAULT setting if ZERO value\n function getAppConfig(uint16 _remoteChainId, address _ua) external view override returns (ApplicationConfiguration memory) {\n return _getAppConfig(_remoteChainId, _ua);\n }\n\n function _getAppConfig(uint16 _remoteChainId, address _ua) internal view returns (ApplicationConfiguration memory) {\n ApplicationConfiguration memory config = appConfig[_ua][_remoteChainId];\n ApplicationConfiguration storage defaultConfig = defaultAppConfig[_remoteChainId];\n\n if (config.inboundProofLibraryVersion == 0) {\n config.inboundProofLibraryVersion = defaultConfig.inboundProofLibraryVersion;\n }\n\n if (config.inboundBlockConfirmations == 0) {\n config.inboundBlockConfirmations = defaultConfig.inboundBlockConfirmations;\n }\n\n if (config.relayer == address(0x0)) {\n config.relayer = defaultConfig.relayer;\n }\n\n if (config.outboundProofType == 0) {\n config.outboundProofType = defaultConfig.outboundProofType;\n }\n\n if (config.outboundBlockConfirmations == 0) {\n config.outboundBlockConfirmations = defaultConfig.outboundBlockConfirmations;\n }\n\n if (config.oracle == address(0x0)) {\n config.oracle = defaultConfig.oracle;\n }\n\n return config;\n }\n\n function setConfig(uint16 _remoteChainId, address _ua, uint _configType, bytes calldata _config) external override onlyEndpoint {\n ApplicationConfiguration storage uaConfig = appConfig[_ua][_remoteChainId];\n if (_configType == CONFIG_TYPE_INBOUND_PROOF_LIBRARY_VERSION) {\n uint16 inboundProofLibraryVersion = abi.decode(_config, (uint16));\n require(inboundProofLibraryVersion \u003c= maxInboundProofLibrary[_remoteChainId], \"LayerZero: invalid inbound proof library version\");\n uaConfig.inboundProofLibraryVersion = inboundProofLibraryVersion;\n } else if (_configType == CONFIG_TYPE_INBOUND_BLOCK_CONFIRMATIONS) {\n uint64 blockConfirmations = abi.decode(_config, (uint64));\n uaConfig.inboundBlockConfirmations = blockConfirmations;\n } else if (_configType == CONFIG_TYPE_RELAYER) {\n address relayer = abi.decode(_config, (address));\n uaConfig.relayer = relayer;\n } else if (_configType == CONFIG_TYPE_OUTBOUND_PROOF_TYPE) {\n uint16 outboundProofType = abi.decode(_config, (uint16));\n require(supportedOutboundProof[_remoteChainId][outboundProofType] || outboundProofType == 0, \"LayerZero: invalid outbound proof type\");\n uaConfig.outboundProofType = outboundProofType;\n } else if (_configType == CONFIG_TYPE_OUTBOUND_BLOCK_CONFIRMATIONS) {\n uint64 blockConfirmations = abi.decode(_config, (uint64));\n uaConfig.outboundBlockConfirmations = blockConfirmations;\n } else if (_configType == CONFIG_TYPE_ORACLE) {\n address oracle = abi.decode(_config, (address));\n uaConfig.oracle = oracle;\n } else {\n revert(\"LayerZero: Invalid config type\");\n }\n\n emit AppConfigUpdated(_ua, _configType, _config);\n }\n\n function getConfig(uint16 _remoteChainId, address _ua, uint _configType) external view override returns (bytes memory) {\n ApplicationConfiguration storage uaConfig = appConfig[_ua][_remoteChainId];\n\n if (_configType == CONFIG_TYPE_INBOUND_PROOF_LIBRARY_VERSION) {\n if (uaConfig.inboundProofLibraryVersion == 0) {\n return abi.encode(defaultAppConfig[_remoteChainId].inboundProofLibraryVersion);\n }\n return abi.encode(uaConfig.inboundProofLibraryVersion);\n } else if (_configType == CONFIG_TYPE_INBOUND_BLOCK_CONFIRMATIONS) {\n if (uaConfig.inboundBlockConfirmations == 0) {\n return abi.encode(defaultAppConfig[_remoteChainId].inboundBlockConfirmations);\n }\n return abi.encode(uaConfig.inboundBlockConfirmations);\n } else if (_configType == CONFIG_TYPE_RELAYER) {\n if (uaConfig.relayer == address(0x0)) {\n return abi.encode(defaultAppConfig[_remoteChainId].relayer);\n }\n return abi.encode(uaConfig.relayer);\n } else if (_configType == CONFIG_TYPE_OUTBOUND_PROOF_TYPE) {\n if (uaConfig.outboundProofType == 0) {\n return abi.encode(defaultAppConfig[_remoteChainId].outboundProofType);\n }\n return abi.encode(uaConfig.outboundProofType);\n } else if (_configType == CONFIG_TYPE_OUTBOUND_BLOCK_CONFIRMATIONS) {\n if (uaConfig.outboundBlockConfirmations == 0) {\n return abi.encode(defaultAppConfig[_remoteChainId].outboundBlockConfirmations);\n }\n return abi.encode(uaConfig.outboundBlockConfirmations);\n } else if (_configType == CONFIG_TYPE_ORACLE) {\n if (uaConfig.oracle == address(0x0)) {\n return abi.encode(defaultAppConfig[_remoteChainId].oracle);\n }\n return abi.encode(uaConfig.oracle);\n } else {\n revert(\"LayerZero: Invalid config type\");\n }\n }\n\n // returns the native fee the UA pays to cover fees\n function estimateFees(uint16 _dstChainId, address _ua, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParams) external view override returns (uint nativeFee, uint zroFee) {\n ApplicationConfiguration memory uaConfig = _getAppConfig(_dstChainId, _ua);\n\n // Relayer Fee\n bytes memory adapterParams;\n if (_adapterParams.length \u003e 0) {\n adapterParams = _adapterParams;\n } else {\n adapterParams = defaultAdapterParams[_dstChainId][uaConfig.outboundProofType];\n }\n uint relayerFee = ILayerZeroRelayerV2(uaConfig.relayer).getFee(_dstChainId, uaConfig.outboundProofType, _ua, _payload.length, adapterParams);\n\n // Oracle Fee\n address ua = _ua; // stack too deep\n uint oracleFee = ILayerZeroOracleV2(uaConfig.oracle).getFee(_dstChainId, uaConfig.outboundProofType, uaConfig.outboundBlockConfirmations, ua);\n\n // LayerZero Fee\n uint protocolFee = treasuryContract.getFees(_payInZRO, relayerFee, oracleFee);\n _payInZRO ? zroFee = protocolFee : nativeFee = protocolFee;\n\n // return the sum of fees\n nativeFee = nativeFee.add(relayerFee).add(oracleFee);\n }\n\n //---------------------------------------------------------------------------\n // Claim Fees\n\n // universal withdraw ZRO token function\n function withdrawZRO(address _to, uint _amount) external override nonReentrant {\n require(msg.sender == address(treasuryContract), \"LayerZero: only treasury\");\n treasuryZROFees = treasuryZROFees.sub(_amount);\n layerZeroToken.safeTransfer(_to, _amount);\n emit WithdrawZRO(msg.sender, _to, _amount);\n }\n\n // universal withdraw native token function.\n // the source contract should perform all the authentication control\n function withdrawNative(address payable _to, uint _amount) external override nonReentrant {\n require(_to != address(0x0), \"LayerZero: _to cannot be zero address\");\n nativeFees[msg.sender] = nativeFees[msg.sender].sub(_amount);\n\n (bool success, ) = _to.call{value: _amount}(\"\");\n require(success, \"LayerZero: withdraw failed\");\n emit WithdrawNative(msg.sender, _to, _amount);\n }\n\n //---------------------------------------------------------------------------\n // Owner calls, configuration only.\n function setLayerZeroToken(address _layerZeroToken) external onlyOwner {\n require(_layerZeroToken != address(0x0), \"LayerZero: _layerZeroToken cannot be zero address\");\n layerZeroToken = IERC20(_layerZeroToken);\n emit SetLayerZeroToken(_layerZeroToken);\n }\n\n function setTreasury(address _treasury) external onlyOwner {\n require(_treasury != address(0x0), \"LayerZero: treasury cannot be zero address\");\n treasuryContract = ILayerZeroTreasury(_treasury);\n emit SetTreasury(_treasury);\n }\n\n function addInboundProofLibraryForChain(uint16 _chainId, address _library) external onlyOwner {\n require(_library != address(0x0), \"LayerZero: library cannot be zero address\");\n uint16 libId = maxInboundProofLibrary[_chainId];\n require(libId \u003c 65535, \"LayerZero: can not add new library\");\n maxInboundProofLibrary[_chainId] = ++libId;\n inboundProofLibrary[_chainId][libId] = _library;\n emit AddInboundProofLibraryForChain(_chainId, _library);\n }\n\n function enableSupportedOutboundProof(uint16 _chainId, uint16 _proofType) external onlyOwner {\n supportedOutboundProof[_chainId][_proofType] = true;\n emit EnableSupportedOutboundProof(_chainId, _proofType);\n }\n\n function setDefaultConfigForChainId(uint16 _chainId, uint16 _inboundProofLibraryVersion, uint64 _inboundBlockConfirmations, address _relayer, uint16 _outboundProofType, uint64 _outboundBlockConfirmations, address _oracle) external onlyOwner {\n require(_inboundProofLibraryVersion \u003c= maxInboundProofLibrary[_chainId] \u0026\u0026 _inboundProofLibraryVersion \u003e 0, \"LayerZero: invalid inbound proof library version\");\n require(_inboundBlockConfirmations \u003e 0, \"LayerZero: invalid inbound block confirmation\");\n require(_relayer != address(0x0), \"LayerZero: invalid relayer address\");\n require(supportedOutboundProof[_chainId][_outboundProofType], \"LayerZero: invalid outbound proof type\");\n require(_outboundBlockConfirmations \u003e 0, \"LayerZero: invalid outbound block confirmation\");\n require(_oracle != address(0x0), \"LayerZero: invalid oracle address\");\n defaultAppConfig[_chainId] = ApplicationConfiguration(_inboundProofLibraryVersion, _inboundBlockConfirmations, _relayer, _outboundProofType, _outboundBlockConfirmations, _oracle);\n emit SetDefaultConfigForChainId(_chainId, _inboundProofLibraryVersion, _inboundBlockConfirmations, _relayer, _outboundProofType, _outboundBlockConfirmations, _oracle);\n }\n\n function setDefaultAdapterParamsForChainId(uint16 _chainId, uint16 _proofType, bytes calldata _adapterParams) external onlyOwner {\n defaultAdapterParams[_chainId][_proofType] = _adapterParams;\n emit SetDefaultAdapterParamsForChainId(_chainId, _proofType, _adapterParams);\n }\n\n function setRemoteUln(uint16 _remoteChainId, bytes32 _remoteUln) external onlyOwner {\n require(ulnLookup[_remoteChainId] == bytes32(0), \"LayerZero: remote uln already set\");\n ulnLookup[_remoteChainId] = _remoteUln;\n emit SetRemoteUln(_remoteChainId, _remoteUln);\n }\n\n function setChainAddressSize(uint16 _chainId, uint _size) external onlyOwner {\n require(chainAddressSizeMap[_chainId] == 0, \"LayerZero: remote chain address size already set\");\n chainAddressSizeMap[_chainId] = _size;\n emit SetChainAddressSize(_chainId, _size);\n }\n\n //----------------------------------------------------------------------------------\n // view functions\n\n function accruedNativeFee(address _address) external view override returns (uint) {\n return nativeFees[_address];\n }\n\n function getOutboundNonce(uint16 _chainId, bytes calldata _path) external view override returns (uint64) {\n return nonceContract.outboundNonce(_chainId, _path);\n }\n\n function _isContract(address addr) internal view returns (bool) {\n uint size;\n assembly {\n size := extcodesize(addr)\n }\n return size != 0;\n }\n}\n"}}
< {"Address.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize, which returns 0 for contracts in\n        // construction, since the code is only stored at the end of the\n        // constructor execution.\n\n        uint256 size;\n        // solhint-disable-next-line no-inline-assembly\n        assembly { size := extcodesize(account) }\n        return size \u003e 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity\u0027s `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance \u003e= amount, \"Address: insufficient balance\");\n\n        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n        (bool success, ) = recipient.call{ value: amount }(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain`call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n      return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n        require(address(this).balance \u003e= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.call{ value: value }(data);\n        return _verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return _verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n        require(isContract(target), \"Address: delegate call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return _verifyCallResult(success, returndata, errorMessage);\n    }\n\n    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length \u003e 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                // solhint-disable-next-line no-inline-assembly\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n"},"Buffer.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\n// https://github.com/ensdomains/buffer\n\npragma solidity ^0.7.0;\n\n/**\n * @dev A library for working with mutable byte buffers in Solidity.\n *\n * Byte buffers are mutable and expandable, and provide a variety of primitives\n * for writing to them. At any time you can fetch a bytes object containing the\n * current contents of the buffer. The bytes object should not be stored between\n * operations, as it may change due to resizing of the buffer.\n */\nlibrary Buffer {\n    /**\n     * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n     *      a capacity. The capacity may be longer than the current value, in\n     *      which case it can be extended without the need to allocate more memory.\n     */\n    struct buffer {\n        bytes buf;\n        uint capacity;\n    }\n\n    /**\n     * @dev Initializes a buffer with an initial capacity.a co\n     * @param buf The buffer to initialize.\n     * @param capacity The number of bytes of space to allocate the buffer.\n     * @return The buffer, for chaining.\n     */\n    function init(buffer memory buf, uint capacity) internal pure returns (buffer memory) {\n        if (capacity % 32 != 0) {\n            capacity += 32 - (capacity % 32);\n        }\n        // Allocate space for the buffer data\n        buf.capacity = capacity;\n        assembly {\n            let ptr := mload(0x40)\n            mstore(buf, ptr)\n            mstore(ptr, 0)\n            mstore(0x40, add(32, add(ptr, capacity)))\n        }\n        return buf;\n    }\n\n\n    /**\n     * @dev Writes a byte string to a buffer. Resizes if doing so would exceed\n     *      the capacity of the buffer.\n     * @param buf The buffer to append to.\n     * @param off The start offset to write to.\n     * @param rawData The data to append.\n     * @param len The number of bytes to copy.\n     * @return The original buffer, for chaining.\n     */\n    function writeRawBytes(\n        buffer memory buf,\n        uint off,\n        bytes memory rawData,\n        uint offData,\n        uint len\n    ) internal pure returns (buffer memory) {\n        if (off + len \u003e buf.capacity) {\n            resize(buf, max(buf.capacity, len + off) * 2);\n        }\n\n        uint dest;\n        uint src;\n        assembly {\n            // Memory address of the buffer data\n            let bufptr := mload(buf)\n            // Length of existing buffer data\n            let buflen := mload(bufptr)\n            // Start address = buffer address + offset + sizeof(buffer length)\n            dest := add(add(bufptr, 32), off)\n            // Update buffer length if we\u0027re extending it\n            if gt(add(len, off), buflen) {\n                mstore(bufptr, add(len, off))\n            }\n            src := add(rawData, offData)\n        }\n\n        // Copy word-length chunks while possible\n        for (; len \u003e= 32; len -= 32) {\n            assembly {\n                mstore(dest, mload(src))\n            }\n            dest += 32;\n            src += 32;\n        }\n\n        // Copy remaining bytes\n        uint mask = 256**(32 - len) - 1;\n        assembly {\n            let srcpart := and(mload(src), not(mask))\n            let destpart := and(mload(dest), mask)\n            mstore(dest, or(destpart, srcpart))\n        }\n\n        return buf;\n    }\n\n    /**\n     * @dev Writes a byte string to a buffer. Resizes if doing so would exceed\n     *      the capacity of the buffer.\n     * @param buf The buffer to append to.\n     * @param off The start offset to write to.\n     * @param data The data to append.\n     * @param len The number of bytes to copy.\n     * @return The original buffer, for chaining.\n     */\n    function write(buffer memory buf, uint off, bytes memory data, uint len) internal pure returns (buffer memory) {\n        require(len \u003c= data.length);\n\n        if (off + len \u003e buf.capacity) {\n            resize(buf, max(buf.capacity, len + off) * 2);\n        }\n\n        uint dest;\n        uint src;\n        assembly {\n        // Memory address of the buffer data\n            let bufptr := mload(buf)\n        // Length of existing buffer data\n            let buflen := mload(bufptr)\n        // Start address = buffer address + offset + sizeof(buffer length)\n            dest := add(add(bufptr, 32), off)\n        // Update buffer length if we\u0027re extending it\n            if gt(add(len, off), buflen) {\n                mstore(bufptr, add(len, off))\n            }\n            src := add(data, 32)\n        }\n\n        // Copy word-length chunks while possible\n        for (; len \u003e= 32; len -= 32) {\n            assembly {\n                mstore(dest, mload(src))\n            }\n            dest += 32;\n            src += 32;\n        }\n\n        // Copy remaining bytes\n        uint mask = 256**(32 - len) - 1;\n        assembly {\n            let srcpart := and(mload(src), not(mask))\n            let destpart := and(mload(dest), mask)\n            mstore(dest, or(destpart, srcpart))\n        }\n\n        return buf;\n    }\n\n    function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n        return write(buf, buf.buf.length, data, data.length);\n    }\n\n    function resize(buffer memory buf, uint capacity) private pure {\n        bytes memory oldbuf = buf.buf;\n        init(buf, capacity);\n        append(buf, oldbuf);\n    }\n\n    function max(uint a, uint b) private pure returns (uint) {\n        if (a \u003e b) {\n            return a;\n        }\n        return b;\n    }\n}\n"},"Context.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity \u003e=0.6.0 \u003c0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address payable) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes memory) {\n        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n        return msg.data;\n    }\n}\n"},"IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller\u0027s account to `recipient`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address recipient, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller\u0027s tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender\u0027s allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `sender` to `recipient` using the\n     * allowance mechanism. `amount` is then deducted from the caller\u0027s\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"},"ILayerZeroEndpoint.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.5.0;\n\nimport \"./ILayerZeroUserApplicationConfig.sol\";\n\ninterface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig {\n    // @notice send a LayerZero message to the specified address at a LayerZero endpoint.\n    // @param _dstChainId - the destination chain identifier\n    // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains\n    // @param _payload - a custom bytes payload to send to the destination contract\n    // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address\n    // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction\n    // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination\n    function send(uint16 _dstChainId, bytes calldata _destination, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable;\n\n    // @notice used by the messaging library to publish verified payload\n    // @param _srcChainId - the source chain identifier\n    // @param _srcAddress - the source contract (as bytes) at the source chain\n    // @param _dstAddress - the address on destination chain\n    // @param _nonce - the unbound message ordering nonce\n    // @param _gasLimit - the gas limit for external contract execution\n    // @param _payload - verified payload to send to the destination contract\n    function receivePayload(uint16 _srcChainId, bytes calldata _srcAddress, address _dstAddress, uint64 _nonce, uint _gasLimit, bytes calldata _payload) external;\n\n    // @notice get the inboundNonce of a receiver from a source chain which could be EVM or non-EVM chain\n    // @param _srcChainId - the source chain identifier\n    // @param _srcAddress - the source chain contract address\n    function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);\n\n    // @notice get the outboundNonce from this source chain which, consequently, is always an EVM\n    // @param _srcAddress - the source chain contract address\n    function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);\n\n    // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery\n    // @param _dstChainId - the destination chain identifier\n    // @param _userApplication - the user app address on this EVM chain\n    // @param _payload - the custom message to send over LayerZero\n    // @param _payInZRO - if false, user app pays the protocol fee in native token\n    // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain\n    function estimateFees(uint16 _dstChainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam) external view returns (uint nativeFee, uint zroFee);\n\n    // @notice get this Endpoint\u0027s immutable source identifier\n    function getChainId() external view returns (uint16);\n\n    // @notice the interface to retry failed message on this Endpoint destination\n    // @param _srcChainId - the source chain identifier\n    // @param _srcAddress - the source chain contract address\n    // @param _payload - the payload to be retried\n    function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external;\n\n    // @notice query if any STORED payload (message blocking) at the endpoint.\n    // @param _srcChainId - the source chain identifier\n    // @param _srcAddress - the source chain contract address\n    function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);\n\n    // @notice query if the _libraryAddress is valid for sending msgs.\n    // @param _userApplication - the user app address on this EVM chain\n    function getSendLibraryAddress(address _userApplication) external view returns (address);\n\n    // @notice query if the _libraryAddress is valid for receiving msgs.\n    // @param _userApplication - the user app address on this EVM chain\n    function getReceiveLibraryAddress(address _userApplication) external view returns (address);\n\n    // @notice query if the non-reentrancy guard for send() is on\n    // @return true if the guard is on. false otherwise\n    function isSendingPayload() external view returns (bool);\n\n    // @notice query if the non-reentrancy guard for receive() is on\n    // @return true if the guard is on. false otherwise\n    function isReceivingPayload() external view returns (bool);\n\n    // @notice get the configuration of the LayerZero messaging library of the specified version\n    // @param _version - messaging library version\n    // @param _chainId - the chainId for the pending config change\n    // @param _userApplication - the contract address of the user application\n    // @param _configType - type of configuration. every messaging library has its own convention.\n    function getConfig(uint16 _version, uint16 _chainId, address _userApplication, uint _configType) external view returns (bytes memory);\n\n    // @notice get the send() LayerZero messaging library version\n    // @param _userApplication - the contract address of the user application\n    function getSendVersion(address _userApplication) external view returns (uint16);\n\n    // @notice get the lzReceive() LayerZero messaging library version\n    // @param _userApplication - the contract address of the user application\n    function getReceiveVersion(address _userApplication) external view returns (uint16);\n}\n"},"ILayerZeroMessagingLibrary.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.7.0;\n\nimport \"./ILayerZeroUserApplicationConfig.sol\";\n\ninterface ILayerZeroMessagingLibrary {\n    // send(), messages will be inflight.\n    function send(address _userApplication, uint64 _lastNonce, uint16 _chainId, bytes calldata _destination, bytes calldata _payload, address payable refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable;\n\n    // estimate native fee at the send side\n    function estimateFees(uint16 _chainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam) external view returns (uint nativeFee, uint zroFee);\n\n    //---------------------------------------------------------------------------\n    // setConfig / getConfig are User Application (UA) functions to specify Oracle, Relayer, blockConfirmations, libraryVersion\n    function setConfig(uint16 _chainId, address _userApplication, uint _configType, bytes calldata _config) external;\n\n    function getConfig(uint16 _chainId, address _userApplication, uint _configType) external view returns (bytes memory);\n}\n"},"ILayerZeroMessagingLibraryV2.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.7.0;\n\nimport \"./ILayerZeroUserApplicationConfig.sol\";\nimport \"./ILayerZeroMessagingLibrary.sol\";\n\ninterface ILayerZeroMessagingLibraryV2 is ILayerZeroMessagingLibrary {\n    function getOutboundNonce(uint16 _chainId, bytes calldata _path) external view returns (uint64);\n}\n"},"ILayerZeroOracleV2.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.7.0;\n\ninterface ILayerZeroOracleV2 {\n    // @notice query price and assign jobs at the same time\n    // @param _dstChainId - the destination endpoint identifier\n    // @param _outboundProofType - the proof type identifier to specify proof to be relayed\n    // @param _outboundBlockConfirmation - block confirmation delay before relaying blocks\n    // @param _userApplication - the source sending contract address\n    function assignJob(uint16 _dstChainId, uint16 _outboundProofType, uint64 _outboundBlockConfirmation, address _userApplication) external returns (uint price);\n\n    // @notice query the oracle price for relaying block information to the destination chain\n    // @param _dstChainId the destination endpoint identifier\n    // @param _outboundProofType the proof type identifier to specify the data to be relayed\n    // @param _outboundBlockConfirmation - block confirmation delay before relaying blocks\n    // @param _userApplication - the source sending contract address\n    function getFee(uint16 _dstChainId, uint16 _outboundProofType, uint64 _outboundBlockConfirmation, address _userApplication) external view returns (uint price);\n\n    // @notice withdraw the accrued fee in ultra light node\n    // @param _to - the fee receiver\n    // @param _amount - the withdrawal amount\n    function withdrawFee(address payable _to, uint _amount) external;\n}\n"},"ILayerZeroReceiver.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.5.0;\n\ninterface ILayerZeroReceiver {\n    // @notice LayerZero endpoint will invoke this function to deliver the message on the destination\n    // @param _srcChainId - the source endpoint identifier\n    // @param _srcAddress - the source sending contract address from the source chain\n    // @param _nonce - the ordered message nonce\n    // @param _payload - the signed payload is the UA bytes has encoded to be sent\n    function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external;\n}\n"},"ILayerZeroRelayerV2.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.7.0;\n\ninterface ILayerZeroRelayerV2 {\n    // @notice query price and assign jobs at the same time\n    // @param _dstChainId - the destination endpoint identifier\n    // @param _outboundProofType - the proof type identifier to specify proof to be relayed\n    // @param _userApplication - the source sending contract address. relayers may apply price discrimination to user apps\n    // @param _payloadSize - the length of the payload. it is an indicator of gas usage for relaying cross-chain messages\n    // @param _adapterParams - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain\n    function assignJob(uint16 _dstChainId, uint16 _outboundProofType, address _userApplication, uint _payloadSize, bytes calldata _adapterParams) external returns (uint price);\n\n    // @notice query the relayer price for relaying the payload and its proof to the destination chain\n    // @param _dstChainId - the destination endpoint identifier\n    // @param _outboundProofType - the proof type identifier to specify proof to be relayed\n    // @param _userApplication - the source sending contract address. relayers may apply price discrimination to user apps\n    // @param _payloadSize - the length of the payload. it is an indicator of gas usage for relaying cross-chain messages\n    // @param _adapterParams - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain\n    function getFee(uint16 _dstChainId, uint16 _outboundProofType, address _userApplication, uint _payloadSize, bytes calldata _adapterParams) external view returns (uint price);\n\n    // @notice withdraw the accrued fee in ultra light node\n    // @param _to - the fee receiver\n    // @param _amount - the withdrawal amount\n    function withdrawFee(address payable _to, uint _amount) external;\n}\n"},"ILayerZeroTreasury.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.5.0;\n\ninterface ILayerZeroTreasury {\n    function getFees(bool payInZro, uint relayerFee, uint oracleFee) external view returns (uint);\n}\n"},"ILayerZeroUltraLightNodeV2.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.7.0;\npragma abicoder v2;\n\ninterface ILayerZeroUltraLightNodeV2 {\n    // Relayer functions\n    function validateTransactionProof(uint16 _srcChainId, address _dstAddress, uint _gasLimit, bytes32 _lookupHash, bytes32 _blockData, bytes calldata _transactionProof) external;\n\n    // an Oracle delivers the block data using updateHash()\n    function updateHash(uint16 _srcChainId, bytes32 _lookupHash, uint _confirmations, bytes32 _blockData) external;\n\n    // can only withdraw the receivable of the msg.sender\n    function withdrawNative(address payable _to, uint _amount) external;\n\n    function withdrawZRO(address _to, uint _amount) external;\n\n    // view functions\n    function getAppConfig(uint16 _remoteChainId, address _userApplicationAddress) external view returns (ApplicationConfiguration memory);\n\n    function accruedNativeFee(address _address) external view returns (uint);\n\n    struct ApplicationConfiguration {\n        uint16 inboundProofLibraryVersion;\n        uint64 inboundBlockConfirmations;\n        address relayer;\n        uint16 outboundProofType;\n        uint64 outboundBlockConfirmations;\n        address oracle;\n    }\n\n    event HashReceived(uint16 indexed srcChainId, address indexed oracle, bytes32 lookupHash, bytes32 blockData, uint confirmations);\n    event RelayerParams(bytes adapterParams, uint16 outboundProofType);\n    event Packet(bytes payload);\n    event InvalidDst(uint16 indexed srcChainId, bytes srcAddress, address indexed dstAddress, uint64 nonce, bytes32 payloadHash);\n    event PacketReceived(uint16 indexed srcChainId, bytes srcAddress, address indexed dstAddress, uint64 nonce, bytes32 payloadHash);\n    event AppConfigUpdated(address indexed userApplication, uint indexed configType, bytes newConfig);\n    event AddInboundProofLibraryForChain(uint16 indexed chainId, address lib);\n    event EnableSupportedOutboundProof(uint16 indexed chainId, uint16 proofType);\n    event SetChainAddressSize(uint16 indexed chainId, uint size);\n    event SetDefaultConfigForChainId(uint16 indexed chainId, uint16 inboundProofLib, uint64 inboundBlockConfirm, address relayer, uint16 outboundProofType, uint64 outboundBlockConfirm, address oracle);\n    event SetDefaultAdapterParamsForChainId(uint16 indexed chainId, uint16 indexed proofType, bytes adapterParams);\n    event SetLayerZeroToken(address indexed tokenAddress);\n    event SetRemoteUln(uint16 indexed chainId, bytes32 uln);\n    event SetTreasury(address indexed treasuryAddress);\n    event WithdrawZRO(address indexed msgSender, address indexed to, uint amount);\n    event WithdrawNative(address indexed msgSender, address indexed to, uint amount);\n}\n"},"ILayerZeroUserApplicationConfig.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.5.0;\n\ninterface ILayerZeroUserApplicationConfig {\n    // @notice set the configuration of the LayerZero messaging library of the specified version\n    // @param _version - messaging library version\n    // @param _chainId - the chainId for the pending config change\n    // @param _configType - type of configuration. every messaging library has its own convention.\n    // @param _config - configuration in the bytes. can encode arbitrary content.\n    function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external;\n\n    // @notice set the send() LayerZero messaging library version to _version\n    // @param _version - new messaging library version\n    function setSendVersion(uint16 _version) external;\n\n    // @notice set the lzReceive() LayerZero messaging library version to _version\n    // @param _version - new messaging library version\n    function setReceiveVersion(uint16 _version) external;\n\n    // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload\n    // @param _srcChainId - the chainId of the source chain\n    // @param _srcAddress - the contract address of the source contract at the source chain\n    function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;\n}\n"},"ILayerZeroValidationLibrary.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity \u003e=0.7.0;\npragma abicoder v2;\n\nimport \"./LayerZeroPacket.sol\";\n\ninterface ILayerZeroValidationLibrary {\n    function validateProof(bytes32 blockData, bytes calldata _data, uint _remoteAddressSize) external returns (LayerZeroPacket.Packet memory packet);\n}\n"},"LayerZeroPacket.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.7.6;\n\nimport \"./Buffer.sol\";\nimport \"./SafeMath.sol\";\n\nlibrary LayerZeroPacket {\n    using Buffer for Buffer.buffer;\n    using SafeMath for uint;\n\n    struct Packet {\n        uint16 srcChainId;\n        uint16 dstChainId;\n        uint64 nonce;\n        address dstAddress;\n        bytes srcAddress;\n        bytes32 ulnAddress;\n        bytes payload;\n    }\n\n    function getPacket(\n        bytes memory data,\n        uint16 srcChain,\n        uint sizeOfSrcAddress,\n        bytes32 ulnAddress\n    ) internal pure returns (LayerZeroPacket.Packet memory) {\n        uint16 dstChainId;\n        address dstAddress;\n        uint size;\n        uint64 nonce;\n\n        // The log consists of the destination chain id and then a bytes payload\n        //      0--------------------------------------------31\n        // 0   |  total bytes size\n        // 32  |  destination chain id\n        // 64  |  bytes offset\n        // 96  |  bytes array size\n        // 128 |  payload\n        assembly {\n            dstChainId := mload(add(data, 32))\n            size := mload(add(data, 96)) /// size of the byte array\n            nonce := mload(add(data, 104)) // offset to convert to uint64  128  is index -24\n            dstAddress := mload(add(data, sub(add(128, sizeOfSrcAddress), 4))) // offset to convert to address 12 -8\n        }\n\n        Buffer.buffer memory srcAddressBuffer;\n        srcAddressBuffer.init(sizeOfSrcAddress);\n        srcAddressBuffer.writeRawBytes(0, data, 136, sizeOfSrcAddress); // 128 + 8\n\n        uint payloadSize = size.sub(28).sub(sizeOfSrcAddress);\n        Buffer.buffer memory payloadBuffer;\n        payloadBuffer.init(payloadSize);\n        payloadBuffer.writeRawBytes(0, data, sizeOfSrcAddress.add(156), payloadSize); // 148 + 8\n        return LayerZeroPacket.Packet(srcChain, dstChainId, nonce, dstAddress, srcAddressBuffer.buf, ulnAddress, payloadBuffer.buf);\n    }\n\n    function getPacketV2(\n        bytes memory data,\n        uint sizeOfSrcAddress,\n        bytes32 ulnAddress\n    ) internal pure returns (LayerZeroPacket.Packet memory) {\n        // packet def: abi.encodePacked(nonce, srcChain, srcAddress, dstChain, dstAddress, payload);\n        // data def: abi.encode(packet) = offset(32) + length(32) + packet\n        //              if from EVM\n        // 0 - 31       0 - 31          |  total bytes size\n        // 32 - 63      32 - 63         |  location\n        // 64 - 95      64 - 95         |  size of the packet\n        // 96 - 103     96 - 103        |  nonce\n        // 104 - 105    104 - 105       |  srcChainId\n        // 106 - P      106 - 125       |  srcAddress, where P = 106 + sizeOfSrcAddress - 1,\n        // P+1 - P+2    126 - 127       |  dstChainId\n        // P+3 - P+22   128 - 147       |  dstAddress\n        // P+23 - END   148 - END       |  payload\n\n        // decode the packet\n        uint256 realSize;\n        uint64 nonce;\n        uint16 srcChain;\n        uint16 dstChain;\n        address dstAddress;\n        assembly {\n            realSize := mload(add(data, 64))\n            nonce := mload(add(data, 72)) // 104 - 32\n            srcChain := mload(add(data, 74)) // 106 - 32\n            dstChain := mload(add(data, add(76, sizeOfSrcAddress))) // P + 3 - 32 = 105 + size + 3 - 32 = 76 + size\n            dstAddress := mload(add(data, add(96, sizeOfSrcAddress))) // P + 23 - 32 = 105 + size + 23 - 32 = 96 + size\n        }\n\n        require(srcChain != 0, \"LayerZeroPacket: invalid packet\");\n\n        Buffer.buffer memory srcAddressBuffer;\n        srcAddressBuffer.init(sizeOfSrcAddress);\n        srcAddressBuffer.writeRawBytes(0, data, 106, sizeOfSrcAddress);\n\n        uint nonPayloadSize = sizeOfSrcAddress.add(32);// 2 + 2 + 8 + 20, 32 + 20 = 52 if sizeOfSrcAddress == 20\n        uint payloadSize = realSize.sub(nonPayloadSize);\n        Buffer.buffer memory payloadBuffer;\n        payloadBuffer.init(payloadSize);\n        payloadBuffer.writeRawBytes(0, data, nonPayloadSize.add(96), payloadSize);\n\n        return LayerZeroPacket.Packet(srcChain, dstChain, nonce, dstAddress, srcAddressBuffer.buf, ulnAddress, payloadBuffer.buf);\n    }\n\n    function getPacketV3(\n        bytes memory data,\n        uint sizeOfSrcAddress,\n        bytes32 ulnAddress\n    ) internal pure returns (LayerZeroPacket.Packet memory) {\n        // data def: abi.encodePacked(nonce, srcChain, srcAddress, dstChain, dstAddress, payload);\n        //              if from EVM\n        // 0 - 31       0 - 31          |  total bytes size\n        // 32 - 39      32 - 39         |  nonce\n        // 40 - 41      40 - 41         |  srcChainId\n        // 42 - P       42 - 61         |  srcAddress, where P = 41 + sizeOfSrcAddress,\n        // P+1 - P+2    62 - 63         |  dstChainId\n        // P+3 - P+22   64 - 83         |  dstAddress\n        // P+23 - END   84 - END        |  payload\n\n        // decode the packet\n        uint256 realSize = data.length;\n        uint nonPayloadSize = sizeOfSrcAddress.add(32);// 2 + 2 + 8 + 20, 32 + 20 = 52 if sizeOfSrcAddress == 20\n        require(realSize \u003e= nonPayloadSize, \"LayerZeroPacket: invalid packet\");\n        uint payloadSize = realSize - nonPayloadSize;\n\n        uint64 nonce;\n        uint16 srcChain;\n        uint16 dstChain;\n        address dstAddress;\n        assembly {\n            nonce := mload(add(data, 8)) // 40 - 32\n            srcChain := mload(add(data, 10)) // 42 - 32\n            dstChain := mload(add(data, add(12, sizeOfSrcAddress))) // P + 3 - 32 = 41 + size + 3 - 32 = 12 + size\n            dstAddress := mload(add(data, add(32, sizeOfSrcAddress))) // P + 23 - 32 = 41 + size + 23 - 32 = 32 + size\n        }\n\n        require(srcChain != 0, \"LayerZeroPacket: invalid packet\");\n\n        Buffer.buffer memory srcAddressBuffer;\n        srcAddressBuffer.init(sizeOfSrcAddress);\n        srcAddressBuffer.writeRawBytes(0, data, 42, sizeOfSrcAddress);\n\n        Buffer.buffer memory payloadBuffer;\n        if (payloadSize \u003e 0) {\n            payloadBuffer.init(payloadSize);\n            payloadBuffer.writeRawBytes(0, data, nonPayloadSize.add(32), payloadSize);\n        }\n\n        return LayerZeroPacket.Packet(srcChain, dstChain, nonce, dstAddress, srcAddressBuffer.buf, ulnAddress, payloadBuffer.buf);\n    }\n}\n"},"NonceContract.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.7.6;\n\nimport \"./ILayerZeroEndpoint.sol\";\n\ncontract NonceContract {\n    ILayerZeroEndpoint public immutable endpoint;\n    // outboundNonce = [dstChainId][remoteAddress + localAddress]\n    mapping(uint16 =\u003e mapping(bytes =\u003e uint64)) public outboundNonce;\n\n    constructor(address _endpoint) {\n        endpoint = ILayerZeroEndpoint(_endpoint);\n    }\n\n    function increment(uint16 _chainId, address _ua, bytes calldata _path) external returns (uint64) {\n        require(endpoint.getSendLibraryAddress(_ua) == msg.sender, \"NonceContract: msg.sender is not valid sendlibrary\");\n        return ++outboundNonce[_chainId][_path];\n    }\n}\n"},"Ownable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\nimport \"./Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    constructor () {\n        address msgSender = _msgSender();\n        _owner = msgSender;\n        emit OwnershipTransferred(address(0), msgSender);\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        emit OwnershipTransferred(_owner, address(0));\n        _owner = address(0);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        emit OwnershipTransferred(_owner, newOwner);\n        _owner = newOwner;\n    }\n}\n"},"ReentrancyGuard.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n    // Booleans are more expensive than uint256 or any type that takes up a full\n    // word because each write operation emits an extra SLOAD to first read the\n    // slot\u0027s contents, replace the bits taken up by the boolean, and then write\n    // back. This is the compiler\u0027s defense against contract upgrades and\n    // pointer aliasing, and it cannot be disabled.\n\n    // The values being non-zero value makes deployment a bit more expensive,\n    // but in exchange the refund on every call to nonReentrant will be lower in\n    // amount. Since refunds are capped to a percentage of the total\n    // transaction\u0027s gas, it is best to keep them low in cases like this one, to\n    // increase the likelihood of the full refund coming into effect.\n    uint256 private constant _NOT_ENTERED = 1;\n    uint256 private constant _ENTERED = 2;\n\n    uint256 private _status;\n\n    constructor () {\n        _status = _NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Calling a `nonReentrant` function from another `nonReentrant`\n     * function is not supported. It is possible to prevent this from happening\n     * by making the `nonReentrant` function external, and make it call a\n     * `private` function that does the actual work.\n     */\n    modifier nonReentrant() {\n        // On the first call to nonReentrant, _notEntered will be true\n        require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n        // Any calls to nonReentrant after this point will fail\n        _status = _ENTERED;\n\n        _;\n\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        _status = _NOT_ENTERED;\n    }\n}\n"},"SafeERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\nimport \"./IERC20.sol\";\nimport \"./SafeMath.sol\";\nimport \"./Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    using SafeMath for uint256;\n    using Address for address;\n\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n    }\n\n    /**\n     * @dev Deprecated. This function has issues similar to the ones found in\n     * {IERC20-approve}, and its usage is discouraged.\n     *\n     * Whenever possible, use {safeIncreaseAllowance} and\n     * {safeDecreaseAllowance} instead.\n     */\n    function safeApprove(IERC20 token, address spender, uint256 value) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // \u0027safeIncreaseAllowance\u0027 and \u0027safeDecreaseAllowance\u0027\n        // solhint-disable-next-line max-line-length\n        require((value == 0) || (token.allowance(address(this), spender) == 0),\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 newAllowance = token.allowance(address(this), spender).add(value);\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n    }\n\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity\u0027s return data size checking mechanism, since\n        // we\u0027re implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n        if (returndata.length \u003e 0) { // Return data is optional\n            // solhint-disable-next-line max-line-length\n            require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n        }\n    }\n}\n"},"SafeMath.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\n/**\n * @dev Wrappers over Solidity\u0027s arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it\u0027s recommended to use it always.\n */\nlibrary SafeMath {\n    /**\n     * @dev Returns the addition of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        uint256 c = a + b;\n        if (c \u003c a) return (false, 0);\n        return (true, c);\n    }\n\n    /**\n     * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        if (b \u003e a) return (false, 0);\n        return (true, a - b);\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        // Gas optimization: this is cheaper than requiring \u0027a\u0027 not being zero, but the\n        // benefit is lost if \u0027b\u0027 is also tested.\n        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n        if (a == 0) return (true, 0);\n        uint256 c = a * b;\n        if (c / a != b) return (false, 0);\n        return (true, c);\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a division by zero flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        if (b == 0) return (false, 0);\n        return (true, a / b);\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        if (b == 0) return (false, 0);\n        return (true, a % b);\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity\u0027s `+` operator.\n     *\n     * Requirements:\n     *\n     * - Addition cannot overflow.\n     */\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\n        uint256 c = a + b;\n        require(c \u003e= a, \"SafeMath: addition overflow\");\n        return c;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting on\n     * overflow (when the result is negative).\n     *\n     * Counterpart to Solidity\u0027s `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n        require(b \u003c= a, \"SafeMath: subtraction overflow\");\n        return a - b;\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity\u0027s `*` operator.\n     *\n     * Requirements:\n     *\n     * - Multiplication cannot overflow.\n     */\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (a == 0) return 0;\n        uint256 c = a * b;\n        require(c / a == b, \"SafeMath: multiplication overflow\");\n        return c;\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers, reverting on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity\u0027s `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\n        require(b \u003e 0, \"SafeMath: division by zero\");\n        return a / b;\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * reverting when dividing by zero.\n     *\n     * Counterpart to Solidity\u0027s `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n        require(b \u003e 0, \"SafeMath: modulo by zero\");\n        return a % b;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n     * overflow (when the result is negative).\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {trySub}.\n     *\n     * Counterpart to Solidity\u0027s `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b \u003c= a, errorMessage);\n        return a - b;\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n     * division by zero. The result is rounded towards zero.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryDiv}.\n     *\n     * Counterpart to Solidity\u0027s `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b \u003e 0, errorMessage);\n        return a / b;\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * reverting with custom message when dividing by zero.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryMod}.\n     *\n     * Counterpart to Solidity\u0027s `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b \u003e 0, errorMessage);\n        return a % b;\n    }\n}\n"},"UltraLightNodeV2.sol":{"content":"// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.7.6;\npragma abicoder v2;\n\nimport \"./Ownable.sol\";\nimport \"./SafeMath.sol\";\nimport \"./ReentrancyGuard.sol\";\nimport \"./IERC20.sol\";\nimport \"./SafeERC20.sol\";\n\nimport \"./ILayerZeroValidationLibrary.sol\";\nimport \"./ILayerZeroReceiver.sol\";\nimport \"./ILayerZeroTreasury.sol\";\nimport \"./ILayerZeroEndpoint.sol\";\n// v2\nimport \"./ILayerZeroMessagingLibraryV2.sol\";\nimport \"./ILayerZeroOracleV2.sol\";\nimport \"./ILayerZeroUltraLightNodeV2.sol\";\nimport \"./ILayerZeroRelayerV2.sol\";\nimport \"./NonceContract.sol\";\n\ncontract UltraLightNodeV2 is ILayerZeroMessagingLibraryV2, ILayerZeroUltraLightNodeV2, ReentrancyGuard, Ownable {\n    using SafeERC20 for IERC20;\n    using SafeMath for uint;\n\n    // Application config\n    uint public constant CONFIG_TYPE_INBOUND_PROOF_LIBRARY_VERSION = 1;\n    uint public constant CONFIG_TYPE_INBOUND_BLOCK_CONFIRMATIONS = 2;\n    uint public constant CONFIG_TYPE_RELAYER = 3;\n    uint public constant CONFIG_TYPE_OUTBOUND_PROOF_TYPE = 4;\n    uint public constant CONFIG_TYPE_OUTBOUND_BLOCK_CONFIRMATIONS = 5;\n    uint public constant CONFIG_TYPE_ORACLE = 6;\n\n    // Token and Contracts\n    IERC20 public layerZeroToken;\n    ILayerZeroTreasury public treasuryContract;\n\n    mapping(address =\u003e uint) public nativeFees;\n    uint public treasuryZROFees;\n\n    // User Application\n    mapping(address =\u003e mapping(uint16 =\u003e ApplicationConfiguration)) public appConfig; // app address =\u003e chainId =\u003e config\n    mapping(uint16 =\u003e ApplicationConfiguration) public defaultAppConfig; // default UA settings if no version specified\n    mapping(uint16 =\u003e mapping(uint16 =\u003e bytes)) public defaultAdapterParams;\n\n    // Validation\n    mapping(uint16 =\u003e mapping(uint16 =\u003e address)) public inboundProofLibrary; // chainId =\u003e library Id =\u003e inboundProofLibrary contract\n    mapping(uint16 =\u003e uint16) public maxInboundProofLibrary; // chainId =\u003e inboundProofLibrary\n    mapping(uint16 =\u003e mapping(uint16 =\u003e bool)) public supportedOutboundProof; // chainId =\u003e outboundProofType =\u003e enabled\n    mapping(uint16 =\u003e uint) public chainAddressSizeMap;\n    mapping(address =\u003e mapping(uint16 =\u003e mapping(bytes32 =\u003e mapping(bytes32 =\u003e uint)))) public hashLookup; //[oracle][srcChainId][blockhash][datahash] -\u003e confirmation\n    mapping(uint16 =\u003e bytes32) public ulnLookup; // remote ulns\n\n    ILayerZeroEndpoint public immutable endpoint;\n    uint16 public immutable localChainId;\n    NonceContract public immutable nonceContract;\n\n    constructor(address _endpoint, address _nonceContract, uint16 _localChainId) {\n        require(_endpoint != address(0x0), \"LayerZero: endpoint cannot be zero address\");\n        require(_nonceContract != address(0x0), \"LayerZero: nonceContract cannot be zero address\");\n        ILayerZeroEndpoint lzEndpoint = ILayerZeroEndpoint(_endpoint);\n        localChainId = _localChainId;\n        endpoint = lzEndpoint;\n        nonceContract = NonceContract(_nonceContract);\n    }\n\n    // only the endpoint can call SEND() and setConfig()\n    modifier onlyEndpoint() {\n        require(address(endpoint) == msg.sender, \"LayerZero: only endpoint\");\n        _;\n    }\n\n    //----------------------------------------------------------------------------------\n    // PROTOCOL\n    function validateTransactionProof(uint16 _srcChainId, address _dstAddress, uint _gasLimit, bytes32 _lookupHash, bytes32 _blockData, bytes calldata _transactionProof) external override {\n        // retrieve UA\u0027s configuration using the _dstAddress from arguments.\n        ApplicationConfiguration memory uaConfig = _getAppConfig(_srcChainId, _dstAddress);\n\n        // assert that the caller == UA\u0027s relayer\n        require(uaConfig.relayer == msg.sender, \"LayerZero: invalid relayer\");\n\n        LayerZeroPacket.Packet memory _packet;\n        uint remoteAddressSize = chainAddressSizeMap[_srcChainId];\n        require(remoteAddressSize != 0, \"LayerZero: incorrect remote address size\");\n        {\n            // assert that the data submitted by UA\u0027s oracle have no fewer confirmations than UA\u0027s configuration\n            uint storedConfirmations = hashLookup[uaConfig.oracle][_srcChainId][_lookupHash][_blockData];\n            require(storedConfirmations \u003e 0 \u0026\u0026 storedConfirmations \u003e= uaConfig.inboundBlockConfirmations, \"LayerZero: not enough block confirmations\");\n\n            // decode\n            address inboundProofLib = inboundProofLibrary[_srcChainId][uaConfig.inboundProofLibraryVersion];\n            _packet = ILayerZeroValidationLibrary(inboundProofLib).validateProof(_blockData, _transactionProof, remoteAddressSize);\n        }\n\n        // packet content assertion\n        require(ulnLookup[_srcChainId] == _packet.ulnAddress \u0026\u0026 _packet.ulnAddress != bytes32(0), \"LayerZero: invalid _packet.ulnAddress\");\n        require(_packet.srcChainId == _srcChainId, \"LayerZero: invalid srcChain Id\");\n        // failsafe because the remoteAddress size being passed into validateProof trims the address this should not hit\n        require(_packet.srcAddress.length == remoteAddressSize, \"LayerZero: invalid srcAddress size\");\n        require(_packet.dstChainId == localChainId, \"LayerZero: invalid dstChain Id\");\n        require(_packet.dstAddress == _dstAddress, \"LayerZero: invalid dstAddress\");\n\n        // if the dst is not a contract, then emit and return early. This will break inbound nonces, but this particular\n        // path is already broken and wont ever be able to deliver anyways\n        if (!_isContract(_dstAddress)) {\n            emit InvalidDst(_packet.srcChainId, _packet.srcAddress, _packet.dstAddress, _packet.nonce, keccak256(_packet.payload));\n            return;\n        }\n\n        bytes memory pathData = abi.encodePacked(_packet.srcAddress, _packet.dstAddress);\n        emit PacketReceived(_packet.srcChainId, _packet.srcAddress, _packet.dstAddress, _packet.nonce, keccak256(_packet.payload));\n        endpoint.receivePayload(_srcChainId, pathData, _dstAddress, _packet.nonce, _gasLimit, _packet.payload);\n    }\n\n    function send(address _ua, uint64, uint16 _dstChainId, bytes calldata _path, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable override onlyEndpoint {\n        address ua = _ua;\n        uint16 dstChainId = _dstChainId;\n        require(ulnLookup[dstChainId] != bytes32(0), \"LayerZero: dstChainId does not exist\");\n\n        bytes memory dstAddress;\n        uint64 nonce;\n        // code block for solving \u0027Stack Too Deep\u0027\n        {\n            uint chainAddressSize = chainAddressSizeMap[dstChainId];\n            // path = remoteAddress + localAddress\n            require(chainAddressSize != 0 \u0026\u0026 _path.length == 20 + chainAddressSize, \"LayerZero: incorrect remote address size\");\n            address srcInPath;\n            bytes memory path = _path; // copy to memory\n            assembly {\n                srcInPath := mload(add(add(path, 20), chainAddressSize)) // chainAddressSize + 20\n            }\n            require(ua == srcInPath, \"LayerZero: wrong path data\");\n            dstAddress = _path[0:chainAddressSize];\n            nonce = nonceContract.increment(dstChainId, ua, path);\n        }\n\n        bytes memory payload = _payload;\n        ApplicationConfiguration memory uaConfig = _getAppConfig(dstChainId, ua);\n\n        // compute all the fees\n        uint relayerFee = _handleRelayer(dstChainId, uaConfig, ua, payload.length, _adapterParams);\n        uint oracleFee = _handleOracle(dstChainId, uaConfig, ua);\n        uint nativeProtocolFee = _handleProtocolFee(relayerFee, oracleFee, ua, _zroPaymentAddress);\n\n        // total native fee, does not include ZRO protocol fee\n        uint totalNativeFee = relayerFee.add(oracleFee).add(nativeProtocolFee);\n\n        // assert the user has attached enough native token for this address\n        require(totalNativeFee \u003c= msg.value, \"LayerZero: not enough native for fees\");\n        // refund if they send too much\n        uint amount = msg.value.sub(totalNativeFee);\n        if (amount \u003e 0) {\n            (bool success, ) = _refundAddress.call{value: amount}(\"\");\n            require(success, \"LayerZero: failed to refund\");\n        }\n\n        // emit the data packet\n        bytes memory encodedPayload = abi.encodePacked(nonce, localChainId, ua, dstChainId, dstAddress, payload);\n        emit Packet(encodedPayload);\n    }\n\n    function _handleRelayer(uint16 _dstChainId, ApplicationConfiguration memory _uaConfig, address _ua, uint _payloadSize, bytes memory _adapterParams) internal returns (uint relayerFee) {\n        if (_adapterParams.length == 0) {\n            _adapterParams = defaultAdapterParams[_dstChainId][_uaConfig.outboundProofType];\n        }\n        address relayerAddress = _uaConfig.relayer;\n        ILayerZeroRelayerV2 relayer = ILayerZeroRelayerV2(relayerAddress);\n        relayerFee = relayer.assignJob(_dstChainId, _uaConfig.outboundProofType, _ua, _payloadSize, _adapterParams);\n\n        _creditNativeFee(relayerAddress, relayerFee);\n\n        // emit the param events\n        emit RelayerParams(_adapterParams, _uaConfig.outboundProofType);\n    }\n\n    function _handleOracle(uint16 _dstChainId, ApplicationConfiguration memory _uaConfig, address _ua) internal returns (uint oracleFee) {\n        address oracleAddress = _uaConfig.oracle;\n        oracleFee = ILayerZeroOracleV2(oracleAddress).assignJob(_dstChainId, _uaConfig.outboundProofType, _uaConfig.outboundBlockConfirmations, _ua);\n\n        _creditNativeFee(oracleAddress, oracleFee);\n    }\n\n    function _handleProtocolFee(uint _relayerFee, uint _oracleFee, address _ua, address _zroPaymentAddress) internal returns (uint protocolNativeFee) {\n        // if no ZRO token or not specifying a payment address, pay in native token\n        bool payInNative = _zroPaymentAddress == address(0x0) || address(layerZeroToken) == address(0x0);\n        uint protocolFee = treasuryContract.getFees(!payInNative, _relayerFee, _oracleFee);\n\n        if (protocolFee \u003e 0) {\n            if (payInNative) {\n                address treasuryAddress = address(treasuryContract);\n                _creditNativeFee(treasuryAddress, protocolFee);\n                protocolNativeFee = protocolFee;\n            } else {\n                // zro payment address must equal the ua or the tx.origin otherwise the transaction reverts\n                require(_zroPaymentAddress == _ua || _zroPaymentAddress == tx.origin, \"LayerZero: must be paid by sender or origin\");\n\n                // transfer the LayerZero token to this contract from the payee\n                layerZeroToken.safeTransferFrom(_zroPaymentAddress, address(this), protocolFee);\n\n                treasuryZROFees = treasuryZROFees.add(protocolFee);\n            }\n        }\n    }\n\n    function _creditNativeFee(address _receiver, uint _amount) internal {\n        nativeFees[_receiver] = nativeFees[_receiver].add(_amount);\n    }\n\n    // Can be called by any address to update a block header\n    // can only upload new block data or the same block data with more confirmations\n    function updateHash(uint16 _srcChainId, bytes32 _lookupHash, uint _confirmations, bytes32 _blockData) external override {\n        uint storedConfirmations = hashLookup[msg.sender][_srcChainId][_lookupHash][_blockData];\n\n        // if it has a record, requires a larger confirmation.\n        require(storedConfirmations \u003c _confirmations, \"LayerZero: oracle data can only update if it has more confirmations\");\n\n        // set the new information into storage\n        hashLookup[msg.sender][_srcChainId][_lookupHash][_blockData] = _confirmations;\n\n        emit HashReceived(_srcChainId, msg.sender, _lookupHash, _blockData, _confirmations);\n    }\n\n    //----------------------------------------------------------------------------------\n    // Other Library Interfaces\n\n    // default to DEFAULT setting if ZERO value\n    function getAppConfig(uint16 _remoteChainId, address _ua) external view override returns (ApplicationConfiguration memory) {\n        return _getAppConfig(_remoteChainId, _ua);\n    }\n\n    function _getAppConfig(uint16 _remoteChainId, address _ua) internal view returns (ApplicationConfiguration memory) {\n        ApplicationConfiguration memory config = appConfig[_ua][_remoteChainId];\n        ApplicationConfiguration storage defaultConfig = defaultAppConfig[_remoteChainId];\n\n        if (config.inboundProofLibraryVersion == 0) {\n            config.inboundProofLibraryVersion = defaultConfig.inboundProofLibraryVersion;\n        }\n\n        if (config.inboundBlockConfirmations == 0) {\n            config.inboundBlockConfirmations = defaultConfig.inboundBlockConfirmations;\n        }\n\n        if (config.relayer == address(0x0)) {\n            config.relayer = defaultConfig.relayer;\n        }\n\n        if (config.outboundProofType == 0) {\n            config.outboundProofType = defaultConfig.outboundProofType;\n        }\n\n        if (config.outboundBlockConfirmations == 0) {\n            config.outboundBlockConfirmations = defaultConfig.outboundBlockConfirmations;\n        }\n\n        if (config.oracle == address(0x0)) {\n            config.oracle = defaultConfig.oracle;\n        }\n\n        return config;\n    }\n\n    function setConfig(uint16 _remoteChainId, address _ua, uint _configType, bytes calldata _config) external override onlyEndpoint {\n        ApplicationConfiguration storage uaConfig = appConfig[_ua][_remoteChainId];\n        if (_configType == CONFIG_TYPE_INBOUND_PROOF_LIBRARY_VERSION) {\n            uint16 inboundProofLibraryVersion = abi.decode(_config, (uint16));\n            require(inboundProofLibraryVersion \u003c= maxInboundProofLibrary[_remoteChainId], \"LayerZero: invalid inbound proof library version\");\n            uaConfig.inboundProofLibraryVersion = inboundProofLibraryVersion;\n        } else if (_configType == CONFIG_TYPE_INBOUND_BLOCK_CONFIRMATIONS) {\n            uint64 blockConfirmations = abi.decode(_config, (uint64));\n            uaConfig.inboundBlockConfirmations = blockConfirmations;\n        } else if (_configType == CONFIG_TYPE_RELAYER) {\n            address relayer = abi.decode(_config, (address));\n            uaConfig.relayer = relayer;\n        } else if (_configType == CONFIG_TYPE_OUTBOUND_PROOF_TYPE) {\n            uint16 outboundProofType = abi.decode(_config, (uint16));\n            require(supportedOutboundProof[_remoteChainId][outboundProofType] || outboundProofType == 0, \"LayerZero: invalid outbound proof type\");\n            uaConfig.outboundProofType = outboundProofType;\n        } else if (_configType == CONFIG_TYPE_OUTBOUND_BLOCK_CONFIRMATIONS) {\n            uint64 blockConfirmations = abi.decode(_config, (uint64));\n            uaConfig.outboundBlockConfirmations = blockConfirmations;\n        } else if (_configType == CONFIG_TYPE_ORACLE) {\n            address oracle = abi.decode(_config, (address));\n            uaConfig.oracle = oracle;\n        } else {\n            revert(\"LayerZero: Invalid config type\");\n        }\n\n        emit AppConfigUpdated(_ua, _configType, _config);\n    }\n\n    function getConfig(uint16 _remoteChainId, address _ua, uint _configType) external view override returns (bytes memory) {\n        ApplicationConfiguration storage uaConfig = appConfig[_ua][_remoteChainId];\n\n        if (_configType == CONFIG_TYPE_INBOUND_PROOF_LIBRARY_VERSION) {\n            if (uaConfig.inboundProofLibraryVersion == 0) {\n                return abi.encode(defaultAppConfig[_remoteChainId].inboundProofLibraryVersion);\n            }\n            return abi.encode(uaConfig.inboundProofLibraryVersion);\n        } else if (_configType == CONFIG_TYPE_INBOUND_BLOCK_CONFIRMATIONS) {\n            if (uaConfig.inboundBlockConfirmations == 0) {\n                return abi.encode(defaultAppConfig[_remoteChainId].inboundBlockConfirmations);\n            }\n            return abi.encode(uaConfig.inboundBlockConfirmations);\n        } else if (_configType == CONFIG_TYPE_RELAYER) {\n            if (uaConfig.relayer == address(0x0)) {\n                return abi.encode(defaultAppConfig[_remoteChainId].relayer);\n            }\n            return abi.encode(uaConfig.relayer);\n        } else if (_configType == CONFIG_TYPE_OUTBOUND_PROOF_TYPE) {\n            if (uaConfig.outboundProofType == 0) {\n                return abi.encode(defaultAppConfig[_remoteChainId].outboundProofType);\n            }\n            return abi.encode(uaConfig.outboundProofType);\n        } else if (_configType == CONFIG_TYPE_OUTBOUND_BLOCK_CONFIRMATIONS) {\n            if (uaConfig.outboundBlockConfirmations == 0) {\n                return abi.encode(defaultAppConfig[_remoteChainId].outboundBlockConfirmations);\n            }\n            return abi.encode(uaConfig.outboundBlockConfirmations);\n        } else if (_configType == CONFIG_TYPE_ORACLE) {\n            if (uaConfig.oracle == address(0x0)) {\n                return abi.encode(defaultAppConfig[_remoteChainId].oracle);\n            }\n            return abi.encode(uaConfig.oracle);\n        } else {\n            revert(\"LayerZero: Invalid config type\");\n        }\n    }\n\n    // returns the native fee the UA pays to cover fees\n    function estimateFees(uint16 _dstChainId, address _ua, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParams) external view override returns (uint nativeFee, uint zroFee) {\n        ApplicationConfiguration memory uaConfig = _getAppConfig(_dstChainId, _ua);\n\n        // Relayer Fee\n        bytes memory adapterParams;\n        if (_adapterParams.length \u003e 0) {\n            adapterParams = _adapterParams;\n        } else {\n            adapterParams = defaultAdapterParams[_dstChainId][uaConfig.outboundProofType];\n        }\n        uint relayerFee = ILayerZeroRelayerV2(uaConfig.relayer).getFee(_dstChainId, uaConfig.outboundProofType, _ua, _payload.length, adapterParams);\n\n        // Oracle Fee\n        address ua = _ua; // stack too deep\n        uint oracleFee = ILayerZeroOracleV2(uaConfig.oracle).getFee(_dstChainId, uaConfig.outboundProofType, uaConfig.outboundBlockConfirmations, ua);\n\n        // LayerZero Fee\n        uint protocolFee = treasuryContract.getFees(_payInZRO, relayerFee, oracleFee);\n        _payInZRO ? zroFee = protocolFee : nativeFee = protocolFee;\n\n        // return the sum of fees\n        nativeFee = nativeFee.add(relayerFee).add(oracleFee);\n    }\n\n    //---------------------------------------------------------------------------\n    // Claim Fees\n\n    // universal withdraw ZRO token function\n    function withdrawZRO(address _to, uint _amount) external override nonReentrant {\n        require(msg.sender == address(treasuryContract), \"LayerZero: only treasury\");\n        treasuryZROFees = treasuryZROFees.sub(_amount);\n        layerZeroToken.safeTransfer(_to, _amount);\n        emit WithdrawZRO(msg.sender, _to, _amount);\n    }\n\n    // universal withdraw native token function.\n    // the source contract should perform all the authentication control\n    function withdrawNative(address payable _to, uint _amount) external override nonReentrant {\n        require(_to != address(0x0), \"LayerZero: _to cannot be zero address\");\n        nativeFees[msg.sender] = nativeFees[msg.sender].sub(_amount);\n\n        (bool success, ) = _to.call{value: _amount}(\"\");\n        require(success, \"LayerZero: withdraw failed\");\n        emit WithdrawNative(msg.sender, _to, _amount);\n    }\n\n    //---------------------------------------------------------------------------\n    // Owner calls, configuration only.\n    function setLayerZeroToken(address _layerZeroToken) external onlyOwner {\n        require(_layerZeroToken != address(0x0), \"LayerZero: _layerZeroToken cannot be zero address\");\n        layerZeroToken = IERC20(_layerZeroToken);\n        emit SetLayerZeroToken(_layerZeroToken);\n    }\n\n    function setTreasury(address _treasury) external onlyOwner {\n        require(_treasury != address(0x0), \"LayerZero: treasury cannot be zero address\");\n        treasuryContract = ILayerZeroTreasury(_treasury);\n        emit SetTreasury(_treasury);\n    }\n\n    function addInboundProofLibraryForChain(uint16 _chainId, address _library) external onlyOwner {\n        require(_library != address(0x0), \"LayerZero: library cannot be zero address\");\n        uint16 libId = maxInboundProofLibrary[_chainId];\n        require(libId \u003c 65535, \"LayerZero: can not add new library\");\n        maxInboundProofLibrary[_chainId] = ++libId;\n        inboundProofLibrary[_chainId][libId] = _library;\n        emit AddInboundProofLibraryForChain(_chainId, _library);\n    }\n\n    function enableSupportedOutboundProof(uint16 _chainId, uint16 _proofType) external onlyOwner {\n        supportedOutboundProof[_chainId][_proofType] = true;\n        emit EnableSupportedOutboundProof(_chainId, _proofType);\n    }\n\n    function setDefaultConfigForChainId(uint16 _chainId, uint16 _inboundProofLibraryVersion, uint64 _inboundBlockConfirmations, address _relayer, uint16 _outboundProofType, uint64 _outboundBlockConfirmations, address _oracle) external onlyOwner {\n        require(_inboundProofLibraryVersion \u003c= maxInboundProofLibrary[_chainId] \u0026\u0026 _inboundProofLibraryVersion \u003e 0, \"LayerZero: invalid inbound proof library version\");\n        require(_inboundBlockConfirmations \u003e 0, \"LayerZero: invalid inbound block confirmation\");\n        require(_relayer != address(0x0), \"LayerZero: invalid relayer address\");\n        require(supportedOutboundProof[_chainId][_outboundProofType], \"LayerZero: invalid outbound proof type\");\n        require(_outboundBlockConfirmations \u003e 0, \"LayerZero: invalid outbound block confirmation\");\n        require(_oracle != address(0x0), \"LayerZero: invalid oracle address\");\n        defaultAppConfig[_chainId] = ApplicationConfiguration(_inboundProofLibraryVersion, _inboundBlockConfirmations, _relayer, _outboundProofType, _outboundBlockConfirmations, _oracle);\n        emit SetDefaultConfigForChainId(_chainId, _inboundProofLibraryVersion, _inboundBlockConfirmations, _relayer, _outboundProofType, _outboundBlockConfirmations, _oracle);\n    }\n\n    function setDefaultAdapterParamsForChainId(uint16 _chainId, uint16 _proofType, bytes calldata _adapterParams) external onlyOwner {\n        defaultAdapterParams[_chainId][_proofType] = _adapterParams;\n        emit SetDefaultAdapterParamsForChainId(_chainId, _proofType, _adapterParams);\n    }\n\n    function setRemoteUln(uint16 _remoteChainId, bytes32 _remoteUln) external onlyOwner {\n        require(ulnLookup[_remoteChainId] == bytes32(0), \"LayerZero: remote uln already set\");\n        ulnLookup[_remoteChainId] = _remoteUln;\n        emit SetRemoteUln(_remoteChainId, _remoteUln);\n    }\n\n    function setChainAddressSize(uint16 _chainId, uint _size) external onlyOwner {\n        require(chainAddressSizeMap[_chainId] == 0, \"LayerZero: remote chain address size already set\");\n        chainAddressSizeMap[_chainId] = _size;\n        emit SetChainAddressSize(_chainId, _size);\n    }\n\n    //----------------------------------------------------------------------------------\n    // view functions\n\n    function accruedNativeFee(address _address) external view override returns (uint) {\n        return nativeFees[_address];\n    }\n\n    function getOutboundNonce(uint16 _chainId, bytes calldata _path) external view override returns (uint64) {\n        return nonceContract.outboundNonce(_chainId, _path);\n    }\n\n    function _isContract(address addr) internal view returns (bool) {\n        uint size;\n        assembly {\n            size := extcodesize(addr)\n        }\n        return size != 0;\n    }\n}\n"}} < 

UltraLightNodeV2 ABI

[{"inputs":[{"internalType":"address","name":"_endpoint","type":"address"},{"internalType":"address","name":"_nonceContract","type":"address"},{"internalType":"uint16","name":"_localChainId","type":"uint16"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"chainId","type":"uint16"},{"indexed":false,"internalType":"address","name":"lib","type":"address"}],"name":"AddInboundProofLibraryForChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userApplication","type":"address"},{"indexed":true,"internalType":"uint256","name":"configType","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"newConfig","type":"bytes"}],"name":"AppConfigUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"chainId","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"proofType","type":"uint16"}],"name":"EnableSupportedOutboundProof","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"srcChainId","type":"uint16"},{"indexed":true,"internalType":"address","name":"oracle","type":"address"},{"indexed":false,"internalType":"bytes32","name":"lookupHash","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"blockData","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"confirmations","type":"uint256"}],"name":"HashReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"srcAddress","type":"bytes"},{"indexed":true,"internalType":"address","name":"dstAddress","type":"address"},{"indexed":false,"internalType":"uint64","name":"nonce","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"}],"name":"InvalidDst","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"payload","type":"bytes"}],"name":"Packet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"srcAddress","type":"bytes"},{"indexed":true,"internalType":"address","name":"dstAddress","type":"address"},{"indexed":false,"internalType":"uint64","name":"nonce","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"}],"name":"PacketReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"adapterParams","type":"bytes"},{"indexed":false,"internalType":"uint16","name":"outboundProofType","type":"uint16"}],"name":"RelayerParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"chainId","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"size","type":"uint256"}],"name":"SetChainAddressSize","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"chainId","type":"uint16"},{"indexed":true,"internalType":"uint16","name":"proofType","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"adapterParams","type":"bytes"}],"name":"SetDefaultAdapterParamsForChainId","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"chainId","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"inboundProofLib","type":"uint16"},{"indexed":false,"internalType":"uint64","name":"inboundBlockConfirm","type":"uint64"},{"indexed":false,"internalType":"address","name":"relayer","type":"address"},{"indexed":false,"internalType":"uint16","name":"outboundProofType","type":"uint16"},{"indexed":false,"internalType":"uint64","name":"outboundBlockConfirm","type":"uint64"},{"indexed":false,"internalType":"address","name":"oracle","type":"address"}],"name":"SetDefaultConfigForChainId","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"}],"name":"SetLayerZeroToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"chainId","type":"uint16"},{"indexed":false,"internalType":"bytes32","name":"uln","type":"bytes32"}],"name":"SetRemoteUln","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"treasuryAddress","type":"address"}],"name":"SetTreasury","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"msgSender","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawNative","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"msgSender","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawZRO","type":"event"},{"inputs":[],"name":"CONFIG_TYPE_INBOUND_BLOCK_CONFIRMATIONS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONFIG_TYPE_INBOUND_PROOF_LIBRARY_VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONFIG_TYPE_ORACLE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONFIG_TYPE_OUTBOUND_BLOCK_CONFIRMATIONS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONFIG_TYPE_OUTBOUND_PROOF_TYPE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONFIG_TYPE_RELAYER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"accruedNativeFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"address","name":"_library","type":"address"}],"name":"addInboundProofLibraryForChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"appConfig","outputs":[{"internalType":"uint16","name":"inboundProofLibraryVersion","type":"uint16"},{"internalType":"uint64","name":"inboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"relayer","type":"address"},{"internalType":"uint16","name":"outboundProofType","type":"uint16"},{"internalType":"uint64","name":"outboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"oracle","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"chainAddressSizeMap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"defaultAdapterParams","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"defaultAppConfig","outputs":[{"internalType":"uint16","name":"inboundProofLibraryVersion","type":"uint16"},{"internalType":"uint64","name":"inboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"relayer","type":"address"},{"internalType":"uint16","name":"outboundProofType","type":"uint16"},{"internalType":"uint64","name":"outboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"oracle","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint16","name":"_proofType","type":"uint16"}],"name":"enableSupportedOutboundProof","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"address","name":"_ua","type":"address"},{"internalType":"bytes","name":"_payload","type":"bytes"},{"internalType":"bool","name":"_payInZRO","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateFees","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"address","name":"_ua","type":"address"}],"name":"getAppConfig","outputs":[{"components":[{"internalType":"uint16","name":"inboundProofLibraryVersion","type":"uint16"},{"internalType":"uint64","name":"inboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"relayer","type":"address"},{"internalType":"uint16","name":"outboundProofType","type":"uint16"},{"internalType":"uint64","name":"outboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"oracle","type":"address"}],"internalType":"struct ILayerZeroUltraLightNodeV2.ApplicationConfiguration","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"address","name":"_ua","type":"address"},{"internalType":"uint256","name":"_configType","type":"uint256"}],"name":"getConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"bytes","name":"_path","type":"bytes"}],"name":"getOutboundNonce","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"hashLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"inboundProofLibrary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"layerZeroToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"localChainId","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"maxInboundProofLibrary","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nativeFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nonceContract","outputs":[{"internalType":"contract NonceContract","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_ua","type":"address"},{"internalType":"uint64","name":"","type":"uint64"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_path","type":"bytes"},{"internalType":"bytes","name":"_payload","type":"bytes"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"send","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_size","type":"uint256"}],"name":"setChainAddressSize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"address","name":"_ua","type":"address"},{"internalType":"uint256","name":"_configType","type":"uint256"},{"internalType":"bytes","name":"_config","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint16","name":"_proofType","type":"uint16"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"setDefaultAdapterParamsForChainId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint16","name":"_inboundProofLibraryVersion","type":"uint16"},{"internalType":"uint64","name":"_inboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"_relayer","type":"address"},{"internalType":"uint16","name":"_outboundProofType","type":"uint16"},{"internalType":"uint64","name":"_outboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"_oracle","type":"address"}],"name":"setDefaultConfigForChainId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_layerZeroToken","type":"address"}],"name":"setLayerZeroToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"bytes32","name":"_remoteUln","type":"bytes32"}],"name":"setRemoteUln","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"supportedOutboundProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryContract","outputs":[{"internalType":"contract ILayerZeroTreasury","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasuryZROFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"ulnLookup","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes32","name":"_lookupHash","type":"bytes32"},{"internalType":"uint256","name":"_confirmations","type":"uint256"},{"internalType":"bytes32","name":"_blockData","type":"bytes32"}],"name":"updateHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"address","name":"_dstAddress","type":"address"},{"internalType":"uint256","name":"_gasLimit","type":"uint256"},{"internalType":"bytes32","name":"_lookupHash","type":"bytes32"},{"internalType":"bytes32","name":"_blockData","type":"bytes32"},{"internalType":"bytes","name":"_transactionProof","type":"bytes"}],"name":"validateTransactionProof","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawNative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawZRO","outputs":[],"stateMutability":"nonpayable","type":"function"}]
[{"inputs":[{"internalType":"address","name":"_endpoint","type":"address"},{"internalType":"address","name":"_nonceContract","type":"address"},{"internalType":"uint16","name":"_localChainId","type":"uint16"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"chainId","type":"uint16"},{"indexed":false,"internalType":"address","name":"lib","type":"address"}],"name":"AddInboundProofLibraryForChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userApplication","type":"address"},{"indexed":true,"internalType":"uint256","name":"configType","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"newConfig","type":"bytes"}],"name":"AppConfigUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"chainId","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"proofType","type":"uint16"}],"name":"EnableSupportedOutboundProof","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"srcChainId","type":"uint16"},{"indexed":true,"internalType":"address","name":"oracle","type":"address"},{"indexed":false,"internalType":"bytes32","name":"lookupHash","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"blockData","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"confirmations","type":"uint256"}],"name":"HashReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"srcAddress","type":"bytes"},{"indexed":true,"internalType":"address","name":"dstAddress","type":"address"},{"indexed":false,"internalType":"uint64","name":"nonce","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"}],"name":"InvalidDst","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"payload","type":"bytes"}],"name":"Packet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"srcAddress","type":"bytes"},{"indexed":true,"internalType":"address","name":"dstAddress","type":"address"},{"indexed":false,"internalType":"uint64","name":"nonce","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"}],"name":"PacketReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"adapterParams","type":"bytes"},{"indexed":false,"internalType":"uint16","name":"outboundProofType","type":"uint16"}],"name":"RelayerParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"chainId","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"size","type":"uint256"}],"name":"SetChainAddressSize","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"chainId","type":"uint16"},{"indexed":true,"internalType":"uint16","name":"proofType","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"adapterParams","type":"bytes"}],"name":"SetDefaultAdapterParamsForChainId","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"chainId","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"inboundProofLib","type":"uint16"},{"indexed":false,"internalType":"uint64","name":"inboundBlockConfirm","type":"uint64"},{"indexed":false,"internalType":"address","name":"relayer","type":"address"},{"indexed":false,"internalType":"uint16","name":"outboundProofType","type":"uint16"},{"indexed":false,"internalType":"uint64","name":"outboundBlockConfirm","type":"uint64"},{"indexed":false,"internalType":"address","name":"oracle","type":"address"}],"name":"SetDefaultConfigForChainId","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"}],"name":"SetLayerZeroToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"chainId","type":"uint16"},{"indexed":false,"internalType":"bytes32","name":"uln","type":"bytes32"}],"name":"SetRemoteUln","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"treasuryAddress","type":"address"}],"name":"SetTreasury","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"msgSender","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawNative","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"msgSender","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawZRO","type":"event"},{"inputs":[],"name":"CONFIG_TYPE_INBOUND_BLOCK_CONFIRMATIONS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONFIG_TYPE_INBOUND_PROOF_LIBRARY_VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONFIG_TYPE_ORACLE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONFIG_TYPE_OUTBOUND_BLOCK_CONFIRMATIONS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONFIG_TYPE_OUTBOUND_PROOF_TYPE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONFIG_TYPE_RELAYER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"accruedNativeFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"address","name":"_library","type":"address"}],"name":"addInboundProofLibraryForChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"appConfig","outputs":[{"internalType":"uint16","name":"inboundProofLibraryVersion","type":"uint16"},{"internalType":"uint64","name":"inboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"relayer","type":"address"},{"internalType":"uint16","name":"outboundProofType","type":"uint16"},{"internalType":"uint64","name":"outboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"oracle","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"chainAddressSizeMap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"defaultAdapterParams","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"defaultAppConfig","outputs":[{"internalType":"uint16","name":"inboundProofLibraryVersion","type":"uint16"},{"internalType":"uint64","name":"inboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"relayer","type":"address"},{"internalType":"uint16","name":"outboundProofType","type":"uint16"},{"internalType":"uint64","name":"outboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"oracle","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint16","name":"_proofType","type":"uint16"}],"name":"enableSupportedOutboundProof","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"address","name":"_ua","type":"address"},{"internalType":"bytes","name":"_payload","type":"bytes"},{"internalType":"bool","name":"_payInZRO","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateFees","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"address","name":"_ua","type":"address"}],"name":"getAppConfig","outputs":[{"components":[{"internalType":"uint16","name":"inboundProofLibraryVersion","type":"uint16"},{"internalType":"uint64","name":"inboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"relayer","type":"address"},{"internalType":"uint16","name":"outboundProofType","type":"uint16"},{"internalType":"uint64","name":"outboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"oracle","type":"address"}],"internalType":"struct ILayerZeroUltraLightNodeV2.ApplicationConfiguration","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"address","name":"_ua","type":"address"},{"internalType":"uint256","name":"_configType","type":"uint256"}],"name":"getConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"bytes","name":"_path","type":"bytes"}],"name":"getOutboundNonce","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"hashLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"inboundProofLibrary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"layerZeroToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"localChainId","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"maxInboundProofLibrary","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nativeFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nonceContract","outputs":[{"internalType":"contract NonceContract","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_ua","type":"address"},{"internalType":"uint64","name":"","type":"uint64"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_path","type":"bytes"},{"internalType":"bytes","name":"_payload","type":"bytes"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"send","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_size","type":"uint256"}],"name":"setChainAddressSize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"address","name":"_ua","type":"address"},{"internalType":"uint256","name":"_configType","type":"uint256"},{"internalType":"bytes","name":"_config","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint16","name":"_proofType","type":"uint16"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"setDefaultAdapterParamsForChainId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint16","name":"_inboundProofLibraryVersion","type":"uint16"},{"internalType":"uint64","name":"_inboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"_relayer","type":"address"},{"internalType":"uint16","name":"_outboundProofType","type":"uint16"},{"internalType":"uint64","name":"_outboundBlockConfirmations","type":"uint64"},{"internalType":"address","name":"_oracle","type":"address"}],"name":"setDefaultConfigForChainId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_layerZeroToken","type":"address"}],"name":"setLayerZeroToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"bytes32","name":"_remoteUln","type":"bytes32"}],"name":"setRemoteUln","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"supportedOutboundProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryContract","outputs":[{"internalType":"contract ILayerZeroTreasury","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasuryZROFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"ulnLookup","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes32","name":"_lookupHash","type":"bytes32"},{"internalType":"uint256","name":"_confirmations","type":"uint256"},{"internalType":"bytes32","name":"_blockData","type":"bytes32"}],"name":"updateHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"address","name":"_dstAddress","type":"address"},{"internalType":"uint256","name":"_gasLimit","type":"uint256"},{"internalType":"bytes32","name":"_lookupHash","type":"bytes32"},{"internalType":"bytes32","name":"_blockData","type":"bytes32"},{"internalType":"bytes","name":"_transactionProof","type":"bytes"}],"name":"validateTransactionProof","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawNative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawZRO","outputs":[],"stateMutability":"nonpayable","type":"function"}]

UltraLightNodeV2 Bytecode

60e06040523480156200001157600080fd5b5060405162005ad838038062005ad883398101604081905262000034916200013f565b60016000908155620000456200011e565b600180546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506001600160a01b038316620000c55760405162461bcd60e51b8152600401620000bc9062000191565b60405180910390fd5b6001600160a01b038216620000ee5760405162461bcd60e51b8152600401620000bc90620001db565b60f01b6001600160f01b03191660a052606091821b6001600160601b0319908116608052911b1660c0526200022a565b3390565b80516001600160a01b03811681146200013a57600080fd5b919050565b60008060006060848603121562000154578283fd5b6200015f8462000122565b92506200016f6020850162000122565b9150604084015161ffff8116811462000186578182fd5b809150509250925092565b6020808252602a908201527f4c617965725a65726f3a20656e64706f696e742063616e6e6f74206265207a65604082015269726f206164647265737360b01b606082015260800190565b6020808252602f908201527f4c617965725a65726f3a206e6f6e6365436f6e74726163742063616e6e6f742060408201526e6265207a65726f206164647265737360881b606082015260800190565b60805160601c60a05160f01c60c05160601c615855620002836000398061084d52806110ee5280612991525080611305528061189552806126ba525080610f2052806118b9528061287b5280612fe852506158556000f3fe6080604052600436106102e75760003560e01c80638317814a11610184578063d543c774116100d6578063ed28580a1161008a578063f47a5feb11610064578063f47a5feb146107f6578063f58589a21461080b578063f8e1734c1461082b576102e7565b8063ed28580a14610796578063f0f44260146107b6578063f2fde38b146107d6576102e7565b8063ddfdef5a116100bb578063ddfdef5a14610736578063ea216c2114610756578063eb0d4c3114610776576102e7565b8063d543c774146106e9578063db00719b14610716576102e7565b8063959f594311610138578063b77d22ad11610112578063b77d22ad14610687578063b8e7e3e01461069c578063b9a99bed146106bc576102e7565b8063959f59431461061a578063987fa2d51461063a578063a46622221461065a576102e7565b806387078f9f1161016957806387078f9f146105d05780638da5cb5b146105f0578063904d3b8d14610605576102e7565b80638317814a146105905780638525b711146105b0576102e7565b806352d2871f1161023d5780636a14ac82116101f1578063759c5b3b116101cb578063759c5b3b1461053b5780638140666e1461055b5780638207f79d14610570576102e7565b80636a14ac82146104e6578063704316e514610506578063715018a614610526576102e7565b80635b056da5116102225780635b056da51461048f5780635e280f11146104b157806369412bfa146104c6576102e7565b806352d2871f1461044f57806352d3b5001461046f576102e7565b80632cfacb061161029f57806340a7bb101161027957806340a7bb10146103f957806349148c37146104275780634d3a0f7c1461043c576102e7565b80632cfacb06146103905780632f813464146103b257806331bd2430146103e4576102e7565b806307b9ca7c116102d057806307b9ca7c1461033957806318da00111461034e5780632a819bbf14610363576102e7565b806302bd9743146102ec57806307b18bde14610317575b600080fd5b3480156102f857600080fd5b5061030161084b565b60405161030e91906149ba565b60405180910390f35b34801561032357600080fd5b50610337610332366004614168565b61086f565b005b34801561034557600080fd5b50610301610a2d565b34801561035a57600080fd5b50610301610a49565b34801561036f57600080fd5b5061038361037e3660046146ae565b610a65565b60405161030e9190614a5c565b34801561039c57600080fd5b506103a5610b27565b60405161030e91906149fe565b3480156103be57600080fd5b506103d26103cd3660046143ee565b610b2c565b60405161030e96959493929190615693565b3480156103f057600080fd5b506103a5610bbd565b34801561040557600080fd5b50610419610414366004614437565b610bc2565b60405161030e9291906156e9565b34801561043357600080fd5b506103a5610f19565b61033761044a366004614222565b610f1e565b34801561045b57600080fd5b5061038361046a3660046144e2565b61139e565b34801561047b57600080fd5b5061033761048a36600461414c565b611763565b34801561049b57600080fd5b506104a4611893565b60405161030e919061552a565b3480156104bd57600080fd5b506103016118b7565b3480156104d257600080fd5b506103a56104e136600461414c565b6118db565b3480156104f257600080fd5b5061033761050136600461472e565b611907565b34801561051257600080fd5b50610337610521366004614621565b611ceb565b34801561053257600080fd5b50610337611db0565b34801561054757600080fd5b506103a56105563660046141cb565b611ead565b34801561056757600080fd5b506103a5611ed9565b34801561057c57600080fd5b5061033761058b36600461440a565b611ede565b34801561059c57600080fd5b506103376105ab3660046146cb565b6120ab565b3480156105bc57600080fd5b506103376105cb366004614210565b6121ae565b3480156105dc57600080fd5b506103376105eb366004614604565b6122e4565b3480156105fc57600080fd5b506103016123f5565b34801561061157600080fd5b506103a5612411565b34801561062657600080fd5b506103a56106353660046143ee565b612416565b34801561064657600080fd5b50610337610655366004614522565b612428565b34801561066657600080fd5b5061067a61067536600461440a565b612924565b60405161030e91906154b1565b34801561069357600080fd5b506103a5612936565b3480156106a857600080fd5b506104a46106b73660046143ee565b61293b565b3480156106c857600080fd5b506106dc6106d736600461465b565b612951565b60405161030e91906156f7565b3480156106f557600080fd5b506107096107043660046146ae565b612a22565b60405161030e91906149db565b34801561072257600080fd5b506103016107313660046146ae565b612a42565b34801561074257600080fd5b506103d2610751366004614193565b612a75565b34801561076257600080fd5b506103a56107713660046143ee565b612b11565b34801561078257600080fd5b506103376107913660046146ae565b612b23565b3480156107a257600080fd5b506103376107b1366004614604565b612c2b565b3480156107c257600080fd5b506103376107d136600461414c565b612d30565b3480156107e257600080fd5b506103376107f136600461414c565b612e60565b34801561080257600080fd5b506103a5612fce565b34801561081757600080fd5b506103a561082636600461414c565b612fd4565b34801561083757600080fd5b50610337610846366004614593565b612fe6565b7f000000000000000000000000000000000000000000000000000000000000000081565b600260005414156108c7576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260005573ffffffffffffffffffffffffffffffffffffffff82166109085760405162461bcd60e51b81526004016108ff90614c80565b60405180910390fd5b33600090815260046020526040902054610922908261338e565b3360009081526004602052604080822092909255905173ffffffffffffffffffffffffffffffffffffffff841690839061095b906148ef565b60006040518083038185875af1925050503d8060008114610998576040519150601f19603f3d011682016040523d82523d6000602084013e61099d565b606091505b50509050806109be5760405162461bcd60e51b81526004016108ff90614bec565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f3bfd26201736b5cb14a562ab3cfc2bef76901726e3a78483d6288af47131e1d984604051610a1b91906149fe565b60405180910390a35050600160005550565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b60086020908152600092835260408084208252918352918190208054825160026001831615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190921691909104601f810185900485028201850190935282815292909190830182828015610b1f5780601f10610af457610100808354040283529160200191610b1f565b820191906000526020600020905b815481529060010190602001808311610b0257829003601f168201915b505050505081565b600381565b6007602052600090815260409020805460019091015461ffff8083169267ffffffffffffffff62010000820481169373ffffffffffffffffffffffffffffffffffffffff6a010000000000000000000084048116947e010000000000000000000000000000000000000000000000000000000000009094049093169291811691680100000000000000009091041686565b600681565b6000806000610bd18a8a6133eb565b905060608415610c1a5785858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929350610ce992505050565b61ffff808c166000908152600860209081526040808320606087015190941683529281529082902080548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018616150201909316929092049182018490048402810184019094528084529091830182828015610ce15780601f10610cb657610100808354040283529160200191610ce1565b820191906000526020600020905b815481529060010190602001808311610cc457829003601f168201915b505050505090505b6000826040015173ffffffffffffffffffffffffffffffffffffffff1663c03f15298d85606001518e8e8e9050876040518663ffffffff1660e01b8152600401610d37959493929190615607565b60206040518083038186803b158015610d4f57600080fd5b505afa158015610d63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8791906147c3565b905060008b905060008460a0015173ffffffffffffffffffffffffffffffffffffffff16635553fb8e8f87606001518860800151866040518563ffffffff1660e01b8152600401610ddb9493929190615650565b60206040518083038186803b158015610df357600080fd5b505afa158015610e07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2b91906147c3565b6003546040517f5cbbbd7500000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690635cbbbd7590610e8b908e90889087906004016149e6565b60206040518083038186803b158015610ea357600080fd5b505afa158015610eb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edb91906147c3565b90508a610eeb5780975087610ef0565b809650865b50610f0582610eff8a876135f7565b906135f7565b975050505050505097509795505050505050565b600281565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610f735760405162461bcd60e51b81526004016108ff906152a9565b61ffff89166000908152600e60205260409020548b908a90610fa75760405162461bcd60e51b81526004016108ff90614b21565b61ffff81166000908152600c6020526040812054606091908015801590610fd05750601481018c145b610fec5760405162461bcd60e51b81526004016108ff9061533d565b6000808e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505050838101601401519250905073ffffffffffffffffffffffffffffffffffffffff878116908316146110685760405162461bcd60e51b81526004016108ff90614f8a565b8e8e600090859261107b93929190615730565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040517f6fe7b6730000000000000000000000000000000000000000000000000000000081529297505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001691636fe7b67391506111289089908b908690600401615539565b602060405180830381600087803b15801561114257600080fd5b505af1158015611156573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117a91906147f7565b935050505060008a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509394506111c692508791508890506133eb565b9050600061120e86838986518d8d8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061365192505050565b9050600061121d87848a613838565b9050600061122d83838b8f6138ff565b9050600061123f82610eff86866135f7565b9050348111156112615760405162461bcd60e51b81526004016108ff90614c23565b600061126d348361338e565b905080156113005760008f73ffffffffffffffffffffffffffffffffffffffff168260405161129b906148ef565b60006040518083038185875af1925050503d80600081146112d8576040519150601f19603f3d011682016040523d82523d6000602084013e6112dd565b606091505b50509050806112fe5760405162461bcd60e51b81526004016108ff90614d97565b505b6000887f00000000000000000000000000000000000000000000000000000000000000008d8d8d8c60405160200161133d969594939291906148f2565b60405160208183030381529060405290507fe9bded5f24a4168e4f3bf44e00298c993b22376aad8c58c7dda9718a54cbea828160405161137d9190614a5c565b60405180910390a15050505050505050505050505050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260066020908152604080832061ffff871684529091529020606090600183141561143f57805461ffff166114295761ffff8086166000908152600760209081526040918290205491516114129392909216910161552a565b60405160208183030381529060405291505061175c565b80546040516114129161ffff169060200161552a565b60028314156114b557805462010000900467ffffffffffffffff166114935761ffff85166000908152600760209081526040918290205491516114129262010000900467ffffffffffffffff1691016156f7565b80546040516114129162010000900467ffffffffffffffff16906020016156f7565b60038314156115675780546a0100000000000000000000900473ffffffffffffffffffffffffffffffffffffffff166115315761ffff8516600090815260076020908152604091829020549151611412926a0100000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1691016149ba565b8054604051611412916a0100000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16906020016149ba565b60048314156116205780547e01000000000000000000000000000000000000000000000000000000000000900461ffff166115e85761ffff808616600090815260076020908152604091829020549151611412937e01000000000000000000000000000000000000000000000000000000000000909304909216910161552a565b8054604051611412917e01000000000000000000000000000000000000000000000000000000000000900461ffff169060200161552a565b600583141561168d57600181015467ffffffffffffffff1661166e5761ffff85166000908152600760209081526040918290206001015491516114129267ffffffffffffffff1691016156f7565b60018101546040516114129167ffffffffffffffff16906020016156f7565b600683141561174257600181015468010000000000000000900473ffffffffffffffffffffffffffffffffffffffff1661170b5761ffff85166000908152600760209081526040918290206001015491516114129268010000000000000000900473ffffffffffffffffffffffffffffffffffffffff1691016149ba565b60018101546040516114129168010000000000000000900473ffffffffffffffffffffffffffffffffffffffff16906020016149ba565b60405162461bcd60e51b81526004016108ff90614bb5565b505b9392505050565b61176b613ad1565b73ffffffffffffffffffffffffffffffffffffffff166117896123f5565b73ffffffffffffffffffffffffffffffffffffffff16146117f1576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81166118245760405162461bcd60e51b81526004016108ff90614cdd565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f33d644987381deff4408951d55afa136f124e22a7810b163b2aaa3ebef770f6490600090a250565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600460205260409020545b919050565b61190f613ad1565b73ffffffffffffffffffffffffffffffffffffffff1661192d6123f5565b73ffffffffffffffffffffffffffffffffffffffff1614611995576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61ffff8088166000908152600a60205260409020548116908716118015906119c1575060008661ffff16115b6119dd5760405162461bcd60e51b81526004016108ff906150d8565b60008567ffffffffffffffff1611611a075760405162461bcd60e51b81526004016108ff906153f7565b73ffffffffffffffffffffffffffffffffffffffff8416611a3a5760405162461bcd60e51b81526004016108ff90614d3a565b61ffff8088166000908152600b602090815260408083209387168352929052205460ff16611a7a5760405162461bcd60e51b81526004016108ff90614ac4565b60008267ffffffffffffffff1611611aa45760405162461bcd60e51b81526004016108ff906152e0565b73ffffffffffffffffffffffffffffffffffffffff8116611ad75760405162461bcd60e51b81526004016108ff90614e62565b6040518060c001604052808761ffff1681526020018667ffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018461ffff1681526020018367ffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815250600760008961ffff1661ffff16815260200190815260200160002060008201518160000160006101000a81548161ffff021916908361ffff16021790555060208201518160000160026101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550604082015181600001600a6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600001601e6101000a81548161ffff021916908361ffff16021790555060808201518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060a08201518160010160086101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050508661ffff167f5a76432853a0871c4e780def7f3ffc7912339b53f022ac31127fe5ff84a36fa1878787878787604051611cda96959493929190615693565b60405180910390a250505050505050565b336000908152600d6020908152604080832061ffff8816845282528083208684528252808320848452909152902054828110611d395760405162461bcd60e51b81526004016108ff9061501e565b336000818152600d6020908152604080832061ffff8a1680855290835281842089855283528184208785529092529182902086905590517f74bbc026808dcba59692d6a8bb20596849ca718e10e2432c6cdf48af865bc5d990611da190889087908990614a07565b60405180910390a35050505050565b611db8613ad1565b73ffffffffffffffffffffffffffffffffffffffff16611dd66123f5565b73ffffffffffffffffffffffffffffffffffffffff1614611e3e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60015460405160009173ffffffffffffffffffffffffffffffffffffffff16907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b600d60209081526000948552604080862082529385528385208152918452828420909152825290205481565b600481565b611ee6613ad1565b73ffffffffffffffffffffffffffffffffffffffff16611f046123f5565b73ffffffffffffffffffffffffffffffffffffffff1614611f6c576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116611f9f5760405162461bcd60e51b81526004016108ff90614fc1565b61ffff8083166000908152600a60205260409020548116908110611fd55760405162461bcd60e51b81526004016108ff9061524c565b61ffff8381166000818152600a6020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001660019790970195861696871790556009825280832095835294905283902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861617905591519091907f802d55279d51813cb7a9a98e8fd2d7bec5346cb830901c11b85d1650cb857e9a9061209e9085906149ba565b60405180910390a2505050565b6120b3613ad1565b73ffffffffffffffffffffffffffffffffffffffff166120d16123f5565b73ffffffffffffffffffffffffffffffffffffffff1614612139576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61ffff8085166000908152600860209081526040808320938716835292905220612164908383613f17565b508261ffff168461ffff167f4a5695eee2a74d548d5f5c485a3de99ace99e3b664c8e30a90f49be6ebb5493284846040516121a0929190614a48565b60405180910390a350505050565b60026000541415612206576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260005560035473ffffffffffffffffffffffffffffffffffffffff1633146122425760405162461bcd60e51b81526004016108ff90614b7e565b60055461224f908261338e565b6005556002546122769073ffffffffffffffffffffffffffffffffffffffff168383613ad5565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f3a20c8c3cd1848485ae8261a52398bb9b26f195b717306b3cf7f058e62c095d5836040516122d391906149fe565b60405180910390a350506001600055565b6122ec613ad1565b73ffffffffffffffffffffffffffffffffffffffff1661230a6123f5565b73ffffffffffffffffffffffffffffffffffffffff1614612372576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61ffff82166000908152600c6020526040902054156123a35760405162461bcd60e51b81526004016108ff9061539a565b61ffff82166000818152600c602052604090819020839055517f0611bb2107e385b79ec826fff8ecc1c1248a7aae3c875c96668f8cfbf1734220906123e99084906149fe565b60405180910390a25050565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b600581565b600c6020526000908152604090205481565b600061243488886133eb565b604081015190915073ffffffffffffffffffffffffffffffffffffffff1633146124705760405162461bcd60e51b81526004016108ff90614f53565b612478613fc1565b61ffff89166000908152600c6020526040902054806124a95760405162461bcd60e51b81526004016108ff9061533d565b60a083015173ffffffffffffffffffffffffffffffffffffffff166000908152600d6020908152604080832061ffff8e16845282528083208a84528252808320898452909152902054801580159061250f5750836020015167ffffffffffffffff168110155b61252b5760405162461bcd60e51b81526004016108ff90615454565b61ffff808c166000908152600960209081526040808320885190941683529290528190205490517fb71e0f7100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690819063b71e0f71906125aa908b908b908b908990600401614a1d565b600060405180830381600087803b1580156125c457600080fd5b505af11580156125d8573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261261e9190810190614312565b60a081015161ffff8e166000908152600e602052604090205491955014915050801561264d575060a082015115155b6126695760405162461bcd60e51b81526004016108ff90614ebf565b8961ffff16826000015161ffff16146126945760405162461bcd60e51b81526004016108ff90614f1c565b80826080015151146126b85760405162461bcd60e51b81526004016108ff90615135565b7f000000000000000000000000000000000000000000000000000000000000000061ffff16826020015161ffff16146127035760405162461bcd60e51b81526004016108ff906150a1565b8873ffffffffffffffffffffffffffffffffffffffff16826060015173ffffffffffffffffffffffffffffffffffffffff16146127525760405162461bcd60e51b81526004016108ff90614e2b565b61275b89613b67565b6127d957816060015173ffffffffffffffffffffffffffffffffffffffff16826000015161ffff167fa2786598bd84ae4a299103996359e6cb4333404583256079dfc279386baf5832846080015185604001518660c00151805190602001206040516127c993929190614a95565b60405180910390a350505061291b565b6000826080015183606001516040516020016127f69291906148a5565b6040516020818303038152906040529050826060015173ffffffffffffffffffffffffffffffffffffffff16836000015161ffff167f2bd2d8a84b748439fd50d79a49502b4eb5faa25b864da6a9ab5c150704be9a4d856080015186604001518760c001518051906020012060405161287193929190614a95565b60405180910390a37f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663c2fa48138c838d87604001518e8960c001516040518763ffffffff1660e01b81526004016128e496959493929190615599565b600060405180830381600087803b1580156128fe57600080fd5b505af1158015612912573d6000803e3d6000fd5b50505050505050505b50505050505050565b61292c613fff565b61175c83836133eb565b600181565b600a6020526000908152604090205461ffff1681565b6040517fc533338f00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063c533338f906129ca9087908790879060040161557b565b60206040518083038186803b1580156129e257600080fd5b505afa1580156129f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a1a91906147f7565b949350505050565b600b60209081526000928352604080842090915290825290205460ff1681565b600960209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b60066020908152600092835260408084209091529082529020805460019091015461ffff8083169267ffffffffffffffff62010000820481169373ffffffffffffffffffffffffffffffffffffffff6a010000000000000000000084048116947e010000000000000000000000000000000000000000000000000000000000009094049093169291811691680100000000000000009091041686565b600e6020526000908152604090205481565b612b2b613ad1565b73ffffffffffffffffffffffffffffffffffffffff16612b496123f5565b73ffffffffffffffffffffffffffffffffffffffff1614612bb1576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61ffff8083166000818152600b60209081526040808320948616835293905282902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590517fec23bee6f88cfecebb09d6aaaed66f0ce110debc1f61117c8270a7116597df9a906123e990849061552a565b612c33613ad1565b73ffffffffffffffffffffffffffffffffffffffff16612c516123f5565b73ffffffffffffffffffffffffffffffffffffffff1614612cb9576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61ffff82166000908152600e602052604090205415612cea5760405162461bcd60e51b81526004016108ff906151ef565b61ffff82166000818152600e602052604090819020839055517f0dad975e1d2fbe771c95cdcc7be9a1e61181de7173abe0a32b8f8f83140873e5906123e99084906149fe565b612d38613ad1565b73ffffffffffffffffffffffffffffffffffffffff16612d566123f5565b73ffffffffffffffffffffffffffffffffffffffff1614612dbe576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116612df15760405162461bcd60e51b81526004016108ff90615192565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517fcb7ef3e545f5cdb893f5c568ba710fe08f336375a2d9fd66e161033f8fc09ef390600090a250565b612e68613ad1565b73ffffffffffffffffffffffffffffffffffffffff16612e866123f5565b73ffffffffffffffffffffffffffffffffffffffff1614612eee576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116612f405760405162461bcd60e51b81526004018080602001828103825260268152602001806157d06026913960400191505060405180910390fd5b60015460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60055481565b60046020526000908152604090205481565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16331461303b5760405162461bcd60e51b81526004016108ff906152a9565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260066020908152604080832061ffff89168452909152902060018414156130f5576000613086838501856143ee565b61ffff8089166000908152600a602052604090205491925090811690821611156130c25760405162461bcd60e51b81526004016108ff906150d8565b81547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff91909116178155613335565b600284141561314c57600061310c838501856147db565b825467ffffffffffffffff90911662010000027fffffffffffffffffffffffffffffffffffffffffffff0000000000000000ffff90911617825550613335565b60038414156131b75760006131638385018561414c565b825473ffffffffffffffffffffffffffffffffffffffff9091166a0100000000000000000000027fffff0000000000000000000000000000000000000000ffffffffffffffffffff90911617825550613335565b60048414156132715760006131ce838501856143ee565b61ffff8089166000908152600b602090815260408083209385168352929052205490915060ff1680613202575061ffff8116155b61321e5760405162461bcd60e51b81526004016108ff90614ac4565b815461ffff9091167e01000000000000000000000000000000000000000000000000000000000000027dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909116178155613335565b60058414156132c9576000613288838501856147db565b6001830180547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff9290921691909117905550613335565b60068414156117425760006132e08385018561414c565b60018301805473ffffffffffffffffffffffffffffffffffffffff90921668010000000000000000027fffffffff0000000000000000000000000000000000000000ffffffffffffffff909216919091179055505b838573ffffffffffffffffffffffffffffffffffffffff167ffc01bf86212a14151d51d1be5c2ac64d67d5ec823dfc6f53298d7ce3f3d3d252858560405161337e929190614a48565b60405180910390a3505050505050565b6000828211156133e5576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6133f3613fff565b73ffffffffffffffffffffffffffffffffffffffff808316600090815260066020908152604080832061ffff808916808652918452828520835160c0810185528154808416825267ffffffffffffffff6201000082048116838901526a010000000000000000000082048a16838801527e010000000000000000000000000000000000000000000000000000000000009091048416606083015260019092015491821660808201526801000000000000000090910490961660a0870152908452600790925290912082519091166134cd57805461ffff1682525b602082015167ffffffffffffffff166134f857805462010000900467ffffffffffffffff1660208301525b604082015173ffffffffffffffffffffffffffffffffffffffff166135435780546a0100000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1660408301525b606082015161ffff1661357e5780547e01000000000000000000000000000000000000000000000000000000000000900461ffff1660608301525b608082015167ffffffffffffffff166135a657600181015467ffffffffffffffff1660808301525b60a082015173ffffffffffffffffffffffffffffffffffffffff1661175a576001015468010000000000000000900473ffffffffffffffffffffffffffffffffffffffff1660a08201529392505050565b60008282018381101561175c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081516000141561372c5761ffff808716600090815260086020908152604080832060608a015190941683529281529082902080548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600186161502019093169290920491820184900484028101840190945280845290918301828280156137245780601f106136f957610100808354040283529160200191613724565b820191906000526020600020905b81548152906001019060200180831161370757829003601f168201915b505050505091505b604080860151606087015191517f5886ea650000000000000000000000000000000000000000000000000000000081529091829173ffffffffffffffffffffffffffffffffffffffff831691635886ea6591613792918c918b908b908b90600401615607565b602060405180830381600087803b1580156137ac57600080fd5b505af11580156137c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137e491906147c3565b92506137f08284613b6d565b7fb0c632f55f1e1b3b2c3d82f41ee4716bb4c00f0f5d84cdafc141581bb8757a4f848860600151604051613825929190614a6f565b60405180910390a1505095945050505050565b60a0820151606083015160808401516040517fc5e193cd0000000000000000000000000000000000000000000000000000000081526000939273ffffffffffffffffffffffffffffffffffffffff84169263c5e193cd926138a1928a9290918990600401615650565b602060405180830381600087803b1580156138bb57600080fd5b505af11580156138cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138f391906147c3565b915061175a8183613b6d565b60008073ffffffffffffffffffffffffffffffffffffffff8316158061393b575060025473ffffffffffffffffffffffffffffffffffffffff16155b6003546040517f5cbbbd7500000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690635cbbbd759061399c908515908b908b906004016149e6565b60206040518083038186803b1580156139b457600080fd5b505afa1580156139c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139ec91906147c3565b90508015613ac7578115613a265760035473ffffffffffffffffffffffffffffffffffffffff16613a1d8183613b6d565b81935050613ac7565b8473ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480613a75575073ffffffffffffffffffffffffffffffffffffffff841632145b613a915760405162461bcd60e51b81526004016108ff90614dce565b600254613ab69073ffffffffffffffffffffffffffffffffffffffff16853084613bca565b600554613ac390826135f7565b6005555b5050949350505050565b3390565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052613b62908490613c65565b505050565b3b151590565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260046020526040902054613b9d90826135f7565b73ffffffffffffffffffffffffffffffffffffffff90921660009081526004602052604090209190915550565b6040805173ffffffffffffffffffffffffffffffffffffffff80861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052613c5f908590613c65565b50505050565b6000613cc7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613d239092919063ffffffff16565b805190915015613b6257808060200190516020811015613ce657600080fd5b5051613b625760405162461bcd60e51b815260040180806020018281038252602a8152602001806157f6602a913960400191505060405180910390fd5b6060612a1a848460008585613d3785613b67565b613d88576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b60208310613df157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613db4565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613e53576040519150601f19603f3d011682016040523d82523d6000602084013e613e58565b606091505b5091509150613e68828286613e73565b979650505050505050565b60608315613e8257508161175c565b825115613e925782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613edc578181015183820152602001613ec4565b50505050905090810190601f168015613f095780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282613f4d5760008555613fb1565b82601f10613f84578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555613fb1565b82800160010185558215613fb1579182015b82811115613fb1578235825591602001919060010190613f96565b50613fbd929150614034565b5090565b6040805160e08101825260008082526020820181905291810182905260608082018390526080820181905260a082019290925260c081019190915290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b5b80821115613fbd5760008155600101614035565b803561190281615784565b805161190281615784565b60008083601f840112614070578182fd5b50813567ffffffffffffffff811115614087578182fd5b60208301915083602082850101111561409f57600080fd5b9250929050565b600082601f8301126140b6578081fd5b815167ffffffffffffffff8111156140ca57fe5b6140fb60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161570c565b81815284602083860101111561410f578283fd5b612a1a826020830160208701615758565b8035611902816157a9565b8051611902816157a9565b8035611902816157b9565b8051611902816157b9565b60006020828403121561415d578081fd5b813561175c81615784565b6000806040838503121561417a578081fd5b823561418581615784565b946020939093013593505050565b600080604083850312156141a5578182fd5b82356141b081615784565b915060208301356141c0816157a9565b809150509250929050565b600080600080608085870312156141e0578182fd5b84356141eb81615784565b935060208501356141fb816157a9565b93969395505050506040820135916060013590565b6000806040838503121561417a578182fd5b60008060008060008060008060008060006101008c8e031215614243578687fd5b61424c8c614049565b9a5061425a60208d01614136565b995061426860408d01614120565b985067ffffffffffffffff8060608e01351115614283578788fd5b6142938e60608f01358f0161405f565b909950975060808d01358110156142a8578687fd5b6142b88e60808f01358f0161405f565b90975095506142c960a08e01614049565b94506142d760c08e01614049565b93508060e08e013511156142e9578283fd5b506142fa8d60e08e01358e0161405f565b81935080925050509295989b509295989b9093969950565b600060208284031215614323578081fd5b815167ffffffffffffffff8082111561433a578283fd5b9083019060e0828603121561434d578283fd5b61435760e061570c565b6143608361412b565b815261436e6020840161412b565b602082015261437f60408401614141565b604082015261439060608401614054565b60608201526080830151828111156143a6578485fd5b6143b2878286016140a6565b60808301525060a083015160a082015260c0830151828111156143d3578485fd5b6143df878286016140a6565b60c08301525095945050505050565b6000602082840312156143ff578081fd5b813561175c816157a9565b6000806040838503121561441c578182fd5b8235614427816157a9565b915060208301356141c081615784565b600080600080600080600060a0888a031215614451578081fd5b873561445c816157a9565b9650602088013561446c81615784565b9550604088013567ffffffffffffffff80821115614488578283fd5b6144948b838c0161405f565b909750955060608a0135915081151582146144ad578283fd5b909350608089013590808211156144c2578283fd5b506144cf8a828b0161405f565b989b979a50959850939692959293505050565b6000806000606084860312156144f6578081fd5b8335614501816157a9565b9250602084013561451181615784565b929592945050506040919091013590565b600080600080600080600060c0888a03121561453c578081fd5b8735614547816157a9565b9650602088013561455781615784565b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff811115614587578182fd5b6144cf8a828b0161405f565b6000806000806000608086880312156145aa578283fd5b85356145b5816157a9565b945060208601356145c581615784565b935060408601359250606086013567ffffffffffffffff8111156145e7578182fd5b6145f38882890161405f565b969995985093965092949392505050565b60008060408385031215614616578182fd5b8235614185816157a9565b60008060008060808587031215614636578182fd5b8435614641816157a9565b966020860135965060408601359560600135945092505050565b60008060006040848603121561466f578081fd5b833561467a816157a9565b9250602084013567ffffffffffffffff811115614695578182fd5b6146a18682870161405f565b9497909650939450505050565b600080604083850312156146c0578182fd5b82356141b0816157a9565b600080600080606085870312156146e0578182fd5b84356146eb816157a9565b935060208501356146fb816157a9565b9250604085013567ffffffffffffffff811115614716578283fd5b6147228782880161405f565b95989497509550505050565b600080600080600080600060e0888a031215614748578081fd5b8735614753816157a9565b96506020880135614763816157a9565b95506040880135614773816157b9565b9450606088013561478381615784565b93506080880135614793816157a9565b925060a08801356147a3816157b9565b915060c08801356147b381615784565b8091505092959891949750929550565b6000602082840312156147d4578081fd5b5051919050565b6000602082840312156147ec578081fd5b813561175c816157b9565b600060208284031215614808578081fd5b815161175c816157b9565b600082845282826020860137806020848601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011685010190509392505050565b60008151808452614873816020860160208601615758565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600083516148b7818460208801615758565b60609390931b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169190920190815260140192915050565b90565b60007fffffffffffffffff0000000000000000000000000000000000000000000000008860c01b1682527fffff000000000000000000000000000000000000000000000000000000000000808860f01b1660088401527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008760601b16600a840152808660f01b16601e840152508351614992816020850160208801615758565b808301905083516149aa816020840160208801615758565b0160200198975050505050505050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526020830191909152604082015260600190565b600085825260606020830152614a37606083018587614813565b905082604083015295945050505050565b600060208252612a1a602083018486614813565b60006020825261175c602083018461485b565b600060408252614a82604083018561485b565b905061ffff831660208301529392505050565b600060608252614aa8606083018661485b565b67ffffffffffffffff9490941660208301525060400152919050565b60208082526026908201527f4c617965725a65726f3a20696e76616c6964206f7574626f756e642070726f6f60408201527f6620747970650000000000000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f4c617965725a65726f3a20647374436861696e496420646f6573206e6f74206560408201527f7869737400000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526018908201527f4c617965725a65726f3a206f6e6c792074726561737572790000000000000000604082015260600190565b6020808252601e908201527f4c617965725a65726f3a20496e76616c696420636f6e66696720747970650000604082015260600190565b6020808252601a908201527f4c617965725a65726f3a207769746864726177206661696c6564000000000000604082015260600190565b60208082526025908201527f4c617965725a65726f3a206e6f7420656e6f756768206e617469766520666f7260408201527f2066656573000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f4c617965725a65726f3a205f746f2063616e6e6f74206265207a65726f20616460408201527f6472657373000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526031908201527f4c617965725a65726f3a205f6c617965725a65726f546f6b656e2063616e6e6f60408201527f74206265207a65726f2061646472657373000000000000000000000000000000606082015260800190565b60208082526022908201527f4c617965725a65726f3a20696e76616c69642072656c6179657220616464726560408201527f7373000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601b908201527f4c617965725a65726f3a206661696c656420746f20726566756e640000000000604082015260600190565b6020808252602b908201527f4c617965725a65726f3a206d75737420626520706169642062792073656e646560408201527f72206f72206f726967696e000000000000000000000000000000000000000000606082015260800190565b6020808252601d908201527f4c617965725a65726f3a20696e76616c69642064737441646472657373000000604082015260600190565b60208082526021908201527f4c617965725a65726f3a20696e76616c6964206f7261636c652061646472657360408201527f7300000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f4c617965725a65726f3a20696e76616c6964205f7061636b65742e756c6e416460408201527f6472657373000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601e908201527f4c617965725a65726f3a20696e76616c696420737263436861696e2049640000604082015260600190565b6020808252601a908201527f4c617965725a65726f3a20696e76616c69642072656c61796572000000000000604082015260600190565b6020808252601a908201527f4c617965725a65726f3a2077726f6e6720706174682064617461000000000000604082015260600190565b60208082526029908201527f4c617965725a65726f3a206c6962726172792063616e6e6f74206265207a657260408201527f6f20616464726573730000000000000000000000000000000000000000000000606082015260800190565b60208082526043908201527f4c617965725a65726f3a206f7261636c6520646174612063616e206f6e6c792060408201527f75706461746520696620697420686173206d6f726520636f6e6669726d61746960608201527f6f6e730000000000000000000000000000000000000000000000000000000000608082015260a00190565b6020808252601e908201527f4c617965725a65726f3a20696e76616c696420647374436861696e2049640000604082015260600190565b60208082526030908201527f4c617965725a65726f3a20696e76616c696420696e626f756e642070726f6f6660408201527f206c6962726172792076657273696f6e00000000000000000000000000000000606082015260800190565b60208082526022908201527f4c617965725a65726f3a20696e76616c6964207372634164647265737320736960408201527f7a65000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602a908201527f4c617965725a65726f3a2074726561737572792063616e6e6f74206265207a6560408201527f726f206164647265737300000000000000000000000000000000000000000000606082015260800190565b60208082526021908201527f4c617965725a65726f3a2072656d6f746520756c6e20616c726561647920736560408201527f7400000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526022908201527f4c617965725a65726f3a2063616e206e6f7420616464206e6577206c6962726160408201527f7279000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526018908201527f4c617965725a65726f3a206f6e6c7920656e64706f696e740000000000000000604082015260600190565b6020808252602e908201527f4c617965725a65726f3a20696e76616c6964206f7574626f756e6420626c6f6360408201527f6b20636f6e6669726d6174696f6e000000000000000000000000000000000000606082015260800190565b60208082526028908201527f4c617965725a65726f3a20696e636f72726563742072656d6f7465206164647260408201527f6573732073697a65000000000000000000000000000000000000000000000000606082015260800190565b60208082526030908201527f4c617965725a65726f3a2072656d6f746520636861696e20616464726573732060408201527f73697a6520616c72656164792073657400000000000000000000000000000000606082015260800190565b6020808252602d908201527f4c617965725a65726f3a20696e76616c696420696e626f756e6420626c6f636b60408201527f20636f6e6669726d6174696f6e00000000000000000000000000000000000000606082015260800190565b60208082526029908201527f4c617965725a65726f3a206e6f7420656e6f75676820626c6f636b20636f6e6660408201527f69726d6174696f6e730000000000000000000000000000000000000000000000606082015260800190565b600060c08201905061ffff808451168352602084015167ffffffffffffffff80821660208601526040860151915073ffffffffffffffffffffffffffffffffffffffff80831660408701528360608801511660608701528160808801511660808701528060a08801511660a08701525050505092915050565b61ffff91909116815260200190565b600061ffff8516825273ffffffffffffffffffffffffffffffffffffffff8416602083015260606040830152615572606083018461485b565b95945050505050565b600061ffff8516825260406020830152615572604083018486614813565b600061ffff8816825260c060208301526155b660c083018861485b565b73ffffffffffffffffffffffffffffffffffffffff8716604084015267ffffffffffffffff8616606084015284608084015282810360a08401526155fa818561485b565b9998505050505050505050565b600061ffff808816835280871660208401525073ffffffffffffffffffffffffffffffffffffffff8516604083015283606083015260a06080830152613e6860a083018461485b565b61ffff948516815292909316602083015267ffffffffffffffff16604082015273ffffffffffffffffffffffffffffffffffffffff909116606082015260800190565b61ffff968716815267ffffffffffffffff958616602082015273ffffffffffffffffffffffffffffffffffffffff948516604082015292909516606083015290921660808301529190911660a082015260c00190565b918252602082015260400190565b67ffffffffffffffff91909116815260200190565b60405181810167ffffffffffffffff8111828210171561572857fe5b604052919050565b6000808585111561573f578182fd5b8386111561574b578182fd5b5050820193919092039150565b60005b8381101561577357818101518382015260200161575b565b83811115613c5f5750506000910152565b73ffffffffffffffffffffffffffffffffffffffff811681146157a657600080fd5b50565b61ffff811681146157a657600080fd5b67ffffffffffffffff811681146157a657600080fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220fec2950ded16215c7cfa48e61f5136dfa2770dd4f696d7deb0a7a636056c350964736f6c6343000706003300000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6750000000000000000000000005b905fe05f81f3a8ad8b28c6e17779cfabf760680000000000000000000000000000000000000000000000000000000000000065
60e06040523480156200001157600080fd5b5060405162005ad838038062005ad883398101604081905262000034916200013f565b60016000908155620000456200011e565b600180546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506001600160a01b038316620000c55760405162461bcd60e51b8152600401620000bc9062000191565b60405180910390fd5b6001600160a01b038216620000ee5760405162461bcd60e51b8152600401620000bc90620001db565b60f01b6001600160f01b03191660a052606091821b6001600160601b0319908116608052911b1660c0526200022a565b3390565b80516001600160a01b03811681146200013a57600080fd5b919050565b60008060006060848603121562000154578283fd5b6200015f8462000122565b92506200016f6020850162000122565b9150604084015161ffff8116811462000186578182fd5b809150509250925092565b6020808252602a908201527f4c617965725a65726f3a20656e64706f696e742063616e6e6f74206265207a65604082015269726f206164647265737360b01b606082015260800190565b6020808252602f908201527f4c617965725a65726f3a206e6f6e6365436f6e74726163742063616e6e6f742060408201526e6265207a65726f206164647265737360881b606082015260800190565b60805160601c60a05160f01c60c05160601c615855620002836000398061084d52806110ee5280612991525080611305528061189552806126ba525080610f2052806118b9528061287b5280612fe852506158556000f3fe6080604052600436106102e75760003560e01c80638317814a11610184578063d543c774116100d6578063ed28580a1161008a578063f47a5feb11610064578063f47a5feb146107f6578063f58589a21461080b578063f8e1734c1461082b576102e7565b8063ed28580a14610796578063f0f44260146107b6578063f2fde38b146107d6576102e7565b8063ddfdef5a116100bb578063ddfdef5a14610736578063ea216c2114610756578063eb0d4c3114610776576102e7565b8063d543c774146106e9578063db00719b14610716576102e7565b8063959f594311610138578063b77d22ad11610112578063b77d22ad14610687578063b8e7e3e01461069c578063b9a99bed146106bc576102e7565b8063959f59431461061a578063987fa2d51461063a578063a46622221461065a576102e7565b806387078f9f1161016957806387078f9f146105d05780638da5cb5b146105f0578063904d3b8d14610605576102e7565b80638317814a146105905780638525b711146105b0576102e7565b806352d2871f1161023d5780636a14ac82116101f1578063759c5b3b116101cb578063759c5b3b1461053b5780638140666e1461055b5780638207f79d14610570576102e7565b80636a14ac82146104e6578063704316e514610506578063715018a614610526576102e7565b80635b056da5116102225780635b056da51461048f5780635e280f11146104b157806369412bfa146104c6576102e7565b806352d2871f1461044f57806352d3b5001461046f576102e7565b80632cfacb061161029f57806340a7bb101161027957806340a7bb10146103f957806349148c37146104275780634d3a0f7c1461043c576102e7565b80632cfacb06146103905780632f813464146103b257806331bd2430146103e4576102e7565b806307b9ca7c116102d057806307b9ca7c1461033957806318da00111461034e5780632a819bbf14610363576102e7565b806302bd9743146102ec57806307b18bde14610317575b600080fd5b3480156102f857600080fd5b5061030161084b565b60405161030e91906149ba565b60405180910390f35b34801561032357600080fd5b50610337610332366004614168565b61086f565b005b34801561034557600080fd5b50610301610a2d565b34801561035a57600080fd5b50610301610a49565b34801561036f57600080fd5b5061038361037e3660046146ae565b610a65565b60405161030e9190614a5c565b34801561039c57600080fd5b506103a5610b27565b60405161030e91906149fe565b3480156103be57600080fd5b506103d26103cd3660046143ee565b610b2c565b60405161030e96959493929190615693565b3480156103f057600080fd5b506103a5610bbd565b34801561040557600080fd5b50610419610414366004614437565b610bc2565b60405161030e9291906156e9565b34801561043357600080fd5b506103a5610f19565b61033761044a366004614222565b610f1e565b34801561045b57600080fd5b5061038361046a3660046144e2565b61139e565b34801561047b57600080fd5b5061033761048a36600461414c565b611763565b34801561049b57600080fd5b506104a4611893565b60405161030e919061552a565b3480156104bd57600080fd5b506103016118b7565b3480156104d257600080fd5b506103a56104e136600461414c565b6118db565b3480156104f257600080fd5b5061033761050136600461472e565b611907565b34801561051257600080fd5b50610337610521366004614621565b611ceb565b34801561053257600080fd5b50610337611db0565b34801561054757600080fd5b506103a56105563660046141cb565b611ead565b34801561056757600080fd5b506103a5611ed9565b34801561057c57600080fd5b5061033761058b36600461440a565b611ede565b34801561059c57600080fd5b506103376105ab3660046146cb565b6120ab565b3480156105bc57600080fd5b506103376105cb366004614210565b6121ae565b3480156105dc57600080fd5b506103376105eb366004614604565b6122e4565b3480156105fc57600080fd5b506103016123f5565b34801561061157600080fd5b506103a5612411565b34801561062657600080fd5b506103a56106353660046143ee565b612416565b34801561064657600080fd5b50610337610655366004614522565b612428565b34801561066657600080fd5b5061067a61067536600461440a565b612924565b60405161030e91906154b1565b34801561069357600080fd5b506103a5612936565b3480156106a857600080fd5b506104a46106b73660046143ee565b61293b565b3480156106c857600080fd5b506106dc6106d736600461465b565b612951565b60405161030e91906156f7565b3480156106f557600080fd5b506107096107043660046146ae565b612a22565b60405161030e91906149db565b34801561072257600080fd5b506103016107313660046146ae565b612a42565b34801561074257600080fd5b506103d2610751366004614193565b612a75565b34801561076257600080fd5b506103a56107713660046143ee565b612b11565b34801561078257600080fd5b506103376107913660046146ae565b612b23565b3480156107a257600080fd5b506103376107b1366004614604565b612c2b565b3480156107c257600080fd5b506103376107d136600461414c565b612d30565b3480156107e257600080fd5b506103376107f136600461414c565b612e60565b34801561080257600080fd5b506103a5612fce565b34801561081757600080fd5b506103a561082636600461414c565b612fd4565b34801561083757600080fd5b50610337610846366004614593565b612fe6565b7f000000000000000000000000000000000000000000000000000000000000000081565b600260005414156108c7576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260005573ffffffffffffffffffffffffffffffffffffffff82166109085760405162461bcd60e51b81526004016108ff90614c80565b60405180910390fd5b33600090815260046020526040902054610922908261338e565b3360009081526004602052604080822092909255905173ffffffffffffffffffffffffffffffffffffffff841690839061095b906148ef565b60006040518083038185875af1925050503d8060008114610998576040519150601f19603f3d011682016040523d82523d6000602084013e61099d565b606091505b50509050806109be5760405162461bcd60e51b81526004016108ff90614bec565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f3bfd26201736b5cb14a562ab3cfc2bef76901726e3a78483d6288af47131e1d984604051610a1b91906149fe565b60405180910390a35050600160005550565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b60086020908152600092835260408084208252918352918190208054825160026001831615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190921691909104601f810185900485028201850190935282815292909190830182828015610b1f5780601f10610af457610100808354040283529160200191610b1f565b820191906000526020600020905b815481529060010190602001808311610b0257829003601f168201915b505050505081565b600381565b6007602052600090815260409020805460019091015461ffff8083169267ffffffffffffffff62010000820481169373ffffffffffffffffffffffffffffffffffffffff6a010000000000000000000084048116947e010000000000000000000000000000000000000000000000000000000000009094049093169291811691680100000000000000009091041686565b600681565b6000806000610bd18a8a6133eb565b905060608415610c1a5785858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929350610ce992505050565b61ffff808c166000908152600860209081526040808320606087015190941683529281529082902080548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018616150201909316929092049182018490048402810184019094528084529091830182828015610ce15780601f10610cb657610100808354040283529160200191610ce1565b820191906000526020600020905b815481529060010190602001808311610cc457829003601f168201915b505050505090505b6000826040015173ffffffffffffffffffffffffffffffffffffffff1663c03f15298d85606001518e8e8e9050876040518663ffffffff1660e01b8152600401610d37959493929190615607565b60206040518083038186803b158015610d4f57600080fd5b505afa158015610d63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8791906147c3565b905060008b905060008460a0015173ffffffffffffffffffffffffffffffffffffffff16635553fb8e8f87606001518860800151866040518563ffffffff1660e01b8152600401610ddb9493929190615650565b60206040518083038186803b158015610df357600080fd5b505afa158015610e07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2b91906147c3565b6003546040517f5cbbbd7500000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690635cbbbd7590610e8b908e90889087906004016149e6565b60206040518083038186803b158015610ea357600080fd5b505afa158015610eb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edb91906147c3565b90508a610eeb5780975087610ef0565b809650865b50610f0582610eff8a876135f7565b906135f7565b975050505050505097509795505050505050565b600281565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610f735760405162461bcd60e51b81526004016108ff906152a9565b61ffff89166000908152600e60205260409020548b908a90610fa75760405162461bcd60e51b81526004016108ff90614b21565b61ffff81166000908152600c6020526040812054606091908015801590610fd05750601481018c145b610fec5760405162461bcd60e51b81526004016108ff9061533d565b6000808e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505050838101601401519250905073ffffffffffffffffffffffffffffffffffffffff878116908316146110685760405162461bcd60e51b81526004016108ff90614f8a565b8e8e600090859261107b93929190615730565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040517f6fe7b6730000000000000000000000000000000000000000000000000000000081529297505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001691636fe7b67391506111289089908b908690600401615539565b602060405180830381600087803b15801561114257600080fd5b505af1158015611156573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117a91906147f7565b935050505060008a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509394506111c692508791508890506133eb565b9050600061120e86838986518d8d8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061365192505050565b9050600061121d87848a613838565b9050600061122d83838b8f6138ff565b9050600061123f82610eff86866135f7565b9050348111156112615760405162461bcd60e51b81526004016108ff90614c23565b600061126d348361338e565b905080156113005760008f73ffffffffffffffffffffffffffffffffffffffff168260405161129b906148ef565b60006040518083038185875af1925050503d80600081146112d8576040519150601f19603f3d011682016040523d82523d6000602084013e6112dd565b606091505b50509050806112fe5760405162461bcd60e51b81526004016108ff90614d97565b505b6000887f00000000000000000000000000000000000000000000000000000000000000008d8d8d8c60405160200161133d969594939291906148f2565b60405160208183030381529060405290507fe9bded5f24a4168e4f3bf44e00298c993b22376aad8c58c7dda9718a54cbea828160405161137d9190614a5c565b60405180910390a15050505050505050505050505050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260066020908152604080832061ffff871684529091529020606090600183141561143f57805461ffff166114295761ffff8086166000908152600760209081526040918290205491516114129392909216910161552a565b60405160208183030381529060405291505061175c565b80546040516114129161ffff169060200161552a565b60028314156114b557805462010000900467ffffffffffffffff166114935761ffff85166000908152600760209081526040918290205491516114129262010000900467ffffffffffffffff1691016156f7565b80546040516114129162010000900467ffffffffffffffff16906020016156f7565b60038314156115675780546a0100000000000000000000900473ffffffffffffffffffffffffffffffffffffffff166115315761ffff8516600090815260076020908152604091829020549151611412926a0100000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1691016149ba565b8054604051611412916a0100000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16906020016149ba565b60048314156116205780547e01000000000000000000000000000000000000000000000000000000000000900461ffff166115e85761ffff808616600090815260076020908152604091829020549151611412937e01000000000000000000000000000000000000000000000000000000000000909304909216910161552a565b8054604051611412917e01000000000000000000000000000000000000000000000000000000000000900461ffff169060200161552a565b600583141561168d57600181015467ffffffffffffffff1661166e5761ffff85166000908152600760209081526040918290206001015491516114129267ffffffffffffffff1691016156f7565b60018101546040516114129167ffffffffffffffff16906020016156f7565b600683141561174257600181015468010000000000000000900473ffffffffffffffffffffffffffffffffffffffff1661170b5761ffff85166000908152600760209081526040918290206001015491516114129268010000000000000000900473ffffffffffffffffffffffffffffffffffffffff1691016149ba565b60018101546040516114129168010000000000000000900473ffffffffffffffffffffffffffffffffffffffff16906020016149ba565b60405162461bcd60e51b81526004016108ff90614bb5565b505b9392505050565b61176b613ad1565b73ffffffffffffffffffffffffffffffffffffffff166117896123f5565b73ffffffffffffffffffffffffffffffffffffffff16146117f1576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81166118245760405162461bcd60e51b81526004016108ff90614cdd565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f33d644987381deff4408951d55afa136f124e22a7810b163b2aaa3ebef770f6490600090a250565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600460205260409020545b919050565b61190f613ad1565b73ffffffffffffffffffffffffffffffffffffffff1661192d6123f5565b73ffffffffffffffffffffffffffffffffffffffff1614611995576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61ffff8088166000908152600a60205260409020548116908716118015906119c1575060008661ffff16115b6119dd5760405162461bcd60e51b81526004016108ff906150d8565b60008567ffffffffffffffff1611611a075760405162461bcd60e51b81526004016108ff906153f7565b73ffffffffffffffffffffffffffffffffffffffff8416611a3a5760405162461bcd60e51b81526004016108ff90614d3a565b61ffff8088166000908152600b602090815260408083209387168352929052205460ff16611a7a5760405162461bcd60e51b81526004016108ff90614ac4565b60008267ffffffffffffffff1611611aa45760405162461bcd60e51b81526004016108ff906152e0565b73ffffffffffffffffffffffffffffffffffffffff8116611ad75760405162461bcd60e51b81526004016108ff90614e62565b6040518060c001604052808761ffff1681526020018667ffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018461ffff1681526020018367ffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815250600760008961ffff1661ffff16815260200190815260200160002060008201518160000160006101000a81548161ffff021916908361ffff16021790555060208201518160000160026101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550604082015181600001600a6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600001601e6101000a81548161ffff021916908361ffff16021790555060808201518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060a08201518160010160086101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050508661ffff167f5a76432853a0871c4e780def7f3ffc7912339b53f022ac31127fe5ff84a36fa1878787878787604051611cda96959493929190615693565b60405180910390a250505050505050565b336000908152600d6020908152604080832061ffff8816845282528083208684528252808320848452909152902054828110611d395760405162461bcd60e51b81526004016108ff9061501e565b336000818152600d6020908152604080832061ffff8a1680855290835281842089855283528184208785529092529182902086905590517f74bbc026808dcba59692d6a8bb20596849ca718e10e2432c6cdf48af865bc5d990611da190889087908990614a07565b60405180910390a35050505050565b611db8613ad1565b73ffffffffffffffffffffffffffffffffffffffff16611dd66123f5565b73ffffffffffffffffffffffffffffffffffffffff1614611e3e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60015460405160009173ffffffffffffffffffffffffffffffffffffffff16907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b600d60209081526000948552604080862082529385528385208152918452828420909152825290205481565b600481565b611ee6613ad1565b73ffffffffffffffffffffffffffffffffffffffff16611f046123f5565b73ffffffffffffffffffffffffffffffffffffffff1614611f6c576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116611f9f5760405162461bcd60e51b81526004016108ff90614fc1565b61ffff8083166000908152600a60205260409020548116908110611fd55760405162461bcd60e51b81526004016108ff9061524c565b61ffff8381166000818152600a6020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001660019790970195861696871790556009825280832095835294905283902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861617905591519091907f802d55279d51813cb7a9a98e8fd2d7bec5346cb830901c11b85d1650cb857e9a9061209e9085906149ba565b60405180910390a2505050565b6120b3613ad1565b73ffffffffffffffffffffffffffffffffffffffff166120d16123f5565b73ffffffffffffffffffffffffffffffffffffffff1614612139576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61ffff8085166000908152600860209081526040808320938716835292905220612164908383613f17565b508261ffff168461ffff167f4a5695eee2a74d548d5f5c485a3de99ace99e3b664c8e30a90f49be6ebb5493284846040516121a0929190614a48565b60405180910390a350505050565b60026000541415612206576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260005560035473ffffffffffffffffffffffffffffffffffffffff1633146122425760405162461bcd60e51b81526004016108ff90614b7e565b60055461224f908261338e565b6005556002546122769073ffffffffffffffffffffffffffffffffffffffff168383613ad5565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f3a20c8c3cd1848485ae8261a52398bb9b26f195b717306b3cf7f058e62c095d5836040516122d391906149fe565b60405180910390a350506001600055565b6122ec613ad1565b73ffffffffffffffffffffffffffffffffffffffff1661230a6123f5565b73ffffffffffffffffffffffffffffffffffffffff1614612372576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61ffff82166000908152600c6020526040902054156123a35760405162461bcd60e51b81526004016108ff9061539a565b61ffff82166000818152600c602052604090819020839055517f0611bb2107e385b79ec826fff8ecc1c1248a7aae3c875c96668f8cfbf1734220906123e99084906149fe565b60405180910390a25050565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b600581565b600c6020526000908152604090205481565b600061243488886133eb565b604081015190915073ffffffffffffffffffffffffffffffffffffffff1633146124705760405162461bcd60e51b81526004016108ff90614f53565b612478613fc1565b61ffff89166000908152600c6020526040902054806124a95760405162461bcd60e51b81526004016108ff9061533d565b60a083015173ffffffffffffffffffffffffffffffffffffffff166000908152600d6020908152604080832061ffff8e16845282528083208a84528252808320898452909152902054801580159061250f5750836020015167ffffffffffffffff168110155b61252b5760405162461bcd60e51b81526004016108ff90615454565b61ffff808c166000908152600960209081526040808320885190941683529290528190205490517fb71e0f7100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690819063b71e0f71906125aa908b908b908b908990600401614a1d565b600060405180830381600087803b1580156125c457600080fd5b505af11580156125d8573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261261e9190810190614312565b60a081015161ffff8e166000908152600e602052604090205491955014915050801561264d575060a082015115155b6126695760405162461bcd60e51b81526004016108ff90614ebf565b8961ffff16826000015161ffff16146126945760405162461bcd60e51b81526004016108ff90614f1c565b80826080015151146126b85760405162461bcd60e51b81526004016108ff90615135565b7f000000000000000000000000000000000000000000000000000000000000000061ffff16826020015161ffff16146127035760405162461bcd60e51b81526004016108ff906150a1565b8873ffffffffffffffffffffffffffffffffffffffff16826060015173ffffffffffffffffffffffffffffffffffffffff16146127525760405162461bcd60e51b81526004016108ff90614e2b565b61275b89613b67565b6127d957816060015173ffffffffffffffffffffffffffffffffffffffff16826000015161ffff167fa2786598bd84ae4a299103996359e6cb4333404583256079dfc279386baf5832846080015185604001518660c00151805190602001206040516127c993929190614a95565b60405180910390a350505061291b565b6000826080015183606001516040516020016127f69291906148a5565b6040516020818303038152906040529050826060015173ffffffffffffffffffffffffffffffffffffffff16836000015161ffff167f2bd2d8a84b748439fd50d79a49502b4eb5faa25b864da6a9ab5c150704be9a4d856080015186604001518760c001518051906020012060405161287193929190614a95565b60405180910390a37f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663c2fa48138c838d87604001518e8960c001516040518763ffffffff1660e01b81526004016128e496959493929190615599565b600060405180830381600087803b1580156128fe57600080fd5b505af1158015612912573d6000803e3d6000fd5b50505050505050505b50505050505050565b61292c613fff565b61175c83836133eb565b600181565b600a6020526000908152604090205461ffff1681565b6040517fc533338f00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063c533338f906129ca9087908790879060040161557b565b60206040518083038186803b1580156129e257600080fd5b505afa1580156129f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a1a91906147f7565b949350505050565b600b60209081526000928352604080842090915290825290205460ff1681565b600960209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b60066020908152600092835260408084209091529082529020805460019091015461ffff8083169267ffffffffffffffff62010000820481169373ffffffffffffffffffffffffffffffffffffffff6a010000000000000000000084048116947e010000000000000000000000000000000000000000000000000000000000009094049093169291811691680100000000000000009091041686565b600e6020526000908152604090205481565b612b2b613ad1565b73ffffffffffffffffffffffffffffffffffffffff16612b496123f5565b73ffffffffffffffffffffffffffffffffffffffff1614612bb1576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61ffff8083166000818152600b60209081526040808320948616835293905282902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590517fec23bee6f88cfecebb09d6aaaed66f0ce110debc1f61117c8270a7116597df9a906123e990849061552a565b612c33613ad1565b73ffffffffffffffffffffffffffffffffffffffff16612c516123f5565b73ffffffffffffffffffffffffffffffffffffffff1614612cb9576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61ffff82166000908152600e602052604090205415612cea5760405162461bcd60e51b81526004016108ff906151ef565b61ffff82166000818152600e602052604090819020839055517f0dad975e1d2fbe771c95cdcc7be9a1e61181de7173abe0a32b8f8f83140873e5906123e99084906149fe565b612d38613ad1565b73ffffffffffffffffffffffffffffffffffffffff16612d566123f5565b73ffffffffffffffffffffffffffffffffffffffff1614612dbe576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116612df15760405162461bcd60e51b81526004016108ff90615192565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517fcb7ef3e545f5cdb893f5c568ba710fe08f336375a2d9fd66e161033f8fc09ef390600090a250565b612e68613ad1565b73ffffffffffffffffffffffffffffffffffffffff16612e866123f5565b73ffffffffffffffffffffffffffffffffffffffff1614612eee576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116612f405760405162461bcd60e51b81526004018080602001828103825260268152602001806157d06026913960400191505060405180910390fd5b60015460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60055481565b60046020526000908152604090205481565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16331461303b5760405162461bcd60e51b81526004016108ff906152a9565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260066020908152604080832061ffff89168452909152902060018414156130f5576000613086838501856143ee565b61ffff8089166000908152600a602052604090205491925090811690821611156130c25760405162461bcd60e51b81526004016108ff906150d8565b81547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff91909116178155613335565b600284141561314c57600061310c838501856147db565b825467ffffffffffffffff90911662010000027fffffffffffffffffffffffffffffffffffffffffffff0000000000000000ffff90911617825550613335565b60038414156131b75760006131638385018561414c565b825473ffffffffffffffffffffffffffffffffffffffff9091166a0100000000000000000000027fffff0000000000000000000000000000000000000000ffffffffffffffffffff90911617825550613335565b60048414156132715760006131ce838501856143ee565b61ffff8089166000908152600b602090815260408083209385168352929052205490915060ff1680613202575061ffff8116155b61321e5760405162461bcd60e51b81526004016108ff90614ac4565b815461ffff9091167e01000000000000000000000000000000000000000000000000000000000000027dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909116178155613335565b60058414156132c9576000613288838501856147db565b6001830180547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff9290921691909117905550613335565b60068414156117425760006132e08385018561414c565b60018301805473ffffffffffffffffffffffffffffffffffffffff90921668010000000000000000027fffffffff0000000000000000000000000000000000000000ffffffffffffffff909216919091179055505b838573ffffffffffffffffffffffffffffffffffffffff167ffc01bf86212a14151d51d1be5c2ac64d67d5ec823dfc6f53298d7ce3f3d3d252858560405161337e929190614a48565b60405180910390a3505050505050565b6000828211156133e5576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6133f3613fff565b73ffffffffffffffffffffffffffffffffffffffff808316600090815260066020908152604080832061ffff808916808652918452828520835160c0810185528154808416825267ffffffffffffffff6201000082048116838901526a010000000000000000000082048a16838801527e010000000000000000000000000000000000000000000000000000000000009091048416606083015260019092015491821660808201526801000000000000000090910490961660a0870152908452600790925290912082519091166134cd57805461ffff1682525b602082015167ffffffffffffffff166134f857805462010000900467ffffffffffffffff1660208301525b604082015173ffffffffffffffffffffffffffffffffffffffff166135435780546a0100000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1660408301525b606082015161ffff1661357e5780547e01000000000000000000000000000000000000000000000000000000000000900461ffff1660608301525b608082015167ffffffffffffffff166135a657600181015467ffffffffffffffff1660808301525b60a082015173ffffffffffffffffffffffffffffffffffffffff1661175a576001015468010000000000000000900473ffffffffffffffffffffffffffffffffffffffff1660a08201529392505050565b60008282018381101561175c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081516000141561372c5761ffff808716600090815260086020908152604080832060608a015190941683529281529082902080548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600186161502019093169290920491820184900484028101840190945280845290918301828280156137245780601f106136f957610100808354040283529160200191613724565b820191906000526020600020905b81548152906001019060200180831161370757829003601f168201915b505050505091505b604080860151606087015191517f5886ea650000000000000000000000000000000000000000000000000000000081529091829173ffffffffffffffffffffffffffffffffffffffff831691635886ea6591613792918c918b908b908b90600401615607565b602060405180830381600087803b1580156137ac57600080fd5b505af11580156137c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137e491906147c3565b92506137f08284613b6d565b7fb0c632f55f1e1b3b2c3d82f41ee4716bb4c00f0f5d84cdafc141581bb8757a4f848860600151604051613825929190614a6f565b60405180910390a1505095945050505050565b60a0820151606083015160808401516040517fc5e193cd0000000000000000000000000000000000000000000000000000000081526000939273ffffffffffffffffffffffffffffffffffffffff84169263c5e193cd926138a1928a9290918990600401615650565b602060405180830381600087803b1580156138bb57600080fd5b505af11580156138cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138f391906147c3565b915061175a8183613b6d565b60008073ffffffffffffffffffffffffffffffffffffffff8316158061393b575060025473ffffffffffffffffffffffffffffffffffffffff16155b6003546040517f5cbbbd7500000000000000000000000000000000000000000000000000000000815291925060009173ffffffffffffffffffffffffffffffffffffffff90911690635cbbbd759061399c908515908b908b906004016149e6565b60206040518083038186803b1580156139b457600080fd5b505afa1580156139c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139ec91906147c3565b90508015613ac7578115613a265760035473ffffffffffffffffffffffffffffffffffffffff16613a1d8183613b6d565b81935050613ac7565b8473ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480613a75575073ffffffffffffffffffffffffffffffffffffffff841632145b613a915760405162461bcd60e51b81526004016108ff90614dce565b600254613ab69073ffffffffffffffffffffffffffffffffffffffff16853084613bca565b600554613ac390826135f7565b6005555b5050949350505050565b3390565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052613b62908490613c65565b505050565b3b151590565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260046020526040902054613b9d90826135f7565b73ffffffffffffffffffffffffffffffffffffffff90921660009081526004602052604090209190915550565b6040805173ffffffffffffffffffffffffffffffffffffffff80861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052613c5f908590613c65565b50505050565b6000613cc7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613d239092919063ffffffff16565b805190915015613b6257808060200190516020811015613ce657600080fd5b5051613b625760405162461bcd60e51b815260040180806020018281038252602a8152602001806157f6602a913960400191505060405180910390fd5b6060612a1a848460008585613d3785613b67565b613d88576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b60208310613df157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613db4565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613e53576040519150601f19603f3d011682016040523d82523d6000602084013e613e58565b606091505b5091509150613e68828286613e73565b979650505050505050565b60608315613e8257508161175c565b825115613e925782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613edc578181015183820152602001613ec4565b50505050905090810190601f168015613f095780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282613f4d5760008555613fb1565b82601f10613f84578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555613fb1565b82800160010185558215613fb1579182015b82811115613fb1578235825591602001919060010190613f96565b50613fbd929150614034565b5090565b6040805160e08101825260008082526020820181905291810182905260608082018390526080820181905260a082019290925260c081019190915290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b5b80821115613fbd5760008155600101614035565b803561190281615784565b805161190281615784565b60008083601f840112614070578182fd5b50813567ffffffffffffffff811115614087578182fd5b60208301915083602082850101111561409f57600080fd5b9250929050565b600082601f8301126140b6578081fd5b815167ffffffffffffffff8111156140ca57fe5b6140fb60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161570c565b81815284602083860101111561410f578283fd5b612a1a826020830160208701615758565b8035611902816157a9565b8051611902816157a9565b8035611902816157b9565b8051611902816157b9565b60006020828403121561415d578081fd5b813561175c81615784565b6000806040838503121561417a578081fd5b823561418581615784565b946020939093013593505050565b600080604083850312156141a5578182fd5b82356141b081615784565b915060208301356141c0816157a9565b809150509250929050565b600080600080608085870312156141e0578182fd5b84356141eb81615784565b935060208501356141fb816157a9565b93969395505050506040820135916060013590565b6000806040838503121561417a578182fd5b60008060008060008060008060008060006101008c8e031215614243578687fd5b61424c8c614049565b9a5061425a60208d01614136565b995061426860408d01614120565b985067ffffffffffffffff8060608e01351115614283578788fd5b6142938e60608f01358f0161405f565b909950975060808d01358110156142a8578687fd5b6142b88e60808f01358f0161405f565b90975095506142c960a08e01614049565b94506142d760c08e01614049565b93508060e08e013511156142e9578283fd5b506142fa8d60e08e01358e0161405f565b81935080925050509295989b509295989b9093969950565b600060208284031215614323578081fd5b815167ffffffffffffffff8082111561433a578283fd5b9083019060e0828603121561434d578283fd5b61435760e061570c565b6143608361412b565b815261436e6020840161412b565b602082015261437f60408401614141565b604082015261439060608401614054565b60608201526080830151828111156143a6578485fd5b6143b2878286016140a6565b60808301525060a083015160a082015260c0830151828111156143d3578485fd5b6143df878286016140a6565b60c08301525095945050505050565b6000602082840312156143ff578081fd5b813561175c816157a9565b6000806040838503121561441c578182fd5b8235614427816157a9565b915060208301356141c081615784565b600080600080600080600060a0888a031215614451578081fd5b873561445c816157a9565b9650602088013561446c81615784565b9550604088013567ffffffffffffffff80821115614488578283fd5b6144948b838c0161405f565b909750955060608a0135915081151582146144ad578283fd5b909350608089013590808211156144c2578283fd5b506144cf8a828b0161405f565b989b979a50959850939692959293505050565b6000806000606084860312156144f6578081fd5b8335614501816157a9565b9250602084013561451181615784565b929592945050506040919091013590565b600080600080600080600060c0888a03121561453c578081fd5b8735614547816157a9565b9650602088013561455781615784565b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff811115614587578182fd5b6144cf8a828b0161405f565b6000806000806000608086880312156145aa578283fd5b85356145b5816157a9565b945060208601356145c581615784565b935060408601359250606086013567ffffffffffffffff8111156145e7578182fd5b6145f38882890161405f565b969995985093965092949392505050565b60008060408385031215614616578182fd5b8235614185816157a9565b60008060008060808587031215614636578182fd5b8435614641816157a9565b966020860135965060408601359560600135945092505050565b60008060006040848603121561466f578081fd5b833561467a816157a9565b9250602084013567ffffffffffffffff811115614695578182fd5b6146a18682870161405f565b9497909650939450505050565b600080604083850312156146c0578182fd5b82356141b0816157a9565b600080600080606085870312156146e0578182fd5b84356146eb816157a9565b935060208501356146fb816157a9565b9250604085013567ffffffffffffffff811115614716578283fd5b6147228782880161405f565b95989497509550505050565b600080600080600080600060e0888a031215614748578081fd5b8735614753816157a9565b96506020880135614763816157a9565b95506040880135614773816157b9565b9450606088013561478381615784565b93506080880135614793816157a9565b925060a08801356147a3816157b9565b915060c08801356147b381615784565b8091505092959891949750929550565b6000602082840312156147d4578081fd5b5051919050565b6000602082840312156147ec578081fd5b813561175c816157b9565b600060208284031215614808578081fd5b815161175c816157b9565b600082845282826020860137806020848601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011685010190509392505050565b60008151808452614873816020860160208601615758565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600083516148b7818460208801615758565b60609390931b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169190920190815260140192915050565b90565b60007fffffffffffffffff0000000000000000000000000000000000000000000000008860c01b1682527fffff000000000000000000000000000000000000000000000000000000000000808860f01b1660088401527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008760601b16600a840152808660f01b16601e840152508351614992816020850160208801615758565b808301905083516149aa816020840160208801615758565b0160200198975050505050505050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526020830191909152604082015260600190565b600085825260606020830152614a37606083018587614813565b905082604083015295945050505050565b600060208252612a1a602083018486614813565b60006020825261175c602083018461485b565b600060408252614a82604083018561485b565b905061ffff831660208301529392505050565b600060608252614aa8606083018661485b565b67ffffffffffffffff9490941660208301525060400152919050565b60208082526026908201527f4c617965725a65726f3a20696e76616c6964206f7574626f756e642070726f6f60408201527f6620747970650000000000000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f4c617965725a65726f3a20647374436861696e496420646f6573206e6f74206560408201527f7869737400000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526018908201527f4c617965725a65726f3a206f6e6c792074726561737572790000000000000000604082015260600190565b6020808252601e908201527f4c617965725a65726f3a20496e76616c696420636f6e66696720747970650000604082015260600190565b6020808252601a908201527f4c617965725a65726f3a207769746864726177206661696c6564000000000000604082015260600190565b60208082526025908201527f4c617965725a65726f3a206e6f7420656e6f756768206e617469766520666f7260408201527f2066656573000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f4c617965725a65726f3a205f746f2063616e6e6f74206265207a65726f20616460408201527f6472657373000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526031908201527f4c617965725a65726f3a205f6c617965725a65726f546f6b656e2063616e6e6f60408201527f74206265207a65726f2061646472657373000000000000000000000000000000606082015260800190565b60208082526022908201527f4c617965725a65726f3a20696e76616c69642072656c6179657220616464726560408201527f7373000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601b908201527f4c617965725a65726f3a206661696c656420746f20726566756e640000000000604082015260600190565b6020808252602b908201527f4c617965725a65726f3a206d75737420626520706169642062792073656e646560408201527f72206f72206f726967696e000000000000000000000000000000000000000000606082015260800190565b6020808252601d908201527f4c617965725a65726f3a20696e76616c69642064737441646472657373000000604082015260600190565b60208082526021908201527f4c617965725a65726f3a20696e76616c6964206f7261636c652061646472657360408201527f7300000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f4c617965725a65726f3a20696e76616c6964205f7061636b65742e756c6e416460408201527f6472657373000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601e908201527f4c617965725a65726f3a20696e76616c696420737263436861696e2049640000604082015260600190565b6020808252601a908201527f4c617965725a65726f3a20696e76616c69642072656c61796572000000000000604082015260600190565b6020808252601a908201527f4c617965725a65726f3a2077726f6e6720706174682064617461000000000000604082015260600190565b60208082526029908201527f4c617965725a65726f3a206c6962726172792063616e6e6f74206265207a657260408201527f6f20616464726573730000000000000000000000000000000000000000000000606082015260800190565b60208082526043908201527f4c617965725a65726f3a206f7261636c6520646174612063616e206f6e6c792060408201527f75706461746520696620697420686173206d6f726520636f6e6669726d61746960608201527f6f6e730000000000000000000000000000000000000000000000000000000000608082015260a00190565b6020808252601e908201527f4c617965725a65726f3a20696e76616c696420647374436861696e2049640000604082015260600190565b60208082526030908201527f4c617965725a65726f3a20696e76616c696420696e626f756e642070726f6f6660408201527f206c6962726172792076657273696f6e00000000000000000000000000000000606082015260800190565b60208082526022908201527f4c617965725a65726f3a20696e76616c6964207372634164647265737320736960408201527f7a65000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602a908201527f4c617965725a65726f3a2074726561737572792063616e6e6f74206265207a6560408201527f726f206164647265737300000000000000000000000000000000000000000000606082015260800190565b60208082526021908201527f4c617965725a65726f3a2072656d6f746520756c6e20616c726561647920736560408201527f7400000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526022908201527f4c617965725a65726f3a2063616e206e6f7420616464206e6577206c6962726160408201527f7279000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526018908201527f4c617965725a65726f3a206f6e6c7920656e64706f696e740000000000000000604082015260600190565b6020808252602e908201527f4c617965725a65726f3a20696e76616c6964206f7574626f756e6420626c6f6360408201527f6b20636f6e6669726d6174696f6e000000000000000000000000000000000000606082015260800190565b60208082526028908201527f4c617965725a65726f3a20696e636f72726563742072656d6f7465206164647260408201527f6573732073697a65000000000000000000000000000000000000000000000000606082015260800190565b60208082526030908201527f4c617965725a65726f3a2072656d6f746520636861696e20616464726573732060408201527f73697a6520616c72656164792073657400000000000000000000000000000000606082015260800190565b6020808252602d908201527f4c617965725a65726f3a20696e76616c696420696e626f756e6420626c6f636b60408201527f20636f6e6669726d6174696f6e00000000000000000000000000000000000000606082015260800190565b60208082526029908201527f4c617965725a65726f3a206e6f7420656e6f75676820626c6f636b20636f6e6660408201527f69726d6174696f6e730000000000000000000000000000000000000000000000606082015260800190565b600060c08201905061ffff808451168352602084015167ffffffffffffffff80821660208601526040860151915073ffffffffffffffffffffffffffffffffffffffff80831660408701528360608801511660608701528160808801511660808701528060a08801511660a08701525050505092915050565b61ffff91909116815260200190565b600061ffff8516825273ffffffffffffffffffffffffffffffffffffffff8416602083015260606040830152615572606083018461485b565b95945050505050565b600061ffff8516825260406020830152615572604083018486614813565b600061ffff8816825260c060208301526155b660c083018861485b565b73ffffffffffffffffffffffffffffffffffffffff8716604084015267ffffffffffffffff8616606084015284608084015282810360a08401526155fa818561485b565b9998505050505050505050565b600061ffff808816835280871660208401525073ffffffffffffffffffffffffffffffffffffffff8516604083015283606083015260a06080830152613e6860a083018461485b565b61ffff948516815292909316602083015267ffffffffffffffff16604082015273ffffffffffffffffffffffffffffffffffffffff909116606082015260800190565b61ffff968716815267ffffffffffffffff958616602082015273ffffffffffffffffffffffffffffffffffffffff948516604082015292909516606083015290921660808301529190911660a082015260c00190565b918252602082015260400190565b67ffffffffffffffff91909116815260200190565b60405181810167ffffffffffffffff8111828210171561572857fe5b604052919050565b6000808585111561573f578182fd5b8386111561574b578182fd5b5050820193919092039150565b60005b8381101561577357818101518382015260200161575b565b83811115613c5f5750506000910152565b73ffffffffffffffffffffffffffffffffffffffff811681146157a657600080fd5b50565b61ffff811681146157a657600080fd5b67ffffffffffffffff811681146157a657600080fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220fec2950ded16215c7cfa48e61f5136dfa2770dd4f696d7deb0a7a636056c350964736f6c6343000706003300000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6750000000000000000000000005b905fe05f81f3a8ad8b28c6e17779cfabf760680000000000000000000000000000000000000000000000000000000000000065

Check out more smart contracts

Build blockchain magic with Alchemy

Alchemy combines the most powerful web3 developer products and tools with resources, community and legendary support.