Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
ReadERC721Owner
Compiler Version
v0.8.24+commit.e11b9ed9
ZkSolc Version
v1.5.7
Optimization Enabled:
Yes with Mode 3
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { ILayerZeroEndpointV2, MessagingFee, MessagingReceipt, Origin } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; import { AddressCast } from "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol"; import { ReadCodecV1, EVMCallComputeV1, EVMCallRequestV1 } from "@layerzerolabs/oapp-evm/contracts/oapp/libs/ReadCodecV1.sol"; import { OAppRead } from "@layerzerolabs/oapp-evm/contracts/oapp/OAppRead.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; contract ReadERC721Owner is OAppRead { event NFTOwnerFetched(address owner); uint8 private constant READ_MSG_TYPE = 1; uint32 public immutable READ_CHANNEL; uint32 public immutable TARGET_EID; // Target chain endpoint ID address public immutable NFT_CONTRACT; // Hardcoded NFT contract address uint256 public immutable TOKEN_ID; // Hardcoded token ID constructor( address _endpoint, uint32 _readChannel, uint32 _targetEid, address _nftContract, uint256 _tokenId ) OAppRead(_endpoint, msg.sender) Ownable(msg.sender) { READ_CHANNEL = _readChannel; TARGET_EID = _targetEid; NFT_CONTRACT = _nftContract; TOKEN_ID = _tokenId; _setPeer(READ_CHANNEL, AddressCast.toBytes32(address(this))); } function fetchOwner(bytes calldata _extraOptions) external payable returns (MessagingReceipt memory receipt) { bytes memory cmd = getCmd(); return _lzSend( READ_CHANNEL, cmd, _extraOptions, MessagingFee(msg.value, 0), payable(msg.sender) ); } function getCmd() public view returns (bytes memory) { bytes memory callData = abi.encodeWithSelector(bytes4(keccak256("ownerOf(uint256)")), TOKEN_ID); EVMCallRequestV1[] memory readRequests = new EVMCallRequestV1[](1); readRequests[0] = EVMCallRequestV1({ appRequestLabel: 1, targetEid: TARGET_EID, isBlockNum: false, blockNumOrTimestamp: uint64(block.timestamp), confirmations: 5, to: NFT_CONTRACT, callData: callData }); EVMCallComputeV1 memory computeSettings = EVMCallComputeV1({ computeSetting: 1, targetEid: ILayerZeroEndpointV2(endpoint).eid(), isBlockNum: false, blockNumOrTimestamp: uint64(block.timestamp), confirmations: 5, to: address(this) }); return ReadCodecV1.encode(0, readRequests, computeSettings); } function lzMap(bytes calldata, bytes calldata _response) external pure returns (bytes memory) { address owner = abi.decode(_response, (address)); return abi.encode(owner); } function _lzReceive( Origin calldata, bytes32, bytes calldata _message, address, bytes calldata ) internal override { address owner = abi.decode(_message, (address)); emit NFTOwnerFetched(owner); } }
// SPDX-License-Identifier: LZBL-1.2 pragma solidity ^0.8.20; library AddressCast { error AddressCast_InvalidSizeForAddress(); error AddressCast_InvalidAddress(); function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) { if (_addressBytes.length > 32) revert AddressCast_InvalidAddress(); result = bytes32(_addressBytes); unchecked { uint256 offset = 32 - _addressBytes.length; result = result >> (offset * 8); } } function toBytes32(address _address) internal pure returns (bytes32 result) { result = bytes32(uint256(uint160(_address))); } function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) { if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress(); result = new bytes(_size); unchecked { uint256 offset = 256 - _size * 8; assembly { mstore(add(result, 32), shl(offset, _addressBytes32)) } } } function toAddress(bytes32 _addressBytes32) internal pure returns (address result) { result = address(uint160(uint256(_addressBytes32))); } function toAddress(bytes calldata _addressBytes) internal pure returns (address result) { if (_addressBytes.length != 20) revert AddressCast_InvalidAddress(); result = address(bytes20(_addressBytes)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import { IMessageLibManager } from "./IMessageLibManager.sol"; import { IMessagingComposer } from "./IMessagingComposer.sol"; import { IMessagingChannel } from "./IMessagingChannel.sol"; import { IMessagingContext } from "./IMessagingContext.sol"; struct MessagingParams { uint32 dstEid; bytes32 receiver; bytes message; bytes options; bool payInLzToken; } struct MessagingReceipt { bytes32 guid; uint64 nonce; MessagingFee fee; } struct MessagingFee { uint256 nativeFee; uint256 lzTokenFee; } struct Origin { uint32 srcEid; bytes32 sender; uint64 nonce; } interface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext { event PacketSent(bytes encodedPayload, bytes options, address sendLibrary); event PacketVerified(Origin origin, address receiver, bytes32 payloadHash); event PacketDelivered(Origin origin, address receiver); event LzReceiveAlert( address indexed receiver, address indexed executor, Origin origin, bytes32 guid, uint256 gas, uint256 value, bytes message, bytes extraData, bytes reason ); event LzTokenSet(address token); event DelegateSet(address sender, address delegate); function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory); function send( MessagingParams calldata _params, address _refundAddress ) external payable returns (MessagingReceipt memory); function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external; function verifiable(Origin calldata _origin, address _receiver) external view returns (bool); function initializable(Origin calldata _origin, address _receiver) external view returns (bool); function lzReceive( Origin calldata _origin, address _receiver, bytes32 _guid, bytes calldata _message, bytes calldata _extraData ) external payable; // oapp can burn messages partially by calling this function with its own business logic if messages are verified in order function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external; function setLzToken(address _lzToken) external; function lzToken() external view returns (address); function nativeToken() external view returns (address); function setDelegate(address _delegate) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol"; struct EVMCallRequestV1 { uint16 appRequestLabel; // Label identifying the application or type of request (can be use in lzCompute) uint32 targetEid; // Target endpoint ID (representing a target blockchain) bool isBlockNum; // True if the request = block number, false if timestamp uint64 blockNumOrTimestamp; // Block number or timestamp to use in the request uint16 confirmations; // Number of block confirmations on top of the requested block number or timestamp before the view function can be called address to; // Address of the target contract on the target chain bytes callData; // Calldata for the contract call } struct EVMCallComputeV1 { uint8 computeSetting; // Compute setting (0 = map only, 1 = reduce only, 2 = map reduce) uint32 targetEid; // Target endpoint ID (representing a target blockchain) bool isBlockNum; // True if the request = block number, false if timestamp uint64 blockNumOrTimestamp; // Block number or timestamp to use in the request uint16 confirmations; // Number of block confirmations on top of the requested block number or timestamp before the view function can be called address to; // Address of the target contract on the target chain } library ReadCodecV1 { using SafeCast for uint256; uint16 internal constant CMD_VERSION = 1; uint8 internal constant REQUEST_VERSION = 1; uint16 internal constant RESOLVER_TYPE_SINGLE_VIEW_EVM_CALL = 1; uint8 internal constant COMPUTE_VERSION = 1; uint16 internal constant COMPUTE_TYPE_SINGLE_VIEW_EVM_CALL = 1; error InvalidVersion(); error InvalidType(); function decode( bytes calldata _cmd ) internal pure returns (uint16 appCmdLabel, EVMCallRequestV1[] memory evmCallRequests, EVMCallComputeV1 memory compute) { uint256 offset = 0; uint16 cmdVersion = uint16(bytes2(_cmd[offset:offset + 2])); offset += 2; if (cmdVersion != CMD_VERSION) revert InvalidVersion(); appCmdLabel = uint16(bytes2(_cmd[offset:offset + 2])); offset += 2; (evmCallRequests, offset) = decodeRequestsV1(_cmd, offset); // decode the compute if it exists if (offset < _cmd.length) { (compute, ) = decodeEVMCallComputeV1(_cmd, offset); } } function decodeRequestsV1( bytes calldata _cmd, uint256 _offset ) internal pure returns (EVMCallRequestV1[] memory evmCallRequests, uint256 newOffset) { newOffset = _offset; uint16 requestCount = uint16(bytes2(_cmd[newOffset:newOffset + 2])); newOffset += 2; evmCallRequests = new EVMCallRequestV1[](requestCount); for (uint16 i = 0; i < requestCount; i++) { uint8 requestVersion = uint8(_cmd[newOffset]); newOffset += 1; if (requestVersion != REQUEST_VERSION) revert InvalidVersion(); uint16 appRequestLabel = uint16(bytes2(_cmd[newOffset:newOffset + 2])); newOffset += 2; uint16 resolverType = uint16(bytes2(_cmd[newOffset:newOffset + 2])); newOffset += 2; if (resolverType == RESOLVER_TYPE_SINGLE_VIEW_EVM_CALL) { (EVMCallRequestV1 memory request, uint256 nextOffset) = decodeEVMCallRequestV1( _cmd, newOffset, appRequestLabel ); newOffset = nextOffset; evmCallRequests[i] = request; } else { revert InvalidType(); } } } function decodeEVMCallRequestV1( bytes calldata _cmd, uint256 _offset, uint16 _appRequestLabel ) internal pure returns (EVMCallRequestV1 memory request, uint256 newOffset) { newOffset = _offset; request.appRequestLabel = _appRequestLabel; uint16 requestSize = uint16(bytes2(_cmd[newOffset:newOffset + 2])); newOffset += 2; request.targetEid = uint32(bytes4(_cmd[newOffset:newOffset + 4])); newOffset += 4; request.isBlockNum = uint8(_cmd[newOffset]) == 1; newOffset += 1; request.blockNumOrTimestamp = uint64(bytes8(_cmd[newOffset:newOffset + 8])); newOffset += 8; request.confirmations = uint16(bytes2(_cmd[newOffset:newOffset + 2])); newOffset += 2; request.to = address(bytes20(_cmd[newOffset:newOffset + 20])); newOffset += 20; uint16 callDataSize = requestSize - 35; request.callData = _cmd[newOffset:newOffset + callDataSize]; newOffset += callDataSize; } function decodeEVMCallComputeV1( bytes calldata _cmd, uint256 _offset ) internal pure returns (EVMCallComputeV1 memory compute, uint256 newOffset) { newOffset = _offset; uint8 computeVersion = uint8(_cmd[newOffset]); newOffset += 1; if (computeVersion != COMPUTE_VERSION) revert InvalidVersion(); uint16 computeType = uint16(bytes2(_cmd[newOffset:newOffset + 2])); newOffset += 2; if (computeType != COMPUTE_TYPE_SINGLE_VIEW_EVM_CALL) revert InvalidType(); compute.computeSetting = uint8(_cmd[newOffset]); newOffset += 1; compute.targetEid = uint32(bytes4(_cmd[newOffset:newOffset + 4])); newOffset += 4; compute.isBlockNum = uint8(_cmd[newOffset]) == 1; newOffset += 1; compute.blockNumOrTimestamp = uint64(bytes8(_cmd[newOffset:newOffset + 8])); newOffset += 8; compute.confirmations = uint16(bytes2(_cmd[newOffset:newOffset + 2])); newOffset += 2; compute.to = address(bytes20(_cmd[newOffset:newOffset + 20])); newOffset += 20; } function decodeCmdAppLabel(bytes calldata _cmd) internal pure returns (uint16) { uint256 offset = 0; uint16 cmdVersion = uint16(bytes2(_cmd[offset:offset + 2])); offset += 2; if (cmdVersion != CMD_VERSION) revert InvalidVersion(); return uint16(bytes2(_cmd[offset:offset + 2])); } function decodeRequestV1AppRequestLabel(bytes calldata _request) internal pure returns (uint16) { uint256 offset = 0; uint8 requestVersion = uint8(_request[offset]); offset += 1; if (requestVersion != REQUEST_VERSION) revert InvalidVersion(); return uint16(bytes2(_request[offset:offset + 2])); } function encode( uint16 _appCmdLabel, EVMCallRequestV1[] memory _evmCallRequests, EVMCallComputeV1 memory _evmCallCompute ) internal pure returns (bytes memory) { bytes memory cmd = encode(_appCmdLabel, _evmCallRequests); if (_evmCallCompute.targetEid != 0) { // if eid is 0, it means no compute cmd = appendEVMCallComputeV1(cmd, _evmCallCompute); } return cmd; } function encode( uint16 _appCmdLabel, EVMCallRequestV1[] memory _evmCallRequests ) internal pure returns (bytes memory) { bytes memory cmd = abi.encodePacked(CMD_VERSION, _appCmdLabel, _evmCallRequests.length.toUint16()); for (uint256 i = 0; i < _evmCallRequests.length; i++) { cmd = appendEVMCallRequestV1(cmd, _evmCallRequests[i]); } return cmd; } // todo: optimize this with Buffer function appendEVMCallRequestV1( bytes memory _cmd, EVMCallRequestV1 memory _request ) internal pure returns (bytes memory) { bytes memory newCmd = abi.encodePacked( _cmd, REQUEST_VERSION, _request.appRequestLabel, RESOLVER_TYPE_SINGLE_VIEW_EVM_CALL, (_request.callData.length + 35).toUint16(), _request.targetEid ); return abi.encodePacked( newCmd, _request.isBlockNum, _request.blockNumOrTimestamp, _request.confirmations, _request.to, _request.callData ); } function appendEVMCallComputeV1( bytes memory _cmd, EVMCallComputeV1 memory _compute ) internal pure returns (bytes memory) { return abi.encodePacked( _cmd, COMPUTE_VERSION, COMPUTE_TYPE_SINGLE_VIEW_EVM_CALL, _compute.computeSetting, _compute.targetEid, _compute.isBlockNum, _compute.blockNumOrTimestamp, _compute.confirmations, _compute.to ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { AddressCast } from "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol"; import { OApp } from "./OApp.sol"; abstract contract OAppRead is OApp { constructor(address _endpoint, address _delegate) OApp(_endpoint, _delegate) {} // ------------------------------- // Only Owner function setReadChannel(uint32 _channelId, bool _active) public virtual onlyOwner { _setPeer(_channelId, _active ? AddressCast.toBytes32(address(this)) : bytes32(0)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; interface IMessagingChannel { event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce); event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash); event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash); function eid() external view returns (uint32); // this is an emergency function if a message cannot be verified for some reasons // required to provide _nextNonce to avoid race condition function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external; function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external; function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external; function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32); function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64); function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64); function inboundPayloadHash( address _receiver, uint32 _srcEid, bytes32 _sender, uint64 _nonce ) external view returns (bytes32); function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; struct SetConfigParam { uint32 eid; uint32 configType; bytes config; } interface IMessageLibManager { struct Timeout { address lib; uint256 expiry; } event LibraryRegistered(address newLib); event DefaultSendLibrarySet(uint32 eid, address newLib); event DefaultReceiveLibrarySet(uint32 eid, address newLib); event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry); event SendLibrarySet(address sender, uint32 eid, address newLib); event ReceiveLibrarySet(address receiver, uint32 eid, address newLib); event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout); function registerLibrary(address _lib) external; function isRegisteredLibrary(address _lib) external view returns (bool); function getRegisteredLibraries() external view returns (address[] memory); function setDefaultSendLibrary(uint32 _eid, address _newLib) external; function defaultSendLibrary(uint32 _eid) external view returns (address); function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _gracePeriod) external; function defaultReceiveLibrary(uint32 _eid) external view returns (address); function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external; function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry); function isSupportedEid(uint32 _eid) external view returns (bool); function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool); /// ------------------- OApp interfaces ------------------- function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external; function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib); function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool); function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external; function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault); function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _expiry) external; function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry); function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external; function getConfig( address _oapp, address _lib, uint32 _eid, uint32 _configType ) external view returns (bytes memory config); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; interface IMessagingContext { function isSendingMessage() external view returns (bool); function getSendContext() external view returns (uint32 dstEid, address sender); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; interface IMessagingComposer { event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message); event ComposeDelivered(address from, address to, bytes32 guid, uint16 index); event LzComposeAlert( address indexed from, address indexed to, address indexed executor, bytes32 guid, uint16 index, uint256 gas, uint256 value, bytes message, bytes extraData, bytes reason ); function composeQueue( address _from, address _to, bytes32 _guid, uint16 _index ) external view returns (bytes32 messageHash); function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external; function lzCompose( address _from, address _to, bytes32 _guid, uint16 _index, bytes calldata _message, bytes calldata _extraData ) external payable; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol) // This file was procedurally generated from scripts/generate/templates/SafeCast.js. pragma solidity ^0.8.20; /** * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeCast { /** * @dev Value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value); /** * @dev An int value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedIntToUint(int256 value); /** * @dev Value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedIntDowncast(uint8 bits, int256 value); /** * @dev An uint value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedUintToInt(uint256 value); /** * @dev Returns the downcasted uint248 from uint256, reverting on * overflow (when the input is greater than largest uint248). * * Counterpart to Solidity's `uint248` operator. * * Requirements: * * - input must fit into 248 bits */ function toUint248(uint256 value) internal pure returns (uint248) { if (value > type(uint248).max) { revert SafeCastOverflowedUintDowncast(248, value); } return uint248(value); } /** * @dev Returns the downcasted uint240 from uint256, reverting on * overflow (when the input is greater than largest uint240). * * Counterpart to Solidity's `uint240` operator. * * Requirements: * * - input must fit into 240 bits */ function toUint240(uint256 value) internal pure returns (uint240) { if (value > type(uint240).max) { revert SafeCastOverflowedUintDowncast(240, value); } return uint240(value); } /** * @dev Returns the downcasted uint232 from uint256, reverting on * overflow (when the input is greater than largest uint232). * * Counterpart to Solidity's `uint232` operator. * * Requirements: * * - input must fit into 232 bits */ function toUint232(uint256 value) internal pure returns (uint232) { if (value > type(uint232).max) { revert SafeCastOverflowedUintDowncast(232, value); } return uint232(value); } /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { if (value > type(uint224).max) { revert SafeCastOverflowedUintDowncast(224, value); } return uint224(value); } /** * @dev Returns the downcasted uint216 from uint256, reverting on * overflow (when the input is greater than largest uint216). * * Counterpart to Solidity's `uint216` operator. * * Requirements: * * - input must fit into 216 bits */ function toUint216(uint256 value) internal pure returns (uint216) { if (value > type(uint216).max) { revert SafeCastOverflowedUintDowncast(216, value); } return uint216(value); } /** * @dev Returns the downcasted uint208 from uint256, reverting on * overflow (when the input is greater than largest uint208). * * Counterpart to Solidity's `uint208` operator. * * Requirements: * * - input must fit into 208 bits */ function toUint208(uint256 value) internal pure returns (uint208) { if (value > type(uint208).max) { revert SafeCastOverflowedUintDowncast(208, value); } return uint208(value); } /** * @dev Returns the downcasted uint200 from uint256, reverting on * overflow (when the input is greater than largest uint200). * * Counterpart to Solidity's `uint200` operator. * * Requirements: * * - input must fit into 200 bits */ function toUint200(uint256 value) internal pure returns (uint200) { if (value > type(uint200).max) { revert SafeCastOverflowedUintDowncast(200, value); } return uint200(value); } /** * @dev Returns the downcasted uint192 from uint256, reverting on * overflow (when the input is greater than largest uint192). * * Counterpart to Solidity's `uint192` operator. * * Requirements: * * - input must fit into 192 bits */ function toUint192(uint256 value) internal pure returns (uint192) { if (value > type(uint192).max) { revert SafeCastOverflowedUintDowncast(192, value); } return uint192(value); } /** * @dev Returns the downcasted uint184 from uint256, reverting on * overflow (when the input is greater than largest uint184). * * Counterpart to Solidity's `uint184` operator. * * Requirements: * * - input must fit into 184 bits */ function toUint184(uint256 value) internal pure returns (uint184) { if (value > type(uint184).max) { revert SafeCastOverflowedUintDowncast(184, value); } return uint184(value); } /** * @dev Returns the downcasted uint176 from uint256, reverting on * overflow (when the input is greater than largest uint176). * * Counterpart to Solidity's `uint176` operator. * * Requirements: * * - input must fit into 176 bits */ function toUint176(uint256 value) internal pure returns (uint176) { if (value > type(uint176).max) { revert SafeCastOverflowedUintDowncast(176, value); } return uint176(value); } /** * @dev Returns the downcasted uint168 from uint256, reverting on * overflow (when the input is greater than largest uint168). * * Counterpart to Solidity's `uint168` operator. * * Requirements: * * - input must fit into 168 bits */ function toUint168(uint256 value) internal pure returns (uint168) { if (value > type(uint168).max) { revert SafeCastOverflowedUintDowncast(168, value); } return uint168(value); } /** * @dev Returns the downcasted uint160 from uint256, reverting on * overflow (when the input is greater than largest uint160). * * Counterpart to Solidity's `uint160` operator. * * Requirements: * * - input must fit into 160 bits */ function toUint160(uint256 value) internal pure returns (uint160) { if (value > type(uint160).max) { revert SafeCastOverflowedUintDowncast(160, value); } return uint160(value); } /** * @dev Returns the downcasted uint152 from uint256, reverting on * overflow (when the input is greater than largest uint152). * * Counterpart to Solidity's `uint152` operator. * * Requirements: * * - input must fit into 152 bits */ function toUint152(uint256 value) internal pure returns (uint152) { if (value > type(uint152).max) { revert SafeCastOverflowedUintDowncast(152, value); } return uint152(value); } /** * @dev Returns the downcasted uint144 from uint256, reverting on * overflow (when the input is greater than largest uint144). * * Counterpart to Solidity's `uint144` operator. * * Requirements: * * - input must fit into 144 bits */ function toUint144(uint256 value) internal pure returns (uint144) { if (value > type(uint144).max) { revert SafeCastOverflowedUintDowncast(144, value); } return uint144(value); } /** * @dev Returns the downcasted uint136 from uint256, reverting on * overflow (when the input is greater than largest uint136). * * Counterpart to Solidity's `uint136` operator. * * Requirements: * * - input must fit into 136 bits */ function toUint136(uint256 value) internal pure returns (uint136) { if (value > type(uint136).max) { revert SafeCastOverflowedUintDowncast(136, value); } return uint136(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { if (value > type(uint128).max) { revert SafeCastOverflowedUintDowncast(128, value); } return uint128(value); } /** * @dev Returns the downcasted uint120 from uint256, reverting on * overflow (when the input is greater than largest uint120). * * Counterpart to Solidity's `uint120` operator. * * Requirements: * * - input must fit into 120 bits */ function toUint120(uint256 value) internal pure returns (uint120) { if (value > type(uint120).max) { revert SafeCastOverflowedUintDowncast(120, value); } return uint120(value); } /** * @dev Returns the downcasted uint112 from uint256, reverting on * overflow (when the input is greater than largest uint112). * * Counterpart to Solidity's `uint112` operator. * * Requirements: * * - input must fit into 112 bits */ function toUint112(uint256 value) internal pure returns (uint112) { if (value > type(uint112).max) { revert SafeCastOverflowedUintDowncast(112, value); } return uint112(value); } /** * @dev Returns the downcasted uint104 from uint256, reverting on * overflow (when the input is greater than largest uint104). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 104 bits */ function toUint104(uint256 value) internal pure returns (uint104) { if (value > type(uint104).max) { revert SafeCastOverflowedUintDowncast(104, value); } return uint104(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { if (value > type(uint96).max) { revert SafeCastOverflowedUintDowncast(96, value); } return uint96(value); } /** * @dev Returns the downcasted uint88 from uint256, reverting on * overflow (when the input is greater than largest uint88). * * Counterpart to Solidity's `uint88` operator. * * Requirements: * * - input must fit into 88 bits */ function toUint88(uint256 value) internal pure returns (uint88) { if (value > type(uint88).max) { revert SafeCastOverflowedUintDowncast(88, value); } return uint88(value); } /** * @dev Returns the downcasted uint80 from uint256, reverting on * overflow (when the input is greater than largest uint80). * * Counterpart to Solidity's `uint80` operator. * * Requirements: * * - input must fit into 80 bits */ function toUint80(uint256 value) internal pure returns (uint80) { if (value > type(uint80).max) { revert SafeCastOverflowedUintDowncast(80, value); } return uint80(value); } /** * @dev Returns the downcasted uint72 from uint256, reverting on * overflow (when the input is greater than largest uint72). * * Counterpart to Solidity's `uint72` operator. * * Requirements: * * - input must fit into 72 bits */ function toUint72(uint256 value) internal pure returns (uint72) { if (value > type(uint72).max) { revert SafeCastOverflowedUintDowncast(72, value); } return uint72(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { if (value > type(uint64).max) { revert SafeCastOverflowedUintDowncast(64, value); } return uint64(value); } /** * @dev Returns the downcasted uint56 from uint256, reverting on * overflow (when the input is greater than largest uint56). * * Counterpart to Solidity's `uint56` operator. * * Requirements: * * - input must fit into 56 bits */ function toUint56(uint256 value) internal pure returns (uint56) { if (value > type(uint56).max) { revert SafeCastOverflowedUintDowncast(56, value); } return uint56(value); } /** * @dev Returns the downcasted uint48 from uint256, reverting on * overflow (when the input is greater than largest uint48). * * Counterpart to Solidity's `uint48` operator. * * Requirements: * * - input must fit into 48 bits */ function toUint48(uint256 value) internal pure returns (uint48) { if (value > type(uint48).max) { revert SafeCastOverflowedUintDowncast(48, value); } return uint48(value); } /** * @dev Returns the downcasted uint40 from uint256, reverting on * overflow (when the input is greater than largest uint40). * * Counterpart to Solidity's `uint40` operator. * * Requirements: * * - input must fit into 40 bits */ function toUint40(uint256 value) internal pure returns (uint40) { if (value > type(uint40).max) { revert SafeCastOverflowedUintDowncast(40, value); } return uint40(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { if (value > type(uint32).max) { revert SafeCastOverflowedUintDowncast(32, value); } return uint32(value); } /** * @dev Returns the downcasted uint24 from uint256, reverting on * overflow (when the input is greater than largest uint24). * * Counterpart to Solidity's `uint24` operator. * * Requirements: * * - input must fit into 24 bits */ function toUint24(uint256 value) internal pure returns (uint24) { if (value > type(uint24).max) { revert SafeCastOverflowedUintDowncast(24, value); } return uint24(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { if (value > type(uint16).max) { revert SafeCastOverflowedUintDowncast(16, value); } return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits */ function toUint8(uint256 value) internal pure returns (uint8) { if (value > type(uint8).max) { revert SafeCastOverflowedUintDowncast(8, value); } return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { if (value < 0) { revert SafeCastOverflowedIntToUint(value); } return uint256(value); } /** * @dev Returns the downcasted int248 from int256, reverting on * overflow (when the input is less than smallest int248 or * greater than largest int248). * * Counterpart to Solidity's `int248` operator. * * Requirements: * * - input must fit into 248 bits */ function toInt248(int256 value) internal pure returns (int248 downcasted) { downcasted = int248(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(248, value); } } /** * @dev Returns the downcasted int240 from int256, reverting on * overflow (when the input is less than smallest int240 or * greater than largest int240). * * Counterpart to Solidity's `int240` operator. * * Requirements: * * - input must fit into 240 bits */ function toInt240(int256 value) internal pure returns (int240 downcasted) { downcasted = int240(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(240, value); } } /** * @dev Returns the downcasted int232 from int256, reverting on * overflow (when the input is less than smallest int232 or * greater than largest int232). * * Counterpart to Solidity's `int232` operator. * * Requirements: * * - input must fit into 232 bits */ function toInt232(int256 value) internal pure returns (int232 downcasted) { downcasted = int232(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(232, value); } } /** * @dev Returns the downcasted int224 from int256, reverting on * overflow (when the input is less than smallest int224 or * greater than largest int224). * * Counterpart to Solidity's `int224` operator. * * Requirements: * * - input must fit into 224 bits */ function toInt224(int256 value) internal pure returns (int224 downcasted) { downcasted = int224(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(224, value); } } /** * @dev Returns the downcasted int216 from int256, reverting on * overflow (when the input is less than smallest int216 or * greater than largest int216). * * Counterpart to Solidity's `int216` operator. * * Requirements: * * - input must fit into 216 bits */ function toInt216(int256 value) internal pure returns (int216 downcasted) { downcasted = int216(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(216, value); } } /** * @dev Returns the downcasted int208 from int256, reverting on * overflow (when the input is less than smallest int208 or * greater than largest int208). * * Counterpart to Solidity's `int208` operator. * * Requirements: * * - input must fit into 208 bits */ function toInt208(int256 value) internal pure returns (int208 downcasted) { downcasted = int208(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(208, value); } } /** * @dev Returns the downcasted int200 from int256, reverting on * overflow (when the input is less than smallest int200 or * greater than largest int200). * * Counterpart to Solidity's `int200` operator. * * Requirements: * * - input must fit into 200 bits */ function toInt200(int256 value) internal pure returns (int200 downcasted) { downcasted = int200(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(200, value); } } /** * @dev Returns the downcasted int192 from int256, reverting on * overflow (when the input is less than smallest int192 or * greater than largest int192). * * Counterpart to Solidity's `int192` operator. * * Requirements: * * - input must fit into 192 bits */ function toInt192(int256 value) internal pure returns (int192 downcasted) { downcasted = int192(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(192, value); } } /** * @dev Returns the downcasted int184 from int256, reverting on * overflow (when the input is less than smallest int184 or * greater than largest int184). * * Counterpart to Solidity's `int184` operator. * * Requirements: * * - input must fit into 184 bits */ function toInt184(int256 value) internal pure returns (int184 downcasted) { downcasted = int184(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(184, value); } } /** * @dev Returns the downcasted int176 from int256, reverting on * overflow (when the input is less than smallest int176 or * greater than largest int176). * * Counterpart to Solidity's `int176` operator. * * Requirements: * * - input must fit into 176 bits */ function toInt176(int256 value) internal pure returns (int176 downcasted) { downcasted = int176(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(176, value); } } /** * @dev Returns the downcasted int168 from int256, reverting on * overflow (when the input is less than smallest int168 or * greater than largest int168). * * Counterpart to Solidity's `int168` operator. * * Requirements: * * - input must fit into 168 bits */ function toInt168(int256 value) internal pure returns (int168 downcasted) { downcasted = int168(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(168, value); } } /** * @dev Returns the downcasted int160 from int256, reverting on * overflow (when the input is less than smallest int160 or * greater than largest int160). * * Counterpart to Solidity's `int160` operator. * * Requirements: * * - input must fit into 160 bits */ function toInt160(int256 value) internal pure returns (int160 downcasted) { downcasted = int160(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(160, value); } } /** * @dev Returns the downcasted int152 from int256, reverting on * overflow (when the input is less than smallest int152 or * greater than largest int152). * * Counterpart to Solidity's `int152` operator. * * Requirements: * * - input must fit into 152 bits */ function toInt152(int256 value) internal pure returns (int152 downcasted) { downcasted = int152(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(152, value); } } /** * @dev Returns the downcasted int144 from int256, reverting on * overflow (when the input is less than smallest int144 or * greater than largest int144). * * Counterpart to Solidity's `int144` operator. * * Requirements: * * - input must fit into 144 bits */ function toInt144(int256 value) internal pure returns (int144 downcasted) { downcasted = int144(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(144, value); } } /** * @dev Returns the downcasted int136 from int256, reverting on * overflow (when the input is less than smallest int136 or * greater than largest int136). * * Counterpart to Solidity's `int136` operator. * * Requirements: * * - input must fit into 136 bits */ function toInt136(int256 value) internal pure returns (int136 downcasted) { downcasted = int136(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(136, value); } } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits */ function toInt128(int256 value) internal pure returns (int128 downcasted) { downcasted = int128(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(128, value); } } /** * @dev Returns the downcasted int120 from int256, reverting on * overflow (when the input is less than smallest int120 or * greater than largest int120). * * Counterpart to Solidity's `int120` operator. * * Requirements: * * - input must fit into 120 bits */ function toInt120(int256 value) internal pure returns (int120 downcasted) { downcasted = int120(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(120, value); } } /** * @dev Returns the downcasted int112 from int256, reverting on * overflow (when the input is less than smallest int112 or * greater than largest int112). * * Counterpart to Solidity's `int112` operator. * * Requirements: * * - input must fit into 112 bits */ function toInt112(int256 value) internal pure returns (int112 downcasted) { downcasted = int112(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(112, value); } } /** * @dev Returns the downcasted int104 from int256, reverting on * overflow (when the input is less than smallest int104 or * greater than largest int104). * * Counterpart to Solidity's `int104` operator. * * Requirements: * * - input must fit into 104 bits */ function toInt104(int256 value) internal pure returns (int104 downcasted) { downcasted = int104(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(104, value); } } /** * @dev Returns the downcasted int96 from int256, reverting on * overflow (when the input is less than smallest int96 or * greater than largest int96). * * Counterpart to Solidity's `int96` operator. * * Requirements: * * - input must fit into 96 bits */ function toInt96(int256 value) internal pure returns (int96 downcasted) { downcasted = int96(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(96, value); } } /** * @dev Returns the downcasted int88 from int256, reverting on * overflow (when the input is less than smallest int88 or * greater than largest int88). * * Counterpart to Solidity's `int88` operator. * * Requirements: * * - input must fit into 88 bits */ function toInt88(int256 value) internal pure returns (int88 downcasted) { downcasted = int88(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(88, value); } } /** * @dev Returns the downcasted int80 from int256, reverting on * overflow (when the input is less than smallest int80 or * greater than largest int80). * * Counterpart to Solidity's `int80` operator. * * Requirements: * * - input must fit into 80 bits */ function toInt80(int256 value) internal pure returns (int80 downcasted) { downcasted = int80(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(80, value); } } /** * @dev Returns the downcasted int72 from int256, reverting on * overflow (when the input is less than smallest int72 or * greater than largest int72). * * Counterpart to Solidity's `int72` operator. * * Requirements: * * - input must fit into 72 bits */ function toInt72(int256 value) internal pure returns (int72 downcasted) { downcasted = int72(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(72, value); } } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits */ function toInt64(int256 value) internal pure returns (int64 downcasted) { downcasted = int64(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(64, value); } } /** * @dev Returns the downcasted int56 from int256, reverting on * overflow (when the input is less than smallest int56 or * greater than largest int56). * * Counterpart to Solidity's `int56` operator. * * Requirements: * * - input must fit into 56 bits */ function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(56, value); } } /** * @dev Returns the downcasted int48 from int256, reverting on * overflow (when the input is less than smallest int48 or * greater than largest int48). * * Counterpart to Solidity's `int48` operator. * * Requirements: * * - input must fit into 48 bits */ function toInt48(int256 value) internal pure returns (int48 downcasted) { downcasted = int48(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(48, value); } } /** * @dev Returns the downcasted int40 from int256, reverting on * overflow (when the input is less than smallest int40 or * greater than largest int40). * * Counterpart to Solidity's `int40` operator. * * Requirements: * * - input must fit into 40 bits */ function toInt40(int256 value) internal pure returns (int40 downcasted) { downcasted = int40(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(40, value); } } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits */ function toInt32(int256 value) internal pure returns (int32 downcasted) { downcasted = int32(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(32, value); } } /** * @dev Returns the downcasted int24 from int256, reverting on * overflow (when the input is less than smallest int24 or * greater than largest int24). * * Counterpart to Solidity's `int24` operator. * * Requirements: * * - input must fit into 24 bits */ function toInt24(int256 value) internal pure returns (int24 downcasted) { downcasted = int24(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(24, value); } } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits */ function toInt16(int256 value) internal pure returns (int16 downcasted) { downcasted = int16(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(16, value); } } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits */ function toInt8(int256 value) internal pure returns (int8 downcasted) { downcasted = int8(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(8, value); } } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive if (value > uint256(type(int256).max)) { revert SafeCastOverflowedUintToInt(value); } return int256(value); } /** * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump. */ function toUint(bool b) internal pure returns (uint256 u) { assembly ("memory-safe") { u := iszero(iszero(b)) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; // @dev Import the 'MessagingFee' and 'MessagingReceipt' so it's exposed to OApp implementers // solhint-disable-next-line no-unused-import import { OAppSender, MessagingFee, MessagingReceipt } from "./OAppSender.sol"; // @dev Import the 'Origin' so it's exposed to OApp implementers // solhint-disable-next-line no-unused-import import { OAppReceiver, Origin } from "./OAppReceiver.sol"; import { OAppCore } from "./OAppCore.sol"; /** * @title OApp * @dev Abstract contract serving as the base for OApp implementation, combining OAppSender and OAppReceiver functionality. */ abstract contract OApp is OAppSender, OAppReceiver { /** * @dev Constructor to initialize the OApp with the provided endpoint and owner. * @param _endpoint The address of the LOCAL LayerZero endpoint. * @param _delegate The delegate capable of making OApp configurations inside of the endpoint. */ constructor(address _endpoint, address _delegate) OAppCore(_endpoint, _delegate) {} /** * @notice Retrieves the OApp version information. * @return senderVersion The version of the OAppSender.sol implementation. * @return receiverVersion The version of the OAppReceiver.sol implementation. */ function oAppVersion() public pure virtual override(OAppSender, OAppReceiver) returns (uint64 senderVersion, uint64 receiverVersion) { return (SENDER_VERSION, RECEIVER_VERSION); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { IOAppReceiver, Origin } from "./interfaces/IOAppReceiver.sol"; import { OAppCore } from "./OAppCore.sol"; /** * @title OAppReceiver * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers. */ abstract contract OAppReceiver is IOAppReceiver, OAppCore { // Custom error message for when the caller is not the registered endpoint/ error OnlyEndpoint(address addr); // @dev The version of the OAppReceiver implementation. // @dev Version is bumped when changes are made to this contract. uint64 internal constant RECEIVER_VERSION = 2; /** * @notice Retrieves the OApp version information. * @return senderVersion The version of the OAppSender.sol contract. * @return receiverVersion The version of the OAppReceiver.sol contract. * * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented. * ie. this is a RECEIVE only OApp. * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions. */ function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) { return (0, RECEIVER_VERSION); } /** * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint. * @dev _origin The origin information containing the source endpoint and sender address. * - srcEid: The source chain endpoint ID. * - sender: The sender address on the src chain. * - nonce: The nonce of the message. * @dev _message The lzReceive payload. * @param _sender The sender address. * @return isSender Is a valid sender. * * @dev Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer. * @dev The default sender IS the OAppReceiver implementer. */ function isComposeMsgSender( Origin calldata /*_origin*/, bytes calldata /*_message*/, address _sender ) public view virtual returns (bool) { return _sender == address(this); } /** * @notice Checks if the path initialization is allowed based on the provided origin. * @param origin The origin information containing the source endpoint and sender address. * @return Whether the path has been initialized. * * @dev This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received. * @dev This defaults to assuming if a peer has been set, its initialized. * Can be overridden by the OApp if there is other logic to determine this. */ function allowInitializePath(Origin calldata origin) public view virtual returns (bool) { return peers[origin.srcEid] == origin.sender; } /** * @notice Retrieves the next nonce for a given source endpoint and sender address. * @dev _srcEid The source endpoint ID. * @dev _sender The sender address. * @return nonce The next nonce. * * @dev The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement. * @dev Is required by the off-chain executor to determine the OApp expects msg execution is ordered. * @dev This is also enforced by the OApp. * @dev By default this is NOT enabled. ie. nextNonce is hardcoded to return 0. */ function nextNonce(uint32 /*_srcEid*/, bytes32 /*_sender*/) public view virtual returns (uint64 nonce) { return 0; } /** * @dev Entry point for receiving messages or packets from the endpoint. * @param _origin The origin information containing the source endpoint and sender address. * - srcEid: The source chain endpoint ID. * - sender: The sender address on the src chain. * - nonce: The nonce of the message. * @param _guid The unique identifier for the received LayerZero message. * @param _message The payload of the received message. * @param _executor The address of the executor for the received message. * @param _extraData Additional arbitrary data provided by the corresponding executor. * * @dev Entry point for receiving msg/packet from the LayerZero endpoint. */ function lzReceive( Origin calldata _origin, bytes32 _guid, bytes calldata _message, address _executor, bytes calldata _extraData ) public payable virtual { // Ensures that only the endpoint can attempt to lzReceive() messages to this OApp. if (address(endpoint) != msg.sender) revert OnlyEndpoint(msg.sender); // Ensure that the sender matches the expected peer for the source endpoint. if (_getPeerOrRevert(_origin.srcEid) != _origin.sender) revert OnlyPeer(_origin.srcEid, _origin.sender); // Call the internal OApp implementation of lzReceive. _lzReceive(_origin, _guid, _message, _executor, _extraData); } /** * @dev Internal function to implement lzReceive logic without needing to copy the basic parameter validation. */ function _lzReceive( Origin calldata _origin, bytes32 _guid, bytes calldata _message, address _executor, bytes calldata _extraData ) internal virtual; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { IOAppCore, ILayerZeroEndpointV2 } from "./interfaces/IOAppCore.sol"; /** * @title OAppCore * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations. */ abstract contract OAppCore is IOAppCore, Ownable { // The LayerZero endpoint associated with the given OApp ILayerZeroEndpointV2 public immutable endpoint; // Mapping to store peers associated with corresponding endpoints mapping(uint32 eid => bytes32 peer) public peers; /** * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate. * @param _endpoint The address of the LOCAL Layer Zero endpoint. * @param _delegate The delegate capable of making OApp configurations inside of the endpoint. * * @dev The delegate typically should be set as the owner of the contract. */ constructor(address _endpoint, address _delegate) { endpoint = ILayerZeroEndpointV2(_endpoint); if (_delegate == address(0)) revert InvalidDelegate(); endpoint.setDelegate(_delegate); } /** * @notice Sets the peer address (OApp instance) for a corresponding endpoint. * @param _eid The endpoint ID. * @param _peer The address of the peer to be associated with the corresponding endpoint. * * @dev Only the owner/admin of the OApp can call this function. * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp. * @dev Set this to bytes32(0) to remove the peer address. * @dev Peer is a bytes32 to accommodate non-evm chains. */ function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyOwner { _setPeer(_eid, _peer); } /** * @notice Sets the peer address (OApp instance) for a corresponding endpoint. * @param _eid The endpoint ID. * @param _peer The address of the peer to be associated with the corresponding endpoint. * * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp. * @dev Set this to bytes32(0) to remove the peer address. * @dev Peer is a bytes32 to accommodate non-evm chains. */ function _setPeer(uint32 _eid, bytes32 _peer) internal virtual { peers[_eid] = _peer; emit PeerSet(_eid, _peer); } /** * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set. * ie. the peer is set to bytes32(0). * @param _eid The endpoint ID. * @return peer The address of the peer associated with the specified endpoint. */ function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) { bytes32 peer = peers[_eid]; if (peer == bytes32(0)) revert NoPeer(_eid); return peer; } /** * @notice Sets the delegate address for the OApp. * @param _delegate The address of the delegate to be set. * * @dev Only the owner/admin of the OApp can call this function. * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract. */ function setDelegate(address _delegate) public onlyOwner { endpoint.setDelegate(_delegate); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { SafeERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { MessagingParams, MessagingFee, MessagingReceipt } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; import { OAppCore } from "./OAppCore.sol"; /** * @title OAppSender * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint. */ abstract contract OAppSender is OAppCore { using SafeERC20 for IERC20; // Custom error messages error NotEnoughNative(uint256 msgValue); error LzTokenUnavailable(); // @dev The version of the OAppSender implementation. // @dev Version is bumped when changes are made to this contract. uint64 internal constant SENDER_VERSION = 1; /** * @notice Retrieves the OApp version information. * @return senderVersion The version of the OAppSender.sol contract. * @return receiverVersion The version of the OAppReceiver.sol contract. * * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented. * ie. this is a SEND only OApp. * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions */ function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) { return (SENDER_VERSION, 0); } /** * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation. * @param _dstEid The destination endpoint ID. * @param _message The message payload. * @param _options Additional options for the message. * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens. * @return fee The calculated MessagingFee for the message. * - nativeFee: The native fee for the message. * - lzTokenFee: The LZ token fee for the message. */ function _quote( uint32 _dstEid, bytes memory _message, bytes memory _options, bool _payInLzToken ) internal view virtual returns (MessagingFee memory fee) { return endpoint.quote( MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken), address(this) ); } /** * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message. * @param _dstEid The destination endpoint ID. * @param _message The message payload. * @param _options Additional options for the message. * @param _fee The calculated LayerZero fee for the message. * - nativeFee: The native fee. * - lzTokenFee: The lzToken fee. * @param _refundAddress The address to receive any excess fee values sent to the endpoint. * @return receipt The receipt for the sent message. * - guid: The unique identifier for the sent message. * - nonce: The nonce of the sent message. * - fee: The LayerZero fee incurred for the message. */ function _lzSend( uint32 _dstEid, bytes memory _message, bytes memory _options, MessagingFee memory _fee, address _refundAddress ) internal virtual returns (MessagingReceipt memory receipt) { // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint. uint256 messageValue = _payNative(_fee.nativeFee); if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee); return // solhint-disable-next-line check-send-result endpoint.send{ value: messageValue }( MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0), _refundAddress ); } /** * @dev Internal function to pay the native fee associated with the message. * @param _nativeFee The native fee to be paid. * @return nativeFee The amount of native currency paid. * * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction, * this will need to be overridden because msg.value would contain multiple lzFees. * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency. * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees. * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time. */ function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) { if (msg.value != _nativeFee) revert NotEnoughNative(msg.value); return _nativeFee; } /** * @dev Internal function to pay the LZ token fee associated with the message. * @param _lzTokenFee The LZ token fee to be paid. * * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint. * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend(). */ function _payLzToken(uint256 _lzTokenFee) internal virtual { // @dev Cannot cache the token because it is not immutable in the endpoint. address lzToken = endpoint.lzToken(); if (lzToken == address(0)) revert LzTokenUnavailable(); // Pay LZ token fee by sending tokens to the endpoint. IERC20(lzToken).safeTransferFrom(msg.sender, address(endpoint), _lzTokenFee); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { ILayerZeroReceiver, Origin } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol"; interface IOAppReceiver is ILayerZeroReceiver { /** * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint. * @param _origin The origin information containing the source endpoint and sender address. * - srcEid: The source chain endpoint ID. * - sender: The sender address on the src chain. * - nonce: The nonce of the message. * @param _message The lzReceive payload. * @param _sender The sender address. * @return isSender Is a valid sender. * * @dev Applications can optionally choose to implement a separate composeMsg sender that is NOT the bridging layer. * @dev The default sender IS the OAppReceiver implementer. */ function isComposeMsgSender( Origin calldata _origin, bytes calldata _message, address _sender ) external view returns (bool isSender); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { ILayerZeroEndpointV2 } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; /** * @title IOAppCore */ interface IOAppCore { // Custom error messages error OnlyPeer(uint32 eid, bytes32 sender); error NoPeer(uint32 eid); error InvalidEndpointCall(); error InvalidDelegate(); // Event emitted when a peer (OApp) is set for a corresponding endpoint event PeerSet(uint32 eid, bytes32 peer); /** * @notice Retrieves the OApp version information. * @return senderVersion The version of the OAppSender.sol contract. * @return receiverVersion The version of the OAppReceiver.sol contract. */ function oAppVersion() external view returns (uint64 senderVersion, uint64 receiverVersion); /** * @notice Retrieves the LayerZero endpoint associated with the OApp. * @return iEndpoint The LayerZero endpoint as an interface. */ function endpoint() external view returns (ILayerZeroEndpointV2 iEndpoint); /** * @notice Retrieves the peer (OApp) associated with a corresponding endpoint. * @param _eid The endpoint ID. * @return peer The peer address (OApp instance) associated with the corresponding endpoint. */ function peers(uint32 _eid) external view returns (bytes32 peer); /** * @notice Sets the peer address (OApp instance) for a corresponding endpoint. * @param _eid The endpoint ID. * @param _peer The address of the peer to be associated with the corresponding endpoint. */ function setPeer(uint32 _eid, bytes32 _peer) external; /** * @notice Sets the delegate address for the OApp Core. * @param _delegate The address of the delegate to be set. */ function setDelegate(address _delegate) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC1363} from "../../../interfaces/IERC1363.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC-20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { /** * @dev An operation with an ERC-20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. * * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being * set here. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { safeTransfer(token, to, value); } else if (!token.transferAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferFromAndCallRelaxed( IERC1363 token, address from, address to, uint256 value, bytes memory data ) internal { if (to.code.length == 0) { safeTransferFrom(token, from, to, value); } else if (!token.transferFromAndCall(from, to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}. * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall} * once without retrying, and relies on the returned value to be true. * * Reverts if the returned value is other than `true`. */ function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { forceApprove(token, to, value); } else if (!token.approveAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements. */ function _callOptionalReturn(IERC20 token, bytes memory data) private { uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) // bubble errors if iszero(success) { let ptr := mload(0x40) returndatacopy(ptr, 0, returndatasize()) revert(ptr, returndatasize()) } returnSize := returndatasize() returnValue := mload(0) } if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { bool success; uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) returnSize := returndatasize() returnValue := mload(0) } return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import { Origin } from "./ILayerZeroEndpointV2.sol"; interface ILayerZeroReceiver { function allowInitializePath(Origin calldata _origin) external view returns (bool); function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64); function lzReceive( Origin calldata _origin, bytes32 _guid, bytes calldata _message, address _executor, bytes calldata _extraData ) external payable; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC165} from "./IERC165.sol"; /** * @title IERC1363 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363]. * * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction. */ interface IERC1363 is IERC20, IERC165 { /* * Note: the ERC-165 identifier for this interface is 0xb0202a11. * 0xb0202a11 === * bytes4(keccak256('transferAndCall(address,uint256)')) ^ * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^ * bytes4(keccak256('approveAndCall(address,uint256)')) ^ * bytes4(keccak256('approveAndCall(address,uint256,bytes)')) */ /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @param data Additional data with no specified format, sent in call to `spender`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[ERC]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "evmVersion": "paris", "optimizer": { "enabled": true, "mode": "3" }, "outputSelection": { "*": { "*": [ "abi", "metadata" ], "": [ "ast" ] } }, "detectMissingLibraries": false, "forceEVMLA": false, "enableEraVMExtensions": false, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"_endpoint","type":"address"},{"internalType":"uint32","name":"_readChannel","type":"uint32"},{"internalType":"uint32","name":"_targetEid","type":"uint32"},{"internalType":"address","name":"_nftContract","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidDelegate","type":"error"},{"inputs":[],"name":"InvalidEndpointCall","type":"error"},{"inputs":[],"name":"LzTokenUnavailable","type":"error"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"}],"name":"NoPeer","type":"error"},{"inputs":[{"internalType":"uint256","name":"msgValue","type":"uint256"}],"name":"NotEnoughNative","type":"error"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"OnlyEndpoint","type":"error"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"}],"name":"OnlyPeer","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"uint8","name":"bits","type":"uint8"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintDowncast","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"NFTOwnerFetched","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":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"peer","type":"bytes32"}],"name":"PeerSet","type":"event"},{"inputs":[],"name":"NFT_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"READ_CHANNEL","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TARGET_EID","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"origin","type":"tuple"}],"name":"allowInitializePath","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endpoint","outputs":[{"internalType":"contract ILayerZeroEndpointV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_extraOptions","type":"bytes"}],"name":"fetchOwner","outputs":[{"components":[{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"fee","type":"tuple"}],"internalType":"struct MessagingReceipt","name":"receipt","type":"tuple"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getCmd","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"","type":"tuple"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"address","name":"_sender","type":"address"}],"name":"isComposeMsgSender","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"bytes","name":"_response","type":"bytes"}],"name":"lzMap","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"_executor","type":"address"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"nextNonce","outputs":[{"internalType":"uint64","name":"nonce","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oAppVersion","outputs":[{"internalType":"uint64","name":"senderVersion","type":"uint64"},{"internalType":"uint64","name":"receiverVersion","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"}],"name":"peers","outputs":[{"internalType":"bytes32","name":"peer","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegate","type":"address"}],"name":"setDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"bytes32","name":"_peer","type":"bytes32"}],"name":"setPeer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_channelId","type":"uint32"},{"internalType":"bool","name":"_active","type":"bool"}],"name":"setReadChannel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
9c4d535b00000000000000000000000000000000000000000000000000000000000000000100028bb7056a9ea1530790c688c64955dcd0c16d7c77a5b82885d353bae5c2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000016c693a3924b947298f7227792953cd6bbb21ac800000000000000000000000000000000000000000000000000000000000003e90000000000000000000000000000000000000000000000000000000000007595000000000000000000000000556697ca91476b811f37a851dd2e53ae4c6024db0000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x000300000000000200110000000000020000000003020019000000000801034f00020000000103550000006001100270000002350010019d00000235021001970000000100300190000000270000c13d0000008001000039000000400010043f000000040020008c000003360000413d000000000108043b000000e001100270000002450010009c000000630000213d000002530010009c000000800000213d0000025a0010009c000000b60000a13d0000025b0010009c000001630000613d0000025c0010009c0000016c0000613d0000025d0010009c000003360000c13d0000000001000416000000000001004b000003360000c13d0000000001000412000f00000001001d000e00600000003d0000800501000039000000440300003900000000040004150000000f0440008a000002300000013d0000000001000416000000000001004b000003360000c13d0000001f0120003900000236011001970000012001100039000000400010043f0000001f0320018f00000237042001980000012001400039000000380000613d0000012005000039000000000608034f000000006706043c0000000005750436000000000015004b000000340000c13d000000000003004b000000450000613d000000000448034f0000000303300210000000000501043300000000053501cf000000000535022f000000000404043b0000010003300089000000000434022f00000000033401cf000000000353019f0000000000310435000000a00020008c000003360000413d000001200300043d000002380030009c000003360000213d000001400100043d000700000001001d000002350010009c000003360000213d000001600100043d000600000001001d000002350010009c000003360000213d000001800100043d000500000001001d000002380010009c000003360000213d0000000006000411000000000006004b000003110000c13d000000400100043d0000024402000041000000000021043500000004021000390000000000020435000002350010009c000002350100804100000040011002100000023f011001c7000008d100010430000002460010009c000000940000213d0000024d0010009c000001110000a13d0000024e0010009c0000020e0000613d0000024f0010009c000002130000613d000002500010009c000003360000c13d000000240020008c000003360000413d0000000001000416000000000001004b000003360000c13d0000000401800370000000000101043b000002350010009c000003360000213d000000000010043f0000000101000039000000200010043f0000004002000039000000000100001908cf08920000040f000000000101041a000000800010043f0000026001000041000008d00001042e000002540010009c000001250000a13d000002550010009c000002260000613d000002560010009c000002370000613d000002570010009c000003360000c13d000000440020008c000003360000413d0000000001000416000000000001004b000003360000c13d0000000401800370000000000101043b000002350010009c000003360000213d000000800000043f0000026001000041000008d00001042e000002470010009c000001340000a13d000002480010009c0000024f0000613d000002490010009c0000026b0000613d0000024a0010009c000003360000c13d000000640020008c000003360000413d0000000001000416000000000001004b000003360000c13d0000000401800370000000000101043b000002350010009c000003360000213d000000000010043f0000000101000039000000200010043f00000040020000390000000001000019000700000008035308cf08920000040f000000070200035f0000002402200370000000000202043b000000000101041a000000000021004b00000000010000390000000101006039000000800010043f0000026001000041000008d00001042e0000025e0010009c000002800000613d0000025f0010009c000003360000c13d000000e40020008c000003360000413d0000008401800370000000000101043b000002400010009c000003360000213d0000002303100039000000000023004b000003360000813d000600040010003d0000000603800360000000000303043b000700000003001d000002400030009c000003360000213d00000007011000290000002401100039000000000021004b000003360000213d000000a401800370000000000101043b000002380010009c000003360000213d000000c401800370000000000101043b000002400010009c000003360000213d0000002303100039000000000023004b000003360000813d0000000403100039000000000338034f000000000303043b000002400030009c000003360000213d00000000013100190000002401100039000000000021004b000003360000213d000002630100004100000000001004430000000001000412000000040010044300000024000004430000000001000414000002350010009c0000023501008041000000c00110021000000264011001c7000080050200003908cf08ca0000040f0000000100200190000005db0000613d0000000002000411000000000101043b0000023801100197000000000021004b000003df0000c13d00000004010000390000000201100367000000000101043b000500000001001d000002350010009c000003360000213d0000000501000029000000000010043f0000000101000039000000200010043f0000000001000414000002350010009c0000023501008041000000c00110021000000241011001c7000080100200003908cf08ca0000040f0000000100200190000003360000613d000000000101043b000000000301041a000000000003004b000004090000c13d000000400100043d0000027102000041000000000021043500000004021000390000000503000029000003ea0000013d000002510010009c000002910000613d000002520010009c000003360000c13d0000000001000416000000000001004b000003360000c13d0000000001000412000900000001001d000800800000003d000080050100003900000044030000390000000004000415000000090440008a0000000504400210000002630200004108cf08a70000040f000000800010043f0000026001000041000008d00001042e000002580010009c000002ac0000613d000002590010009c000003360000c13d0000000001000416000000000001004b000003360000c13d0000000001000412000d00000001001d000c00200000003d0000800501000039000000440300003900000000040004150000000d0440008a0000028a0000013d0000024b0010009c000002be0000613d0000024c0010009c000003360000c13d000000440020008c000003360000413d0000000001000416000000000001004b000003360000c13d0000000401800370000000000101043b000002400010009c000003360000213d0000002303100039000000000023004b000003360000813d0000000403100039000000000338034f000000000303043b000002400030009c000003360000213d00000000013100190000002401100039000000000021004b000003360000213d0000002401800370000000000101043b000002400010009c000003360000213d000000040110003908cf05ea0000040f000000000221001908cf084b0000040f0000023803100197000000400100043d000600000001001d000000200210003900000000003204350000002002000039000000000021043508cf06160000040f000000400100043d000700000001001d0000002002000039000000000221043600000006010000290000021b0000013d0000000001000416000000000001004b000003360000c13d0000000101000039000000800010043f0000000201000039000000a00010043f0000027301000041000008d00001042e000000240020008c000003360000413d0000000401800370000000000101043b000002400010009c000003360000213d0000002303100039000000000023004b000003360000813d000600040010003d0000000603800360000000000303043b000700000003001d000002400030009c000003360000213d0000000701100029000500240010003d000000050020006b000003360000213d000000800000043f000000a00000043f0000012001000039000000400010043f000000e00000043f000001000000043f000000e001000039000000c00010043f08cf06210000040f000002630200004100000000002004430000000002000412000000040020044300000020020000390000002400200443000400000001001d0000000001000414000002350010009c0000023501008041000000c00110021000000264011001c7000080050200003908cf08ca0000040f0000000100200190000005db0000613d000000000501043b000000400100043d000002650010009c000003690000213d0000004002100039000000400020043f00000007020000290000001f0220003900000279022001970000003f02200039000002790220019700000000030004160000000003310436000300000003001d0000000000030435000000400400043d0000000002240019000000000042004b00000000030000390000000103004039000002400020009c000003690000213d0000000100300190000003690000c13d000200000005001d000000400020043f000100000004001d000000070200002900000000022404360000000504000029000000000040007c000003360000213d000000070500002900000279045001980000001f0550018f0000000003420019000000060600002900000020066000390000000206600367000001c60000613d000000000706034f0000000008020019000000007907043c0000000008980436000000000038004b000001c20000c13d000000000005004b000001d30000613d000000000446034f0000000305500210000000000603043300000000065601cf000000000656022f000000000404043b0000010005500089000000000454022f00000000045401cf000000000464019f000000000043043500000007022000290000000000020435000000400200043d000002660020009c000003690000213d0000006003200039000000400030043f000000200320003900000000000304350000000000020435000000400300043d000002650030009c000003690000213d0000004004300039000000400040043f0000002004300039000000000004043500000000000304350000004002200039000000000032043500000000010104330000000002000416000000000012004b000003e50000c13d00000003010000290000000001010433000700000001001d000000000001004b000003ec0000c13d00000002010000290000023501100197000700000001001d000000000010043f0000000101000039000000200010043f0000000001000414000002350010009c0000023501008041000000c00110021000000241011001c7000080100200003908cf08ca0000040f0000000100200190000003360000613d000000400300043d000000000101043b000000000401041a000000000004004b000004260000c13d00000271010000410000000000130435000000040130003900000007020000290000000000210435000002350030009c000002350300804100000040013002100000023f011001c7000008d1000104300000000001000416000000000001004b000003360000c13d000000000100041a000002330000013d0000000001000416000000000001004b000003360000c13d08cf06210000040f0000002002000039000000400300043d000700000003001d000000000223043608cf06040000040f00000007020000290000000001210049000002350010009c00000235010080410000006001100210000002350020009c00000235020080410000004002200210000000000121019f000008d00001042e0000000001000416000000000001004b000003360000c13d0000000001000412000b00000001001d000a00000000003d0000800501000039000000440300003900000000040004150000000b0440008a0000000504400210000002630200004108cf08a70000040f0000023801100197000000800010043f0000026001000041000008d00001042e0000000001000416000000000001004b000003360000c13d000000000100041a00000238021001970000000005000411000000000052004b0000030c0000c13d0000023901100197000000000010041b0000000001000414000002350010009c0000023501008041000000c0011002100000023a011001c70000800d0200003900000003030000390000023b04000041000000000600001908cf08c50000040f0000000100200190000003360000613d0000000001000019000008d00001042e000000440020008c000003360000413d0000000001000416000000000001004b000003360000c13d0000000401800370000000000101043b000002350010009c000003360000213d0000002402800370000000000202043b000000000002004b0000000003000039000000010300c039000000000032004b000003360000c13d000000000300041a00000238043001970000000003000411000000000034004b0000033d0000c13d000000000002004b0000000002000019000002bb0000613d000000000200041008cf08670000040f0000000001000019000008d00001042e000000240020008c000003360000413d0000000001000416000000000001004b000003360000c13d0000000401800370000000000601043b000002380060009c000003360000213d000000000100041a00000238021001970000000005000411000000000052004b0000030c0000c13d000000000006004b000003420000c13d0000024401000041000000800010043f000000840000043f0000026201000041000008d1000104300000000001000416000000000001004b000003360000c13d0000000001000412001100000001001d001000400000003d000080050100003900000044030000390000000004000415000000110440008a0000000504400210000002630200004108cf08a70000040f0000023501100197000000800010043f0000026001000041000008d00001042e000000a40020008c000003360000413d0000000001000416000000000001004b000003360000c13d0000006401800370000000000101043b000002400010009c000003360000213d0000002303100039000000000023004b000003360000813d0000000403100039000000000338034f000000000303043b000002400030009c000003360000213d00000000013100190000002401100039000000000021004b000003360000213d0000008401800370000000000101043b000002380010009c000003360000213d0000000002000410000000b00000013d000000440020008c000003360000413d0000000001000416000000000001004b000003360000c13d0000000401800370000000000101043b000700000001001d000002350010009c000003360000213d08cf08570000040f00000024010000390000000201100367000000000201043b000000070100002908cf08670000040f0000000001000019000008d00001042e000000240020008c000003360000413d0000000001000416000000000001004b000003360000c13d0000000401800370000000000101043b000700000001001d000002380010009c000003360000213d000000000100041a00000238021001970000000001000411000000000012004b000003380000c13d000002630100004100000000001004430000000001000412000000040010044300000024000004430000000001000414000002350010009c0000023501008041000000c00110021000000264011001c7000080050200003908cf08ca0000040f0000000100200190000005db0000613d000000000101043b0000023c0200004100000000002004430000023801100197000600000001001d00000004001004430000000001000414000002350010009c0000023501008041000000c0011002100000023d011001c7000080020200003908cf08ca0000040f0000000100200190000005db0000613d000000000101043b000000000001004b000003360000613d000000400400043d0000023e01000041000000000014043500000004014000390000000702000029000000000021043500000000010004140000000602000029000000040020008c000003070000613d000002350040009c000002350300004100000000030440190000004003300210000002350010009c0000023501008041000000c001100210000000000131019f0000023f011001c7000700000004001d08cf08c50000040f00000007040000290000006003100270000102350030019d0000000100200190000003c00000613d000002400040009c000003690000213d000000400040043f0000000001000019000008d00001042e0000026101000041000000800010043f000000840050043f0000026201000041000008d100010430000001a00100043d000300000001001d000000000100041a0000023902100197000000000262019f000000000020041b00000000020004140000023805100197000002350020009c0000023502008041000000c0012002100000023a011001c70000800d02000039000400000003001d00000003030000390000023b0400004108cf08c50000040f00000004030000290000000100200190000003360000613d000000800030043f0000023c01000041000000000010044300000004003004430000000001000414000002350010009c0000023501008041000000c0011002100000023d011001c7000080020200003908cf08ca0000040f0000000100200190000005db0000613d000000000101043b000000000001004b00000004020000290000034e0000c13d0000000001000019000008d1000104300000026102000041000000800020043f000000840010043f0000026201000041000008d1000104300000026101000041000000800010043f000000840030043f0000026201000041000008d1000104300000023901100197000000000161019f000000000010041b0000000001000414000002350010009c0000023501008041000000c0011002100000023a011001c70000800d0200003900000003030000390000023b040000410000024a0000013d000000400400043d0000023e0100004100000000001404350000000401400039000000000300041100000000003104350000000001000414000000040020008c000003670000613d000002350040009c000002350300004100000000030440190000004003300210000002350010009c0000023501008041000000c001100210000000000131019f0000023f011001c7000400000004001d08cf08c50000040f00000004040000290000006003100270000102350030019d0000000100200190000003b30000613d000002400040009c0000036f0000a13d0000027201000041000000000010043f0000004101000039000000040010043f0000023f01000041000008d100010430000000400040043f0000000701000029000000a00010043f0000000602000029000000c00020043f0000000502000029000000e00020043f0000000302000029000001000020043f000000000010043f0000000101000039000000200010043f0000000001000414000002350010009c0000023501008041000000c00110021000000241011001c7000080100200003908cf08ca0000040f0000000100200190000003360000613d000000000101043b0000000002000410000000000021041b000000400100043d0000002003100039000000000023043500000007020000290000000000210435000002350010009c000002350100804100000040011002100000000002000414000002350020009c0000023502008041000000c002200210000000000112019f00000241011001c70000800d020000390000000103000039000002420400004108cf08c50000040f0000000100200190000003360000613d000000800100043d00000140000004430000016000100443000000a00100043d00000020020000390000018000200443000001a000100443000000c00100043d0000004003000039000001c000300443000001e0001004430000006001000039000000e00300043d000002000010044300000220003004430000008001000039000001000300043d000002400010044300000260003004430000010000200443000000050100003900000120001004430000024301000041000008d00001042e00000235033001970000001f0530018f0000023706300198000000400200043d0000000004620019000003cc0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000003bb0000c13d000003cc0000013d00000235033001970000001f0530018f0000023706300198000000400200043d0000000004620019000003cc0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000003c80000c13d000000000005004b000003d90000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f00000000001404350000006001300210000002350020009c00000235020080410000004002200210000000000112019f000008d100010430000000400100043d00000274030000410000000000310435000000040310003900000000002304350000005e0000013d000000400100043d000002670200004100000000002104350000000402100039000000000300041600000000003204350000005e0000013d000002630100004100000000001004430000000001000412000000040010044300000024000004430000000001000414000002350010009c0000023501008041000000c00110021000000264011001c7000080050200003908cf08ca0000040f0000000100200190000005db0000613d000000000201043b000000400300043d0000026801000041000600000003001d000000000013043500000000010004140000023802200197000500000002001d000000040020008c000004980000c13d0000000103000031000000200030008c00000020040000390000000004034019000004c20000013d00000002010003670000002402100370000000000202043b000000000023004b000004dd0000c13d0000000702000029000000200020008c000003360000413d00000006020000290000002002200039000000000121034f000000000101043b000002380010009c000003360000213d000000400200043d0000000000120435000002350020009c000002350200804100000040012002100000000002000414000002350020009c0000023502008041000000c002200210000000000112019f00000277011001c70000800d02000039000000010300003900000278040000410000024a0000013d0000026c0030009c0000000105000029000003690000213d00000003010000290000000001010433000000a002300039000000400020043f000000000001004b0000000002000039000000010200c039000000800130003900000000002104350000006002300039000000000052043500000040053000390000000406000029000000000065043500000020063000390000000000460435000000070400002900000000004304350000026f04000041000000400800043d0000000004480436000400000004001d000000040480003900000040070000390000000000740435000000000303043300000235033001970000004404800039000000000034043500000000030604330000006404800039000000000034043500000000030504330000008404800039000000a0050000390000000000540435000000e40680003900000000540304340000000000460435000700000008001d0000010403800039000000000004004b0000045c0000613d000000000600001900000000073600190000000008650019000000000808043300000000008704350000002006600039000000000046004b000004550000413d000000000534001900000000000504350000001f04400039000002790440019700000000020204330000000705000029000000a405500039000000c0064000390000000000650435000000000334001900000000260204340000000007630436000000000006004b000004720000613d000000000300001900000000047300190000000005320019000000000505043300000000005404350000002003300039000000000063004b0000046b0000413d000600000006001d000500000007001d0000000002760019000000000002043500000000010104330000000704000029000000240240003900000000030004110000000000320435000000000001004b0000000001000039000000010100c039000000c4024000390000000000120435000002630100004100000000001004430000000001000412000000040010044300000024000004430000000001000414000002350010009c0000023501008041000000c00110021000000264011001c7000080050200003908cf08ca0000040f0000000100200190000005db0000613d000000000201043b00000000010004140000023804200197000000040040008c000004f90000c13d0000000103000031000000800030008c00000080040000390000000004034019000005580000013d0000000602000029000002350020009c00000235020080410000004002200210000002350010009c0000023501008041000000c001100210000000000121019f00000269011001c7000000050200002908cf08ca0000040f00000060031002700000023503300197000000200030008c000000200400003900000000040340190000001f0640018f00000020074001900000000605700029000004b20000613d000000000801034f0000000609000029000000008a08043c0000000009a90436000000000059004b000004ae0000c13d000000000006004b000004bf0000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f0000000100200190000004ed0000613d0000001f01400039000000600210018f0000000601200029000000000021004b00000000020000390000000102004039000002400010009c000003690000213d0000000100200190000003690000c13d000000400010043f000000200030008c000003360000413d00000006020000290000000002020433000600000002001d0000026a0020009c000003360000813d000000060000006b000005100000c13d0000026e020000410000000000210435000002350010009c0000023501008041000000400110021000000269011001c7000008d1000104300000000401100370000000000101043b000002350010009c000003360000213d000000400300043d000000240430003900000000002404350000027502000041000000000023043500000004023000390000000000120435000002350030009c0000023503008041000000400130021000000276011001c7000008d1000104300000001f0530018f0000023706300198000000400200043d0000000004620019000003cc0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000004f40000c13d000003cc0000013d0000000706000029000000050260006900000006030000290000001f0330003900000279033001970000000002320019000002350060009c000002350300004100000000030640190000004003300210000002350020009c00000235020080410000006002200210000000000232019f000002350010009c0000023501008041000000c001100210000000000121019f0000000002000416000000000002004b000005340000c13d0000000002040019000005380000013d00000064021000390000000703000029000000000032043500000044021000390000000503000029000000000032043500000020021000390000026b030000410000000000320435000000240310003900000000040004110000000000430435000000640300003900000000003104350000026c0010009c000003690000213d000000a003100039000000400030043f000000000301043300000000010004140000000604000029000000040040008c0000059d0000c13d0000000001020433000000000010043f000000010010008c00000000010000390000000101006039000000000001004b000001f00000c13d000000400100043d0000026d02000041000000000021043500000004021000390000000603000029000003ea0000013d0000023a011001c700008009020000390000000003000416000000000500001908cf08c50000040f00000060031002700000023503300197000000800030008c000000800400003900000000040340190000001f0640018f000000e0074001900000000705700029000005480000613d000000000801034f0000000709000029000000008a08043c0000000009a90436000000000059004b000005440000c13d000000000006004b000005550000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f0000000100200190000005910000613d0000001f01400039000001e00210018f0000000701200029000000000021004b00000000020000390000000102004039000002400010009c000003690000213d0000000100200190000003690000c13d000000400010043f000000800030008c000003360000413d000002660010009c000003690000213d0000006002100039000000400020043f00000007020000290000000002020433000000000221043600000004030000290000000003030433000002400030009c000003360000213d0000000000320435000000400300043d000002650030009c000003690000213d0000004004300039000000400040043f0000000705000029000000400450003900000000040404330000000004430436000000600550003900000000050504330000000000540435000000400410003900000000003404350000000001010433000000400300043d00000000011304360000000002020433000002400220019700000000002104350000000001040433000000002101043400000040043000390000000000140435000000000102043300000060023000390000000000120435000002350030009c0000023503008041000000400130021000000270011001c7000008d00001042e0000001f0530018f0000023706300198000000400200043d0000000004620019000003cc0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000005980000c13d000003cc0000013d000002350020009c00000235020080410000004002200210000002350030009c00000235030080410000006003300210000000000223019f000002350010009c0000023501008041000000c001100210000000000112019f000000060200002908cf08c50000040f00000060031002700000023503300197000000200030008c000000200400003900000000040340190000001f0540018f0000002004400190000005b80000613d000000000601034f0000000007000019000000006806043c0000000007870436000000000047004b000005b40000c13d000000000005004b000005c50000613d000000000641034f0000000305500210000000000704043300000000075701cf000000000757022f000000000606043b0000010005500089000000000656022f00000000055601cf000000000575019f0000000000540435000100000003001f0000000100200190000005dc0000613d000000000003004b000005e80000c13d0000023c010000410000000000100443000000060100002900000004001004430000000001000414000002350010009c0000023501008041000000c0011002100000023d011001c7000080020200003908cf08ca0000040f0000000100200190000005db0000613d000000000101043b000000000001004b000001f00000c13d0000052e0000013d000000000001042f0000001f0530018f0000023706300198000000400200043d0000000004620019000003cc0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000005e30000c13d000003cc0000013d000000000100043d000005290000013d0000001f03100039000000000023004b00000000040000190000027a040040410000027a052001970000027a03300197000000000653013f000000000053004b00000000030000190000027a030020410000027a0060009c000000000304c019000000000003004b000006020000613d0000000203100367000000000303043b000002400030009c000006020000213d00000020011000390000000004310019000000000024004b000006020000213d0000000002030019000000000001042d0000000001000019000008d10001043000000000430104340000000001320436000000000003004b000006100000613d000000000200001900000000051200190000000006240019000000000606043300000000006504350000002002200039000000000032004b000006090000413d000000000213001900000000000204350000001f0230003900000279022001970000000001210019000000000001042d0000027b0010009c0000061b0000813d0000004001100039000000400010043f000000000001042d0000027201000041000000000010043f0000004101000039000000040010043f0000023f01000041000008d1000104300008000000000002000000400100043d000500000001001d00000020011000390000027c0200004100000000002104350000026301000041000000000010044300000000010004120000000400100443000000800100003900000024001004430000000001000414000002350010009c0000023501008041000000c00110021000000264011001c7000080050200003908cf08ca0000040f0000000100200190000008190000613d000000000101043b000000050400002900000024024000390000000000120435000000240100003900000000001404350000027d0040009c000008010000813d0000006001400039000800000001001d000000400010043f0000026c0040009c000008010000213d000000a001400039000000400010043f000000010300003900000008010000290000000000310435000000400100043d0000027e0010009c000008010000213d000000e002100039000000400020043f000000c00210003900000060050000390000000000520435000000a00210003900000000000204350000008002100039000000000002043500000060021000390000000000020435000000400210003900000000000204350000002002100039000000000002043500000000000104350000008002400039000700000002001d0000000000120435000000400100043d000600000001001d0000027e0010009c000008010000213d0000000602000029000000e001200039000000400010043f0000000001320436000400000001001d0000026301000041000000000010044300000000010004120000000400100443000000400100003900000024001004430000000001000414000002350010009c0000023501008041000000c00110021000000264011001c7000080050200003908cf08ca0000040f0000000100200190000008190000613d000000000101043b0000023501100197000000040200002900000000001204350000000601000029000000400110003900000000000104350000027f0100004100000000001004430000000001000414000002350010009c0000023501008041000000c00110021000000280011001c70000800b0200003908cf08ca0000040f0000000100200190000008190000613d000000000101043b000000060400002900000080024000390000000503000039000000000032043500000060024000390000024001100197000400000001001d00000000001204350000026301000041000000000010044300000000010004120000000400100443000000600100003900000024001004430000000001000414000002350010009c0000023501008041000000c00110021000000264011001c7000080050200003908cf08ca0000040f0000000100200190000008190000613d000000000101043b0000000604000029000000c00240003900000005030000290000000000320435000000a0024000390000023801100197000000000012043500000008010000290000000001010433000000000001004b0000081c0000613d0000000701000029000000060200002900000000002104350000028101000041000000400200043d000500000002001d0000000000120435000002630100004100000000001004430000000001000412000000040010044300000024000004430000000001000414000002350010009c0000023501008041000000c00110021000000264011001c7000080050200003908cf08ca0000040f0000000100200190000008190000613d000000000201043b00000000010004140000023802200197000000040020008c000006cd0000c13d0000000103000031000000200030008c000000200400003900000000040340190000000105000039000000050b000029000006f80000013d0000000503000029000002350030009c00000235030080410000004003300210000002350010009c0000023501008041000000c001100210000000000131019f00000269011001c708cf08ca0000040f000000050b00002900000060031002700000023503300197000000200030008c000000200400003900000000040340190000001f0640018f000000200740019000000000057b0019000006e70000613d000000000801034f00000000090b0019000000008a08043c0000000009a90436000000000059004b000006e30000c13d000000000006004b000006f40000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f00000001002001900000082d0000613d00000001050000390000001f01400039000000600110018f0000000002b10019000000000012004b00000000010000390000000101004039000600000002001d000002400020009c000008010000213d0000000100100190000008010000c13d0000000601000029000000400010043f000000200030008c0000081a0000413d00000000010b0433000002350010009c0000081a0000213d0000000602000029000002820020009c000008010000213d0000000603000029000000c002300039000000400020043f000000a0043000390000000002000410000300000004001d00000000002404350000008002300039000200000002001d000000050400003900000000004204350000006002300039000100000002001d000000040400002900000000004204350000002002300039000500000002001d000000000012043500000000005304350000004001300039000400000001001d0000000000010435000000400a00043d0000002401a0003900000008020000290000000003020433000002830030009c000008220000813d0000002009a00039000002840200004100000000002904350000002202a000390000000000020435000000f0023002100000000000210435000000060100003900000000001a04350000026500a0009c000008010000213d0000004001a00039000000400010043f00000008020000290000000002020433000000000002004b000007ba0000613d000002840d000041000000000e0000190000000502e0021000000007022000290000000004020433000000c00540003900000000020504330000000002020433000002870020009c000008070000813d00000023062000390000ffdd0020008c0000080d0000813d0000000028040434000000200f1000390000000007020433000000000a0a043300000000000a004b000007550000613d0000000002000019000000000bf20019000000000c290019000000000c0c04330000000000cb043500000020022000390000000000a2004b0000074e0000413d0000000002fa0019000000000002043500000000021a00190000002009200039000002850b0000410000000000b90435000000f0088002100000002109200039000000000089043500000023082000390000000000d80435000000f006600210000000250820003900000000006804350000002702200039000000e00670021000000000006204350000000b02a0003900000000002104350000004a02a000390000027902200197000000000a12001900000000002a004b000000000200003900000001020040390000024000a0009c000008010000213d0000000100200190000008010000c13d0000004000a0043f0000002009a000390000000005050433000000a00240003900000000060204330000008002400039000000000702043300000060024000390000000008020433000000400240003900000000040204330000000001010433000000000001004b000007880000613d0000000002000019000000000b920019000000000cf20019000000000c0c04330000000000cb04350000002002200039000000000012004b000007810000413d000000000291001900000000000204350000000002a10019000000000004004b00000285040000410000000004006019000000200b20003900000000004b0435000000c00480021000000021082000390000000000480435000000f0047002100000002907200039000000000047043500000060046002100000002b0620003900000000004604350000003f062000390000000054050434000000000004004b000007a50000613d000000000200001900000000076200190000000008250019000000000808043300000000008704350000002002200039000000000042004b0000079e0000413d0000000002640019000000000002043500000000014100190000001f0210003900000000002a04350000005e0110003900000279021001970000000001a20019000000000021004b00000000020000390000000102004039000002400010009c000008010000213d0000000100200190000008010000c13d000000400010043f000000010ee000390000000802000029000000000202043300000000002e004b0000073c0000413d000000050200002900000000080204330000023500800198000007ff0000613d000000200c100039000000030200002900000000040204330000000202000029000000000502043300000001020000290000000006020433000000040200002900000000070204330000000602000029000000000b02043300000000020a0433000000000002004b000007d40000613d000000000a000019000000000dca0019000000000ea90019000000000e0e04330000000000ed0435000000200aa0003900000000002a004b000007cd0000413d0000000009c2001900000000000904350000000009120019000000200a900039000002850c0000410000000000ca0435000000210a900039000002840c0000410000000000ca0435000000f80ab00210000000230b9000390000000000ab0435000000e008800210000000240a90003900000000008a0435000000000007004b0000028507000041000000000700601900000028089000390000000000780435000000c00660021000000029079000390000000000670435000000f0055002100000003106900039000000000056043500000033059000390000006004400210000000000045043500000066042000390000027903400197000000270220003900000000002104350000000002130019000000000032004b00000000030000390000000103004039000002400020009c000008010000213d0000000100300190000008010000c13d000000400020043f000000000001042d00000000010a0019000000000001042d0000027201000041000000000010043f0000004101000039000000040010043f0000023f01000041000008d1000104300000027201000041000000000010043f0000001101000039000000040010043f0000023f01000041000008d1000104300000002402100039000000000062043500000286020000410000000000210435000000040210003900000010030000390000000000320435000002350010009c0000023501008041000000400110021000000276011001c7000008d100010430000000000001042f0000000001000019000008d1000104300000027201000041000000000010043f0000003201000039000000040010043f0000023f01000041000008d100010430000002860200004100000000002a04350000000402a000390000001004000039000000000042043500000000003104350000023500a0009c000002350a0080410000004001a0021000000276011001c7000008d1000104300000001f0530018f0000023706300198000000400200043d0000000004620019000008380000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000008340000c13d000000000005004b000008450000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f00000000001404350000006001300210000002350020009c00000235020080410000004002200210000000000121019f000008d1000104300000000002120049000002880020009c000008550000213d0000001f0020008c000008550000a13d0000000201100367000000000101043b000002380010009c000008550000213d000000000001042d0000000001000019000008d100010430000000000100041a00000238021001970000000001000411000000000012004b0000085d0000c13d000000000001042d000000400200043d0000026103000041000000000032043500000004032000390000000000130435000002350020009c000002350200804100000040012002100000023f011001c7000008d1000104300002000000000002000200000002001d0000023501100197000100000001001d000000000010043f0000000101000039000000200010043f0000000001000414000002350010009c0000023501008041000000c00110021000000241011001c7000080100200003908cf08ca0000040f00000001002001900000088f0000613d000000000101043b0000000203000029000000000031041b000000400100043d0000002002100039000000000032043500000001020000290000000000210435000002350010009c000002350100804100000040011002100000000002000414000002350020009c0000023502008041000000c002200210000000000112019f00000241011001c70000800d020000390000000103000039000002420400004108cf08c50000040f00000001002001900000088f0000613d000000000001042d0000000001000019000008d100010430000000000001042f000002350010009c00000235010080410000004001100210000002350020009c00000235020080410000006002200210000000000112019f0000000002000414000002350020009c0000023502008041000000c002200210000000000112019f0000023a011001c7000080100200003908cf08ca0000040f0000000100200190000008a50000613d000000000101043b000000000001042d0000000001000019000008d10001043000000000050100190000000000200443000000050030008c000008b50000413d000000040100003900000000020000190000000506200210000000000664001900000005066002700000000006060031000000000161043a0000000102200039000000000031004b000008ad0000413d000002350030009c000002350300804100000060013002100000000002000414000002350020009c0000023502008041000000c002200210000000000112019f00000289011001c7000000000205001908cf08ca0000040f0000000100200190000008c40000613d000000000101043b000000000001042d000000000001042f000008c8002104210000000102000039000000000001042d0000000002000019000000000001042d000008cd002104230000000102000039000000000001042d0000000002000019000000000001042d000008cf00000432000008d00001042e000008d1000104300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000000ffffffe0000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000008be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e01806aa1896bbf26568e884a7374b41e002500962caba6a15023a8d90e8508b830200000200000000000000000000000000000024000000000000000000000000ca5eb5e1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff0200000000000000000000000000000000000040000000000000000000000000238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b00000002000000000000000000000000000001800000010000000000000000001e4fbdf7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000082413eab00000000000000000000000000000000000000000000000000000000ca5eb5e000000000000000000000000000000000000000000000000000000000f0a9e48000000000000000000000000000000000000000000000000000000000f0a9e48100000000000000000000000000000000000000000000000000000000f2fde38b00000000000000000000000000000000000000000000000000000000ff7bd03d00000000000000000000000000000000000000000000000000000000ca5eb5e100000000000000000000000000000000000000000000000000000000e60c287c000000000000000000000000000000000000000000000000000000008da5cb5a000000000000000000000000000000000000000000000000000000008da5cb5b00000000000000000000000000000000000000000000000000000000b10c754400000000000000000000000000000000000000000000000000000000bb0b6a530000000000000000000000000000000000000000000000000000000082413eac0000000000000000000000000000000000000000000000000000000089a89002000000000000000000000000000000000000000000000000000000003400288a000000000000000000000000000000000000000000000000000000005e280f10000000000000000000000000000000000000000000000000000000005e280f1100000000000000000000000000000000000000000000000000000000715018a6000000000000000000000000000000000000000000000000000000007d25a05e000000000000000000000000000000000000000000000000000000003400288b000000000000000000000000000000000000000000000000000000003859d9370000000000000000000000000000000000000000000000000000000017442b6f0000000000000000000000000000000000000000000000000000000017442b70000000000000000000000000000000000000000000000000000000001a25bf87000000000000000000000000000000000000000000000000000000001fda9a02000000000000000000000000000000000000000000000000000000000f0aee290000000000000000000000000000000000000000000000000000000013137d650000000000000000000000000000000000000020000000800000000000000000118cdaa7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000800000000000000000310ab089e4439a4c15d089f94afb7896ff553aecb10793d0ab882de59d99a32e0200000200000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffbf000000000000000000000000000000000000000000000000ffffffffffffff9f9f70412000000000000000000000000000000000000000000000000000000000e4fe1d94000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000001000000000000000000000000000000000000000023b872dd00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff5f5274afe7000000000000000000000000000000000000000000000000000000005373352a000000000000000000000000000000000000000000000000000000002637a450000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f6ff4fb7000000000000000000000000000000000000000000000000000000004e487b7100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000080000000000000000091ac5e4f00000000000000000000000000000000000000000000000000000000c26bebcc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000440000000000000000000000000200000000000000000000000000000000000020000000000000000000000000471fa9583e44dac5c83a2fd2cbd8fb7a7898a73370ebcad107c1ab530f9a5d06ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffc06352211e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffa0000000000000000000000000000000000000000000000000ffffffffffffff1f796b89b91644bc98cd93958e4c9038275d622183e25ac5af08cc6b5d955391320200000200000000000000000000000000000004000000000000000000000000416ecebf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff3f0000000000000000000000000000000000000000000000000000000000010000000100000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006dfcc65000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdd7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0200000200000000000000000000000000000000000000000000000000000000582fa94e4742def3caa0098a90401e447aa95c47716711e36ea2bc263717343c
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000016c693a3924b947298f7227792953cd6bbb21ac800000000000000000000000000000000000000000000000000000000000003e90000000000000000000000000000000000000000000000000000000000007595000000000000000000000000556697ca91476b811f37a851dd2e53ae4c6024db0000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : _endpoint (address): 0x16c693A3924B947298F7227792953Cd6BBb21Ac8
Arg [1] : _readChannel (uint32): 1001
Arg [2] : _targetEid (uint32): 30101
Arg [3] : _nftContract (address): 0x556697Ca91476B811f37A851dD2e53ae4c6024dB
Arg [4] : _tokenId (uint256): 1
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000016c693a3924b947298f7227792953cd6bbb21ac8
Arg [1] : 00000000000000000000000000000000000000000000000000000000000003e9
Arg [2] : 0000000000000000000000000000000000000000000000000000000000007595
Arg [3] : 000000000000000000000000556697ca91476b811f37a851dd2e53ae4c6024db
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000001
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.