Polygon Sponsored slots available. Book your slot here!
ERC-721
Overview
Max Total Supply
0 CCNFT
Holders
2
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 CCNFTLoading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
CrossChainNFT
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import './interfaces/ILayerZeroEndpoint.sol'; import './interfaces/ILayerZeroReceiver.sol'; import './NonblockingLzApp.sol'; error NotTokenOwner(); error InsufficientGas(); error SupplyExceeded(); contract CrossChainNFT is Ownable, ERC721, NonblockingLzApp { uint256 public counter; uint256 public currentTokenId; uint256 public immutable MAX_ID; event ReceivedNFT( uint16 _srcChainId, address _from, uint256 _tokenId, uint256 counter ); constructor( address _endpoint, uint256 _startTokenId ) ERC721('CrossChainNFT', 'CCNFT') NonblockingLzApp(_endpoint) { currentTokenId = _startTokenId; MAX_ID = currentTokenId + 99999; } function mint() external { if (currentTokenId == MAX_ID) revert SupplyExceeded(); _mint(msg.sender, currentTokenId); unchecked { ++currentTokenId; ++counter; } } function crossChain(uint16 dstChainId, uint256 tokenId) public payable { if (msg.sender != ownerOf(tokenId)) revert NotTokenOwner(); // Remove NFT on current chain unchecked { --counter; } _burn(tokenId); bytes memory payload = abi.encode(msg.sender, tokenId); uint16 version = 1; uint256 gasForLzReceive = 350000; bytes memory adapterParams = abi.encodePacked(version, gasForLzReceive); (uint256 messageFee, ) = lzEndpoint.estimateFees( dstChainId, address(this), payload, false, adapterParams ); if (msg.value <= messageFee) revert InsufficientGas(); // _lzSend( // dstChainId, // payload, // payable(msg.sender), // address(0x0), // adapterParams, // msg.value // ); } function _nonblockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 /*_nonce*/, bytes memory _payload ) internal override { address from; assembly { from := mload(add(_srcAddress, 20)) } (address toAddress, uint256 tokenId) = abi.decode( _payload, (address, uint256) ); _mint(toAddress, tokenId); unchecked { ++counter; } emit ReceivedNFT(_srcChainId, from, tokenId, counter); } // Endpoint.sol estimateFees() returns the fees for the message function estimateFees( uint16 dstChainId, uint256 tokenId ) external view returns (uint256) { bytes memory payload = abi.encode(msg.sender, tokenId); uint16 version = 1; uint256 gasForLzReceive = 350000; bytes memory adapterParams = abi.encodePacked(version, gasForLzReceive); (uint256 messageFee, ) = lzEndpoint.estimateFees( dstChainId, address(this), payload, false, adapterParams ); return messageFee; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.2) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _ownerOf(tokenId) != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such * that `ownerOf(tokenId)` is `a`. */ // solhint-disable-next-line func-name-mixedcase function __unsafe_increaseBalance(address account, uint256 amount) internal { _balances[account] += amount; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; import "./ILayerZeroUserApplicationConfig.sol"; interface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig { // @notice send a LayerZero message to the specified address at a LayerZero endpoint. // @param _dstChainId - the destination chain identifier // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains // @param _payload - a custom bytes payload to send to the destination contract // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination function send( uint16 _dstChainId, bytes calldata _destination, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams ) external payable; // @notice used by the messaging library to publish verified payload // @param _srcChainId - the source chain identifier // @param _srcAddress - the source contract (as bytes) at the source chain // @param _dstAddress - the address on destination chain // @param _nonce - the unbound message ordering nonce // @param _gasLimit - the gas limit for external contract execution // @param _payload - verified payload to send to the destination contract function receivePayload( uint16 _srcChainId, bytes calldata _srcAddress, address _dstAddress, uint64 _nonce, uint _gasLimit, bytes calldata _payload ) external; // @notice get the inboundNonce of a receiver from a source chain which could be EVM or non-EVM chain // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address function getInboundNonce( uint16 _srcChainId, bytes calldata _srcAddress ) external view returns (uint64); // @notice get the outboundNonce from this source chain which, consequently, is always an EVM // @param _srcAddress - the source chain contract address function getOutboundNonce( uint16 _dstChainId, address _srcAddress ) external view returns (uint64); // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery // @param _dstChainId - the destination chain identifier // @param _userApplication - the user app address on this EVM chain // @param _payload - the custom message to send over LayerZero // @param _payInZRO - if false, user app pays the protocol fee in native token // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain function estimateFees( uint16 _dstChainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam ) external view returns (uint nativeFee, uint zroFee); // @notice get this Endpoint's immutable source identifier function getChainId() external view returns (uint16); // @notice the interface to retry failed message on this Endpoint destination // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address // @param _payload - the payload to be retried function retryPayload( uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload ) external; // @notice query if any STORED payload (message blocking) at the endpoint. // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address function hasStoredPayload( uint16 _srcChainId, bytes calldata _srcAddress ) external view returns (bool); // @notice query if the _libraryAddress is valid for sending msgs. // @param _userApplication - the user app address on this EVM chain function getSendLibraryAddress( address _userApplication ) external view returns (address); // @notice query if the _libraryAddress is valid for receiving msgs. // @param _userApplication - the user app address on this EVM chain function getReceiveLibraryAddress( address _userApplication ) external view returns (address); // @notice query if the non-reentrancy guard for send() is on // @return true if the guard is on. false otherwise function isSendingPayload() external view returns (bool); // @notice query if the non-reentrancy guard for receive() is on // @return true if the guard is on. false otherwise function isReceivingPayload() external view returns (bool); // @notice get the configuration of the LayerZero messaging library of the specified version // @param _version - messaging library version // @param _chainId - the chainId for the pending config change // @param _userApplication - the contract address of the user application // @param _configType - type of configuration. every messaging library has its own convention. function getConfig( uint16 _version, uint16 _chainId, address _userApplication, uint _configType ) external view returns (bytes memory); // @notice get the send() LayerZero messaging library version // @param _userApplication - the contract address of the user application function getSendVersion( address _userApplication ) external view returns (uint16); // @notice get the lzReceive() LayerZero messaging library version // @param _userApplication - the contract address of the user application function getReceiveVersion( address _userApplication ) external view returns (uint16); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; interface ILayerZeroReceiver { // @notice LayerZero endpoint will invoke this function to deliver the message on the destination // @param _srcChainId - the source endpoint identifier // @param _srcAddress - the source sending contract address from the source chain // @param _nonce - the ordered message nonce // @param _payload - the signed payload is the UA bytes has encoded to be sent function lzReceive( uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload ) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; interface ILayerZeroUserApplicationConfig { // @notice set the configuration of the LayerZero messaging library of the specified version // @param _version - messaging library version // @param _chainId - the chainId for the pending config change // @param _configType - type of configuration. every messaging library has its own convention. // @param _config - configuration in the bytes. can encode arbitrary content. function setConfig( uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config ) external; // @notice set the send() LayerZero messaging library version to _version // @param _version - new messaging library version function setSendVersion(uint16 _version) external; // @notice set the lzReceive() LayerZero messaging library version to _version // @param _version - new messaging library version function setReceiveVersion(uint16 _version) external; // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload // @param _srcChainId - the chainId of the source chain // @param _srcAddress - the contract address of the source contract at the source chain function forceResumeReceive( uint16 _srcChainId, bytes calldata _srcAddress ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "./interfaces/ILayerZeroReceiver.sol"; import "./interfaces/ILayerZeroUserApplicationConfig.sol"; import "./interfaces/ILayerZeroEndpoint.sol"; import "./utils/BytesLib.sol"; /* * a generic LzReceiver implementation */ abstract contract LzApp is Ownable, ILayerZeroReceiver, ILayerZeroUserApplicationConfig { using BytesLib for bytes; // ua can not send payload larger than this by default, but it can be changed by the ua owner uint public constant DEFAULT_PAYLOAD_SIZE_LIMIT = 10000; ILayerZeroEndpoint public immutable lzEndpoint; mapping(uint16 => bytes) public trustedRemoteLookup; mapping(uint16 => mapping(uint16 => uint)) public minDstGasLookup; mapping(uint16 => uint) public payloadSizeLimitLookup; address public precrime; event SetPrecrime(address precrime); event SetTrustedRemote(uint16 _remoteChainId, bytes _path); event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress); event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint _minDstGas); constructor(address _endpoint) { lzEndpoint = ILayerZeroEndpoint(_endpoint); } function lzReceive( uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload ) public virtual override { // lzReceive must be called by the endpoint for security require( _msgSender() == address(lzEndpoint), "LzApp: invalid endpoint caller" ); bytes memory trustedRemote = trustedRemoteLookup[_srcChainId]; // if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote. require( _srcAddress.length == trustedRemote.length && trustedRemote.length > 0 && keccak256(_srcAddress) == keccak256(trustedRemote), "LzApp: invalid source sending contract" ); _blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload); } // abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging function _blockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual; function _lzSend( uint16 _dstChainId, bytes memory _payload, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams, uint _nativeFee ) internal virtual { bytes memory trustedRemote = trustedRemoteLookup[_dstChainId]; require( trustedRemote.length != 0, "LzApp: destination chain is not a trusted source" ); _checkPayloadSize(_dstChainId, _payload.length); lzEndpoint.send{value: _nativeFee}( _dstChainId, trustedRemote, _payload, _refundAddress, _zroPaymentAddress, _adapterParams ); } function _checkGasLimit( uint16 _dstChainId, uint16 _type, bytes memory _adapterParams, uint _extraGas ) internal view virtual { uint providedGasLimit = _getGasLimit(_adapterParams); uint minGasLimit = minDstGasLookup[_dstChainId][_type] + _extraGas; require(minGasLimit > 0, "LzApp: minGasLimit not set"); require(providedGasLimit >= minGasLimit, "LzApp: gas limit is too low"); } function _getGasLimit( bytes memory _adapterParams ) internal pure virtual returns (uint gasLimit) { require(_adapterParams.length >= 34, "LzApp: invalid adapterParams"); assembly { gasLimit := mload(add(_adapterParams, 34)) } } function _checkPayloadSize( uint16 _dstChainId, uint _payloadSize ) internal view virtual { uint payloadSizeLimit = payloadSizeLimitLookup[_dstChainId]; if (payloadSizeLimit == 0) { // use default if not set payloadSizeLimit = DEFAULT_PAYLOAD_SIZE_LIMIT; } require( _payloadSize <= payloadSizeLimit, "LzApp: payload size is too large" ); } //---------------------------UserApplication config---------------------------------------- function getConfig( uint16 _version, uint16 _chainId, address, uint _configType ) external view returns (bytes memory) { return lzEndpoint.getConfig( _version, _chainId, address(this), _configType ); } // generic config for LayerZero user Application function setConfig( uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config ) external override onlyOwner { lzEndpoint.setConfig(_version, _chainId, _configType, _config); } function setSendVersion(uint16 _version) external override onlyOwner { lzEndpoint.setSendVersion(_version); } function setReceiveVersion(uint16 _version) external override onlyOwner { lzEndpoint.setReceiveVersion(_version); } function forceResumeReceive( uint16 _srcChainId, bytes calldata _srcAddress ) external override onlyOwner { lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress); } // _path = abi.encodePacked(remoteAddress, localAddress) // this function set the trusted path for the cross-chain communication function setTrustedRemote( uint16 _srcChainId, bytes calldata _path ) external onlyOwner { trustedRemoteLookup[_srcChainId] = _path; emit SetTrustedRemote(_srcChainId, _path); } function setTrustedRemoteAddress( uint16 _remoteChainId, bytes calldata _remoteAddress ) external onlyOwner { trustedRemoteLookup[_remoteChainId] = abi.encodePacked( _remoteAddress, address(this) ); emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress); } function getTrustedRemoteAddress( uint16 _remoteChainId ) external view returns (bytes memory) { bytes memory path = trustedRemoteLookup[_remoteChainId]; require(path.length != 0, "LzApp: no trusted path record"); return path.slice(0, path.length - 20); // the last 20 bytes should be address(this) } function setPrecrime(address _precrime) external onlyOwner { precrime = _precrime; emit SetPrecrime(_precrime); } function setMinDstGas( uint16 _dstChainId, uint16 _packetType, uint _minGas ) external onlyOwner { require(_minGas > 0, "LzApp: invalid minGas"); minDstGasLookup[_dstChainId][_packetType] = _minGas; emit SetMinDstGas(_dstChainId, _packetType, _minGas); } // if the size is 0, it means default size limit function setPayloadSizeLimit( uint16 _dstChainId, uint _size ) external onlyOwner { payloadSizeLimitLookup[_dstChainId] = _size; } //--------------------------- VIEW FUNCTION ---------------------------------------- function isTrustedRemote( uint16 _srcChainId, bytes calldata _srcAddress ) external view returns (bool) { bytes memory trustedSource = trustedRemoteLookup[_srcChainId]; return keccak256(trustedSource) == keccak256(_srcAddress); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./LzApp.sol"; import "./utils/ExcessivelySafeCall.sol"; /* * the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel * this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking * NOTE: if the srcAddress is not configured properly, it will still block the message pathway from (srcChainId, srcAddress) */ abstract contract NonblockingLzApp is LzApp { using ExcessivelySafeCall for address; constructor(address _endpoint) LzApp(_endpoint) {} mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages; event MessageFailed( uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload, bytes _reason ); event RetryMessageSuccess( uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _payloadHash ); // overriding the virtual function in LzReceiver function _blockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual override { (bool success, bytes memory reason) = address(this).excessivelySafeCall( gasleft(), 150, abi.encodeWithSelector( this.nonblockingLzReceive.selector, _srcChainId, _srcAddress, _nonce, _payload ) ); // try-catch all errors/exceptions if (!success) { _storeFailedMessage( _srcChainId, _srcAddress, _nonce, _payload, reason ); } } function _storeFailedMessage( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload, bytes memory _reason ) internal virtual { failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(_payload); emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload, _reason); } function nonblockingLzReceive( uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload ) public virtual { // only internal transaction require( _msgSender() == address(this), "NonblockingLzApp: caller must be LzApp" ); _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload); } //@notice override this function function _nonblockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual; function retryMessage( uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload ) public payable virtual { // assert there is message to retry bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce]; require( payloadHash != bytes32(0), "NonblockingLzApp: no stored message" ); require( keccak256(_payload) == payloadHash, "NonblockingLzApp: invalid payload" ); // clear the stored message failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0); // execute the message. revert if it fails again _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload); emit RetryMessageSuccess(_srcChainId, _srcAddress, _nonce, payloadHash); } }
// SPDX-License-Identifier: Unlicense /* * @title Solidity Bytes Arrays Utils * @author Gonçalo Sá <[email protected]> * * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity. * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage. */ pragma solidity >=0.8.0 <0.9.0; library BytesLib { function concat( bytes memory _preBytes, bytes memory _postBytes ) internal pure returns (bytes memory) { bytes memory tempBytes; assembly { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // Store the length of the first bytes array at the beginning of // the memory for tempBytes. let length := mload(_preBytes) mstore(tempBytes, length) // Maintain a memory counter for the current write location in the // temp bytes array by adding the 32 bytes for the array length to // the starting location. let mc := add(tempBytes, 0x20) // Stop copying when the memory counter reaches the length of the // first bytes array. let end := add(mc, length) for { // Initialize a copy counter to the start of the _preBytes data, // 32 bytes into its memory. let cc := add(_preBytes, 0x20) } lt(mc, end) { // Increase both counters by 32 bytes each iteration. mc := add(mc, 0x20) cc := add(cc, 0x20) } { // Write the _preBytes data into the tempBytes memory 32 bytes // at a time. mstore(mc, mload(cc)) } // Add the length of _postBytes to the current length of tempBytes // and store it as the new length in the first 32 bytes of the // tempBytes memory. length := mload(_postBytes) mstore(tempBytes, add(length, mload(tempBytes))) // Move the memory counter back from a multiple of 0x20 to the // actual end of the _preBytes data. mc := end // Stop copying when the memory counter reaches the new combined // length of the arrays. end := add(mc, length) for { let cc := add(_postBytes, 0x20) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } // Update the free-memory pointer by padding our last write location // to 32 bytes: add 31 bytes to the end of tempBytes to move to the // next 32 byte block, then round down to the nearest multiple of // 32. If the sum of the length of the two arrays is zero then add // one before rounding down to leave a blank 32 bytes (the length block with 0). mstore( 0x40, and( add(add(end, iszero(add(length, mload(_preBytes)))), 31), not(31) // Round down to the nearest 32 bytes. ) ) } return tempBytes; } function concatStorage( bytes storage _preBytes, bytes memory _postBytes ) internal { assembly { // Read the first 32 bytes of _preBytes storage, which is the length // of the array. (We don't need to use the offset into the slot // because arrays use the entire slot.) let fslot := sload(_preBytes.slot) // Arrays of 31 bytes or less have an even value in their slot, // while longer arrays have an odd value. The actual length is // the slot divided by two for odd values, and the lowest order // byte divided by two for even values. // If the slot is even, bitwise and the slot with 255 and divide by // two to get the length. If the slot is odd, bitwise and the slot // with -1 and divide by two. let slength := div( and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2 ) let mlength := mload(_postBytes) let newlength := add(slength, mlength) // slength can contain both the length and contents of the array // if length < 32 bytes so let's prepare for that // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage switch add(lt(slength, 32), lt(newlength, 32)) case 2 { // Since the new array still fits in the slot, we just need to // update the contents of the slot. // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length sstore( _preBytes.slot, // all the modifications to the slot are inside this // next block add( // we can just add to the slot contents because the // bytes we want to change are the LSBs fslot, add( mul( div( // load the bytes from memory mload(add(_postBytes, 0x20)), // zero all bytes to the right exp(0x100, sub(32, mlength)) ), // and now shift left the number of bytes to // leave space for the length in the slot exp(0x100, sub(32, newlength)) ), // increase length by the double of the memory // bytes length mul(mlength, 2) ) ) ) } case 1 { // The stored value fits in the slot, but the combined value // will exceed it. // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) let sc := add(keccak256(0x0, 0x20), div(slength, 32)) // save new length sstore(_preBytes.slot, add(mul(newlength, 2), 1)) // The contents of the _postBytes array start 32 bytes into // the structure. Our first read should obtain the `submod` // bytes that can fit into the unused space in the last word // of the stored array. To get this, we read 32 bytes starting // from `submod`, so the data we read overlaps with the array // contents by `submod` bytes. Masking the lowest-order // `submod` bytes allows us to add that value directly to the // stored value. let submod := sub(32, slength) let mc := add(_postBytes, submod) let end := add(_postBytes, mlength) let mask := sub(exp(0x100, submod), 1) sstore( sc, add( and( fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00 ), and(mload(mc), mask) ) ) for { mc := add(mc, 0x20) sc := add(sc, 1) } lt(mc, end) { sc := add(sc, 1) mc := add(mc, 0x20) } { sstore(sc, mload(mc)) } mask := exp(0x100, sub(mc, end)) sstore(sc, mul(div(mload(mc), mask), mask)) } default { // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) // Start copying to the last used word of the stored array. let sc := add(keccak256(0x0, 0x20), div(slength, 32)) // save new length sstore(_preBytes.slot, add(mul(newlength, 2), 1)) // Copy over the first `submod` bytes of the new data as in // case 1 above. let slengthmod := mod(slength, 32) let mlengthmod := mod(mlength, 32) let submod := sub(32, slengthmod) let mc := add(_postBytes, submod) let end := add(_postBytes, mlength) let mask := sub(exp(0x100, submod), 1) sstore(sc, add(sload(sc), and(mload(mc), mask))) for { sc := add(sc, 1) mc := add(mc, 0x20) } lt(mc, end) { sc := add(sc, 1) mc := add(mc, 0x20) } { sstore(sc, mload(mc)) } mask := exp(0x100, sub(mc, end)) sstore(sc, mul(div(mload(mc), mask), mask)) } } } function slice( bytes memory _bytes, uint256 _start, uint256 _length ) internal pure returns (bytes memory) { require(_length + 31 >= _length, "slice_overflow"); require(_bytes.length >= _start + _length, "slice_outOfBounds"); bytes memory tempBytes; assembly { switch iszero(_length) case 0 { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // The first word of the slice result is potentially a partial // word read from the original array. To read it, we calculate // the length of that partial word and start copying that many // bytes into the array. The first word we copy will start with // data we don't care about, but the last `lengthmod` bytes will // land at the beginning of the contents of the new array. When // we're done copying, we overwrite the full first word with // the actual length of the slice. let lengthmod := and(_length, 31) // The multiplication in the next line is necessary // because when slicing multiples of 32 bytes (lengthmod == 0) // the following copy loop was copying the origin's length // and then ending prematurely not copying everything it should. let mc := add( add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)) ) let end := add(mc, _length) for { // The multiplication in the next line has the same exact purpose // as the one above. let cc := add( add( add(_bytes, lengthmod), mul(0x20, iszero(lengthmod)) ), _start ) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } mstore(tempBytes, _length) //update free-memory pointer //allocating the array padded to 32 bytes like the compiler does now mstore(0x40, and(add(mc, 31), not(31))) } //if we want a zero-length slice let's just return a zero-length array default { tempBytes := mload(0x40) //zero out the 32 bytes slice we are about to return //we need to do it because Solidity does not garbage collect mstore(tempBytes, 0) mstore(0x40, add(tempBytes, 0x20)) } } return tempBytes; } function toAddress( bytes memory _bytes, uint256 _start ) internal pure returns (address) { require(_bytes.length >= _start + 20, "toAddress_outOfBounds"); address tempAddress; assembly { tempAddress := div( mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000 ) } return tempAddress; } function toUint8( bytes memory _bytes, uint256 _start ) internal pure returns (uint8) { require(_bytes.length >= _start + 1, "toUint8_outOfBounds"); uint8 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x1), _start)) } return tempUint; } function toUint16( bytes memory _bytes, uint256 _start ) internal pure returns (uint16) { require(_bytes.length >= _start + 2, "toUint16_outOfBounds"); uint16 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x2), _start)) } return tempUint; } function toUint32( bytes memory _bytes, uint256 _start ) internal pure returns (uint32) { require(_bytes.length >= _start + 4, "toUint32_outOfBounds"); uint32 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x4), _start)) } return tempUint; } function toUint64( bytes memory _bytes, uint256 _start ) internal pure returns (uint64) { require(_bytes.length >= _start + 8, "toUint64_outOfBounds"); uint64 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x8), _start)) } return tempUint; } function toUint96( bytes memory _bytes, uint256 _start ) internal pure returns (uint96) { require(_bytes.length >= _start + 12, "toUint96_outOfBounds"); uint96 tempUint; assembly { tempUint := mload(add(add(_bytes, 0xc), _start)) } return tempUint; } function toUint128( bytes memory _bytes, uint256 _start ) internal pure returns (uint128) { require(_bytes.length >= _start + 16, "toUint128_outOfBounds"); uint128 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x10), _start)) } return tempUint; } function toUint256( bytes memory _bytes, uint256 _start ) internal pure returns (uint256) { require(_bytes.length >= _start + 32, "toUint256_outOfBounds"); uint256 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x20), _start)) } return tempUint; } function toBytes32( bytes memory _bytes, uint256 _start ) internal pure returns (bytes32) { require(_bytes.length >= _start + 32, "toBytes32_outOfBounds"); bytes32 tempBytes32; assembly { tempBytes32 := mload(add(add(_bytes, 0x20), _start)) } return tempBytes32; } function equal( bytes memory _preBytes, bytes memory _postBytes ) internal pure returns (bool) { bool success = true; assembly { let length := mload(_preBytes) // if lengths don't match the arrays are not equal switch eq(length, mload(_postBytes)) case 1 { // cb is a circuit breaker in the for loop since there's // no said feature for inline assembly loops // cb = 1 - don't breaker // cb = 0 - break let cb := 1 let mc := add(_preBytes, 0x20) let end := add(mc, length) for { let cc := add(_postBytes, 0x20) // the next line is the loop condition: // while(uint256(mc < end) + cb == 2) } eq(add(lt(mc, end), cb), 2) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { // if any of these checks fails then arrays are not equal if iszero(eq(mload(mc), mload(cc))) { // unsuccess: success := 0 cb := 0 } } } default { // unsuccess: success := 0 } } return success; } function equalStorage( bytes storage _preBytes, bytes memory _postBytes ) internal view returns (bool) { bool success = true; assembly { // we know _preBytes_offset is 0 let fslot := sload(_preBytes.slot) // Decode the length of the stored array like in concatStorage(). let slength := div( and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2 ) let mlength := mload(_postBytes) // if lengths don't match the arrays are not equal switch eq(slength, mlength) case 1 { // slength can contain both the length and contents of the array // if length < 32 bytes so let's prepare for that // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage if iszero(iszero(slength)) { switch lt(slength, 32) case 1 { // blank the last byte which is the length fslot := mul(div(fslot, 0x100), 0x100) if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) { // unsuccess: success := 0 } } default { // cb is a circuit breaker in the for loop since there's // no said feature for inline assembly loops // cb = 1 - don't breaker // cb = 0 - break let cb := 1 // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) let sc := keccak256(0x0, 0x20) let mc := add(_postBytes, 0x20) let end := add(mc, mlength) // the next line is the loop condition: // while(uint256(mc < end) + cb == 2) for { } eq(add(lt(mc, end), cb), 2) { sc := add(sc, 1) mc := add(mc, 0x20) } { if iszero(eq(sload(sc), mload(mc))) { // unsuccess: success := 0 cb := 0 } } } } } default { // unsuccess: success := 0 } } return success; } }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.7.6; library ExcessivelySafeCall { uint256 constant LOW_28_MASK = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff; /// @notice Use when you _really_ really _really_ don't trust the called /// contract. This prevents the called contract from causing reversion of /// the caller in as many ways as we can. /// @dev The main difference between this and a solidity low-level call is /// that we limit the number of bytes that the callee can cause to be /// copied to caller memory. This prevents stupid things like malicious /// contracts returning 10,000,000 bytes causing a local OOG when copying /// to memory. /// @param _target The address to call /// @param _gas The amount of gas to forward to the remote contract /// @param _maxCopy The maximum number of bytes of returndata to copy /// to memory. /// @param _calldata The data to send to the remote contract /// @return success and returndata, as `.call()`. Returndata is capped to /// `_maxCopy` bytes. function excessivelySafeCall( address _target, uint256 _gas, uint16 _maxCopy, bytes memory _calldata ) internal returns (bool, bytes memory) { // set up for assembly call uint256 _toCopy; bool _success; bytes memory _returnData = new bytes(_maxCopy); // dispatch message to recipient // by assembly calling "handle" function // we call via assembly to avoid memcopying a very large returndata // returned by a malicious contract assembly { _success := call( _gas, // gas _target, // recipient 0, // ether value add(_calldata, 0x20), // inloc mload(_calldata), // inlen 0, // outloc 0 // outlen ) // limit our copy to 256 bytes _toCopy := returndatasize() if gt(_toCopy, _maxCopy) { _toCopy := _maxCopy } // Store the length of the copied bytes mstore(_returnData, _toCopy) // copy the bytes from returndata[0:_toCopy] returndatacopy(add(_returnData, 0x20), 0, _toCopy) } return (_success, _returnData); } /// @notice Use when you _really_ really _really_ don't trust the called /// contract. This prevents the called contract from causing reversion of /// the caller in as many ways as we can. /// @dev The main difference between this and a solidity low-level call is /// that we limit the number of bytes that the callee can cause to be /// copied to caller memory. This prevents stupid things like malicious /// contracts returning 10,000,000 bytes causing a local OOG when copying /// to memory. /// @param _target The address to call /// @param _gas The amount of gas to forward to the remote contract /// @param _maxCopy The maximum number of bytes of returndata to copy /// to memory. /// @param _calldata The data to send to the remote contract /// @return success and returndata, as `.call()`. Returndata is capped to /// `_maxCopy` bytes. function excessivelySafeStaticCall( address _target, uint256 _gas, uint16 _maxCopy, bytes memory _calldata ) internal view returns (bool, bytes memory) { // set up for assembly call uint256 _toCopy; bool _success; bytes memory _returnData = new bytes(_maxCopy); // dispatch message to recipient // by assembly calling "handle" function // we call via assembly to avoid memcopying a very large returndata // returned by a malicious contract assembly { _success := staticcall( _gas, // gas _target, // recipient add(_calldata, 0x20), // inloc mload(_calldata), // inlen 0, // outloc 0 // outlen ) // limit our copy to 256 bytes _toCopy := returndatasize() if gt(_toCopy, _maxCopy) { _toCopy := _maxCopy } // Store the length of the copied bytes mstore(_returnData, _toCopy) // copy the bytes from returndata[0:_toCopy] returndatacopy(add(_returnData, 0x20), 0, _toCopy) } return (_success, _returnData); } /** * @notice Swaps function selectors in encoded contract calls * @dev Allows reuse of encoded calldata for functions with identical * argument types but different names. It simply swaps out the first 4 bytes * for the new selector. This function modifies memory in place, and should * only be used with caution. * @param _newSelector The new 4-byte selector * @param _buf The encoded contract args */ function swapSelector( bytes4 _newSelector, bytes memory _buf ) internal pure { require(_buf.length >= 4); uint256 _mask = LOW_28_MASK; assembly { // load the first word of let _word := mload(add(_buf, 0x20)) // mask out the top 4 bytes // /x _word := and(_word, _mask) _word := or(_newSelector, _word) mstore(add(_buf, 0x20), _word) } } }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_endpoint","type":"address"},{"internalType":"uint256","name":"_startTokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InsufficientGas","type":"error"},{"inputs":[],"name":"NotTokenOwner","type":"error"},{"inputs":[],"name":"SupplyExceeded","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"_payload","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"_reason","type":"bytes"}],"name":"MessageFailed","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":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"counter","type":"uint256"}],"name":"ReceivedNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"RetryMessageSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"_type","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"_minDstGas","type":"uint256"}],"name":"SetMinDstGas","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"precrime","type":"address"}],"name":"SetPrecrime","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_path","type":"bytes"}],"name":"SetTrustedRemote","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_remoteAddress","type":"bytes"}],"name":"SetTrustedRemoteAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_PAYLOAD_SIZE_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"counter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"dstChainId","type":"uint16"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"crossChain","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"currentTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"dstChainId","type":"uint16"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"estimateFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint64","name":"","type":"uint64"}],"name":"failedMessages","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"forceResumeReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"_configType","type":"uint256"}],"name":"getConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"}],"name":"getTrustedRemoteAddress","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"isTrustedRemote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lzEndpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"minDstGasLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"nonblockingLzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"payloadSizeLimitLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"precrime","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"retryMessage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_configType","type":"uint256"},{"internalType":"bytes","name":"_config","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint16","name":"_packetType","type":"uint16"},{"internalType":"uint256","name":"_minGas","type":"uint256"}],"name":"setMinDstGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"_size","type":"uint256"}],"name":"setPayloadSizeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_precrime","type":"address"}],"name":"setPrecrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setReceiveVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setSendVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_path","type":"bytes"}],"name":"setTrustedRemote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"bytes","name":"_remoteAddress","type":"bytes"}],"name":"setTrustedRemoteAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"trustedRemoteLookup","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60c06040523480156200001157600080fd5b50604051620060bf380380620060bf8339818101604052810190620000379190620002bb565b81806040518060400160405280600d81526020017f43726f7373436861696e4e4654000000000000000000000000000000000000008152506040518060400160405280600581526020017f43434e4654000000000000000000000000000000000000000000000000000000815250620000c5620000b96200014a60201b60201c565b6200015260201b60201c565b8160019081620000d6919062000572565b508060029081620000e8919062000572565b5050508073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1681525050505080600d819055506201869f600d546200013b919062000688565b60a081815250505050620006c3565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000248826200021b565b9050919050565b6200025a816200023b565b81146200026657600080fd5b50565b6000815190506200027a816200024f565b92915050565b6000819050919050565b620002958162000280565b8114620002a157600080fd5b50565b600081519050620002b5816200028a565b92915050565b60008060408385031215620002d557620002d462000216565b5b6000620002e58582860162000269565b9250506020620002f885828601620002a4565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200038457607f821691505b6020821081036200039a57620003996200033c565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620004047fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620003c5565b620004108683620003c5565b95508019841693508086168417925050509392505050565b6000819050919050565b6000620004536200044d620004478462000280565b62000428565b62000280565b9050919050565b6000819050919050565b6200046f8362000432565b620004876200047e826200045a565b848454620003d2565b825550505050565b600090565b6200049e6200048f565b620004ab81848462000464565b505050565b5b81811015620004d357620004c760008262000494565b600181019050620004b1565b5050565b601f8211156200052257620004ec81620003a0565b620004f784620003b5565b8101602085101562000507578190505b6200051f6200051685620003b5565b830182620004b0565b50505b505050565b600082821c905092915050565b6000620005476000198460080262000527565b1980831691505092915050565b600062000562838362000534565b9150826002028217905092915050565b6200057d8262000302565b67ffffffffffffffff8111156200059957620005986200030d565b5b620005a582546200036b565b620005b2828285620004d7565b600060209050601f831160018114620005ea5760008415620005d5578287015190505b620005e1858262000554565b86555062000651565b601f198416620005fa86620003a0565b60005b828110156200062457848901518255600182019150602085019450602081019050620005fd565b8683101562000644578489015162000640601f89168262000534565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000620006958262000280565b9150620006a28362000280565b9250828201905080821115620006bd57620006bc62000659565b5b92915050565b60805160a05161599762000728600039600081816110e90152611172015260008181610a6401528181610e3c0152818161105b015281816112790152818161141d015281816115e401528181611c9101528181611e10015261233d01526159976000f3fe6080604052600436106102655760003560e01c806370a0823111610144578063b88d4fde116100b6578063d1deba1f1161007a578063d1deba1f14610951578063df2a5b3b1461096d578063e985e9c514610996578063eb8d72b7146109d3578063f2fde38b146109fc578063f5ecbdbc14610a2557610265565b8063b88d4fde1461086e578063baf3292d14610897578063c4461834146108c0578063c87b56dd146108eb578063cbed8b9c1461092857610265565b8063950c8a7411610108578063950c8a741461075e57806395d89b41146107895780639f38369a146107b4578063a22cb465146107f1578063a6c3d1651461081a578063b353aaa71461084357610265565b806370a0823114610665578063715018a6146106a25780637533d788146106b95780638cfd8f5c146106f65780638da5cb5b1461073357610265565b80631e128296116101dd57806342842e0e116101a157806342842e0e1461054557806342d65a8d1461056e5780635b8c41e61461059757806361bc221a146105d45780636352211e146105ff57806366ad5c8a1461063c57610265565b80631e1282961461044957806323b872dd14610465578063362790f61461048e5780633d8b38f6146104cb5780633f1f4fa41461050857610265565b8063081812fc1161022f578063081812fc1461034f578063095ea7b31461038c5780630df37483146103b557806310ddb137146103de5780631249c58b1461040757806317bac0521461041e57610265565b80621d35671461026a5780629a9b7b1461029357806301ffc9a7146102be57806306fdde03146102fb57806307e0db1714610326575b600080fd5b34801561027657600080fd5b50610291600480360381019061028c9190613877565b610a62565b005b34801561029f57600080fd5b506102a8610cb8565b6040516102b59190613937565b60405180910390f35b3480156102ca57600080fd5b506102e560048036038101906102e091906139aa565b610cbe565b6040516102f291906139f2565b60405180910390f35b34801561030757600080fd5b50610310610da0565b60405161031d9190613a9d565b60405180910390f35b34801561033257600080fd5b5061034d60048036038101906103489190613abf565b610e32565b005b34801561035b57600080fd5b5061037660048036038101906103719190613b18565b610ec8565b6040516103839190613b86565b60405180910390f35b34801561039857600080fd5b506103b360048036038101906103ae9190613bcd565b610f0e565b005b3480156103c157600080fd5b506103dc60048036038101906103d79190613c0d565b611025565b005b3480156103ea57600080fd5b5061040560048036038101906104009190613abf565b611051565b005b34801561041357600080fd5b5061041c6110e7565b005b34801561042a57600080fd5b50610433611170565b6040516104409190613937565b60405180910390f35b610463600480360381019061045e9190613c0d565b611194565b005b34801561047157600080fd5b5061048c60048036038101906104879190613c4d565b61135e565b005b34801561049a57600080fd5b506104b560048036038101906104b09190613c0d565b6113be565b6040516104c29190613937565b60405180910390f35b3480156104d757600080fd5b506104f260048036038101906104ed9190613ca0565b6114ce565b6040516104ff91906139f2565b60405180910390f35b34801561051457600080fd5b5061052f600480360381019061052a9190613abf565b6115a2565b60405161053c9190613937565b60405180910390f35b34801561055157600080fd5b5061056c60048036038101906105679190613c4d565b6115ba565b005b34801561057a57600080fd5b5061059560048036038101906105909190613ca0565b6115da565b005b3480156105a357600080fd5b506105be60048036038101906105b99190613e30565b611676565b6040516105cb9190613eb8565b60405180910390f35b3480156105e057600080fd5b506105e96116be565b6040516105f69190613937565b60405180910390f35b34801561060b57600080fd5b5061062660048036038101906106219190613b18565b6116c4565b6040516106339190613b86565b60405180910390f35b34801561064857600080fd5b50610663600480360381019061065e9190613877565b61174a565b005b34801561067157600080fd5b5061068c60048036038101906106879190613ed3565b61185b565b6040516106999190613937565b60405180910390f35b3480156106ae57600080fd5b506106b7611912565b005b3480156106c557600080fd5b506106e060048036038101906106db9190613abf565b611926565b6040516106ed9190613f55565b60405180910390f35b34801561070257600080fd5b5061071d60048036038101906107189190613f77565b6119c6565b60405161072a9190613937565b60405180910390f35b34801561073f57600080fd5b506107486119eb565b6040516107559190613b86565b60405180910390f35b34801561076a57600080fd5b50610773611a14565b6040516107809190613b86565b60405180910390f35b34801561079557600080fd5b5061079e611a3a565b6040516107ab9190613a9d565b60405180910390f35b3480156107c057600080fd5b506107db60048036038101906107d69190613abf565b611acc565b6040516107e89190613f55565b60405180910390f35b3480156107fd57600080fd5b5061081860048036038101906108139190613fe3565b611be5565b005b34801561082657600080fd5b50610841600480360381019061083c9190613ca0565b611bfb565b005b34801561084f57600080fd5b50610858611c8f565b6040516108659190614082565b60405180910390f35b34801561087a57600080fd5b506108956004803603810190610890919061409d565b611cb3565b005b3480156108a357600080fd5b506108be60048036038101906108b99190613ed3565b611d15565b005b3480156108cc57600080fd5b506108d5611d98565b6040516108e29190613937565b60405180910390f35b3480156108f757600080fd5b50610912600480360381019061090d9190613b18565b611d9e565b60405161091f9190613a9d565b60405180910390f35b34801561093457600080fd5b5061094f600480360381019061094a9190614120565b611e06565b005b61096b60048036038101906109669190613877565b611ea8565b005b34801561097957600080fd5b50610994600480360381019061098f91906141a8565b6120eb565b005b3480156109a257600080fd5b506109bd60048036038101906109b891906141fb565b6121af565b6040516109ca91906139f2565b60405180910390f35b3480156109df57600080fd5b506109fa60048036038101906109f59190613ca0565b612243565b005b348015610a0857600080fd5b50610a236004803603810190610a1e9190613ed3565b6122b6565b005b348015610a3157600080fd5b50610a4c6004803603810190610a47919061423b565b612339565b604051610a599190613f55565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610aa16123ea565b73ffffffffffffffffffffffffffffffffffffffff1614610af7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aee906142ee565b60405180910390fd5b6000600760008861ffff1661ffff1681526020019081526020016000208054610b1f9061433d565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4b9061433d565b8015610b985780601f10610b6d57610100808354040283529160200191610b98565b820191906000526020600020905b815481529060010190602001808311610b7b57829003601f168201915b50505050509050805186869050148015610bb3575060008151115b8015610bdc575080805190602001208686604051610bd292919061439e565b6040518091039020145b610c1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1290614429565b60405180910390fd5b610caf8787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506123f2565b50505050505050565b600d5481565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610d8957507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610d995750610d98826124bd565b5b9050919050565b606060018054610daf9061433d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ddb9061433d565b8015610e285780601f10610dfd57610100808354040283529160200191610e28565b820191906000526020600020905b815481529060010190602001808311610e0b57829003601f168201915b5050505050905090565b610e3a612527565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166307e0db17826040518263ffffffff1660e01b8152600401610e939190614458565b600060405180830381600087803b158015610ead57600080fd5b505af1158015610ec1573d6000803e3d6000fd5b5050505050565b6000610ed3826125a5565b6005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610f19826116c4565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610f89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f80906144e5565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610fa86123ea565b73ffffffffffffffffffffffffffffffffffffffff161480610fd75750610fd681610fd16123ea565b6121af565b5b611016576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100d90614577565b60405180910390fd5b61102083836125f0565b505050565b61102d612527565b80600960008461ffff1661ffff168152602001908152602001600020819055505050565b611059612527565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166310ddb137826040518263ffffffff1660e01b81526004016110b29190614458565b600060405180830381600087803b1580156110cc57600080fd5b505af11580156110e0573d6000803e3d6000fd5b5050505050565b7f0000000000000000000000000000000000000000000000000000000000000000600d5403611142576040517f7d3d824900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61114e33600d546126a9565b600d6000815460010191905081905550600c6000815460010191905081905550565b7f000000000000000000000000000000000000000000000000000000000000000081565b61119d816116c4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611201576040517f59dc379f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600c60008154600190039190508190555061121b816128c6565b60003382604051602001611230929190614597565b6040516020818303038152906040529050600060019050600062055730905060008282604051602001611264929190614617565b604051602081830303815290604052905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166340a7bb108830886000876040518663ffffffff1660e01b81526004016112d9959493929190614643565b6040805180830381865afa1580156112f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131991906146b9565b509050803411611355576040517f1c26714c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050505050565b61136f6113696123ea565b82612a14565b6113ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a59061476b565b60405180910390fd5b6113b9838383612aa9565b505050565b60008033836040516020016113d4929190614597565b6040516020818303038152906040529050600060019050600062055730905060008282604051602001611408929190614617565b604051602081830303815290604052905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166340a7bb108930886000876040518663ffffffff1660e01b815260040161147d959493929190614643565b6040805180830381865afa158015611499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bd91906146b9565b509050809550505050505092915050565b600080600760008661ffff1661ffff16815260200190815260200160002080546114f79061433d565b80601f01602080910402602001604051908101604052809291908181526020018280546115239061433d565b80156115705780601f1061154557610100808354040283529160200191611570565b820191906000526020600020905b81548152906001019060200180831161155357829003601f168201915b50505050509050838360405161158792919061439e565b60405180910390208180519060200120149150509392505050565b60096020528060005260406000206000915090505481565b6115d583838360405180602001604052806000815250611cb3565b505050565b6115e2612527565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166342d65a8d8484846040518463ffffffff1660e01b815260040161163f939291906147b8565b600060405180830381600087803b15801561165957600080fd5b505af115801561166d573d6000803e3d6000fd5b50505050505050565b600b6020528260005260406000208280516020810182018051848252602083016020850120818352809550505050505060205280600052604060002060009250925050505481565b600c5481565b6000806116d083612da2565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611741576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173890614836565b60405180910390fd5b80915050919050565b3073ffffffffffffffffffffffffffffffffffffffff166117696123ea565b73ffffffffffffffffffffffffffffffffffffffff16146117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b6906148c8565b60405180910390fd5b6118538686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050612ddf565b505050505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036118cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c29061495a565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61191a612527565b6119246000612e65565b565b600760205280600052604060002060009150905080546119459061433d565b80601f01602080910402602001604051908101604052809291908181526020018280546119719061433d565b80156119be5780601f10611993576101008083540402835291602001916119be565b820191906000526020600020905b8154815290600101906020018083116119a157829003601f168201915b505050505081565b6008602052816000526040600020602052806000526040600020600091509150505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060028054611a499061433d565b80601f0160208091040260200160405190810160405280929190818152602001828054611a759061433d565b8015611ac25780601f10611a9757610100808354040283529160200191611ac2565b820191906000526020600020905b815481529060010190602001808311611aa557829003601f168201915b5050505050905090565b60606000600760008461ffff1661ffff1681526020019081526020016000208054611af69061433d565b80601f0160208091040260200160405190810160405280929190818152602001828054611b229061433d565b8015611b6f5780601f10611b4457610100808354040283529160200191611b6f565b820191906000526020600020905b815481529060010190602001808311611b5257829003601f168201915b505050505090506000815103611bba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb1906149c6565b60405180910390fd5b611bdd600060148351611bcd9190614a15565b83612f299092919063ffffffff16565b915050919050565b611bf7611bf06123ea565b8383613047565b5050565b611c03612527565b818130604051602001611c1893929190614a91565b604051602081830303815290604052600760008561ffff1661ffff1681526020019081526020016000209081611c4e9190614c5d565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce838383604051611c82939291906147b8565b60405180910390a1505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b611cc4611cbe6123ea565b83612a14565b611d03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cfa9061476b565b60405180910390fd5b611d0f848484846131b3565b50505050565b611d1d612527565b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b81604051611d8d9190613b86565b60405180910390a150565b61271081565b6060611da9826125a5565b6000611db361320f565b90506000815111611dd35760405180602001604052806000815250611dfe565b80611ddd84613226565b604051602001611dee929190614d6b565b6040516020818303038152906040525b915050919050565b611e0e612527565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663cbed8b9c86868686866040518663ffffffff1660e01b8152600401611e6f959493929190614d8f565b600060405180830381600087803b158015611e8957600080fd5b505af1158015611e9d573d6000803e3d6000fd5b505050505050505050565b6000600b60008861ffff1661ffff1681526020019081526020016000208686604051611ed592919061439e565b908152602001604051809103902060008567ffffffffffffffff1667ffffffffffffffff1681526020019081526020016000205490506000801b8103611f50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4790614e4f565b60405180910390fd5b808383604051611f6192919061439e565b604051809103902014611fa9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fa090614ee1565b60405180910390fd5b6000801b600b60008961ffff1661ffff1681526020019081526020016000208787604051611fd892919061439e565b908152602001604051809103902060008667ffffffffffffffff1667ffffffffffffffff168152602001908152602001600020819055506120a38787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050612ddf565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e587878787856040516120da959493929190614f10565b60405180910390a150505050505050565b6120f3612527565b60008111612136576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212d90614faa565b60405180910390fd5b80600860008561ffff1661ffff16815260200190815260200160002060008461ffff1661ffff168152602001908152602001600020819055507f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac08383836040516121a293929190614fca565b60405180910390a1505050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61224b612527565b8181600760008661ffff1661ffff168152602001908152602001600020918261227592919061500c565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab8383836040516122a9939291906147b8565b60405180910390a1505050565b6122be612527565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361232d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123249061514e565b60405180910390fd5b61233681612e65565b50565b60607f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663f5ecbdbc868630866040518563ffffffff1660e01b815260040161239a949392919061516e565b600060405180830381865afa1580156123b7573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906123e09190615223565b9050949350505050565b600033905090565b60008061249e5a60966366ad5c8a60e01b8989898960405160240161241a949392919061526c565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050503073ffffffffffffffffffffffffffffffffffffffff166132f4909392919063ffffffff16565b91509150816124b5576124b4868686868561338c565b5b505050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61252f6123ea565b73ffffffffffffffffffffffffffffffffffffffff1661254d6119eb565b73ffffffffffffffffffffffffffffffffffffffff16146125a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259a9061530b565b60405180910390fd5b565b6125ae8161343a565b6125ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e490614836565b60405180910390fd5b50565b816005600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16612663836116c4565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270f90615377565b60405180910390fd5b6127218161343a565b15612761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612758906153e3565b60405180910390fd5b61276f60008383600161347b565b6127788161343a565b156127b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127af906153e3565b60405180910390fd5b6001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46128c2600083836001613481565b5050565b60006128d1826116c4565b90506128e181600084600161347b565b6128ea826116c4565b90506005600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506003600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612a10816000846001613481565b5050565b600080612a20836116c4565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612a625750612a6181856121af565b5b80612aa057508373ffffffffffffffffffffffffffffffffffffffff16612a8884610ec8565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612ac9826116c4565b73ffffffffffffffffffffffffffffffffffffffff1614612b1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b1690615475565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612b8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8590615507565b60405180910390fd5b612b9b838383600161347b565b8273ffffffffffffffffffffffffffffffffffffffff16612bbb826116c4565b73ffffffffffffffffffffffffffffffffffffffff1614612c11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c0890615475565b60405180910390fd5b6005600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612d9d8383836001613481565b505050565b60006003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006014840151905060008083806020019051810190612dff9190615565565b91509150612e0d82826126a9565b600c60008154600101919050819055507f31ae2bb20187b24b2039def7711f43f56311ec96de17b7ef01d1b1da40eb2eee878483600c54604051612e5494939291906155a5565b60405180910390a150505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b606081601f83612f3991906155ea565b1015612f7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f719061566a565b60405180910390fd5b8183612f8691906155ea565b84511015612fc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fc0906156d6565b60405180910390fd5b6060821560008114612fea576040519150600082526020820160405261303b565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015613028578051835260208301925060208101905061300b565b50868552601f19601f8301166040525050505b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036130b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130ac90615742565b60405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516131a691906139f2565b60405180910390a3505050565b6131be848484612aa9565b6131ca84848484613487565b613209576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613200906157d4565b60405180910390fd5b50505050565b606060405180602001604052806000815250905090565b6060600060016132358461360e565b01905060008167ffffffffffffffff81111561325457613253613d05565b5b6040519080825280601f01601f1916602001820160405280156132865781602001600182028036833780820191505090505b509050600082602001820190505b6001156132e9578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85816132dd576132dc6157f4565b5b04945060008503613294575b819350505050919050565b6000606060008060008661ffff1667ffffffffffffffff81111561331b5761331a613d05565b5b6040519080825280601f01601f19166020018201604052801561334d5781602001600182028036833780820191505090505b50905060008087516020890160008d8df191503d92508683111561336f578692505b828152826000602083013e81819450945050505094509492505050565b8180519060200120600b60008761ffff1661ffff168152602001908152602001600020856040516133bd9190615854565b908152602001604051809103902060008567ffffffffffffffff1667ffffffffffffffff168152602001908152602001600020819055507fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c858585858560405161342b95949392919061586b565b60405180910390a15050505050565b60008073ffffffffffffffffffffffffffffffffffffffff1661345c83612da2565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b50505050565b50505050565b60006134a88473ffffffffffffffffffffffffffffffffffffffff16613761565b15613601578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026134d16123ea565b8786866040518563ffffffff1660e01b81526004016134f394939291906158d3565b6020604051808303816000875af192505050801561352f57506040513d601f19601f8201168201806040525081019061352c9190615934565b60015b6135b1573d806000811461355f576040519150601f19603f3d011682016040523d82523d6000602084013e613564565b606091505b5060008151036135a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016135a0906157d4565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050613606565b600190505b949350505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831061366c577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381613662576136616157f4565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106136a9576d04ee2d6d415b85acef8100000000838161369f5761369e6157f4565b5b0492506020810190505b662386f26fc1000083106136d857662386f26fc1000083816136ce576136cd6157f4565b5b0492506010810190505b6305f5e1008310613701576305f5e10083816136f7576136f66157f4565b5b0492506008810190505b612710831061372657612710838161371c5761371b6157f4565b5b0492506004810190505b60648310613749576064838161373f5761373e6157f4565b5b0492506002810190505b600a8310613758576001810190505b80915050919050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000604051905090565b600080fd5b600080fd5b600061ffff82169050919050565b6137af81613798565b81146137ba57600080fd5b50565b6000813590506137cc816137a6565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126137f7576137f66137d2565b5b8235905067ffffffffffffffff811115613814576138136137d7565b5b6020830191508360018202830111156138305761382f6137dc565b5b9250929050565b600067ffffffffffffffff82169050919050565b61385481613837565b811461385f57600080fd5b50565b6000813590506138718161384b565b92915050565b600080600080600080608087890312156138945761389361378e565b5b60006138a289828a016137bd565b965050602087013567ffffffffffffffff8111156138c3576138c2613793565b5b6138cf89828a016137e1565b955095505060406138e289828a01613862565b935050606087013567ffffffffffffffff81111561390357613902613793565b5b61390f89828a016137e1565b92509250509295509295509295565b6000819050919050565b6139318161391e565b82525050565b600060208201905061394c6000830184613928565b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61398781613952565b811461399257600080fd5b50565b6000813590506139a48161397e565b92915050565b6000602082840312156139c0576139bf61378e565b5b60006139ce84828501613995565b91505092915050565b60008115159050919050565b6139ec816139d7565b82525050565b6000602082019050613a0760008301846139e3565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613a47578082015181840152602081019050613a2c565b60008484015250505050565b6000601f19601f8301169050919050565b6000613a6f82613a0d565b613a798185613a18565b9350613a89818560208601613a29565b613a9281613a53565b840191505092915050565b60006020820190508181036000830152613ab78184613a64565b905092915050565b600060208284031215613ad557613ad461378e565b5b6000613ae3848285016137bd565b91505092915050565b613af58161391e565b8114613b0057600080fd5b50565b600081359050613b1281613aec565b92915050565b600060208284031215613b2e57613b2d61378e565b5b6000613b3c84828501613b03565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613b7082613b45565b9050919050565b613b8081613b65565b82525050565b6000602082019050613b9b6000830184613b77565b92915050565b613baa81613b65565b8114613bb557600080fd5b50565b600081359050613bc781613ba1565b92915050565b60008060408385031215613be457613be361378e565b5b6000613bf285828601613bb8565b9250506020613c0385828601613b03565b9150509250929050565b60008060408385031215613c2457613c2361378e565b5b6000613c32858286016137bd565b9250506020613c4385828601613b03565b9150509250929050565b600080600060608486031215613c6657613c6561378e565b5b6000613c7486828701613bb8565b9350506020613c8586828701613bb8565b9250506040613c9686828701613b03565b9150509250925092565b600080600060408486031215613cb957613cb861378e565b5b6000613cc7868287016137bd565b935050602084013567ffffffffffffffff811115613ce857613ce7613793565b5b613cf4868287016137e1565b92509250509250925092565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613d3d82613a53565b810181811067ffffffffffffffff82111715613d5c57613d5b613d05565b5b80604052505050565b6000613d6f613784565b9050613d7b8282613d34565b919050565b600067ffffffffffffffff821115613d9b57613d9a613d05565b5b613da482613a53565b9050602081019050919050565b82818337600083830152505050565b6000613dd3613dce84613d80565b613d65565b905082815260208101848484011115613def57613dee613d00565b5b613dfa848285613db1565b509392505050565b600082601f830112613e1757613e166137d2565b5b8135613e27848260208601613dc0565b91505092915050565b600080600060608486031215613e4957613e4861378e565b5b6000613e57868287016137bd565b935050602084013567ffffffffffffffff811115613e7857613e77613793565b5b613e8486828701613e02565b9250506040613e9586828701613862565b9150509250925092565b6000819050919050565b613eb281613e9f565b82525050565b6000602082019050613ecd6000830184613ea9565b92915050565b600060208284031215613ee957613ee861378e565b5b6000613ef784828501613bb8565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000613f2782613f00565b613f318185613f0b565b9350613f41818560208601613a29565b613f4a81613a53565b840191505092915050565b60006020820190508181036000830152613f6f8184613f1c565b905092915050565b60008060408385031215613f8e57613f8d61378e565b5b6000613f9c858286016137bd565b9250506020613fad858286016137bd565b9150509250929050565b613fc0816139d7565b8114613fcb57600080fd5b50565b600081359050613fdd81613fb7565b92915050565b60008060408385031215613ffa57613ff961378e565b5b600061400885828601613bb8565b925050602061401985828601613fce565b9150509250929050565b6000819050919050565b600061404861404361403e84613b45565b614023565b613b45565b9050919050565b600061405a8261402d565b9050919050565b600061406c8261404f565b9050919050565b61407c81614061565b82525050565b60006020820190506140976000830184614073565b92915050565b600080600080608085870312156140b7576140b661378e565b5b60006140c587828801613bb8565b94505060206140d687828801613bb8565b93505060406140e787828801613b03565b925050606085013567ffffffffffffffff81111561410857614107613793565b5b61411487828801613e02565b91505092959194509250565b60008060008060006080868803121561413c5761413b61378e565b5b600061414a888289016137bd565b955050602061415b888289016137bd565b945050604061416c88828901613b03565b935050606086013567ffffffffffffffff81111561418d5761418c613793565b5b614199888289016137e1565b92509250509295509295909350565b6000806000606084860312156141c1576141c061378e565b5b60006141cf868287016137bd565b93505060206141e0868287016137bd565b92505060406141f186828701613b03565b9150509250925092565b600080604083850312156142125761421161378e565b5b600061422085828601613bb8565b925050602061423185828601613bb8565b9150509250929050565b600080600080608085870312156142555761425461378e565b5b6000614263878288016137bd565b9450506020614274878288016137bd565b935050604061428587828801613bb8565b925050606061429687828801613b03565b91505092959194509250565b7f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c65720000600082015250565b60006142d8601e83613a18565b91506142e3826142a2565b602082019050919050565b60006020820190508181036000830152614307816142cb565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061435557607f821691505b6020821081036143685761436761430e565b5b50919050565b600081905092915050565b6000614385838561436e565b9350614392838584613db1565b82840190509392505050565b60006143ab828486614379565b91508190509392505050565b7f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b6000614413602683613a18565b915061441e826143b7565b604082019050919050565b6000602082019050818103600083015261444281614406565b9050919050565b61445281613798565b82525050565b600060208201905061446d6000830184614449565b92915050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b60006144cf602183613a18565b91506144da82614473565b604082019050919050565b600060208201905081810360008301526144fe816144c2565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000602082015250565b6000614561603d83613a18565b915061456c82614505565b604082019050919050565b6000602082019050818103600083015261459081614554565b9050919050565b60006040820190506145ac6000830185613b77565b6145b96020830184613928565b9392505050565b60008160f01b9050919050565b60006145d8826145c0565b9050919050565b6145f06145eb82613798565b6145cd565b82525050565b6000819050919050565b61461161460c8261391e565b6145f6565b82525050565b600061462382856145df565b6002820191506146338284614600565b6020820191508190509392505050565b600060a0820190506146586000830188614449565b6146656020830187613b77565b81810360408301526146778186613f1c565b905061468660608301856139e3565b81810360808301526146988184613f1c565b90509695505050505050565b6000815190506146b381613aec565b92915050565b600080604083850312156146d0576146cf61378e565b5b60006146de858286016146a4565b92505060206146ef858286016146a4565b9150509250929050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206f7220617070726f76656400000000000000000000000000000000000000602082015250565b6000614755602d83613a18565b9150614760826146f9565b604082019050919050565b6000602082019050818103600083015261478481614748565b9050919050565b60006147978385613f0b565b93506147a4838584613db1565b6147ad83613a53565b840190509392505050565b60006040820190506147cd6000830186614449565b81810360208301526147e081848661478b565b9050949350505050565b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b6000614820601883613a18565b915061482b826147ea565b602082019050919050565b6000602082019050818103600083015261484f81614813565b9050919050565b7f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d75737420626560008201527f204c7a4170700000000000000000000000000000000000000000000000000000602082015250565b60006148b2602683613a18565b91506148bd82614856565b604082019050919050565b600060208201905081810360008301526148e1816148a5565b9050919050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b6000614944602983613a18565b915061494f826148e8565b604082019050919050565b6000602082019050818103600083015261497381614937565b9050919050565b7f4c7a4170703a206e6f20747275737465642070617468207265636f7264000000600082015250565b60006149b0601d83613a18565b91506149bb8261497a565b602082019050919050565b600060208201905081810360008301526149df816149a3565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614a208261391e565b9150614a2b8361391e565b9250828203905081811115614a4357614a426149e6565b5b92915050565b60008160601b9050919050565b6000614a6182614a49565b9050919050565b6000614a7382614a56565b9050919050565b614a8b614a8682613b65565b614a68565b82525050565b6000614a9e828587614379565b9150614aaa8284614a7a565b601482019150819050949350505050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302614b1d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82614ae0565b614b278683614ae0565b95508019841693508086168417925050509392505050565b6000614b5a614b55614b508461391e565b614023565b61391e565b9050919050565b6000819050919050565b614b7483614b3f565b614b88614b8082614b61565b848454614aed565b825550505050565b600090565b614b9d614b90565b614ba8818484614b6b565b505050565b5b81811015614bcc57614bc1600082614b95565b600181019050614bae565b5050565b601f821115614c1157614be281614abb565b614beb84614ad0565b81016020851015614bfa578190505b614c0e614c0685614ad0565b830182614bad565b50505b505050565b600082821c905092915050565b6000614c3460001984600802614c16565b1980831691505092915050565b6000614c4d8383614c23565b9150826002028217905092915050565b614c6682613f00565b67ffffffffffffffff811115614c7f57614c7e613d05565b5b614c89825461433d565b614c94828285614bd0565b600060209050601f831160018114614cc75760008415614cb5578287015190505b614cbf8582614c41565b865550614d27565b601f198416614cd586614abb565b60005b82811015614cfd57848901518255600182019150602085019450602081019050614cd8565b86831015614d1a5784890151614d16601f891682614c23565b8355505b6001600288020188555050505b505050505050565b600081905092915050565b6000614d4582613a0d565b614d4f8185614d2f565b9350614d5f818560208601613a29565b80840191505092915050565b6000614d778285614d3a565b9150614d838284614d3a565b91508190509392505050565b6000608082019050614da46000830188614449565b614db16020830187614449565b614dbe6040830186613928565b8181036060830152614dd181848661478b565b90509695505050505050565b7f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360008201527f6167650000000000000000000000000000000000000000000000000000000000602082015250565b6000614e39602383613a18565b9150614e4482614ddd565b604082019050919050565b60006020820190508181036000830152614e6881614e2c565b9050919050565b7f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f6160008201527f6400000000000000000000000000000000000000000000000000000000000000602082015250565b6000614ecb602183613a18565b9150614ed682614e6f565b604082019050919050565b60006020820190508181036000830152614efa81614ebe565b9050919050565b614f0a81613837565b82525050565b6000608082019050614f256000830188614449565b8181036020830152614f3881868861478b565b9050614f476040830185614f01565b614f546060830184613ea9565b9695505050505050565b7f4c7a4170703a20696e76616c6964206d696e4761730000000000000000000000600082015250565b6000614f94601583613a18565b9150614f9f82614f5e565b602082019050919050565b60006020820190508181036000830152614fc381614f87565b9050919050565b6000606082019050614fdf6000830186614449565b614fec6020830185614449565b614ff96040830184613928565b949350505050565b600082905092915050565b6150168383615001565b67ffffffffffffffff81111561502f5761502e613d05565b5b615039825461433d565b615044828285614bd0565b6000601f8311600181146150735760008415615061578287013590505b61506b8582614c41565b8655506150d3565b601f19841661508186614abb565b60005b828110156150a957848901358255600182019150602085019450602081019050615084565b868310156150c657848901356150c2601f891682614c23565b8355505b6001600288020188555050505b50505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000615138602683613a18565b9150615143826150dc565b604082019050919050565b600060208201905081810360008301526151678161512b565b9050919050565b60006080820190506151836000830187614449565b6151906020830186614449565b61519d6040830185613b77565b6151aa6060830184613928565b95945050505050565b60006151c66151c184613d80565b613d65565b9050828152602081018484840111156151e2576151e1613d00565b5b6151ed848285613a29565b509392505050565b600082601f83011261520a576152096137d2565b5b815161521a8482602086016151b3565b91505092915050565b6000602082840312156152395761523861378e565b5b600082015167ffffffffffffffff81111561525757615256613793565b5b615263848285016151f5565b91505092915050565b60006080820190506152816000830187614449565b81810360208301526152938186613f1c565b90506152a26040830185614f01565b81810360608301526152b48184613f1c565b905095945050505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006152f5602083613a18565b9150615300826152bf565b602082019050919050565b60006020820190508181036000830152615324816152e8565b9050919050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b6000615361602083613a18565b915061536c8261532b565b602082019050919050565b6000602082019050818103600083015261539081615354565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b60006153cd601c83613a18565b91506153d882615397565b602082019050919050565b600060208201905081810360008301526153fc816153c0565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b600061545f602583613a18565b915061546a82615403565b604082019050919050565b6000602082019050818103600083015261548e81615452565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006154f1602483613a18565b91506154fc82615495565b604082019050919050565b60006020820190508181036000830152615520816154e4565b9050919050565b600061553282613b45565b9050919050565b61554281615527565b811461554d57600080fd5b50565b60008151905061555f81615539565b92915050565b6000806040838503121561557c5761557b61378e565b5b600061558a85828601615550565b925050602061559b858286016146a4565b9150509250929050565b60006080820190506155ba6000830187614449565b6155c76020830186613b77565b6155d46040830185613928565b6155e16060830184613928565b95945050505050565b60006155f58261391e565b91506156008361391e565b9250828201905080821115615618576156176149e6565b5b92915050565b7f736c6963655f6f766572666c6f77000000000000000000000000000000000000600082015250565b6000615654600e83613a18565b915061565f8261561e565b602082019050919050565b6000602082019050818103600083015261568381615647565b9050919050565b7f736c6963655f6f75744f66426f756e6473000000000000000000000000000000600082015250565b60006156c0601183613a18565b91506156cb8261568a565b602082019050919050565b600060208201905081810360008301526156ef816156b3565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b600061572c601983613a18565b9150615737826156f6565b602082019050919050565b6000602082019050818103600083015261575b8161571f565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b60006157be603283613a18565b91506157c982615762565b604082019050919050565b600060208201905081810360008301526157ed816157b1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061582e82613f00565b615838818561436e565b9350615848818560208601613a29565b80840191505092915050565b60006158608284615823565b915081905092915050565b600060a0820190506158806000830188614449565b81810360208301526158928187613f1c565b90506158a16040830186614f01565b81810360608301526158b38185613f1c565b905081810360808301526158c78184613f1c565b90509695505050505050565b60006080820190506158e86000830187613b77565b6158f56020830186613b77565b6159026040830185613928565b81810360608301526159148184613f1c565b905095945050505050565b60008151905061592e8161397e565b92915050565b60006020828403121561594a5761594961378e565b5b60006159588482850161591f565b9150509291505056fea2646970667358221220c4aa9a48994ab607d40476a48d8c952836eeb5403133eebc87c05eedc456974364736f6c634300081100330000000000000000000000003c2269811836af69497e5f486a85d7316753cf620000000000000000000000000000000000000000000000000000000000061a80
Deployed Bytecode
0x6080604052600436106102655760003560e01c806370a0823111610144578063b88d4fde116100b6578063d1deba1f1161007a578063d1deba1f14610951578063df2a5b3b1461096d578063e985e9c514610996578063eb8d72b7146109d3578063f2fde38b146109fc578063f5ecbdbc14610a2557610265565b8063b88d4fde1461086e578063baf3292d14610897578063c4461834146108c0578063c87b56dd146108eb578063cbed8b9c1461092857610265565b8063950c8a7411610108578063950c8a741461075e57806395d89b41146107895780639f38369a146107b4578063a22cb465146107f1578063a6c3d1651461081a578063b353aaa71461084357610265565b806370a0823114610665578063715018a6146106a25780637533d788146106b95780638cfd8f5c146106f65780638da5cb5b1461073357610265565b80631e128296116101dd57806342842e0e116101a157806342842e0e1461054557806342d65a8d1461056e5780635b8c41e61461059757806361bc221a146105d45780636352211e146105ff57806366ad5c8a1461063c57610265565b80631e1282961461044957806323b872dd14610465578063362790f61461048e5780633d8b38f6146104cb5780633f1f4fa41461050857610265565b8063081812fc1161022f578063081812fc1461034f578063095ea7b31461038c5780630df37483146103b557806310ddb137146103de5780631249c58b1461040757806317bac0521461041e57610265565b80621d35671461026a5780629a9b7b1461029357806301ffc9a7146102be57806306fdde03146102fb57806307e0db1714610326575b600080fd5b34801561027657600080fd5b50610291600480360381019061028c9190613877565b610a62565b005b34801561029f57600080fd5b506102a8610cb8565b6040516102b59190613937565b60405180910390f35b3480156102ca57600080fd5b506102e560048036038101906102e091906139aa565b610cbe565b6040516102f291906139f2565b60405180910390f35b34801561030757600080fd5b50610310610da0565b60405161031d9190613a9d565b60405180910390f35b34801561033257600080fd5b5061034d60048036038101906103489190613abf565b610e32565b005b34801561035b57600080fd5b5061037660048036038101906103719190613b18565b610ec8565b6040516103839190613b86565b60405180910390f35b34801561039857600080fd5b506103b360048036038101906103ae9190613bcd565b610f0e565b005b3480156103c157600080fd5b506103dc60048036038101906103d79190613c0d565b611025565b005b3480156103ea57600080fd5b5061040560048036038101906104009190613abf565b611051565b005b34801561041357600080fd5b5061041c6110e7565b005b34801561042a57600080fd5b50610433611170565b6040516104409190613937565b60405180910390f35b610463600480360381019061045e9190613c0d565b611194565b005b34801561047157600080fd5b5061048c60048036038101906104879190613c4d565b61135e565b005b34801561049a57600080fd5b506104b560048036038101906104b09190613c0d565b6113be565b6040516104c29190613937565b60405180910390f35b3480156104d757600080fd5b506104f260048036038101906104ed9190613ca0565b6114ce565b6040516104ff91906139f2565b60405180910390f35b34801561051457600080fd5b5061052f600480360381019061052a9190613abf565b6115a2565b60405161053c9190613937565b60405180910390f35b34801561055157600080fd5b5061056c60048036038101906105679190613c4d565b6115ba565b005b34801561057a57600080fd5b5061059560048036038101906105909190613ca0565b6115da565b005b3480156105a357600080fd5b506105be60048036038101906105b99190613e30565b611676565b6040516105cb9190613eb8565b60405180910390f35b3480156105e057600080fd5b506105e96116be565b6040516105f69190613937565b60405180910390f35b34801561060b57600080fd5b5061062660048036038101906106219190613b18565b6116c4565b6040516106339190613b86565b60405180910390f35b34801561064857600080fd5b50610663600480360381019061065e9190613877565b61174a565b005b34801561067157600080fd5b5061068c60048036038101906106879190613ed3565b61185b565b6040516106999190613937565b60405180910390f35b3480156106ae57600080fd5b506106b7611912565b005b3480156106c557600080fd5b506106e060048036038101906106db9190613abf565b611926565b6040516106ed9190613f55565b60405180910390f35b34801561070257600080fd5b5061071d60048036038101906107189190613f77565b6119c6565b60405161072a9190613937565b60405180910390f35b34801561073f57600080fd5b506107486119eb565b6040516107559190613b86565b60405180910390f35b34801561076a57600080fd5b50610773611a14565b6040516107809190613b86565b60405180910390f35b34801561079557600080fd5b5061079e611a3a565b6040516107ab9190613a9d565b60405180910390f35b3480156107c057600080fd5b506107db60048036038101906107d69190613abf565b611acc565b6040516107e89190613f55565b60405180910390f35b3480156107fd57600080fd5b5061081860048036038101906108139190613fe3565b611be5565b005b34801561082657600080fd5b50610841600480360381019061083c9190613ca0565b611bfb565b005b34801561084f57600080fd5b50610858611c8f565b6040516108659190614082565b60405180910390f35b34801561087a57600080fd5b506108956004803603810190610890919061409d565b611cb3565b005b3480156108a357600080fd5b506108be60048036038101906108b99190613ed3565b611d15565b005b3480156108cc57600080fd5b506108d5611d98565b6040516108e29190613937565b60405180910390f35b3480156108f757600080fd5b50610912600480360381019061090d9190613b18565b611d9e565b60405161091f9190613a9d565b60405180910390f35b34801561093457600080fd5b5061094f600480360381019061094a9190614120565b611e06565b005b61096b60048036038101906109669190613877565b611ea8565b005b34801561097957600080fd5b50610994600480360381019061098f91906141a8565b6120eb565b005b3480156109a257600080fd5b506109bd60048036038101906109b891906141fb565b6121af565b6040516109ca91906139f2565b60405180910390f35b3480156109df57600080fd5b506109fa60048036038101906109f59190613ca0565b612243565b005b348015610a0857600080fd5b50610a236004803603810190610a1e9190613ed3565b6122b6565b005b348015610a3157600080fd5b50610a4c6004803603810190610a47919061423b565b612339565b604051610a599190613f55565b60405180910390f35b7f0000000000000000000000003c2269811836af69497e5f486a85d7316753cf6273ffffffffffffffffffffffffffffffffffffffff16610aa16123ea565b73ffffffffffffffffffffffffffffffffffffffff1614610af7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aee906142ee565b60405180910390fd5b6000600760008861ffff1661ffff1681526020019081526020016000208054610b1f9061433d565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4b9061433d565b8015610b985780601f10610b6d57610100808354040283529160200191610b98565b820191906000526020600020905b815481529060010190602001808311610b7b57829003601f168201915b50505050509050805186869050148015610bb3575060008151115b8015610bdc575080805190602001208686604051610bd292919061439e565b6040518091039020145b610c1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1290614429565b60405180910390fd5b610caf8787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506123f2565b50505050505050565b600d5481565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610d8957507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610d995750610d98826124bd565b5b9050919050565b606060018054610daf9061433d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ddb9061433d565b8015610e285780601f10610dfd57610100808354040283529160200191610e28565b820191906000526020600020905b815481529060010190602001808311610e0b57829003601f168201915b5050505050905090565b610e3a612527565b7f0000000000000000000000003c2269811836af69497e5f486a85d7316753cf6273ffffffffffffffffffffffffffffffffffffffff166307e0db17826040518263ffffffff1660e01b8152600401610e939190614458565b600060405180830381600087803b158015610ead57600080fd5b505af1158015610ec1573d6000803e3d6000fd5b5050505050565b6000610ed3826125a5565b6005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610f19826116c4565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610f89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f80906144e5565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610fa86123ea565b73ffffffffffffffffffffffffffffffffffffffff161480610fd75750610fd681610fd16123ea565b6121af565b5b611016576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100d90614577565b60405180910390fd5b61102083836125f0565b505050565b61102d612527565b80600960008461ffff1661ffff168152602001908152602001600020819055505050565b611059612527565b7f0000000000000000000000003c2269811836af69497e5f486a85d7316753cf6273ffffffffffffffffffffffffffffffffffffffff166310ddb137826040518263ffffffff1660e01b81526004016110b29190614458565b600060405180830381600087803b1580156110cc57600080fd5b505af11580156110e0573d6000803e3d6000fd5b5050505050565b7f000000000000000000000000000000000000000000000000000000000007a11f600d5403611142576040517f7d3d824900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61114e33600d546126a9565b600d6000815460010191905081905550600c6000815460010191905081905550565b7f000000000000000000000000000000000000000000000000000000000007a11f81565b61119d816116c4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611201576040517f59dc379f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600c60008154600190039190508190555061121b816128c6565b60003382604051602001611230929190614597565b6040516020818303038152906040529050600060019050600062055730905060008282604051602001611264929190614617565b604051602081830303815290604052905060007f0000000000000000000000003c2269811836af69497e5f486a85d7316753cf6273ffffffffffffffffffffffffffffffffffffffff166340a7bb108830886000876040518663ffffffff1660e01b81526004016112d9959493929190614643565b6040805180830381865afa1580156112f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131991906146b9565b509050803411611355576040517f1c26714c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050505050565b61136f6113696123ea565b82612a14565b6113ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a59061476b565b60405180910390fd5b6113b9838383612aa9565b505050565b60008033836040516020016113d4929190614597565b6040516020818303038152906040529050600060019050600062055730905060008282604051602001611408929190614617565b604051602081830303815290604052905060007f0000000000000000000000003c2269811836af69497e5f486a85d7316753cf6273ffffffffffffffffffffffffffffffffffffffff166340a7bb108930886000876040518663ffffffff1660e01b815260040161147d959493929190614643565b6040805180830381865afa158015611499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bd91906146b9565b509050809550505050505092915050565b600080600760008661ffff1661ffff16815260200190815260200160002080546114f79061433d565b80601f01602080910402602001604051908101604052809291908181526020018280546115239061433d565b80156115705780601f1061154557610100808354040283529160200191611570565b820191906000526020600020905b81548152906001019060200180831161155357829003601f168201915b50505050509050838360405161158792919061439e565b60405180910390208180519060200120149150509392505050565b60096020528060005260406000206000915090505481565b6115d583838360405180602001604052806000815250611cb3565b505050565b6115e2612527565b7f0000000000000000000000003c2269811836af69497e5f486a85d7316753cf6273ffffffffffffffffffffffffffffffffffffffff166342d65a8d8484846040518463ffffffff1660e01b815260040161163f939291906147b8565b600060405180830381600087803b15801561165957600080fd5b505af115801561166d573d6000803e3d6000fd5b50505050505050565b600b6020528260005260406000208280516020810182018051848252602083016020850120818352809550505050505060205280600052604060002060009250925050505481565b600c5481565b6000806116d083612da2565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611741576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173890614836565b60405180910390fd5b80915050919050565b3073ffffffffffffffffffffffffffffffffffffffff166117696123ea565b73ffffffffffffffffffffffffffffffffffffffff16146117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b6906148c8565b60405180910390fd5b6118538686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050612ddf565b505050505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036118cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c29061495a565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61191a612527565b6119246000612e65565b565b600760205280600052604060002060009150905080546119459061433d565b80601f01602080910402602001604051908101604052809291908181526020018280546119719061433d565b80156119be5780601f10611993576101008083540402835291602001916119be565b820191906000526020600020905b8154815290600101906020018083116119a157829003601f168201915b505050505081565b6008602052816000526040600020602052806000526040600020600091509150505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060028054611a499061433d565b80601f0160208091040260200160405190810160405280929190818152602001828054611a759061433d565b8015611ac25780601f10611a9757610100808354040283529160200191611ac2565b820191906000526020600020905b815481529060010190602001808311611aa557829003601f168201915b5050505050905090565b60606000600760008461ffff1661ffff1681526020019081526020016000208054611af69061433d565b80601f0160208091040260200160405190810160405280929190818152602001828054611b229061433d565b8015611b6f5780601f10611b4457610100808354040283529160200191611b6f565b820191906000526020600020905b815481529060010190602001808311611b5257829003601f168201915b505050505090506000815103611bba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb1906149c6565b60405180910390fd5b611bdd600060148351611bcd9190614a15565b83612f299092919063ffffffff16565b915050919050565b611bf7611bf06123ea565b8383613047565b5050565b611c03612527565b818130604051602001611c1893929190614a91565b604051602081830303815290604052600760008561ffff1661ffff1681526020019081526020016000209081611c4e9190614c5d565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce838383604051611c82939291906147b8565b60405180910390a1505050565b7f0000000000000000000000003c2269811836af69497e5f486a85d7316753cf6281565b611cc4611cbe6123ea565b83612a14565b611d03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cfa9061476b565b60405180910390fd5b611d0f848484846131b3565b50505050565b611d1d612527565b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b81604051611d8d9190613b86565b60405180910390a150565b61271081565b6060611da9826125a5565b6000611db361320f565b90506000815111611dd35760405180602001604052806000815250611dfe565b80611ddd84613226565b604051602001611dee929190614d6b565b6040516020818303038152906040525b915050919050565b611e0e612527565b7f0000000000000000000000003c2269811836af69497e5f486a85d7316753cf6273ffffffffffffffffffffffffffffffffffffffff1663cbed8b9c86868686866040518663ffffffff1660e01b8152600401611e6f959493929190614d8f565b600060405180830381600087803b158015611e8957600080fd5b505af1158015611e9d573d6000803e3d6000fd5b505050505050505050565b6000600b60008861ffff1661ffff1681526020019081526020016000208686604051611ed592919061439e565b908152602001604051809103902060008567ffffffffffffffff1667ffffffffffffffff1681526020019081526020016000205490506000801b8103611f50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4790614e4f565b60405180910390fd5b808383604051611f6192919061439e565b604051809103902014611fa9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fa090614ee1565b60405180910390fd5b6000801b600b60008961ffff1661ffff1681526020019081526020016000208787604051611fd892919061439e565b908152602001604051809103902060008667ffffffffffffffff1667ffffffffffffffff168152602001908152602001600020819055506120a38787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050612ddf565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e587878787856040516120da959493929190614f10565b60405180910390a150505050505050565b6120f3612527565b60008111612136576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212d90614faa565b60405180910390fd5b80600860008561ffff1661ffff16815260200190815260200160002060008461ffff1661ffff168152602001908152602001600020819055507f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac08383836040516121a293929190614fca565b60405180910390a1505050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61224b612527565b8181600760008661ffff1661ffff168152602001908152602001600020918261227592919061500c565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab8383836040516122a9939291906147b8565b60405180910390a1505050565b6122be612527565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361232d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123249061514e565b60405180910390fd5b61233681612e65565b50565b60607f0000000000000000000000003c2269811836af69497e5f486a85d7316753cf6273ffffffffffffffffffffffffffffffffffffffff1663f5ecbdbc868630866040518563ffffffff1660e01b815260040161239a949392919061516e565b600060405180830381865afa1580156123b7573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906123e09190615223565b9050949350505050565b600033905090565b60008061249e5a60966366ad5c8a60e01b8989898960405160240161241a949392919061526c565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050503073ffffffffffffffffffffffffffffffffffffffff166132f4909392919063ffffffff16565b91509150816124b5576124b4868686868561338c565b5b505050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61252f6123ea565b73ffffffffffffffffffffffffffffffffffffffff1661254d6119eb565b73ffffffffffffffffffffffffffffffffffffffff16146125a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259a9061530b565b60405180910390fd5b565b6125ae8161343a565b6125ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e490614836565b60405180910390fd5b50565b816005600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16612663836116c4565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270f90615377565b60405180910390fd5b6127218161343a565b15612761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612758906153e3565b60405180910390fd5b61276f60008383600161347b565b6127788161343a565b156127b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127af906153e3565b60405180910390fd5b6001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46128c2600083836001613481565b5050565b60006128d1826116c4565b90506128e181600084600161347b565b6128ea826116c4565b90506005600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506003600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612a10816000846001613481565b5050565b600080612a20836116c4565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612a625750612a6181856121af565b5b80612aa057508373ffffffffffffffffffffffffffffffffffffffff16612a8884610ec8565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612ac9826116c4565b73ffffffffffffffffffffffffffffffffffffffff1614612b1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b1690615475565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612b8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8590615507565b60405180910390fd5b612b9b838383600161347b565b8273ffffffffffffffffffffffffffffffffffffffff16612bbb826116c4565b73ffffffffffffffffffffffffffffffffffffffff1614612c11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c0890615475565b60405180910390fd5b6005600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612d9d8383836001613481565b505050565b60006003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006014840151905060008083806020019051810190612dff9190615565565b91509150612e0d82826126a9565b600c60008154600101919050819055507f31ae2bb20187b24b2039def7711f43f56311ec96de17b7ef01d1b1da40eb2eee878483600c54604051612e5494939291906155a5565b60405180910390a150505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b606081601f83612f3991906155ea565b1015612f7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f719061566a565b60405180910390fd5b8183612f8691906155ea565b84511015612fc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fc0906156d6565b60405180910390fd5b6060821560008114612fea576040519150600082526020820160405261303b565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015613028578051835260208301925060208101905061300b565b50868552601f19601f8301166040525050505b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036130b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130ac90615742565b60405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516131a691906139f2565b60405180910390a3505050565b6131be848484612aa9565b6131ca84848484613487565b613209576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613200906157d4565b60405180910390fd5b50505050565b606060405180602001604052806000815250905090565b6060600060016132358461360e565b01905060008167ffffffffffffffff81111561325457613253613d05565b5b6040519080825280601f01601f1916602001820160405280156132865781602001600182028036833780820191505090505b509050600082602001820190505b6001156132e9578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85816132dd576132dc6157f4565b5b04945060008503613294575b819350505050919050565b6000606060008060008661ffff1667ffffffffffffffff81111561331b5761331a613d05565b5b6040519080825280601f01601f19166020018201604052801561334d5781602001600182028036833780820191505090505b50905060008087516020890160008d8df191503d92508683111561336f578692505b828152826000602083013e81819450945050505094509492505050565b8180519060200120600b60008761ffff1661ffff168152602001908152602001600020856040516133bd9190615854565b908152602001604051809103902060008567ffffffffffffffff1667ffffffffffffffff168152602001908152602001600020819055507fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c858585858560405161342b95949392919061586b565b60405180910390a15050505050565b60008073ffffffffffffffffffffffffffffffffffffffff1661345c83612da2565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b50505050565b50505050565b60006134a88473ffffffffffffffffffffffffffffffffffffffff16613761565b15613601578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026134d16123ea565b8786866040518563ffffffff1660e01b81526004016134f394939291906158d3565b6020604051808303816000875af192505050801561352f57506040513d601f19601f8201168201806040525081019061352c9190615934565b60015b6135b1573d806000811461355f576040519150601f19603f3d011682016040523d82523d6000602084013e613564565b606091505b5060008151036135a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016135a0906157d4565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050613606565b600190505b949350505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831061366c577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381613662576136616157f4565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106136a9576d04ee2d6d415b85acef8100000000838161369f5761369e6157f4565b5b0492506020810190505b662386f26fc1000083106136d857662386f26fc1000083816136ce576136cd6157f4565b5b0492506010810190505b6305f5e1008310613701576305f5e10083816136f7576136f66157f4565b5b0492506008810190505b612710831061372657612710838161371c5761371b6157f4565b5b0492506004810190505b60648310613749576064838161373f5761373e6157f4565b5b0492506002810190505b600a8310613758576001810190505b80915050919050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000604051905090565b600080fd5b600080fd5b600061ffff82169050919050565b6137af81613798565b81146137ba57600080fd5b50565b6000813590506137cc816137a6565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126137f7576137f66137d2565b5b8235905067ffffffffffffffff811115613814576138136137d7565b5b6020830191508360018202830111156138305761382f6137dc565b5b9250929050565b600067ffffffffffffffff82169050919050565b61385481613837565b811461385f57600080fd5b50565b6000813590506138718161384b565b92915050565b600080600080600080608087890312156138945761389361378e565b5b60006138a289828a016137bd565b965050602087013567ffffffffffffffff8111156138c3576138c2613793565b5b6138cf89828a016137e1565b955095505060406138e289828a01613862565b935050606087013567ffffffffffffffff81111561390357613902613793565b5b61390f89828a016137e1565b92509250509295509295509295565b6000819050919050565b6139318161391e565b82525050565b600060208201905061394c6000830184613928565b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61398781613952565b811461399257600080fd5b50565b6000813590506139a48161397e565b92915050565b6000602082840312156139c0576139bf61378e565b5b60006139ce84828501613995565b91505092915050565b60008115159050919050565b6139ec816139d7565b82525050565b6000602082019050613a0760008301846139e3565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613a47578082015181840152602081019050613a2c565b60008484015250505050565b6000601f19601f8301169050919050565b6000613a6f82613a0d565b613a798185613a18565b9350613a89818560208601613a29565b613a9281613a53565b840191505092915050565b60006020820190508181036000830152613ab78184613a64565b905092915050565b600060208284031215613ad557613ad461378e565b5b6000613ae3848285016137bd565b91505092915050565b613af58161391e565b8114613b0057600080fd5b50565b600081359050613b1281613aec565b92915050565b600060208284031215613b2e57613b2d61378e565b5b6000613b3c84828501613b03565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613b7082613b45565b9050919050565b613b8081613b65565b82525050565b6000602082019050613b9b6000830184613b77565b92915050565b613baa81613b65565b8114613bb557600080fd5b50565b600081359050613bc781613ba1565b92915050565b60008060408385031215613be457613be361378e565b5b6000613bf285828601613bb8565b9250506020613c0385828601613b03565b9150509250929050565b60008060408385031215613c2457613c2361378e565b5b6000613c32858286016137bd565b9250506020613c4385828601613b03565b9150509250929050565b600080600060608486031215613c6657613c6561378e565b5b6000613c7486828701613bb8565b9350506020613c8586828701613bb8565b9250506040613c9686828701613b03565b9150509250925092565b600080600060408486031215613cb957613cb861378e565b5b6000613cc7868287016137bd565b935050602084013567ffffffffffffffff811115613ce857613ce7613793565b5b613cf4868287016137e1565b92509250509250925092565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613d3d82613a53565b810181811067ffffffffffffffff82111715613d5c57613d5b613d05565b5b80604052505050565b6000613d6f613784565b9050613d7b8282613d34565b919050565b600067ffffffffffffffff821115613d9b57613d9a613d05565b5b613da482613a53565b9050602081019050919050565b82818337600083830152505050565b6000613dd3613dce84613d80565b613d65565b905082815260208101848484011115613def57613dee613d00565b5b613dfa848285613db1565b509392505050565b600082601f830112613e1757613e166137d2565b5b8135613e27848260208601613dc0565b91505092915050565b600080600060608486031215613e4957613e4861378e565b5b6000613e57868287016137bd565b935050602084013567ffffffffffffffff811115613e7857613e77613793565b5b613e8486828701613e02565b9250506040613e9586828701613862565b9150509250925092565b6000819050919050565b613eb281613e9f565b82525050565b6000602082019050613ecd6000830184613ea9565b92915050565b600060208284031215613ee957613ee861378e565b5b6000613ef784828501613bb8565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000613f2782613f00565b613f318185613f0b565b9350613f41818560208601613a29565b613f4a81613a53565b840191505092915050565b60006020820190508181036000830152613f6f8184613f1c565b905092915050565b60008060408385031215613f8e57613f8d61378e565b5b6000613f9c858286016137bd565b9250506020613fad858286016137bd565b9150509250929050565b613fc0816139d7565b8114613fcb57600080fd5b50565b600081359050613fdd81613fb7565b92915050565b60008060408385031215613ffa57613ff961378e565b5b600061400885828601613bb8565b925050602061401985828601613fce565b9150509250929050565b6000819050919050565b600061404861404361403e84613b45565b614023565b613b45565b9050919050565b600061405a8261402d565b9050919050565b600061406c8261404f565b9050919050565b61407c81614061565b82525050565b60006020820190506140976000830184614073565b92915050565b600080600080608085870312156140b7576140b661378e565b5b60006140c587828801613bb8565b94505060206140d687828801613bb8565b93505060406140e787828801613b03565b925050606085013567ffffffffffffffff81111561410857614107613793565b5b61411487828801613e02565b91505092959194509250565b60008060008060006080868803121561413c5761413b61378e565b5b600061414a888289016137bd565b955050602061415b888289016137bd565b945050604061416c88828901613b03565b935050606086013567ffffffffffffffff81111561418d5761418c613793565b5b614199888289016137e1565b92509250509295509295909350565b6000806000606084860312156141c1576141c061378e565b5b60006141cf868287016137bd565b93505060206141e0868287016137bd565b92505060406141f186828701613b03565b9150509250925092565b600080604083850312156142125761421161378e565b5b600061422085828601613bb8565b925050602061423185828601613bb8565b9150509250929050565b600080600080608085870312156142555761425461378e565b5b6000614263878288016137bd565b9450506020614274878288016137bd565b935050604061428587828801613bb8565b925050606061429687828801613b03565b91505092959194509250565b7f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c65720000600082015250565b60006142d8601e83613a18565b91506142e3826142a2565b602082019050919050565b60006020820190508181036000830152614307816142cb565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061435557607f821691505b6020821081036143685761436761430e565b5b50919050565b600081905092915050565b6000614385838561436e565b9350614392838584613db1565b82840190509392505050565b60006143ab828486614379565b91508190509392505050565b7f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b6000614413602683613a18565b915061441e826143b7565b604082019050919050565b6000602082019050818103600083015261444281614406565b9050919050565b61445281613798565b82525050565b600060208201905061446d6000830184614449565b92915050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b60006144cf602183613a18565b91506144da82614473565b604082019050919050565b600060208201905081810360008301526144fe816144c2565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000602082015250565b6000614561603d83613a18565b915061456c82614505565b604082019050919050565b6000602082019050818103600083015261459081614554565b9050919050565b60006040820190506145ac6000830185613b77565b6145b96020830184613928565b9392505050565b60008160f01b9050919050565b60006145d8826145c0565b9050919050565b6145f06145eb82613798565b6145cd565b82525050565b6000819050919050565b61461161460c8261391e565b6145f6565b82525050565b600061462382856145df565b6002820191506146338284614600565b6020820191508190509392505050565b600060a0820190506146586000830188614449565b6146656020830187613b77565b81810360408301526146778186613f1c565b905061468660608301856139e3565b81810360808301526146988184613f1c565b90509695505050505050565b6000815190506146b381613aec565b92915050565b600080604083850312156146d0576146cf61378e565b5b60006146de858286016146a4565b92505060206146ef858286016146a4565b9150509250929050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206f7220617070726f76656400000000000000000000000000000000000000602082015250565b6000614755602d83613a18565b9150614760826146f9565b604082019050919050565b6000602082019050818103600083015261478481614748565b9050919050565b60006147978385613f0b565b93506147a4838584613db1565b6147ad83613a53565b840190509392505050565b60006040820190506147cd6000830186614449565b81810360208301526147e081848661478b565b9050949350505050565b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b6000614820601883613a18565b915061482b826147ea565b602082019050919050565b6000602082019050818103600083015261484f81614813565b9050919050565b7f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d75737420626560008201527f204c7a4170700000000000000000000000000000000000000000000000000000602082015250565b60006148b2602683613a18565b91506148bd82614856565b604082019050919050565b600060208201905081810360008301526148e1816148a5565b9050919050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b6000614944602983613a18565b915061494f826148e8565b604082019050919050565b6000602082019050818103600083015261497381614937565b9050919050565b7f4c7a4170703a206e6f20747275737465642070617468207265636f7264000000600082015250565b60006149b0601d83613a18565b91506149bb8261497a565b602082019050919050565b600060208201905081810360008301526149df816149a3565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614a208261391e565b9150614a2b8361391e565b9250828203905081811115614a4357614a426149e6565b5b92915050565b60008160601b9050919050565b6000614a6182614a49565b9050919050565b6000614a7382614a56565b9050919050565b614a8b614a8682613b65565b614a68565b82525050565b6000614a9e828587614379565b9150614aaa8284614a7a565b601482019150819050949350505050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302614b1d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82614ae0565b614b278683614ae0565b95508019841693508086168417925050509392505050565b6000614b5a614b55614b508461391e565b614023565b61391e565b9050919050565b6000819050919050565b614b7483614b3f565b614b88614b8082614b61565b848454614aed565b825550505050565b600090565b614b9d614b90565b614ba8818484614b6b565b505050565b5b81811015614bcc57614bc1600082614b95565b600181019050614bae565b5050565b601f821115614c1157614be281614abb565b614beb84614ad0565b81016020851015614bfa578190505b614c0e614c0685614ad0565b830182614bad565b50505b505050565b600082821c905092915050565b6000614c3460001984600802614c16565b1980831691505092915050565b6000614c4d8383614c23565b9150826002028217905092915050565b614c6682613f00565b67ffffffffffffffff811115614c7f57614c7e613d05565b5b614c89825461433d565b614c94828285614bd0565b600060209050601f831160018114614cc75760008415614cb5578287015190505b614cbf8582614c41565b865550614d27565b601f198416614cd586614abb565b60005b82811015614cfd57848901518255600182019150602085019450602081019050614cd8565b86831015614d1a5784890151614d16601f891682614c23565b8355505b6001600288020188555050505b505050505050565b600081905092915050565b6000614d4582613a0d565b614d4f8185614d2f565b9350614d5f818560208601613a29565b80840191505092915050565b6000614d778285614d3a565b9150614d838284614d3a565b91508190509392505050565b6000608082019050614da46000830188614449565b614db16020830187614449565b614dbe6040830186613928565b8181036060830152614dd181848661478b565b90509695505050505050565b7f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360008201527f6167650000000000000000000000000000000000000000000000000000000000602082015250565b6000614e39602383613a18565b9150614e4482614ddd565b604082019050919050565b60006020820190508181036000830152614e6881614e2c565b9050919050565b7f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f6160008201527f6400000000000000000000000000000000000000000000000000000000000000602082015250565b6000614ecb602183613a18565b9150614ed682614e6f565b604082019050919050565b60006020820190508181036000830152614efa81614ebe565b9050919050565b614f0a81613837565b82525050565b6000608082019050614f256000830188614449565b8181036020830152614f3881868861478b565b9050614f476040830185614f01565b614f546060830184613ea9565b9695505050505050565b7f4c7a4170703a20696e76616c6964206d696e4761730000000000000000000000600082015250565b6000614f94601583613a18565b9150614f9f82614f5e565b602082019050919050565b60006020820190508181036000830152614fc381614f87565b9050919050565b6000606082019050614fdf6000830186614449565b614fec6020830185614449565b614ff96040830184613928565b949350505050565b600082905092915050565b6150168383615001565b67ffffffffffffffff81111561502f5761502e613d05565b5b615039825461433d565b615044828285614bd0565b6000601f8311600181146150735760008415615061578287013590505b61506b8582614c41565b8655506150d3565b601f19841661508186614abb565b60005b828110156150a957848901358255600182019150602085019450602081019050615084565b868310156150c657848901356150c2601f891682614c23565b8355505b6001600288020188555050505b50505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000615138602683613a18565b9150615143826150dc565b604082019050919050565b600060208201905081810360008301526151678161512b565b9050919050565b60006080820190506151836000830187614449565b6151906020830186614449565b61519d6040830185613b77565b6151aa6060830184613928565b95945050505050565b60006151c66151c184613d80565b613d65565b9050828152602081018484840111156151e2576151e1613d00565b5b6151ed848285613a29565b509392505050565b600082601f83011261520a576152096137d2565b5b815161521a8482602086016151b3565b91505092915050565b6000602082840312156152395761523861378e565b5b600082015167ffffffffffffffff81111561525757615256613793565b5b615263848285016151f5565b91505092915050565b60006080820190506152816000830187614449565b81810360208301526152938186613f1c565b90506152a26040830185614f01565b81810360608301526152b48184613f1c565b905095945050505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006152f5602083613a18565b9150615300826152bf565b602082019050919050565b60006020820190508181036000830152615324816152e8565b9050919050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b6000615361602083613a18565b915061536c8261532b565b602082019050919050565b6000602082019050818103600083015261539081615354565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b60006153cd601c83613a18565b91506153d882615397565b602082019050919050565b600060208201905081810360008301526153fc816153c0565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b600061545f602583613a18565b915061546a82615403565b604082019050919050565b6000602082019050818103600083015261548e81615452565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006154f1602483613a18565b91506154fc82615495565b604082019050919050565b60006020820190508181036000830152615520816154e4565b9050919050565b600061553282613b45565b9050919050565b61554281615527565b811461554d57600080fd5b50565b60008151905061555f81615539565b92915050565b6000806040838503121561557c5761557b61378e565b5b600061558a85828601615550565b925050602061559b858286016146a4565b9150509250929050565b60006080820190506155ba6000830187614449565b6155c76020830186613b77565b6155d46040830185613928565b6155e16060830184613928565b95945050505050565b60006155f58261391e565b91506156008361391e565b9250828201905080821115615618576156176149e6565b5b92915050565b7f736c6963655f6f766572666c6f77000000000000000000000000000000000000600082015250565b6000615654600e83613a18565b915061565f8261561e565b602082019050919050565b6000602082019050818103600083015261568381615647565b9050919050565b7f736c6963655f6f75744f66426f756e6473000000000000000000000000000000600082015250565b60006156c0601183613a18565b91506156cb8261568a565b602082019050919050565b600060208201905081810360008301526156ef816156b3565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b600061572c601983613a18565b9150615737826156f6565b602082019050919050565b6000602082019050818103600083015261575b8161571f565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b60006157be603283613a18565b91506157c982615762565b604082019050919050565b600060208201905081810360008301526157ed816157b1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061582e82613f00565b615838818561436e565b9350615848818560208601613a29565b80840191505092915050565b60006158608284615823565b915081905092915050565b600060a0820190506158806000830188614449565b81810360208301526158928187613f1c565b90506158a16040830186614f01565b81810360608301526158b38185613f1c565b905081810360808301526158c78184613f1c565b90509695505050505050565b60006080820190506158e86000830187613b77565b6158f56020830186613b77565b6159026040830185613928565b81810360608301526159148184613f1c565b905095945050505050565b60008151905061592e8161397e565b92915050565b60006020828403121561594a5761594961378e565b5b60006159588482850161591f565b9150509291505056fea2646970667358221220c4aa9a48994ab607d40476a48d8c952836eeb5403133eebc87c05eedc456974364736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003c2269811836af69497e5f486a85d7316753cf620000000000000000000000000000000000000000000000000000000000061a80
-----Decoded View---------------
Arg [0] : _endpoint (address): 0x3c2269811836af69497E5F486A85D7316753cf62
Arg [1] : _startTokenId (uint256): 400000
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000003c2269811836af69497e5f486a85d7316753cf62
Arg [1] : 0000000000000000000000000000000000000000000000000000000000061a80
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.