Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
TokenTracker
Multichain Info
N/A
Loading...
Loading
Contract Name:
Item
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 2000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity ^0.8.0; import { ONFT1155 } from "./dependencies/layerZero/onft1155/ONFT1155.sol"; import { IItem } from "./interfaces/IItem.sol"; contract Item is IItem, ONFT1155 { address public immutable _character; address public immutable _marketplace; address public immutable _boss; error NotValidSender(address sender); constructor(address character_, address marketplace_, address boss_, address lzEndpoint_) ONFT1155("Item", lzEndpoint_) { _character = character_; _marketplace = marketplace_; _boss = boss_; } function burn(address from, uint256 id) external override { _validateSender(); _burn(from, id, 1); emit ItemBurned(from, id); } function mint(address to, uint256 id) external override { _validateSender(); _mint(to, id, 1, ""); emit ItemMinted(to, id); } function burnBatch(address from, uint256[] memory ids, uint256[] memory amounts) external override { _validateSender(); _burnBatch(from, ids, amounts); emit ItemBatchBurned(from, ids, amounts); } function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts) external override { _validateSender(); _mintBatch(to, ids, amounts, ""); emit ItemBatchMinted(to, ids, amounts); } function privilegedSafeTransferFrom(address from_, address to_, uint256 id_) external override { _validateSender(); _safeTransferFrom(from_, to_, id_, 1, ""); emit ItemPrivilegedTransfer(from_, to_, id_); } function _validateSender() internal view { if (msg.sender != _character && msg.sender != _marketplace && msg.sender != _boss) { revert NotValidSender(msg.sender); } } }
// 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. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: address zero is not a valid owner"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn(address from, uint256 id, uint256 amount) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @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, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `ids` and `amounts` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] calldata accounts, uint256[] calldata ids ) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// 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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [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://consensys.net/diligence/blog/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 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, uint256 _gasLimit, bytes calldata _payload ) external; // @notice get the inboundNonce of a lzApp 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 (uint256 nativeFee, uint256 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, uint256 _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: MIT 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: MIT 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, uint256 _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.5.0; import "./IONFT1155Core.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; /** * @dev Interface of the ONFT standard */ interface IONFT1155 is IONFT1155Core, IERC1155 { }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Interface of the ONFT Core standard */ interface IONFT1155Core is IERC165 { event SendToChain( uint16 indexed _dstChainId, address indexed _from, bytes indexed _toAddress, uint256 _tokenId, uint256 _amount ); event SendBatchToChain( uint16 indexed _dstChainId, address indexed _from, bytes indexed _toAddress, uint256[] _tokenIds, uint256[] _amounts ); event ReceiveFromChain( uint16 indexed _srcChainId, bytes indexed _srcAddress, address indexed _toAddress, uint256 _tokenId, uint256 _amount ); event ReceiveBatchFromChain( uint16 indexed _srcChainId, bytes indexed _srcAddress, address indexed _toAddress, uint256[] _tokenIds, uint256[] _amounts ); // _from - address where tokens should be deducted from on behalf of // _dstChainId - L0 defined chain id to send tokens too // _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain // _tokenId - token Id to transfer // _amount - amount of the tokens to transfer // _refundAddress - address on src that will receive refund for any overpayment of L0 fees // _zroPaymentAddress - if paying in zro, pass the address to use. using 0x0 indicates not paying fees in zro // _adapterParams - flexible bytes array to indicate messaging adapter services in L0 function sendFrom( address _from, uint16 _dstChainId, bytes calldata _toAddress, uint256 _tokenId, uint256 _amount, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams ) external payable; // _from - address where tokens should be deducted from on behalf of // _dstChainId - L0 defined chain id to send tokens too // _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain // _tokenIds - token Ids to transfer // _amounts - amounts of the tokens to transfer // _refundAddress - address on src that will receive refund for any overpayment of L0 fees // _zroPaymentAddress - if paying in zro, pass the address to use. using 0x0 indicates not paying fees in zro // _adapterParams - flexible bytes array to indicate messaging adapter services in L0 function sendBatchFrom( address _from, uint16 _dstChainId, bytes calldata _toAddress, uint256[] calldata _tokenIds, uint256[] calldata _amounts, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams ) external payable; // _dstChainId - L0 defined chain id to send tokens too // _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain // _tokenId - token Id to transfer // _amount - amount of the tokens to transfer // _useZro - indicates to use zro to pay L0 fees // _adapterParams - flexible bytes array to indicate messaging adapter services in L0 function estimateSendFee( uint16 _dstChainId, bytes calldata _toAddress, uint256 _tokenId, uint256 _amount, bool _useZro, bytes calldata _adapterParams ) external view returns (uint256 nativeFee, uint256 zroFee); // _dstChainId - L0 defined chain id to send tokens too // _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain // _tokenIds - tokens Id to transfer // _amounts - amounts of the tokens to transfer // _useZro - indicates to use zro to pay L0 fees // _adapterParams - flexible bytes array to indicate messaging adapter services in L0 function estimateSendBatchFee( uint16 _dstChainId, bytes calldata _toAddress, uint256[] calldata _tokenIds, uint256[] calldata _amounts, bool _useZro, bytes calldata _adapterParams ) external view returns (uint256 nativeFee, uint256 zroFee); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "../interfaces/lzApp/ILayerZeroReceiver.sol"; import "../interfaces/lzApp/ILayerZeroUserApplicationConfig.sol"; import "../interfaces/lzApp/ILayerZeroEndpoint.sol"; import "../util/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 uint256 public constant DEFAULT_PAYLOAD_SIZE_LIMIT = 10_000; ILayerZeroEndpoint public immutable lzEndpoint; mapping(uint16 => bytes) public trustedRemoteLookup; mapping(uint16 => mapping(uint16 => uint256)) public minDstGasLookup; mapping(uint16 => uint256) 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, uint256 _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, uint256 _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, uint256 _extraGas) internal view virtual { uint256 providedGasLimit = _getGasLimit(_adapterParams); uint256 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 (uint256 gasLimit) { require(_adapterParams.length >= 34, "LzApp: invalid adapterParams"); assembly { gasLimit := mload(add(_adapterParams, 34)) } } function _checkPayloadSize(uint16 _dstChainId, uint256 _payloadSize) internal view virtual { uint256 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, uint256 _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, uint256 _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, uint256 _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, uint256 _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 "../util/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: MIT pragma solidity ^0.8.0; import "../interfaces/onft1155/IONFT1155.sol"; import "./ONFT1155Core.sol"; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; // NOTE: this ONFT contract has no public minting logic. // must implement your own minting logic in child classes contract ONFT1155 is ONFT1155Core, ERC1155, IONFT1155 { constructor(string memory _uri, address _lzEndpoint) ERC1155(_uri) ONFT1155Core(_lzEndpoint) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ONFT1155Core, ERC1155, IERC165) returns (bool) { return interfaceId == type(IONFT1155).interfaceId || super.supportsInterface(interfaceId); } function _debitFrom(address _from, uint16, bytes memory, uint256[] memory _tokenIds, uint256[] memory _amounts) internal virtual override { address spender = _msgSender(); require(spender == _from || isApprovedForAll(_from, spender), "ONFT1155: send caller is not owner nor approved"); _burnBatch(_from, _tokenIds, _amounts); } function _creditTo(uint16, address _toAddress, uint256[] memory _tokenIds, uint256[] memory _amounts) internal virtual override { _mintBatch(_toAddress, _tokenIds, _amounts, ""); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../interfaces/onft1155/IONFT1155Core.sol"; import "../lzApp/NonblockingLzApp.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; abstract contract ONFT1155Core is NonblockingLzApp, ERC165, IONFT1155Core { uint256 public constant NO_EXTRA_GAS = 0; uint16 public constant FUNCTION_TYPE_SEND = 1; uint16 public constant FUNCTION_TYPE_SEND_BATCH = 2; bool public useCustomAdapterParams; event SetUseCustomAdapterParams(bool _useCustomAdapterParams); constructor(address _lzEndpoint) NonblockingLzApp(_lzEndpoint) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IONFT1155Core).interfaceId || super.supportsInterface(interfaceId); } function estimateSendFee( uint16 _dstChainId, bytes memory _toAddress, uint256 _tokenId, uint256 _amount, bool _useZro, bytes memory _adapterParams ) public view virtual override returns (uint256 nativeFee, uint256 zroFee) { return estimateSendBatchFee( _dstChainId, _toAddress, _toSingletonArray(_tokenId), _toSingletonArray(_amount), _useZro, _adapterParams ); } function estimateSendBatchFee( uint16 _dstChainId, bytes memory _toAddress, uint256[] memory _tokenIds, uint256[] memory _amounts, bool _useZro, bytes memory _adapterParams ) public view virtual override returns (uint256 nativeFee, uint256 zroFee) { bytes memory payload = abi.encode(_toAddress, _tokenIds, _amounts); return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams); } function sendFrom( address _from, uint16 _dstChainId, bytes memory _toAddress, uint256 _tokenId, uint256 _amount, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams ) public payable virtual override { _sendBatch( _from, _dstChainId, _toAddress, _toSingletonArray(_tokenId), _toSingletonArray(_amount), _refundAddress, _zroPaymentAddress, _adapterParams ); } function sendBatchFrom( address _from, uint16 _dstChainId, bytes memory _toAddress, uint256[] memory _tokenIds, uint256[] memory _amounts, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams ) public payable virtual override { _sendBatch( _from, _dstChainId, _toAddress, _tokenIds, _amounts, _refundAddress, _zroPaymentAddress, _adapterParams ); } function _sendBatch( address _from, uint16 _dstChainId, bytes memory _toAddress, uint256[] memory _tokenIds, uint256[] memory _amounts, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams ) internal virtual { _debitFrom(_from, _dstChainId, _toAddress, _tokenIds, _amounts); bytes memory payload = abi.encode(_toAddress, _tokenIds, _amounts); if (_tokenIds.length == 1) { if (useCustomAdapterParams) { _checkGasLimit(_dstChainId, FUNCTION_TYPE_SEND, _adapterParams, NO_EXTRA_GAS); } else { require(_adapterParams.length == 0, "LzApp: _adapterParams must be empty."); } _lzSend(_dstChainId, payload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value); emit SendToChain(_dstChainId, _from, _toAddress, _tokenIds[0], _amounts[0]); } else if (_tokenIds.length > 1) { if (useCustomAdapterParams) { _checkGasLimit(_dstChainId, FUNCTION_TYPE_SEND_BATCH, _adapterParams, NO_EXTRA_GAS); } else { require(_adapterParams.length == 0, "LzApp: _adapterParams must be empty."); } _lzSend(_dstChainId, payload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value); emit SendBatchToChain(_dstChainId, _from, _toAddress, _tokenIds, _amounts); } } function _nonblockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64, /*_nonce*/ bytes memory _payload ) internal virtual override { // decode and load the toAddress (bytes memory toAddressBytes, uint256[] memory tokenIds, uint256[] memory amounts) = abi.decode(_payload, (bytes, uint256[], uint256[])); address toAddress; assembly { toAddress := mload(add(toAddressBytes, 20)) } _creditTo(_srcChainId, toAddress, tokenIds, amounts); if (tokenIds.length == 1) { emit ReceiveFromChain(_srcChainId, _srcAddress, toAddress, tokenIds[0], amounts[0]); } else if (tokenIds.length > 1) { emit ReceiveBatchFromChain(_srcChainId, _srcAddress, toAddress, tokenIds, amounts); } } function setUseCustomAdapterParams(bool _useCustomAdapterParams) external onlyOwner { useCustomAdapterParams = _useCustomAdapterParams; emit SetUseCustomAdapterParams(_useCustomAdapterParams); } function _debitFrom( address _from, uint16 _dstChainId, bytes memory _toAddress, uint256[] memory _tokenIds, uint256[] memory _amounts ) internal virtual; function _creditTo(uint16 _srcChainId, address _toAddress, uint256[] memory _tokenIds, uint256[] memory _amounts) internal virtual; function _toSingletonArray(uint256 element) internal pure returns (uint256[] memory) { uint256[] memory array = new uint[](1); array[0] = element; return array; } }
// 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) } } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity ^0.8.0; import { IONFT1155 } from "src/dependencies/layerZero/interfaces/onft1155/IONFT1155.sol"; interface IItem is IONFT1155 { event ItemBurned(address indexed from, uint256 id); event ItemMinted(address indexed to, uint256 id); event ItemBatchBurned(address indexed from, uint256[] ids, uint256[] amounts); event ItemBatchMinted(address indexed to, uint256[] ids, uint256[] amounts); event ItemPrivilegedTransfer(address indexed from, address indexed to, uint256 id); function burn(address from, uint256 id) external; function mint(address to, uint256 id) external; function burnBatch(address from, uint256[] memory ids, uint256[] memory amounts) external; function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts) external; function privilegedSafeTransferFrom(address from_, address to_, uint256 id_) external; }
{ "remappings": [ "@forge-std/=lib/forge-std/src/", "@openzeppelin/=lib/openzeppelin-contracts/", "@uniswap/=lib/", "base64-sol/=src/dependencies/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "v3-core/=lib/v3-core/contracts/", "v3-periphery/=lib/v3-periphery/contracts/" ], "optimizer": { "enabled": true, "runs": 2000 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
[{"inputs":[{"internalType":"address","name":"character_","type":"address"},{"internalType":"address","name":"marketplace_","type":"address"},{"internalType":"address","name":"boss_","type":"address"},{"internalType":"address","name":"lzEndpoint_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"NotValidSender","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","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":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"ItemBatchBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"ItemBatchMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"ItemBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"ItemMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"ItemPrivilegedTransfer","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":true,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":true,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":true,"internalType":"address","name":"_toAddress","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"ReceiveBatchFromChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":true,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":true,"internalType":"address","name":"_toAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ReceiveFromChain","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":true,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"bytes","name":"_toAddress","type":"bytes"},{"indexed":false,"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"SendBatchToChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"bytes","name":"_toAddress","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"SendToChain","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":false,"internalType":"bool","name":"_useCustomAdapterParams","type":"bool"}],"name":"SetUseCustomAdapterParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"DEFAULT_PAYLOAD_SIZE_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FUNCTION_TYPE_SEND","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FUNCTION_TYPE_SEND_BATCH","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NO_EXTRA_GAS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_boss","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_character","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_marketplace","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"bool","name":"_useZro","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateSendBatchFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_useZro","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateSendFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","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":"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":"account","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":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"mintBatch","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":"nonblockingLzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","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":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"privilegedSafeTransferFrom","outputs":[],"stateMutability":"nonpayable","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":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"sendBatchFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"sendFrom","outputs":[],"stateMutability":"payable","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":"bool","name":"_useCustomAdapterParams","type":"bool"}],"name":"setUseCustomAdapterParams","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":[{"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"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"useCustomAdapterParams","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101006040523480156200001257600080fd5b50604051620054de380380620054de83398101604081905262000035916200011b565b6040805180820190915260048152634974656d60e01b6020820152818181808062000060336200009c565b6001600160a01b0316608052506200007a905081620000ec565b5050506001600160a01b0393841660a0525090821660c0521660e052620002e9565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6009620000fa82826200021d565b5050565b80516001600160a01b03811681146200011657600080fd5b919050565b600080600080608085870312156200013257600080fd5b6200013d85620000fe565b93506200014d60208601620000fe565b92506200015d60408601620000fe565b91506200016d60608601620000fe565b905092959194509250565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001a357607f821691505b602082108103620001c457634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200021857600081815260208120601f850160051c81016020861015620001f35750805b601f850160051c820191505b818110156200021457828155600101620001ff565b5050505b505050565b81516001600160401b0381111562000239576200023962000178565b62000251816200024a84546200018e565b84620001ca565b602080601f831160018114620002895760008415620002705750858301515b600019600386901b1c1916600185901b17855562000214565b600085815260208120601f198616915b82811015620002ba5788860151825594840194600190910190840162000299565b5085821015620002d95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e05161516e62000370600039600081816109cd015261240901526000818161083901526123d401526000818161088301526123a00152600081816107e501528181610a5201528181610d9a01528181610eef01528181611130015281816118090152818161194301528181611f370152613bba015261516e6000f3fe6080604052600436106103275760003560e01c80638da5cb5b116101a5578063c572bc31116100ec578063eab45d9c11610095578063f004375a1161006f578063f004375a146109bb578063f242432a146109ef578063f2fde38b14610a0f578063f5ecbdbc14610a2f57600080fd5b8063eab45d9c14610961578063eb8d72b714610981578063ed629c5c146109a157600080fd5b8063d81d0a15116100c6578063d81d0a15146108d8578063df2a5b3b146108f8578063e985e9c51461091857600080fd5b8063c572bc3114610871578063cbed8b9c146108a5578063d1deba1f146108c557600080fd5b8063af3fb21c1161014e578063baf3292d11610128578063baf3292d14610807578063be54622114610827578063c44618341461085b57600080fd5b8063af3fb21c1461079e578063b2535663146107b3578063b353aaa7146107d357600080fd5b80639f38369a1161017f5780639f38369a1461073e578063a22cb4651461075e578063a6c3d1651461077e57600080fd5b80638da5cb5b146106cc578063950c8a74146106fe5780639dc29fac1461071e57600080fd5b806342d65a8d1161027457806366ad5c8a1161021d5780637533d788116101f75780637533d7881461061f578063837207531461063f5780638608e5f81461065f5780638cfd8f5c1461069457600080fd5b806366ad5c8a146105ca5780636b20c454146105ea578063715018a61461060a57600080fd5b80634db8226a1161024e5780634db8226a1461053b5780634e1273f41461054e5780635b8c41e61461057b57600080fd5b806342d65a8d146104f357806344770515146105135780634ab4e6871461052857600080fd5b806310ddb137116102d65780633d8b38f6116102b05780633d8b38f6146104865780633f1f4fa4146104a657806340c10f19146104d357600080fd5b806310ddb1371461041e578063149e3e1f1461043e5780632eb2c2d61461046657600080fd5b806307e0db171161030757806307e0db17146103b15780630df37483146103d15780630e89341c146103f157600080fd5b80621d35671461032c578062fdd58e1461034e57806301ffc9a714610381575b600080fd5b34801561033857600080fd5b5061034c610347366004613d9b565b610a4f565b005b34801561035a57600080fd5b5061036e610369366004613e4f565b610c97565b6040519081526020015b60405180910390f35b34801561038d57600080fd5b506103a161039c366004613e91565b610d3d565b6040519015158152602001610378565b3480156103bd57600080fd5b5061034c6103cc366004613eae565b610d60565b3480156103dd57600080fd5b5061034c6103ec366004613ec9565b610e02565b3480156103fd57600080fd5b5061041161040c366004613ee5565b610e21565b6040516103789190613f56565b34801561042a57600080fd5b5061034c610439366004613eae565b610eb5565b34801561044a57600080fd5b50610453600281565b60405161ffff9091168152602001610378565b34801561047257600080fd5b5061034c6104813660046140c5565b610f26565b34801561049257600080fd5b506103a16104a1366004614173565b610fc1565b3480156104b257600080fd5b5061036e6104c1366004613eae565b60036020526000908152604090205481565b3480156104df57600080fd5b5061034c6104ee366004613e4f565b61108d565b3480156104ff57600080fd5b5061034c61050e366004614173565b6110f8565b34801561051f57600080fd5b5061036e600081565b61034c6105363660046141c6565b611197565b61034c6105493660046142b6565b6111b1565b34801561055a57600080fd5b5061056e61056936600461435d565b6111d1565b6040516103789190614465565b34801561058757600080fd5b5061036e610596366004614478565b6005602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156105d657600080fd5b5061034c6105e5366004613d9b565b61130f565b3480156105f657600080fd5b5061034c6106053660046144d6565b611402565b34801561061657600080fd5b5061034c61145d565b34801561062b57600080fd5b5061041161063a366004613eae565b611471565b34801561064b57600080fd5b5061034c61065a36600461454c565b61150b565b34801561066b57600080fd5b5061067f61067a36600461459d565b611582565b60408051928352602083019190915201610378565b3480156106a057600080fd5b5061036e6106af366004614634565b600260209081526000928352604080842090915290825290205481565b3480156106d857600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610378565b34801561070a57600080fd5b506004546106e6906001600160a01b031681565b34801561072a57600080fd5b5061034c610739366004613e4f565b6115b2565b34801561074a57600080fd5b50610411610759366004613eae565b611601565b34801561076a57600080fd5b5061034c610779366004614667565b611717565b34801561078a57600080fd5b5061034c610799366004614173565b611726565b3480156107aa57600080fd5b50610453600181565b3480156107bf57600080fd5b5061067f6107ce366004614693565b6117af565b3480156107df57600080fd5b506106e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561081357600080fd5b5061034c610822366004614730565b611896565b34801561083357600080fd5b506106e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561086757600080fd5b5061036e61271081565b34801561087d57600080fd5b506106e67f000000000000000000000000000000000000000000000000000000000000000081565b3480156108b157600080fd5b5061034c6108c036600461474d565b61190b565b61034c6108d3366004613d9b565b6119b9565b3480156108e457600080fd5b5061034c6108f33660046144d6565b611c07565b34801561090457600080fd5b5061034c6109133660046147bc565b611c65565b34801561092457600080fd5b506103a16109333660046147f8565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b34801561096d57600080fd5b5061034c61097c366004614831565b611d1f565b34801561098d57600080fd5b5061034c61099c366004614173565b611d68565b3480156109ad57600080fd5b506006546103a19060ff1681565b3480156109c757600080fd5b506106e67f000000000000000000000000000000000000000000000000000000000000000081565b3480156109fb57600080fd5b5061034c610a0a36600461484c565b611dc2565b348015610a1b57600080fd5b5061034c610a2a366004614730565b611e5d565b348015610a3b57600080fd5b50610411610a4a3660046148b5565b611eed565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614610acc5760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff861660009081526001602052604081208054610aea90614902565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1690614902565b8015610b635780601f10610b3857610100808354040283529160200191610b63565b820191906000526020600020905b815481529060010190602001808311610b4657829003601f168201915b50505050509050805186869050148015610b7e575060008151115b8015610ba6575080516020820120604051610b9c908890889061493c565b6040518091039020145b610c185760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610ac3565b610c8e8787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a935091508890889081908401838280828437600092019190915250611fb792505050565b50505050505050565b60006001600160a01b038316610d155760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e6572000000000000000000000000000000000000000000006064820152608401610ac3565b5060009081526007602090815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b031982161580610d5a5750610d5a82612045565b92915050565b610d686120b7565b6040517f07e0db1700000000000000000000000000000000000000000000000000000000815261ffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906307e0db17906024015b600060405180830381600087803b158015610de757600080fd5b505af1158015610dfb573d6000803e3d6000fd5b5050505050565b610e0a6120b7565b61ffff909116600090815260036020526040902055565b606060098054610e3090614902565b80601f0160208091040260200160405190810160405280929190818152602001828054610e5c90614902565b8015610ea95780601f10610e7e57610100808354040283529160200191610ea9565b820191906000526020600020905b815481529060010190602001808311610e8c57829003601f168201915b50505050509050919050565b610ebd6120b7565b6040517f10ddb13700000000000000000000000000000000000000000000000000000000815261ffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906310ddb13790602401610dcd565b6001600160a01b038516331480610f425750610f428533610933565b610fb45760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608401610ac3565b610dfb8585858585612111565b61ffff831660009081526001602052604081208054829190610fe290614902565b80601f016020809104026020016040519081016040528092919081815260200182805461100e90614902565b801561105b5780601f106110305761010080835404028352916020019161105b565b820191906000526020600020905b81548152906001019060200180831161103e57829003601f168201915b50505050509050838360405161107292919061493c565b60405180910390208180519060200120149150509392505050565b611095612395565b6110b18282600160405180602001604052806000815250612465565b816001600160a01b03167f170cd7fbac3527c51a8eadf77fb756ac94fe074ba361cc0a021c1bf9f1a7d7cf826040516110ec91815260200190565b60405180910390a25050565b6111006120b7565b6040517f42d65a8d0000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906342d65a8d9061116990869086908690600401614977565b600060405180830381600087803b15801561118357600080fd5b505af1158015610c8e573d6000803e3d6000fd5b6111a7888888888888888861258e565b5050505050505050565b6111a78888886111c08961281f565b6111c98961281f565b88888861258e565b6060815183511461124a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608401610ac3565b6000835167ffffffffffffffff81111561126657611266613f69565b60405190808252806020026020018201604052801561128f578160200160208202803683370190505b50905060005b8451811015611307576112da8582815181106112b3576112b3614995565b60200260200101518583815181106112cd576112cd614995565b6020026020010151610c97565b8282815181106112ec576112ec614995565b6020908102919091010152611300816149c1565b9050611295565b509392505050565b3330146113845760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d75737420626560448201527f204c7a41707000000000000000000000000000000000000000000000000000006064820152608401610ac3565b6113fa8686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f89018190048102820181019092528781528993509150879087908190840183828082843760009201919091525061286a92505050565b505050505050565b61140a612395565b6114158383836129b7565b826001600160a01b03167ff315e67617b673b3f9d530176057c65e57db1fe200441e69e9d7603f7f7f789b83836040516114509291906149db565b60405180910390a2505050565b6114656120b7565b61146f6000612c32565b565b6001602052600090815260409020805461148a90614902565b80601f01602080910402602001604051908101604052809291908181526020018280546114b690614902565b80156115035780601f106114d857610100808354040283529160200191611503565b820191906000526020600020905b8154815290600101906020018083116114e657829003601f168201915b505050505081565b611513612395565b611530838383600160405180602001604052806000815250612c9a565b816001600160a01b0316836001600160a01b03167fd7abe51c018ddbb17febc5a71c36815c81c1e274a16b3d99970cd98584d17d688360405161157591815260200190565b60405180910390a3505050565b6000806115a388886115938961281f565b61159c8961281f565b88886117af565b91509150965096945050505050565b6115ba612395565b6115c682826001612e69565b816001600160a01b03167fb620f2f293b715db2b38d4575792cf6607a8258ddc95bf71638a519de46f8b6b826040516110ec91815260200190565b61ffff811660009081526001602052604081208054606092919061162490614902565b80601f016020809104026020016040519081016040528092919081815260200182805461165090614902565b801561169d5780601f106116725761010080835404028352916020019161169d565b820191906000526020600020905b81548152906001019060200180831161168057829003601f168201915b5050505050905080516000036116f55760405162461bcd60e51b815260206004820152601d60248201527f4c7a4170703a206e6f20747275737465642070617468207265636f72640000006044820152606401610ac3565b6117106000601483516117089190614a00565b83919061301b565b9392505050565b611722338383613143565b5050565b61172e6120b7565b81813060405160200161174393929190614a17565b60408051601f1981840301815291815261ffff851660009081526001602052209061176e9082614a96565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce8383836040516117a293929190614977565b60405180910390a1505050565b60008060008787876040516020016117c993929190614b56565b60408051601f19818403018152908290527f40a7bb1000000000000000000000000000000000000000000000000000000000825291506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906340a7bb1090611846908c90309086908b908b90600401614b99565b6040805180830381865afa158015611862573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118869190614beb565b9250925050965096945050505050565b61189e6120b7565b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b906020015b60405180910390a150565b6119136120b7565b6040517fcbed8b9c0000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063cbed8b9c906119809088908890889088908890600401614c0f565b600060405180830381600087803b15801561199a57600080fd5b505af11580156119ae573d6000803e3d6000fd5b505050505050505050565b61ffff861660009081526005602052604080822090516119dc908890889061493c565b908152604080516020928190038301902067ffffffffffffffff871660009081529252902054905080611a775760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201527f61676500000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b808383604051611a8892919061493c565b604051809103902014611b035760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f6160448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b61ffff87166000908152600560205260408082209051611b26908990899061493c565b908152604080516020928190038301812067ffffffffffffffff8916600090815290845282902093909355601f88018290048202830182019052868252611bbf918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a93509150889088908190840183828082843760009201919091525061286a92505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e58787878785604051611bf6959493929190614c48565b60405180910390a150505050505050565b611c0f612395565b611c2a8383836040518060200160405280600081525061322f565b826001600160a01b03167f0d4c50e5ebf755bafd67af075e537a0bc038cfe574120f65de5bf7beb72bcb1b83836040516114509291906149db565b611c6d6120b7565b60008111611cbd5760405162461bcd60e51b815260206004820152601560248201527f4c7a4170703a20696e76616c6964206d696e47617300000000000000000000006044820152606401610ac3565b61ffff83811660008181526002602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac0906060016117a2565b611d276120b7565b6006805460ff19168215159081179091556040519081527f1584ad594a70cbe1e6515592e1272a987d922b097ead875069cebe8b40c004a490602001611900565b611d706120b7565b61ffff83166000908152600160205260409020611d8e828483614c84565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab8383836040516117a293929190614977565b6001600160a01b038516331480611dde5750611dde8533610933565b611e505760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608401610ac3565b610dfb8585858585612c9a565b611e656120b7565b6001600160a01b038116611ee15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610ac3565b611eea81612c32565b50565b6040517ff5ecbdbc00000000000000000000000000000000000000000000000000000000815261ffff808616600483015284166024820152306044820152606481018290526060907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f5ecbdbc90608401600060405180830381865afa158015611f86573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611fae9190810190614d93565b95945050505050565b60008061202f5a60966366ad5c8a60e01b89898989604051602401611fdf9493929190614dd0565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199093169290921790915230929190613412565b91509150816113fa576113fa868686868561349d565b60006001600160e01b031982167fd9b67a260000000000000000000000000000000000000000000000000000000014806120a857506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b80610d5a5750610d5a8261353b565b6000546001600160a01b0316331461146f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ac3565b81518351146121735760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ac3565b6001600160a01b0384166121ef5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610ac3565b3360005b845181101561232f57600085828151811061221057612210614995565b60200260200101519050600085838151811061222e5761222e614995565b60209081029190910181015160008481526007835260408082206001600160a01b038e1683529093529190912054909150818110156122d55760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610ac3565b60008381526007602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612314908490614e0f565b9250508190555050505080612328906149c1565b90506121f3565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161237f9291906149db565b60405180910390a46113fa8187878787876135a2565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015906123f75750336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614155b801561242c5750336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614155b1561146f576040517f3c468ee1000000000000000000000000000000000000000000000000000000008152336004820152602401610ac3565b6001600160a01b0384166124e15760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b3360006124ed8561281f565b905060006124fa8561281f565b905060008681526007602090815260408083206001600160a01b038b1684529091528120805487929061252e908490614e0f565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610c8e8360008989898961378e565b61259b88888888886138d1565b60008686866040516020016125b293929190614b56565b6040516020818303038152906040529050855160010361270c5760065460ff16156125ea576125e588600184600061398b565b61265e565b81511561265e5760405162461bcd60e51b8152602060048201526024808201527f4c7a4170703a205f61646170746572506172616d73206d75737420626520656d60448201527f7074792e000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b61266c888286868634613a6a565b8660405161267a9190614e27565b6040518091039020896001600160a01b03168961ffff167f968b0d61ebcf43e5d76ed87bd2c4ee2f22b4969b9f4ca49e3373c025eddd5eeb896000815181106126c5576126c5614995565b6020026020010151896000815181106126e0576126e0614995565b60200260200101516040516126ff929190918252602082015260400190565b60405180910390a46119ae565b6001865111156119ae5760065460ff16156127345761272f88600284600061398b565b6127a8565b8151156127a85760405162461bcd60e51b8152602060048201526024808201527f4c7a4170703a205f61646170746572506172616d73206d75737420626520656d60448201527f7074792e000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b6127b6888286868634613a6a565b866040516127c49190614e27565b6040518091039020896001600160a01b03168961ffff167fddd15f7cfbd674ac2096d598f1650367f8a8bd72b4e3abd85591099ea3b57e33898960405161280c9291906149db565b60405180910390a4505050505050505050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061285957612859614995565b602090810291909101015292915050565b6000806000838060200190518101906128839190614ea9565b6014830151929550909350915061289c88828585613c36565b825160010361294557806001600160a01b0316876040516128bd9190614e27565b60405180910390208961ffff167f1bf64e58d19fc43de4c44b3d1bb1fae313979af831a7a39f3297564294329f0f866000815181106128fe576128fe614995565b60200260200101518660008151811061291957612919614995565b6020026020010151604051612938929190918252602082015260400190565b60405180910390a46111a7565b6001835111156111a757806001600160a01b0316876040516129679190614e27565b60405180910390208961ffff167f1ae08edbbcd7baa8d064835de8593ce16b313414525ac89534e349f4da7926e486866040516129a59291906149db565b60405180910390a45050505050505050565b6001600160a01b038316612a335760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b8051825114612a955760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ac3565b604080516020810190915260009081905233905b8351811015612bc3576000848281518110612ac657612ac6614995565b602002602001015190506000848381518110612ae457612ae4614995565b60209081029190910181015160008481526007835260408082206001600160a01b038c168352909352919091205490915081811015612b8a5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e6365000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b60009283526007602090815260408085206001600160a01b038b1686529091529092209103905580612bbb816149c1565b915050612aa9565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612c149291906149db565b60405180910390a46040805160208101909152600090525b50505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038416612d165760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610ac3565b336000612d228561281f565b90506000612d2f8561281f565b905060008681526007602090815260408083206001600160a01b038c16845290915290205485811015612dca5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610ac3565b60008781526007602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612e09908490614e0f565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46119ae848a8a8a8a8a61378e565b6001600160a01b038316612ee55760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b336000612ef18461281f565b90506000612efe8461281f565b6040805160208082018352600091829052888252600781528282206001600160a01b038b1683529052205490915084811015612fa15760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e6365000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b60008681526007602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052610c8e565b60608161302981601f614e0f565b10156130775760405162461bcd60e51b815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401610ac3565b6130818284614e0f565b845110156130d15760405162461bcd60e51b815260206004820152601160248201527f736c6963655f6f75744f66426f756e64730000000000000000000000000000006044820152606401610ac3565b6060821580156130f0576040519150600082526020820160405261313a565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015613129578051835260209283019201613111565b5050858452601f01601f1916604052505b50949350505050565b816001600160a01b0316836001600160a01b0316036131ca5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608401610ac3565b6001600160a01b03838116600081815260086020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101611575565b6001600160a01b0384166132ab5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b815183511461330d5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ac3565b3360005b84518110156133aa5783818151811061332c5761332c614995565b60200260200101516007600087848151811061334a5761334a614995565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546133929190614e0f565b909155508190506133a2816149c1565b915050613311565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516133fb9291906149db565b60405180910390a4610dfb816000878787876135a2565b6000606060008060008661ffff1667ffffffffffffffff81111561343857613438613f69565b6040519080825280601f01601f191660200182016040528015613462576020820181803683370190505b50905060008087516020890160008d8df191503d925086831115613484578692505b828152826000602083013e909890975095505050505050565b8180519060200120600560008761ffff1661ffff168152602001908152602001600020856040516134ce9190614e27565b90815260408051918290036020908101832067ffffffffffffffff88166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c9061352c9087908790879087908790614f27565b60405180910390a15050505050565b60006001600160e01b031982167f33577776000000000000000000000000000000000000000000000000000000001480610d5a57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610d5a565b6001600160a01b0384163b156113fa576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c81906135ff9089908990889088908890600401614f7a565b6020604051808303816000875af192505050801561363a575060408051601f3d908101601f1916820190925261363791810190614fb8565b60015b6136ef57613646614fd5565b806308c379a00361367f575061365a614ff1565b806136655750613681565b8060405162461bcd60e51b8152600401610ac39190613f56565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610ac3565b6001600160e01b031981167fbc197c810000000000000000000000000000000000000000000000000000000014610c8e5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610ac3565b6001600160a01b0384163b156113fa576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906137eb9089908990889088908890600401615099565b6020604051808303816000875af1925050508015613826575060408051601f3d908101601f1916820190925261382391810190614fb8565b60015b61383257613646614fd5565b6001600160e01b031981167ff23a6e610000000000000000000000000000000000000000000000000000000014610c8e5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610ac3565b336001600160a01b03861681148061390e57506001600160a01b0380871660009081526008602090815260408083209385168352929052205460ff165b6139805760405162461bcd60e51b815260206004820152602f60248201527f4f4e4654313135353a2073656e642063616c6c6572206973206e6f74206f776e60448201527f6572206e6f7220617070726f76656400000000000000000000000000000000006064820152608401610ac3565b6113fa8684846129b7565b600061399683613c51565b61ffff8087166000908152600260209081526040808320938916835292905290812054919250906139c8908490614e0f565b905060008111613a1a5760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f74207365740000000000006044820152606401610ac3565b808210156113fa5760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f7700000000006044820152606401610ac3565b61ffff861660009081526001602052604081208054613a8890614902565b80601f0160208091040260200160405190810160405280929190818152602001828054613ab490614902565b8015613b015780601f10613ad657610100808354040283529160200191613b01565b820191906000526020600020905b815481529060010190602001808311613ae457829003601f168201915b505050505090508051600003613b7f5760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201527f61207472757374656420736f75726365000000000000000000000000000000006064820152608401610ac3565b613b8a878751613cad565b6040517fc58031000000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c5803100908490613bfb908b9086908c908c908c908c906004016150d1565b6000604051808303818588803b158015613c1457600080fd5b505af1158015613c28573d6000803e3d6000fd5b505050505050505050505050565b612c2c8383836040518060200160405280600081525061322f565b6000602282511015613ca55760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c69642061646170746572506172616d73000000006044820152606401610ac3565b506022015190565b61ffff821660009081526003602052604081205490819003613cce57506127105b80821115613d1e5760405162461bcd60e51b815260206004820181905260248201527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c617267656044820152606401610ac3565b505050565b803561ffff81168114613d3557600080fd5b919050565b60008083601f840112613d4c57600080fd5b50813567ffffffffffffffff811115613d6457600080fd5b602083019150836020828501011115613d7c57600080fd5b9250929050565b803567ffffffffffffffff81168114613d3557600080fd5b60008060008060008060808789031215613db457600080fd5b613dbd87613d23565b9550602087013567ffffffffffffffff80821115613dda57600080fd5b613de68a838b01613d3a565b9097509550859150613dfa60408a01613d83565b94506060890135915080821115613e1057600080fd5b50613e1d89828a01613d3a565b979a9699509497509295939492505050565b6001600160a01b0381168114611eea57600080fd5b8035613d3581613e2f565b60008060408385031215613e6257600080fd5b8235613e6d81613e2f565b946020939093013593505050565b6001600160e01b031981168114611eea57600080fd5b600060208284031215613ea357600080fd5b813561171081613e7b565b600060208284031215613ec057600080fd5b61171082613d23565b60008060408385031215613edc57600080fd5b613e6d83613d23565b600060208284031215613ef757600080fd5b5035919050565b60005b83811015613f19578181015183820152602001613f01565b83811115612c2c5750506000910152565b60008151808452613f42816020860160208601613efe565b601f01601f19169290920160200192915050565b6020815260006117106020830184613f2a565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715613fa557613fa5613f69565b6040525050565b600067ffffffffffffffff821115613fc657613fc6613f69565b5060051b60200190565b600082601f830112613fe157600080fd5b81356020613fee82613fac565b604051613ffb8282613f7f565b83815260059390931b850182019282810191508684111561401b57600080fd5b8286015b84811015614036578035835291830191830161401f565b509695505050505050565b600067ffffffffffffffff82111561405b5761405b613f69565b50601f01601f191660200190565b600082601f83011261407a57600080fd5b813561408581614041565b6040516140928282613f7f565b8281528560208487010111156140a757600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a086880312156140dd57600080fd5b85356140e881613e2f565b945060208601356140f881613e2f565b9350604086013567ffffffffffffffff8082111561411557600080fd5b61412189838a01613fd0565b9450606088013591508082111561413757600080fd5b61414389838a01613fd0565b9350608088013591508082111561415957600080fd5b5061416688828901614069565b9150509295509295909350565b60008060006040848603121561418857600080fd5b61419184613d23565b9250602084013567ffffffffffffffff8111156141ad57600080fd5b6141b986828701613d3a565b9497909650939450505050565b600080600080600080600080610100898b0312156141e357600080fd5b6141ec89613e44565b97506141fa60208a01613d23565b9650604089013567ffffffffffffffff8082111561421757600080fd5b6142238c838d01614069565b975060608b013591508082111561423957600080fd5b6142458c838d01613fd0565b965060808b013591508082111561425b57600080fd5b6142678c838d01613fd0565b955061427560a08c01613e44565b945061428360c08c01613e44565b935060e08b013591508082111561429957600080fd5b506142a68b828c01614069565b9150509295985092959890939650565b600080600080600080600080610100898b0312156142d357600080fd5b88356142de81613e2f565b97506142ec60208a01613d23565b9650604089013567ffffffffffffffff8082111561430957600080fd5b6143158c838d01614069565b975060608b0135965060808b0135955060a08b0135915061433582613e2f565b90935060c08a01359061434782613e2f565b90925060e08a0135908082111561429957600080fd5b6000806040838503121561437057600080fd5b823567ffffffffffffffff8082111561438857600080fd5b818501915085601f83011261439c57600080fd5b813560206143a982613fac565b6040516143b68282613f7f565b83815260059390931b85018201928281019150898411156143d657600080fd5b948201945b838610156143fd5785356143ee81613e2f565b825294820194908201906143db565b9650508601359250508082111561441357600080fd5b5061442085828601613fd0565b9150509250929050565b600081518084526020808501945080840160005b8381101561445a5781518752958201959082019060010161443e565b509495945050505050565b602081526000611710602083018461442a565b60008060006060848603121561448d57600080fd5b61449684613d23565b9250602084013567ffffffffffffffff8111156144b257600080fd5b6144be86828701614069565b9250506144cd60408501613d83565b90509250925092565b6000806000606084860312156144eb57600080fd5b83356144f681613e2f565b9250602084013567ffffffffffffffff8082111561451357600080fd5b61451f87838801613fd0565b9350604086013591508082111561453557600080fd5b5061454286828701613fd0565b9150509250925092565b60008060006060848603121561456157600080fd5b833561456c81613e2f565b9250602084013561457c81613e2f565b929592945050506040919091013590565b80358015158114613d3557600080fd5b60008060008060008060c087890312156145b657600080fd5b6145bf87613d23565b9550602087013567ffffffffffffffff808211156145dc57600080fd5b6145e88a838b01614069565b9650604089013595506060890135945061460460808a0161458d565b935060a089013591508082111561461a57600080fd5b5061462789828a01614069565b9150509295509295509295565b6000806040838503121561464757600080fd5b61465083613d23565b915061465e60208401613d23565b90509250929050565b6000806040838503121561467a57600080fd5b823561468581613e2f565b915061465e6020840161458d565b60008060008060008060c087890312156146ac57600080fd5b6146b587613d23565b9550602087013567ffffffffffffffff808211156146d257600080fd5b6146de8a838b01614069565b965060408901359150808211156146f457600080fd5b6147008a838b01613fd0565b9550606089013591508082111561471657600080fd5b6147228a838b01613fd0565b945061460460808a0161458d565b60006020828403121561474257600080fd5b813561171081613e2f565b60008060008060006080868803121561476557600080fd5b61476e86613d23565b945061477c60208701613d23565b935060408601359250606086013567ffffffffffffffff81111561479f57600080fd5b6147ab88828901613d3a565b969995985093965092949392505050565b6000806000606084860312156147d157600080fd5b6147da84613d23565b92506147e860208501613d23565b9150604084013590509250925092565b6000806040838503121561480b57600080fd5b823561481681613e2f565b9150602083013561482681613e2f565b809150509250929050565b60006020828403121561484357600080fd5b6117108261458d565b600080600080600060a0868803121561486457600080fd5b853561486f81613e2f565b9450602086013561487f81613e2f565b93506040860135925060608601359150608086013567ffffffffffffffff8111156148a957600080fd5b61416688828901614069565b600080600080608085870312156148cb57600080fd5b6148d485613d23565b93506148e260208601613d23565b925060408501356148f281613e2f565b9396929550929360600135925050565b600181811c9082168061491657607f821691505b60208210810361493657634e487b7160e01b600052602260045260246000fd5b50919050565b8183823760009101908152919050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b61ffff84168152604060208201526000611fae60408301848661494c565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982036149d4576149d46149ab565b5060010190565b6040815260006149ee604083018561442a565b8281036020840152611fae818561442a565b600082821015614a1257614a126149ab565b500390565b8284823760609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169101908152601401919050565b601f821115613d1e57600081815260208120601f850160051c81016020861015614a775750805b601f850160051c820191505b818110156113fa57828155600101614a83565b815167ffffffffffffffff811115614ab057614ab0613f69565b614ac481614abe8454614902565b84614a50565b602080601f831160018114614af95760008415614ae15750858301515b600019600386901b1c1916600185901b1785556113fa565b600085815260208120601f198616915b82811015614b2857888601518255948401946001909101908401614b09565b5085821015614b465787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b606081526000614b696060830186613f2a565b8281036020840152614b7b818661442a565b90508281036040840152614b8f818561442a565b9695505050505050565b61ffff861681526001600160a01b038516602082015260a060408201526000614bc560a0830186613f2a565b84151560608401528281036080840152614bdf8185613f2a565b98975050505050505050565b60008060408385031215614bfe57600080fd5b505080516020909101519092909150565b600061ffff808816835280871660208401525084604083015260806060830152614c3d60808301848661494c565b979650505050505050565b61ffff86168152608060208201526000614c6660808301868861494c565b67ffffffffffffffff94909416604083015250606001529392505050565b67ffffffffffffffff831115614c9c57614c9c613f69565b614cb083614caa8354614902565b83614a50565b6000601f841160018114614ce45760008515614ccc5750838201355b600019600387901b1c1916600186901b178355610dfb565b600083815260209020601f19861690835b82811015614d155786850135825560209485019460019092019101614cf5565b5086821015614d325760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600082601f830112614d5557600080fd5b8151614d6081614041565b604051614d6d8282613f7f565b828152856020848701011115614d8257600080fd5b611fae836020830160208801613efe565b600060208284031215614da557600080fd5b815167ffffffffffffffff811115614dbc57600080fd5b614dc884828501614d44565b949350505050565b61ffff85168152608060208201526000614ded6080830186613f2a565b67ffffffffffffffff851660408401528281036060840152614c3d8185613f2a565b60008219821115614e2257614e226149ab565b500190565b60008251614e39818460208701613efe565b9190910192915050565b600082601f830112614e5457600080fd5b81516020614e6182613fac565b604051614e6e8282613f7f565b83815260059390931b8501820192828101915086841115614e8e57600080fd5b8286015b848110156140365780518352918301918301614e92565b600080600060608486031215614ebe57600080fd5b835167ffffffffffffffff80821115614ed657600080fd5b614ee287838801614d44565b94506020860151915080821115614ef857600080fd5b614f0487838801614e43565b93506040860151915080821115614f1a57600080fd5b5061454286828701614e43565b61ffff8616815260a060208201526000614f4460a0830187613f2a565b67ffffffffffffffff861660408401528281036060840152614f668186613f2a565b90508281036080840152614bdf8185613f2a565b60006001600160a01b03808816835280871660208401525060a06040830152614fa660a083018661442a565b8281036060840152614f66818661442a565b600060208284031215614fca57600080fd5b815161171081613e7b565b600060033d1115614fee5760046000803e5060005160e01c5b90565b600060443d1015614fff5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff816024840111818411171561504d57505050505090565b82850191508151818111156150655750505050505090565b843d870101602082850101111561507f5750505050505090565b61508e60208286010187613f7f565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152614c3d60a0830184613f2a565b61ffff8716815260c0602082015260006150ee60c0830188613f2a565b82810360408401526151008188613f2a565b6001600160a01b0387811660608601528616608085015283810360a0850152905061512b8185613f2a565b999850505050505050505056fea264697066735822122053798cd6ac7f8cfae63b6d7cd040695765f24e8fa1dd1834269938bed59777ab64736f6c634300080f003300000000000000000000000065aac97b628ada288b8302510a01d703968c4f6e00000000000000000000000059d4e5d8935cbd32b4ab663e06eaf18208ae4bd5000000000000000000000000884fc9cfab2a0bbe0ad647b75249609b72ad20b9000000000000000000000000ae92d5ad7583ad66e49a0c67bad18f6ba52dddc1
Deployed Bytecode
0x6080604052600436106103275760003560e01c80638da5cb5b116101a5578063c572bc31116100ec578063eab45d9c11610095578063f004375a1161006f578063f004375a146109bb578063f242432a146109ef578063f2fde38b14610a0f578063f5ecbdbc14610a2f57600080fd5b8063eab45d9c14610961578063eb8d72b714610981578063ed629c5c146109a157600080fd5b8063d81d0a15116100c6578063d81d0a15146108d8578063df2a5b3b146108f8578063e985e9c51461091857600080fd5b8063c572bc3114610871578063cbed8b9c146108a5578063d1deba1f146108c557600080fd5b8063af3fb21c1161014e578063baf3292d11610128578063baf3292d14610807578063be54622114610827578063c44618341461085b57600080fd5b8063af3fb21c1461079e578063b2535663146107b3578063b353aaa7146107d357600080fd5b80639f38369a1161017f5780639f38369a1461073e578063a22cb4651461075e578063a6c3d1651461077e57600080fd5b80638da5cb5b146106cc578063950c8a74146106fe5780639dc29fac1461071e57600080fd5b806342d65a8d1161027457806366ad5c8a1161021d5780637533d788116101f75780637533d7881461061f578063837207531461063f5780638608e5f81461065f5780638cfd8f5c1461069457600080fd5b806366ad5c8a146105ca5780636b20c454146105ea578063715018a61461060a57600080fd5b80634db8226a1161024e5780634db8226a1461053b5780634e1273f41461054e5780635b8c41e61461057b57600080fd5b806342d65a8d146104f357806344770515146105135780634ab4e6871461052857600080fd5b806310ddb137116102d65780633d8b38f6116102b05780633d8b38f6146104865780633f1f4fa4146104a657806340c10f19146104d357600080fd5b806310ddb1371461041e578063149e3e1f1461043e5780632eb2c2d61461046657600080fd5b806307e0db171161030757806307e0db17146103b15780630df37483146103d15780630e89341c146103f157600080fd5b80621d35671461032c578062fdd58e1461034e57806301ffc9a714610381575b600080fd5b34801561033857600080fd5b5061034c610347366004613d9b565b610a4f565b005b34801561035a57600080fd5b5061036e610369366004613e4f565b610c97565b6040519081526020015b60405180910390f35b34801561038d57600080fd5b506103a161039c366004613e91565b610d3d565b6040519015158152602001610378565b3480156103bd57600080fd5b5061034c6103cc366004613eae565b610d60565b3480156103dd57600080fd5b5061034c6103ec366004613ec9565b610e02565b3480156103fd57600080fd5b5061041161040c366004613ee5565b610e21565b6040516103789190613f56565b34801561042a57600080fd5b5061034c610439366004613eae565b610eb5565b34801561044a57600080fd5b50610453600281565b60405161ffff9091168152602001610378565b34801561047257600080fd5b5061034c6104813660046140c5565b610f26565b34801561049257600080fd5b506103a16104a1366004614173565b610fc1565b3480156104b257600080fd5b5061036e6104c1366004613eae565b60036020526000908152604090205481565b3480156104df57600080fd5b5061034c6104ee366004613e4f565b61108d565b3480156104ff57600080fd5b5061034c61050e366004614173565b6110f8565b34801561051f57600080fd5b5061036e600081565b61034c6105363660046141c6565b611197565b61034c6105493660046142b6565b6111b1565b34801561055a57600080fd5b5061056e61056936600461435d565b6111d1565b6040516103789190614465565b34801561058757600080fd5b5061036e610596366004614478565b6005602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156105d657600080fd5b5061034c6105e5366004613d9b565b61130f565b3480156105f657600080fd5b5061034c6106053660046144d6565b611402565b34801561061657600080fd5b5061034c61145d565b34801561062b57600080fd5b5061041161063a366004613eae565b611471565b34801561064b57600080fd5b5061034c61065a36600461454c565b61150b565b34801561066b57600080fd5b5061067f61067a36600461459d565b611582565b60408051928352602083019190915201610378565b3480156106a057600080fd5b5061036e6106af366004614634565b600260209081526000928352604080842090915290825290205481565b3480156106d857600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610378565b34801561070a57600080fd5b506004546106e6906001600160a01b031681565b34801561072a57600080fd5b5061034c610739366004613e4f565b6115b2565b34801561074a57600080fd5b50610411610759366004613eae565b611601565b34801561076a57600080fd5b5061034c610779366004614667565b611717565b34801561078a57600080fd5b5061034c610799366004614173565b611726565b3480156107aa57600080fd5b50610453600181565b3480156107bf57600080fd5b5061067f6107ce366004614693565b6117af565b3480156107df57600080fd5b506106e67f000000000000000000000000ae92d5ad7583ad66e49a0c67bad18f6ba52dddc181565b34801561081357600080fd5b5061034c610822366004614730565b611896565b34801561083357600080fd5b506106e67f00000000000000000000000059d4e5d8935cbd32b4ab663e06eaf18208ae4bd581565b34801561086757600080fd5b5061036e61271081565b34801561087d57600080fd5b506106e67f00000000000000000000000065aac97b628ada288b8302510a01d703968c4f6e81565b3480156108b157600080fd5b5061034c6108c036600461474d565b61190b565b61034c6108d3366004613d9b565b6119b9565b3480156108e457600080fd5b5061034c6108f33660046144d6565b611c07565b34801561090457600080fd5b5061034c6109133660046147bc565b611c65565b34801561092457600080fd5b506103a16109333660046147f8565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b34801561096d57600080fd5b5061034c61097c366004614831565b611d1f565b34801561098d57600080fd5b5061034c61099c366004614173565b611d68565b3480156109ad57600080fd5b506006546103a19060ff1681565b3480156109c757600080fd5b506106e67f000000000000000000000000884fc9cfab2a0bbe0ad647b75249609b72ad20b981565b3480156109fb57600080fd5b5061034c610a0a36600461484c565b611dc2565b348015610a1b57600080fd5b5061034c610a2a366004614730565b611e5d565b348015610a3b57600080fd5b50610411610a4a3660046148b5565b611eed565b337f000000000000000000000000ae92d5ad7583ad66e49a0c67bad18f6ba52dddc16001600160a01b031614610acc5760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff861660009081526001602052604081208054610aea90614902565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1690614902565b8015610b635780601f10610b3857610100808354040283529160200191610b63565b820191906000526020600020905b815481529060010190602001808311610b4657829003601f168201915b50505050509050805186869050148015610b7e575060008151115b8015610ba6575080516020820120604051610b9c908890889061493c565b6040518091039020145b610c185760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610ac3565b610c8e8787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a935091508890889081908401838280828437600092019190915250611fb792505050565b50505050505050565b60006001600160a01b038316610d155760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e6572000000000000000000000000000000000000000000006064820152608401610ac3565b5060009081526007602090815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b031982161580610d5a5750610d5a82612045565b92915050565b610d686120b7565b6040517f07e0db1700000000000000000000000000000000000000000000000000000000815261ffff821660048201527f000000000000000000000000ae92d5ad7583ad66e49a0c67bad18f6ba52dddc16001600160a01b0316906307e0db17906024015b600060405180830381600087803b158015610de757600080fd5b505af1158015610dfb573d6000803e3d6000fd5b5050505050565b610e0a6120b7565b61ffff909116600090815260036020526040902055565b606060098054610e3090614902565b80601f0160208091040260200160405190810160405280929190818152602001828054610e5c90614902565b8015610ea95780601f10610e7e57610100808354040283529160200191610ea9565b820191906000526020600020905b815481529060010190602001808311610e8c57829003601f168201915b50505050509050919050565b610ebd6120b7565b6040517f10ddb13700000000000000000000000000000000000000000000000000000000815261ffff821660048201527f000000000000000000000000ae92d5ad7583ad66e49a0c67bad18f6ba52dddc16001600160a01b0316906310ddb13790602401610dcd565b6001600160a01b038516331480610f425750610f428533610933565b610fb45760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608401610ac3565b610dfb8585858585612111565b61ffff831660009081526001602052604081208054829190610fe290614902565b80601f016020809104026020016040519081016040528092919081815260200182805461100e90614902565b801561105b5780601f106110305761010080835404028352916020019161105b565b820191906000526020600020905b81548152906001019060200180831161103e57829003601f168201915b50505050509050838360405161107292919061493c565b60405180910390208180519060200120149150509392505050565b611095612395565b6110b18282600160405180602001604052806000815250612465565b816001600160a01b03167f170cd7fbac3527c51a8eadf77fb756ac94fe074ba361cc0a021c1bf9f1a7d7cf826040516110ec91815260200190565b60405180910390a25050565b6111006120b7565b6040517f42d65a8d0000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000ae92d5ad7583ad66e49a0c67bad18f6ba52dddc116906342d65a8d9061116990869086908690600401614977565b600060405180830381600087803b15801561118357600080fd5b505af1158015610c8e573d6000803e3d6000fd5b6111a7888888888888888861258e565b5050505050505050565b6111a78888886111c08961281f565b6111c98961281f565b88888861258e565b6060815183511461124a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608401610ac3565b6000835167ffffffffffffffff81111561126657611266613f69565b60405190808252806020026020018201604052801561128f578160200160208202803683370190505b50905060005b8451811015611307576112da8582815181106112b3576112b3614995565b60200260200101518583815181106112cd576112cd614995565b6020026020010151610c97565b8282815181106112ec576112ec614995565b6020908102919091010152611300816149c1565b9050611295565b509392505050565b3330146113845760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d75737420626560448201527f204c7a41707000000000000000000000000000000000000000000000000000006064820152608401610ac3565b6113fa8686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f89018190048102820181019092528781528993509150879087908190840183828082843760009201919091525061286a92505050565b505050505050565b61140a612395565b6114158383836129b7565b826001600160a01b03167ff315e67617b673b3f9d530176057c65e57db1fe200441e69e9d7603f7f7f789b83836040516114509291906149db565b60405180910390a2505050565b6114656120b7565b61146f6000612c32565b565b6001602052600090815260409020805461148a90614902565b80601f01602080910402602001604051908101604052809291908181526020018280546114b690614902565b80156115035780601f106114d857610100808354040283529160200191611503565b820191906000526020600020905b8154815290600101906020018083116114e657829003601f168201915b505050505081565b611513612395565b611530838383600160405180602001604052806000815250612c9a565b816001600160a01b0316836001600160a01b03167fd7abe51c018ddbb17febc5a71c36815c81c1e274a16b3d99970cd98584d17d688360405161157591815260200190565b60405180910390a3505050565b6000806115a388886115938961281f565b61159c8961281f565b88886117af565b91509150965096945050505050565b6115ba612395565b6115c682826001612e69565b816001600160a01b03167fb620f2f293b715db2b38d4575792cf6607a8258ddc95bf71638a519de46f8b6b826040516110ec91815260200190565b61ffff811660009081526001602052604081208054606092919061162490614902565b80601f016020809104026020016040519081016040528092919081815260200182805461165090614902565b801561169d5780601f106116725761010080835404028352916020019161169d565b820191906000526020600020905b81548152906001019060200180831161168057829003601f168201915b5050505050905080516000036116f55760405162461bcd60e51b815260206004820152601d60248201527f4c7a4170703a206e6f20747275737465642070617468207265636f72640000006044820152606401610ac3565b6117106000601483516117089190614a00565b83919061301b565b9392505050565b611722338383613143565b5050565b61172e6120b7565b81813060405160200161174393929190614a17565b60408051601f1981840301815291815261ffff851660009081526001602052209061176e9082614a96565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce8383836040516117a293929190614977565b60405180910390a1505050565b60008060008787876040516020016117c993929190614b56565b60408051601f19818403018152908290527f40a7bb1000000000000000000000000000000000000000000000000000000000825291506001600160a01b037f000000000000000000000000ae92d5ad7583ad66e49a0c67bad18f6ba52dddc116906340a7bb1090611846908c90309086908b908b90600401614b99565b6040805180830381865afa158015611862573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118869190614beb565b9250925050965096945050505050565b61189e6120b7565b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b906020015b60405180910390a150565b6119136120b7565b6040517fcbed8b9c0000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000ae92d5ad7583ad66e49a0c67bad18f6ba52dddc1169063cbed8b9c906119809088908890889088908890600401614c0f565b600060405180830381600087803b15801561199a57600080fd5b505af11580156119ae573d6000803e3d6000fd5b505050505050505050565b61ffff861660009081526005602052604080822090516119dc908890889061493c565b908152604080516020928190038301902067ffffffffffffffff871660009081529252902054905080611a775760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201527f61676500000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b808383604051611a8892919061493c565b604051809103902014611b035760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f6160448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b61ffff87166000908152600560205260408082209051611b26908990899061493c565b908152604080516020928190038301812067ffffffffffffffff8916600090815290845282902093909355601f88018290048202830182019052868252611bbf918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a93509150889088908190840183828082843760009201919091525061286a92505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e58787878785604051611bf6959493929190614c48565b60405180910390a150505050505050565b611c0f612395565b611c2a8383836040518060200160405280600081525061322f565b826001600160a01b03167f0d4c50e5ebf755bafd67af075e537a0bc038cfe574120f65de5bf7beb72bcb1b83836040516114509291906149db565b611c6d6120b7565b60008111611cbd5760405162461bcd60e51b815260206004820152601560248201527f4c7a4170703a20696e76616c6964206d696e47617300000000000000000000006044820152606401610ac3565b61ffff83811660008181526002602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac0906060016117a2565b611d276120b7565b6006805460ff19168215159081179091556040519081527f1584ad594a70cbe1e6515592e1272a987d922b097ead875069cebe8b40c004a490602001611900565b611d706120b7565b61ffff83166000908152600160205260409020611d8e828483614c84565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab8383836040516117a293929190614977565b6001600160a01b038516331480611dde5750611dde8533610933565b611e505760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608401610ac3565b610dfb8585858585612c9a565b611e656120b7565b6001600160a01b038116611ee15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610ac3565b611eea81612c32565b50565b6040517ff5ecbdbc00000000000000000000000000000000000000000000000000000000815261ffff808616600483015284166024820152306044820152606481018290526060907f000000000000000000000000ae92d5ad7583ad66e49a0c67bad18f6ba52dddc16001600160a01b03169063f5ecbdbc90608401600060405180830381865afa158015611f86573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611fae9190810190614d93565b95945050505050565b60008061202f5a60966366ad5c8a60e01b89898989604051602401611fdf9493929190614dd0565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199093169290921790915230929190613412565b91509150816113fa576113fa868686868561349d565b60006001600160e01b031982167fd9b67a260000000000000000000000000000000000000000000000000000000014806120a857506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b80610d5a5750610d5a8261353b565b6000546001600160a01b0316331461146f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ac3565b81518351146121735760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ac3565b6001600160a01b0384166121ef5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610ac3565b3360005b845181101561232f57600085828151811061221057612210614995565b60200260200101519050600085838151811061222e5761222e614995565b60209081029190910181015160008481526007835260408082206001600160a01b038e1683529093529190912054909150818110156122d55760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610ac3565b60008381526007602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612314908490614e0f565b9250508190555050505080612328906149c1565b90506121f3565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161237f9291906149db565b60405180910390a46113fa8187878787876135a2565b336001600160a01b037f00000000000000000000000065aac97b628ada288b8302510a01d703968c4f6e16148015906123f75750336001600160a01b037f00000000000000000000000059d4e5d8935cbd32b4ab663e06eaf18208ae4bd51614155b801561242c5750336001600160a01b037f000000000000000000000000884fc9cfab2a0bbe0ad647b75249609b72ad20b91614155b1561146f576040517f3c468ee1000000000000000000000000000000000000000000000000000000008152336004820152602401610ac3565b6001600160a01b0384166124e15760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b3360006124ed8561281f565b905060006124fa8561281f565b905060008681526007602090815260408083206001600160a01b038b1684529091528120805487929061252e908490614e0f565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610c8e8360008989898961378e565b61259b88888888886138d1565b60008686866040516020016125b293929190614b56565b6040516020818303038152906040529050855160010361270c5760065460ff16156125ea576125e588600184600061398b565b61265e565b81511561265e5760405162461bcd60e51b8152602060048201526024808201527f4c7a4170703a205f61646170746572506172616d73206d75737420626520656d60448201527f7074792e000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b61266c888286868634613a6a565b8660405161267a9190614e27565b6040518091039020896001600160a01b03168961ffff167f968b0d61ebcf43e5d76ed87bd2c4ee2f22b4969b9f4ca49e3373c025eddd5eeb896000815181106126c5576126c5614995565b6020026020010151896000815181106126e0576126e0614995565b60200260200101516040516126ff929190918252602082015260400190565b60405180910390a46119ae565b6001865111156119ae5760065460ff16156127345761272f88600284600061398b565b6127a8565b8151156127a85760405162461bcd60e51b8152602060048201526024808201527f4c7a4170703a205f61646170746572506172616d73206d75737420626520656d60448201527f7074792e000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b6127b6888286868634613a6a565b866040516127c49190614e27565b6040518091039020896001600160a01b03168961ffff167fddd15f7cfbd674ac2096d598f1650367f8a8bd72b4e3abd85591099ea3b57e33898960405161280c9291906149db565b60405180910390a4505050505050505050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061285957612859614995565b602090810291909101015292915050565b6000806000838060200190518101906128839190614ea9565b6014830151929550909350915061289c88828585613c36565b825160010361294557806001600160a01b0316876040516128bd9190614e27565b60405180910390208961ffff167f1bf64e58d19fc43de4c44b3d1bb1fae313979af831a7a39f3297564294329f0f866000815181106128fe576128fe614995565b60200260200101518660008151811061291957612919614995565b6020026020010151604051612938929190918252602082015260400190565b60405180910390a46111a7565b6001835111156111a757806001600160a01b0316876040516129679190614e27565b60405180910390208961ffff167f1ae08edbbcd7baa8d064835de8593ce16b313414525ac89534e349f4da7926e486866040516129a59291906149db565b60405180910390a45050505050505050565b6001600160a01b038316612a335760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b8051825114612a955760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ac3565b604080516020810190915260009081905233905b8351811015612bc3576000848281518110612ac657612ac6614995565b602002602001015190506000848381518110612ae457612ae4614995565b60209081029190910181015160008481526007835260408082206001600160a01b038c168352909352919091205490915081811015612b8a5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e6365000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b60009283526007602090815260408085206001600160a01b038b1686529091529092209103905580612bbb816149c1565b915050612aa9565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612c149291906149db565b60405180910390a46040805160208101909152600090525b50505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038416612d165760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610ac3565b336000612d228561281f565b90506000612d2f8561281f565b905060008681526007602090815260408083206001600160a01b038c16845290915290205485811015612dca5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610ac3565b60008781526007602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612e09908490614e0f565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46119ae848a8a8a8a8a61378e565b6001600160a01b038316612ee55760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b336000612ef18461281f565b90506000612efe8461281f565b6040805160208082018352600091829052888252600781528282206001600160a01b038b1683529052205490915084811015612fa15760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e6365000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b60008681526007602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052610c8e565b60608161302981601f614e0f565b10156130775760405162461bcd60e51b815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401610ac3565b6130818284614e0f565b845110156130d15760405162461bcd60e51b815260206004820152601160248201527f736c6963655f6f75744f66426f756e64730000000000000000000000000000006044820152606401610ac3565b6060821580156130f0576040519150600082526020820160405261313a565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015613129578051835260209283019201613111565b5050858452601f01601f1916604052505b50949350505050565b816001600160a01b0316836001600160a01b0316036131ca5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608401610ac3565b6001600160a01b03838116600081815260086020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101611575565b6001600160a01b0384166132ab5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610ac3565b815183511461330d5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610ac3565b3360005b84518110156133aa5783818151811061332c5761332c614995565b60200260200101516007600087848151811061334a5761334a614995565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546133929190614e0f565b909155508190506133a2816149c1565b915050613311565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516133fb9291906149db565b60405180910390a4610dfb816000878787876135a2565b6000606060008060008661ffff1667ffffffffffffffff81111561343857613438613f69565b6040519080825280601f01601f191660200182016040528015613462576020820181803683370190505b50905060008087516020890160008d8df191503d925086831115613484578692505b828152826000602083013e909890975095505050505050565b8180519060200120600560008761ffff1661ffff168152602001908152602001600020856040516134ce9190614e27565b90815260408051918290036020908101832067ffffffffffffffff88166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c9061352c9087908790879087908790614f27565b60405180910390a15050505050565b60006001600160e01b031982167f33577776000000000000000000000000000000000000000000000000000000001480610d5a57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610d5a565b6001600160a01b0384163b156113fa576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c81906135ff9089908990889088908890600401614f7a565b6020604051808303816000875af192505050801561363a575060408051601f3d908101601f1916820190925261363791810190614fb8565b60015b6136ef57613646614fd5565b806308c379a00361367f575061365a614ff1565b806136655750613681565b8060405162461bcd60e51b8152600401610ac39190613f56565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610ac3565b6001600160e01b031981167fbc197c810000000000000000000000000000000000000000000000000000000014610c8e5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610ac3565b6001600160a01b0384163b156113fa576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906137eb9089908990889088908890600401615099565b6020604051808303816000875af1925050508015613826575060408051601f3d908101601f1916820190925261382391810190614fb8565b60015b61383257613646614fd5565b6001600160e01b031981167ff23a6e610000000000000000000000000000000000000000000000000000000014610c8e5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610ac3565b336001600160a01b03861681148061390e57506001600160a01b0380871660009081526008602090815260408083209385168352929052205460ff165b6139805760405162461bcd60e51b815260206004820152602f60248201527f4f4e4654313135353a2073656e642063616c6c6572206973206e6f74206f776e60448201527f6572206e6f7220617070726f76656400000000000000000000000000000000006064820152608401610ac3565b6113fa8684846129b7565b600061399683613c51565b61ffff8087166000908152600260209081526040808320938916835292905290812054919250906139c8908490614e0f565b905060008111613a1a5760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f74207365740000000000006044820152606401610ac3565b808210156113fa5760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f7700000000006044820152606401610ac3565b61ffff861660009081526001602052604081208054613a8890614902565b80601f0160208091040260200160405190810160405280929190818152602001828054613ab490614902565b8015613b015780601f10613ad657610100808354040283529160200191613b01565b820191906000526020600020905b815481529060010190602001808311613ae457829003601f168201915b505050505090508051600003613b7f5760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201527f61207472757374656420736f75726365000000000000000000000000000000006064820152608401610ac3565b613b8a878751613cad565b6040517fc58031000000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000ae92d5ad7583ad66e49a0c67bad18f6ba52dddc1169063c5803100908490613bfb908b9086908c908c908c908c906004016150d1565b6000604051808303818588803b158015613c1457600080fd5b505af1158015613c28573d6000803e3d6000fd5b505050505050505050505050565b612c2c8383836040518060200160405280600081525061322f565b6000602282511015613ca55760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c69642061646170746572506172616d73000000006044820152606401610ac3565b506022015190565b61ffff821660009081526003602052604081205490819003613cce57506127105b80821115613d1e5760405162461bcd60e51b815260206004820181905260248201527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c617267656044820152606401610ac3565b505050565b803561ffff81168114613d3557600080fd5b919050565b60008083601f840112613d4c57600080fd5b50813567ffffffffffffffff811115613d6457600080fd5b602083019150836020828501011115613d7c57600080fd5b9250929050565b803567ffffffffffffffff81168114613d3557600080fd5b60008060008060008060808789031215613db457600080fd5b613dbd87613d23565b9550602087013567ffffffffffffffff80821115613dda57600080fd5b613de68a838b01613d3a565b9097509550859150613dfa60408a01613d83565b94506060890135915080821115613e1057600080fd5b50613e1d89828a01613d3a565b979a9699509497509295939492505050565b6001600160a01b0381168114611eea57600080fd5b8035613d3581613e2f565b60008060408385031215613e6257600080fd5b8235613e6d81613e2f565b946020939093013593505050565b6001600160e01b031981168114611eea57600080fd5b600060208284031215613ea357600080fd5b813561171081613e7b565b600060208284031215613ec057600080fd5b61171082613d23565b60008060408385031215613edc57600080fd5b613e6d83613d23565b600060208284031215613ef757600080fd5b5035919050565b60005b83811015613f19578181015183820152602001613f01565b83811115612c2c5750506000910152565b60008151808452613f42816020860160208601613efe565b601f01601f19169290920160200192915050565b6020815260006117106020830184613f2a565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715613fa557613fa5613f69565b6040525050565b600067ffffffffffffffff821115613fc657613fc6613f69565b5060051b60200190565b600082601f830112613fe157600080fd5b81356020613fee82613fac565b604051613ffb8282613f7f565b83815260059390931b850182019282810191508684111561401b57600080fd5b8286015b84811015614036578035835291830191830161401f565b509695505050505050565b600067ffffffffffffffff82111561405b5761405b613f69565b50601f01601f191660200190565b600082601f83011261407a57600080fd5b813561408581614041565b6040516140928282613f7f565b8281528560208487010111156140a757600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a086880312156140dd57600080fd5b85356140e881613e2f565b945060208601356140f881613e2f565b9350604086013567ffffffffffffffff8082111561411557600080fd5b61412189838a01613fd0565b9450606088013591508082111561413757600080fd5b61414389838a01613fd0565b9350608088013591508082111561415957600080fd5b5061416688828901614069565b9150509295509295909350565b60008060006040848603121561418857600080fd5b61419184613d23565b9250602084013567ffffffffffffffff8111156141ad57600080fd5b6141b986828701613d3a565b9497909650939450505050565b600080600080600080600080610100898b0312156141e357600080fd5b6141ec89613e44565b97506141fa60208a01613d23565b9650604089013567ffffffffffffffff8082111561421757600080fd5b6142238c838d01614069565b975060608b013591508082111561423957600080fd5b6142458c838d01613fd0565b965060808b013591508082111561425b57600080fd5b6142678c838d01613fd0565b955061427560a08c01613e44565b945061428360c08c01613e44565b935060e08b013591508082111561429957600080fd5b506142a68b828c01614069565b9150509295985092959890939650565b600080600080600080600080610100898b0312156142d357600080fd5b88356142de81613e2f565b97506142ec60208a01613d23565b9650604089013567ffffffffffffffff8082111561430957600080fd5b6143158c838d01614069565b975060608b0135965060808b0135955060a08b0135915061433582613e2f565b90935060c08a01359061434782613e2f565b90925060e08a0135908082111561429957600080fd5b6000806040838503121561437057600080fd5b823567ffffffffffffffff8082111561438857600080fd5b818501915085601f83011261439c57600080fd5b813560206143a982613fac565b6040516143b68282613f7f565b83815260059390931b85018201928281019150898411156143d657600080fd5b948201945b838610156143fd5785356143ee81613e2f565b825294820194908201906143db565b9650508601359250508082111561441357600080fd5b5061442085828601613fd0565b9150509250929050565b600081518084526020808501945080840160005b8381101561445a5781518752958201959082019060010161443e565b509495945050505050565b602081526000611710602083018461442a565b60008060006060848603121561448d57600080fd5b61449684613d23565b9250602084013567ffffffffffffffff8111156144b257600080fd5b6144be86828701614069565b9250506144cd60408501613d83565b90509250925092565b6000806000606084860312156144eb57600080fd5b83356144f681613e2f565b9250602084013567ffffffffffffffff8082111561451357600080fd5b61451f87838801613fd0565b9350604086013591508082111561453557600080fd5b5061454286828701613fd0565b9150509250925092565b60008060006060848603121561456157600080fd5b833561456c81613e2f565b9250602084013561457c81613e2f565b929592945050506040919091013590565b80358015158114613d3557600080fd5b60008060008060008060c087890312156145b657600080fd5b6145bf87613d23565b9550602087013567ffffffffffffffff808211156145dc57600080fd5b6145e88a838b01614069565b9650604089013595506060890135945061460460808a0161458d565b935060a089013591508082111561461a57600080fd5b5061462789828a01614069565b9150509295509295509295565b6000806040838503121561464757600080fd5b61465083613d23565b915061465e60208401613d23565b90509250929050565b6000806040838503121561467a57600080fd5b823561468581613e2f565b915061465e6020840161458d565b60008060008060008060c087890312156146ac57600080fd5b6146b587613d23565b9550602087013567ffffffffffffffff808211156146d257600080fd5b6146de8a838b01614069565b965060408901359150808211156146f457600080fd5b6147008a838b01613fd0565b9550606089013591508082111561471657600080fd5b6147228a838b01613fd0565b945061460460808a0161458d565b60006020828403121561474257600080fd5b813561171081613e2f565b60008060008060006080868803121561476557600080fd5b61476e86613d23565b945061477c60208701613d23565b935060408601359250606086013567ffffffffffffffff81111561479f57600080fd5b6147ab88828901613d3a565b969995985093965092949392505050565b6000806000606084860312156147d157600080fd5b6147da84613d23565b92506147e860208501613d23565b9150604084013590509250925092565b6000806040838503121561480b57600080fd5b823561481681613e2f565b9150602083013561482681613e2f565b809150509250929050565b60006020828403121561484357600080fd5b6117108261458d565b600080600080600060a0868803121561486457600080fd5b853561486f81613e2f565b9450602086013561487f81613e2f565b93506040860135925060608601359150608086013567ffffffffffffffff8111156148a957600080fd5b61416688828901614069565b600080600080608085870312156148cb57600080fd5b6148d485613d23565b93506148e260208601613d23565b925060408501356148f281613e2f565b9396929550929360600135925050565b600181811c9082168061491657607f821691505b60208210810361493657634e487b7160e01b600052602260045260246000fd5b50919050565b8183823760009101908152919050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b61ffff84168152604060208201526000611fae60408301848661494c565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982036149d4576149d46149ab565b5060010190565b6040815260006149ee604083018561442a565b8281036020840152611fae818561442a565b600082821015614a1257614a126149ab565b500390565b8284823760609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169101908152601401919050565b601f821115613d1e57600081815260208120601f850160051c81016020861015614a775750805b601f850160051c820191505b818110156113fa57828155600101614a83565b815167ffffffffffffffff811115614ab057614ab0613f69565b614ac481614abe8454614902565b84614a50565b602080601f831160018114614af95760008415614ae15750858301515b600019600386901b1c1916600185901b1785556113fa565b600085815260208120601f198616915b82811015614b2857888601518255948401946001909101908401614b09565b5085821015614b465787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b606081526000614b696060830186613f2a565b8281036020840152614b7b818661442a565b90508281036040840152614b8f818561442a565b9695505050505050565b61ffff861681526001600160a01b038516602082015260a060408201526000614bc560a0830186613f2a565b84151560608401528281036080840152614bdf8185613f2a565b98975050505050505050565b60008060408385031215614bfe57600080fd5b505080516020909101519092909150565b600061ffff808816835280871660208401525084604083015260806060830152614c3d60808301848661494c565b979650505050505050565b61ffff86168152608060208201526000614c6660808301868861494c565b67ffffffffffffffff94909416604083015250606001529392505050565b67ffffffffffffffff831115614c9c57614c9c613f69565b614cb083614caa8354614902565b83614a50565b6000601f841160018114614ce45760008515614ccc5750838201355b600019600387901b1c1916600186901b178355610dfb565b600083815260209020601f19861690835b82811015614d155786850135825560209485019460019092019101614cf5565b5086821015614d325760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600082601f830112614d5557600080fd5b8151614d6081614041565b604051614d6d8282613f7f565b828152856020848701011115614d8257600080fd5b611fae836020830160208801613efe565b600060208284031215614da557600080fd5b815167ffffffffffffffff811115614dbc57600080fd5b614dc884828501614d44565b949350505050565b61ffff85168152608060208201526000614ded6080830186613f2a565b67ffffffffffffffff851660408401528281036060840152614c3d8185613f2a565b60008219821115614e2257614e226149ab565b500190565b60008251614e39818460208701613efe565b9190910192915050565b600082601f830112614e5457600080fd5b81516020614e6182613fac565b604051614e6e8282613f7f565b83815260059390931b8501820192828101915086841115614e8e57600080fd5b8286015b848110156140365780518352918301918301614e92565b600080600060608486031215614ebe57600080fd5b835167ffffffffffffffff80821115614ed657600080fd5b614ee287838801614d44565b94506020860151915080821115614ef857600080fd5b614f0487838801614e43565b93506040860151915080821115614f1a57600080fd5b5061454286828701614e43565b61ffff8616815260a060208201526000614f4460a0830187613f2a565b67ffffffffffffffff861660408401528281036060840152614f668186613f2a565b90508281036080840152614bdf8185613f2a565b60006001600160a01b03808816835280871660208401525060a06040830152614fa660a083018661442a565b8281036060840152614f66818661442a565b600060208284031215614fca57600080fd5b815161171081613e7b565b600060033d1115614fee5760046000803e5060005160e01c5b90565b600060443d1015614fff5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff816024840111818411171561504d57505050505090565b82850191508151818111156150655750505050505090565b843d870101602082850101111561507f5750505050505090565b61508e60208286010187613f7f565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152614c3d60a0830184613f2a565b61ffff8716815260c0602082015260006150ee60c0830188613f2a565b82810360408401526151008188613f2a565b6001600160a01b0387811660608601528616608085015283810360a0850152905061512b8185613f2a565b999850505050505050505056fea264697066735822122053798cd6ac7f8cfae63b6d7cd040695765f24e8fa1dd1834269938bed59777ab64736f6c634300080f0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000065aac97b628ada288b8302510a01d703968c4f6e00000000000000000000000059d4e5d8935cbd32b4ab663e06eaf18208ae4bd5000000000000000000000000884fc9cfab2a0bbe0ad647b75249609b72ad20b9000000000000000000000000ae92d5ad7583ad66e49a0c67bad18f6ba52dddc1
-----Decoded View---------------
Arg [0] : character_ (address): 0x65aAc97b628AdA288b8302510A01D703968c4F6E
Arg [1] : marketplace_ (address): 0x59d4E5d8935cBD32b4ab663E06EAF18208Ae4BD5
Arg [2] : boss_ (address): 0x884Fc9CFab2A0BBE0aD647B75249609B72Ad20B9
Arg [3] : lzEndpoint_ (address): 0xae92d5aD7583AD66E49A0c67BAd18F6ba52dDDc1
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000065aac97b628ada288b8302510a01d703968c4f6e
Arg [1] : 00000000000000000000000059d4e5d8935cbd32b4ab663e06eaf18208ae4bd5
Arg [2] : 000000000000000000000000884fc9cfab2a0bbe0ad647b75249609b72ad20b9
Arg [3] : 000000000000000000000000ae92d5ad7583ad66e49a0c67bad18f6ba52dddc1
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.