Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
18692914 | 447 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
Worlds
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 1337000 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
/* ・ * ★ ・ 。 ・ ゚☆ 。 * ★ ゚・。 * 。 * ☆ 。・゚*.。 ゚ *.。☆。★ ・ ` .-:::::-.` `-::---...``` `-:` .:+ssssoooo++//:.` .-/+shhhhhhhhhhhhhyyyssooo: .--::. .+ossso+/////++/:://-` .////+shhhhhhhhhhhhhhhhhhhhhy `-----::. `/+////+++///+++/:--:/+/- -////+shhhhhhhhhhhhhhhhhhhhhy `------:::-` `//-.``.-/+ooosso+:-.-/oso- -////+shhhhhhhhhhhhhhhhhhhhhy .--------:::-` :+:.` .-/osyyyyyyso++syhyo.-////+shhhhhhhhhhhhhhhhhhhhhy `-----------:::-. +o+:-.-:/oyhhhhhhdhhhhhdddy:-////+shhhhhhhhhhhhhhhhhhhhhy .------------::::-- `oys+/::/+shhhhhhhdddddddddy/-////+shhhhhhhhhhhhhhhhhhhhhy .--------------:::::-` +ys+////+yhhhhhhhddddddddhy:-////+yhhhhhhhhhhhhhhhhhhhhhy `----------------::::::-`.ss+/:::+oyhhhhhhhhhhhhhhho`-////+shhhhhhhhhhhhhhhhhhhhhy .------------------:::::::.-so//::/+osyyyhhhhhhhhhys` -////+shhhhhhhhhhhhhhhhhhhhhy `.-------------------::/:::::..+o+////+oosssyyyyyyys+` .////+shhhhhhhhhhhhhhhhhhhhhy .--------------------::/:::.` -+o++++++oooosssss/. `-//+shhhhhhhhhhhhhhhhhhhhyo .------- ``````.......--` `-/+ooooosso+/-` `./++++///:::--...``hhhhyo ````` * ・ 。 ・ ゚☆ 。 * ★ ゚・。 * 。 * ☆ 。・゚*.。 ゚ *.。☆。★ ・ * ゚。·*・。 ゚* ☆゚・。°*. ゚ ・ ゚*。・゚★。 ・ *゚。 * ・゚*。★・ ☆∴。 * ・ 。 */ // SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { ContextUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import { ERC165Upgradeable } from "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import { ERC721Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import { IERC165Upgradeable } from "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol"; import { IWorldsDropMarket } from "./interfaces/internal/IWorldsDropMarket.sol"; import { IWorldsNFTMarket } from "./interfaces/internal/IWorldsNFTMarket.sol"; import { IWorldsSharedMarket } from "./interfaces/internal/IWorldsSharedMarket.sol"; import { IWorldsNftUserRoles } from "./interfaces/internal/routes/IWorldsNftUserRoles.sol"; import { DelegateForwarder } from "./mixins/shared/DelegateForwarder.sol"; import { ERC4906 } from "./mixins/collections/ERC4906.sol"; import { ERC721UserRoles } from "./mixins/roles/ERC721UserRoles.sol"; import { FoundationTreasuryNode } from "./mixins/shared/FoundationTreasuryNode.sol"; import { NFTDropMarketNode } from "./mixins/shared/NFTDropMarketNode.sol"; import { NFTMarketNode } from "./mixins/shared/NFTMarketNode.sol"; import { RouterContextTriple } from "./mixins/shared/RouterContextTriple.sol"; import { WorldsAllowlist } from "./mixins/worlds/WorldsAllowlist.sol"; import { WorldsAllowlistBySeller } from "./mixins/worlds/WorldsAllowlistBySeller.sol"; import { WorldsCore } from "./mixins/worlds/WorldsCore.sol"; import { WorldsInventoryByCollection } from "./mixins/worlds/WorldsInventoryByCollection.sol"; import { WorldsInventoryByNft } from "./mixins/worlds/WorldsInventoryByNft.sol"; import { WorldsInventoryBySplit } from "./mixins/worlds/WorldsInventoryBySplit.sol"; import { WorldsManagement } from "./mixins/worlds/WorldsManagement.sol"; import { WorldsMetadata } from "./mixins/worlds/WorldsMetadata.sol"; import { WorldsNftMarketExhibitionMigration } from "./mixins/worlds/WorldsNftMarketExhibitionMigration.sol"; import { WorldsNotImplemented } from "./mixins/worlds/WorldsNotImplemented.sol"; import { WorldsPaymentInfo } from "./mixins/worlds/WorldsPaymentInfo.sol"; import { WorldsTransfer2Step } from "./mixins/worlds/WorldsTransfer2Step.sol"; import { WorldsUserRoles } from "./mixins/worlds/WorldsUserRoles.sol"; /** * @title Worlds are NFTs which aggregate collections of curated content. * @author HardlyDifficult & reggieag */ contract Worlds is NFTMarketNode, NFTDropMarketNode, FoundationTreasuryNode, IWorldsDropMarket, IWorldsNFTMarket, DelegateForwarder, IWorldsSharedMarket, IWorldsNftUserRoles, Initializable, ContextUpgradeable, ERC165Upgradeable, RouterContextTriple, ERC721Upgradeable, ERC4906, ERC721UserRoles, WorldsCore, WorldsUserRoles, WorldsMetadata, WorldsPaymentInfo, WorldsAllowlistBySeller, WorldsAllowlist, WorldsInventoryByCollection, WorldsInventoryBySplit, WorldsInventoryByNft, WorldsManagement, WorldsTransfer2Step, WorldsNftMarketExhibitionMigration, WorldsNotImplemented { //////////////////////////////////////////////////////////////// // Setup //////////////////////////////////////////////////////////////// /** * @notice Set immutable variables for the implementation contract. * @param treasury Foundation's treasury contract address. * @param nftMarket Foundation's NFTMarket contract address. * @param nftDropMarket Foundation's NFTDropMarket contract address. * @param nftMarketRouter Foundation's NFTMarketRouter contract address. * @param worldsMetadataDelegate The contract which will handle some metadata requests for Worlds. * @param splitTemplate The contract which will be used to create new World split proxies. * @dev Using immutable instead of constants allows us to use different values on testnet. */ constructor( address payable treasury, address nftMarket, address nftDropMarket, address nftMarketRouter, address worldsMetadataDelegate, address splitTemplate ) RouterContextTriple(nftMarket, nftDropMarket, nftMarketRouter) FoundationTreasuryNode(treasury) NFTMarketNode(nftMarket) NFTDropMarketNode(nftDropMarket) WorldsMetadata(worldsMetadataDelegate) WorldsInventoryBySplit(splitTemplate) { _disableInitializers(); } /** * @notice Initialize the upgradeable proxy contract for Worlds. */ function initialize() external initializer { // Assign the NFT's name and symbol. __ERC721_init_unchained("Worlds", "WORLD"); } //////////////////////////////////////////////////////////////// // Inheritance Requirements // (no-ops to avoid compile errors) //////////////////////////////////////////////////////////////// /// @inheritdoc IERC165Upgradeable function supportsInterface( bytes4 interfaceId ) public view override( ERC165Upgradeable, ERC721Upgradeable, ERC4906, WorldsMetadata, WorldsManagement, WorldsNftMarketExhibitionMigration ) returns (bool isSupported) { isSupported = super.supportsInterface(interfaceId); } /// @inheritdoc WorldsMetadata function tokenURI( uint256 worldId ) public view override(ERC721Upgradeable, WorldsMetadata, WorldsManagement, WorldsNftMarketExhibitionMigration) returns (string memory uri) { uri = super.tokenURI(worldId); } /// @inheritdoc ERC721Upgradeable function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal override(ERC721Upgradeable, WorldsTransfer2Step) { super._afterTokenTransfer(from, to, firstTokenId, batchSize); } /// @inheritdoc ERC721Upgradeable function _burn( uint256 worldId ) internal override( ERC721Upgradeable, WorldsPaymentInfo, WorldsMetadata, WorldsAllowlistBySeller, WorldsManagement, WorldsNftMarketExhibitionMigration ) { super._burn(worldId); } /// @inheritdoc ContextUpgradeable function _msgSender() internal view override(ContextUpgradeable, RouterContextTriple) returns (address sender) { sender = super._msgSender(); } /// @inheritdoc WorldsNotImplemented function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public pure override(ERC721Upgradeable, WorldsNotImplemented) { super.safeTransferFrom(from, to, tokenId, data); } /// @inheritdoc WorldsNotImplemented function transferFrom( address from, address to, uint256 tokenId ) public pure override(ERC721Upgradeable, WorldsNotImplemented) { super.transferFrom(from, to, tokenId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/StringsUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _ownerOf(tokenId) != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721Upgradeable.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal virtual { require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such * that `ownerOf(tokenId)` is `a`. */ // solhint-disable-next-line func-name-mixedcase function __unsafe_increaseBalance(address account, uint256 amount) internal { _balances[account] += amount; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[44] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @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.8.0/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; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// 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 IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMathUpgradeable { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; import "./math/SignedMathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/Clones.sol) pragma solidity ^0.8.20; /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. */ library Clones { /** * @dev A clone instance deployment failed. */ error ERC1167FailedCreateClone(); /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create(0, 0x09, 0x37) } if (instance == address(0)) { revert ERC1167FailedCreateClone(); } } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create2(0, 0x09, 0x37, salt) } if (instance == address(0)) { revert ERC1167FailedCreateClone(); } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(add(ptr, 0x38), deployer) mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff) mstore(add(ptr, 0x14), implementation) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73) mstore(add(ptr, 0x58), salt) mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37)) predicted := keccak256(add(ptr, 0x43), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt ) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SafeCast.sol) // This file was procedurally generated from scripts/generate/templates/SafeCast.js. pragma solidity ^0.8.20; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeCast { /** * @dev Value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value); /** * @dev An int value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedIntToUint(int256 value); /** * @dev Value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedIntDowncast(uint8 bits, int256 value); /** * @dev An uint value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedUintToInt(uint256 value); /** * @dev Returns the downcasted uint248 from uint256, reverting on * overflow (when the input is greater than largest uint248). * * Counterpart to Solidity's `uint248` operator. * * Requirements: * * - input must fit into 248 bits */ function toUint248(uint256 value) internal pure returns (uint248) { if (value > type(uint248).max) { revert SafeCastOverflowedUintDowncast(248, value); } return uint248(value); } /** * @dev Returns the downcasted uint240 from uint256, reverting on * overflow (when the input is greater than largest uint240). * * Counterpart to Solidity's `uint240` operator. * * Requirements: * * - input must fit into 240 bits */ function toUint240(uint256 value) internal pure returns (uint240) { if (value > type(uint240).max) { revert SafeCastOverflowedUintDowncast(240, value); } return uint240(value); } /** * @dev Returns the downcasted uint232 from uint256, reverting on * overflow (when the input is greater than largest uint232). * * Counterpart to Solidity's `uint232` operator. * * Requirements: * * - input must fit into 232 bits */ function toUint232(uint256 value) internal pure returns (uint232) { if (value > type(uint232).max) { revert SafeCastOverflowedUintDowncast(232, value); } return uint232(value); } /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { if (value > type(uint224).max) { revert SafeCastOverflowedUintDowncast(224, value); } return uint224(value); } /** * @dev Returns the downcasted uint216 from uint256, reverting on * overflow (when the input is greater than largest uint216). * * Counterpart to Solidity's `uint216` operator. * * Requirements: * * - input must fit into 216 bits */ function toUint216(uint256 value) internal pure returns (uint216) { if (value > type(uint216).max) { revert SafeCastOverflowedUintDowncast(216, value); } return uint216(value); } /** * @dev Returns the downcasted uint208 from uint256, reverting on * overflow (when the input is greater than largest uint208). * * Counterpart to Solidity's `uint208` operator. * * Requirements: * * - input must fit into 208 bits */ function toUint208(uint256 value) internal pure returns (uint208) { if (value > type(uint208).max) { revert SafeCastOverflowedUintDowncast(208, value); } return uint208(value); } /** * @dev Returns the downcasted uint200 from uint256, reverting on * overflow (when the input is greater than largest uint200). * * Counterpart to Solidity's `uint200` operator. * * Requirements: * * - input must fit into 200 bits */ function toUint200(uint256 value) internal pure returns (uint200) { if (value > type(uint200).max) { revert SafeCastOverflowedUintDowncast(200, value); } return uint200(value); } /** * @dev Returns the downcasted uint192 from uint256, reverting on * overflow (when the input is greater than largest uint192). * * Counterpart to Solidity's `uint192` operator. * * Requirements: * * - input must fit into 192 bits */ function toUint192(uint256 value) internal pure returns (uint192) { if (value > type(uint192).max) { revert SafeCastOverflowedUintDowncast(192, value); } return uint192(value); } /** * @dev Returns the downcasted uint184 from uint256, reverting on * overflow (when the input is greater than largest uint184). * * Counterpart to Solidity's `uint184` operator. * * Requirements: * * - input must fit into 184 bits */ function toUint184(uint256 value) internal pure returns (uint184) { if (value > type(uint184).max) { revert SafeCastOverflowedUintDowncast(184, value); } return uint184(value); } /** * @dev Returns the downcasted uint176 from uint256, reverting on * overflow (when the input is greater than largest uint176). * * Counterpart to Solidity's `uint176` operator. * * Requirements: * * - input must fit into 176 bits */ function toUint176(uint256 value) internal pure returns (uint176) { if (value > type(uint176).max) { revert SafeCastOverflowedUintDowncast(176, value); } return uint176(value); } /** * @dev Returns the downcasted uint168 from uint256, reverting on * overflow (when the input is greater than largest uint168). * * Counterpart to Solidity's `uint168` operator. * * Requirements: * * - input must fit into 168 bits */ function toUint168(uint256 value) internal pure returns (uint168) { if (value > type(uint168).max) { revert SafeCastOverflowedUintDowncast(168, value); } return uint168(value); } /** * @dev Returns the downcasted uint160 from uint256, reverting on * overflow (when the input is greater than largest uint160). * * Counterpart to Solidity's `uint160` operator. * * Requirements: * * - input must fit into 160 bits */ function toUint160(uint256 value) internal pure returns (uint160) { if (value > type(uint160).max) { revert SafeCastOverflowedUintDowncast(160, value); } return uint160(value); } /** * @dev Returns the downcasted uint152 from uint256, reverting on * overflow (when the input is greater than largest uint152). * * Counterpart to Solidity's `uint152` operator. * * Requirements: * * - input must fit into 152 bits */ function toUint152(uint256 value) internal pure returns (uint152) { if (value > type(uint152).max) { revert SafeCastOverflowedUintDowncast(152, value); } return uint152(value); } /** * @dev Returns the downcasted uint144 from uint256, reverting on * overflow (when the input is greater than largest uint144). * * Counterpart to Solidity's `uint144` operator. * * Requirements: * * - input must fit into 144 bits */ function toUint144(uint256 value) internal pure returns (uint144) { if (value > type(uint144).max) { revert SafeCastOverflowedUintDowncast(144, value); } return uint144(value); } /** * @dev Returns the downcasted uint136 from uint256, reverting on * overflow (when the input is greater than largest uint136). * * Counterpart to Solidity's `uint136` operator. * * Requirements: * * - input must fit into 136 bits */ function toUint136(uint256 value) internal pure returns (uint136) { if (value > type(uint136).max) { revert SafeCastOverflowedUintDowncast(136, value); } return uint136(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { if (value > type(uint128).max) { revert SafeCastOverflowedUintDowncast(128, value); } return uint128(value); } /** * @dev Returns the downcasted uint120 from uint256, reverting on * overflow (when the input is greater than largest uint120). * * Counterpart to Solidity's `uint120` operator. * * Requirements: * * - input must fit into 120 bits */ function toUint120(uint256 value) internal pure returns (uint120) { if (value > type(uint120).max) { revert SafeCastOverflowedUintDowncast(120, value); } return uint120(value); } /** * @dev Returns the downcasted uint112 from uint256, reverting on * overflow (when the input is greater than largest uint112). * * Counterpart to Solidity's `uint112` operator. * * Requirements: * * - input must fit into 112 bits */ function toUint112(uint256 value) internal pure returns (uint112) { if (value > type(uint112).max) { revert SafeCastOverflowedUintDowncast(112, value); } return uint112(value); } /** * @dev Returns the downcasted uint104 from uint256, reverting on * overflow (when the input is greater than largest uint104). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 104 bits */ function toUint104(uint256 value) internal pure returns (uint104) { if (value > type(uint104).max) { revert SafeCastOverflowedUintDowncast(104, value); } return uint104(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { if (value > type(uint96).max) { revert SafeCastOverflowedUintDowncast(96, value); } return uint96(value); } /** * @dev Returns the downcasted uint88 from uint256, reverting on * overflow (when the input is greater than largest uint88). * * Counterpart to Solidity's `uint88` operator. * * Requirements: * * - input must fit into 88 bits */ function toUint88(uint256 value) internal pure returns (uint88) { if (value > type(uint88).max) { revert SafeCastOverflowedUintDowncast(88, value); } return uint88(value); } /** * @dev Returns the downcasted uint80 from uint256, reverting on * overflow (when the input is greater than largest uint80). * * Counterpart to Solidity's `uint80` operator. * * Requirements: * * - input must fit into 80 bits */ function toUint80(uint256 value) internal pure returns (uint80) { if (value > type(uint80).max) { revert SafeCastOverflowedUintDowncast(80, value); } return uint80(value); } /** * @dev Returns the downcasted uint72 from uint256, reverting on * overflow (when the input is greater than largest uint72). * * Counterpart to Solidity's `uint72` operator. * * Requirements: * * - input must fit into 72 bits */ function toUint72(uint256 value) internal pure returns (uint72) { if (value > type(uint72).max) { revert SafeCastOverflowedUintDowncast(72, value); } return uint72(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { if (value > type(uint64).max) { revert SafeCastOverflowedUintDowncast(64, value); } return uint64(value); } /** * @dev Returns the downcasted uint56 from uint256, reverting on * overflow (when the input is greater than largest uint56). * * Counterpart to Solidity's `uint56` operator. * * Requirements: * * - input must fit into 56 bits */ function toUint56(uint256 value) internal pure returns (uint56) { if (value > type(uint56).max) { revert SafeCastOverflowedUintDowncast(56, value); } return uint56(value); } /** * @dev Returns the downcasted uint48 from uint256, reverting on * overflow (when the input is greater than largest uint48). * * Counterpart to Solidity's `uint48` operator. * * Requirements: * * - input must fit into 48 bits */ function toUint48(uint256 value) internal pure returns (uint48) { if (value > type(uint48).max) { revert SafeCastOverflowedUintDowncast(48, value); } return uint48(value); } /** * @dev Returns the downcasted uint40 from uint256, reverting on * overflow (when the input is greater than largest uint40). * * Counterpart to Solidity's `uint40` operator. * * Requirements: * * - input must fit into 40 bits */ function toUint40(uint256 value) internal pure returns (uint40) { if (value > type(uint40).max) { revert SafeCastOverflowedUintDowncast(40, value); } return uint40(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { if (value > type(uint32).max) { revert SafeCastOverflowedUintDowncast(32, value); } return uint32(value); } /** * @dev Returns the downcasted uint24 from uint256, reverting on * overflow (when the input is greater than largest uint24). * * Counterpart to Solidity's `uint24` operator. * * Requirements: * * - input must fit into 24 bits */ function toUint24(uint256 value) internal pure returns (uint24) { if (value > type(uint24).max) { revert SafeCastOverflowedUintDowncast(24, value); } return uint24(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { if (value > type(uint16).max) { revert SafeCastOverflowedUintDowncast(16, value); } return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits */ function toUint8(uint256 value) internal pure returns (uint8) { if (value > type(uint8).max) { revert SafeCastOverflowedUintDowncast(8, value); } return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { if (value < 0) { revert SafeCastOverflowedIntToUint(value); } return uint256(value); } /** * @dev Returns the downcasted int248 from int256, reverting on * overflow (when the input is less than smallest int248 or * greater than largest int248). * * Counterpart to Solidity's `int248` operator. * * Requirements: * * - input must fit into 248 bits */ function toInt248(int256 value) internal pure returns (int248 downcasted) { downcasted = int248(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(248, value); } } /** * @dev Returns the downcasted int240 from int256, reverting on * overflow (when the input is less than smallest int240 or * greater than largest int240). * * Counterpart to Solidity's `int240` operator. * * Requirements: * * - input must fit into 240 bits */ function toInt240(int256 value) internal pure returns (int240 downcasted) { downcasted = int240(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(240, value); } } /** * @dev Returns the downcasted int232 from int256, reverting on * overflow (when the input is less than smallest int232 or * greater than largest int232). * * Counterpart to Solidity's `int232` operator. * * Requirements: * * - input must fit into 232 bits */ function toInt232(int256 value) internal pure returns (int232 downcasted) { downcasted = int232(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(232, value); } } /** * @dev Returns the downcasted int224 from int256, reverting on * overflow (when the input is less than smallest int224 or * greater than largest int224). * * Counterpart to Solidity's `int224` operator. * * Requirements: * * - input must fit into 224 bits */ function toInt224(int256 value) internal pure returns (int224 downcasted) { downcasted = int224(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(224, value); } } /** * @dev Returns the downcasted int216 from int256, reverting on * overflow (when the input is less than smallest int216 or * greater than largest int216). * * Counterpart to Solidity's `int216` operator. * * Requirements: * * - input must fit into 216 bits */ function toInt216(int256 value) internal pure returns (int216 downcasted) { downcasted = int216(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(216, value); } } /** * @dev Returns the downcasted int208 from int256, reverting on * overflow (when the input is less than smallest int208 or * greater than largest int208). * * Counterpart to Solidity's `int208` operator. * * Requirements: * * - input must fit into 208 bits */ function toInt208(int256 value) internal pure returns (int208 downcasted) { downcasted = int208(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(208, value); } } /** * @dev Returns the downcasted int200 from int256, reverting on * overflow (when the input is less than smallest int200 or * greater than largest int200). * * Counterpart to Solidity's `int200` operator. * * Requirements: * * - input must fit into 200 bits */ function toInt200(int256 value) internal pure returns (int200 downcasted) { downcasted = int200(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(200, value); } } /** * @dev Returns the downcasted int192 from int256, reverting on * overflow (when the input is less than smallest int192 or * greater than largest int192). * * Counterpart to Solidity's `int192` operator. * * Requirements: * * - input must fit into 192 bits */ function toInt192(int256 value) internal pure returns (int192 downcasted) { downcasted = int192(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(192, value); } } /** * @dev Returns the downcasted int184 from int256, reverting on * overflow (when the input is less than smallest int184 or * greater than largest int184). * * Counterpart to Solidity's `int184` operator. * * Requirements: * * - input must fit into 184 bits */ function toInt184(int256 value) internal pure returns (int184 downcasted) { downcasted = int184(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(184, value); } } /** * @dev Returns the downcasted int176 from int256, reverting on * overflow (when the input is less than smallest int176 or * greater than largest int176). * * Counterpart to Solidity's `int176` operator. * * Requirements: * * - input must fit into 176 bits */ function toInt176(int256 value) internal pure returns (int176 downcasted) { downcasted = int176(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(176, value); } } /** * @dev Returns the downcasted int168 from int256, reverting on * overflow (when the input is less than smallest int168 or * greater than largest int168). * * Counterpart to Solidity's `int168` operator. * * Requirements: * * - input must fit into 168 bits */ function toInt168(int256 value) internal pure returns (int168 downcasted) { downcasted = int168(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(168, value); } } /** * @dev Returns the downcasted int160 from int256, reverting on * overflow (when the input is less than smallest int160 or * greater than largest int160). * * Counterpart to Solidity's `int160` operator. * * Requirements: * * - input must fit into 160 bits */ function toInt160(int256 value) internal pure returns (int160 downcasted) { downcasted = int160(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(160, value); } } /** * @dev Returns the downcasted int152 from int256, reverting on * overflow (when the input is less than smallest int152 or * greater than largest int152). * * Counterpart to Solidity's `int152` operator. * * Requirements: * * - input must fit into 152 bits */ function toInt152(int256 value) internal pure returns (int152 downcasted) { downcasted = int152(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(152, value); } } /** * @dev Returns the downcasted int144 from int256, reverting on * overflow (when the input is less than smallest int144 or * greater than largest int144). * * Counterpart to Solidity's `int144` operator. * * Requirements: * * - input must fit into 144 bits */ function toInt144(int256 value) internal pure returns (int144 downcasted) { downcasted = int144(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(144, value); } } /** * @dev Returns the downcasted int136 from int256, reverting on * overflow (when the input is less than smallest int136 or * greater than largest int136). * * Counterpart to Solidity's `int136` operator. * * Requirements: * * - input must fit into 136 bits */ function toInt136(int256 value) internal pure returns (int136 downcasted) { downcasted = int136(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(136, value); } } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits */ function toInt128(int256 value) internal pure returns (int128 downcasted) { downcasted = int128(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(128, value); } } /** * @dev Returns the downcasted int120 from int256, reverting on * overflow (when the input is less than smallest int120 or * greater than largest int120). * * Counterpart to Solidity's `int120` operator. * * Requirements: * * - input must fit into 120 bits */ function toInt120(int256 value) internal pure returns (int120 downcasted) { downcasted = int120(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(120, value); } } /** * @dev Returns the downcasted int112 from int256, reverting on * overflow (when the input is less than smallest int112 or * greater than largest int112). * * Counterpart to Solidity's `int112` operator. * * Requirements: * * - input must fit into 112 bits */ function toInt112(int256 value) internal pure returns (int112 downcasted) { downcasted = int112(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(112, value); } } /** * @dev Returns the downcasted int104 from int256, reverting on * overflow (when the input is less than smallest int104 or * greater than largest int104). * * Counterpart to Solidity's `int104` operator. * * Requirements: * * - input must fit into 104 bits */ function toInt104(int256 value) internal pure returns (int104 downcasted) { downcasted = int104(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(104, value); } } /** * @dev Returns the downcasted int96 from int256, reverting on * overflow (when the input is less than smallest int96 or * greater than largest int96). * * Counterpart to Solidity's `int96` operator. * * Requirements: * * - input must fit into 96 bits */ function toInt96(int256 value) internal pure returns (int96 downcasted) { downcasted = int96(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(96, value); } } /** * @dev Returns the downcasted int88 from int256, reverting on * overflow (when the input is less than smallest int88 or * greater than largest int88). * * Counterpart to Solidity's `int88` operator. * * Requirements: * * - input must fit into 88 bits */ function toInt88(int256 value) internal pure returns (int88 downcasted) { downcasted = int88(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(88, value); } } /** * @dev Returns the downcasted int80 from int256, reverting on * overflow (when the input is less than smallest int80 or * greater than largest int80). * * Counterpart to Solidity's `int80` operator. * * Requirements: * * - input must fit into 80 bits */ function toInt80(int256 value) internal pure returns (int80 downcasted) { downcasted = int80(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(80, value); } } /** * @dev Returns the downcasted int72 from int256, reverting on * overflow (when the input is less than smallest int72 or * greater than largest int72). * * Counterpart to Solidity's `int72` operator. * * Requirements: * * - input must fit into 72 bits */ function toInt72(int256 value) internal pure returns (int72 downcasted) { downcasted = int72(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(72, value); } } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits */ function toInt64(int256 value) internal pure returns (int64 downcasted) { downcasted = int64(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(64, value); } } /** * @dev Returns the downcasted int56 from int256, reverting on * overflow (when the input is less than smallest int56 or * greater than largest int56). * * Counterpart to Solidity's `int56` operator. * * Requirements: * * - input must fit into 56 bits */ function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(56, value); } } /** * @dev Returns the downcasted int48 from int256, reverting on * overflow (when the input is less than smallest int48 or * greater than largest int48). * * Counterpart to Solidity's `int48` operator. * * Requirements: * * - input must fit into 48 bits */ function toInt48(int256 value) internal pure returns (int48 downcasted) { downcasted = int48(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(48, value); } } /** * @dev Returns the downcasted int40 from int256, reverting on * overflow (when the input is less than smallest int40 or * greater than largest int40). * * Counterpart to Solidity's `int40` operator. * * Requirements: * * - input must fit into 40 bits */ function toInt40(int256 value) internal pure returns (int40 downcasted) { downcasted = int40(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(40, value); } } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits */ function toInt32(int256 value) internal pure returns (int32 downcasted) { downcasted = int32(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(32, value); } } /** * @dev Returns the downcasted int24 from int256, reverting on * overflow (when the input is less than smallest int24 or * greater than largest int24). * * Counterpart to Solidity's `int24` operator. * * Requirements: * * - input must fit into 24 bits */ function toInt24(int256 value) internal pure returns (int24 downcasted) { downcasted = int24(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(24, value); } } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits */ function toInt16(int256 value) internal pure returns (int16 downcasted) { downcasted = int16(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(16, value); } } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits */ function toInt8(int256 value) internal pure returns (int8 downcasted) { downcasted = int8(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(8, value); } } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive if (value > uint256(type(int256).max)) { revert SafeCastOverflowedUintToInt(value); } return int256(value); } }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; /** * @title Declares a function used to delegatecall in a read-only context. * @author HardlyDifficult */ interface IDelegateView { function _delegateView() external view; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; interface INFTDropMarketExhibitionMigration { function worldsMigrateExhibitionListings( uint256 exhibitionId, address[] calldata collectionListings ) external returns (address[] memory collectionSellers); }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; interface INFTMarketExhibitionMigration { struct NFTListing { address nftContract; uint256 nftTokenId; } function worldsInitializeMigration() external returns (uint256 lastExhibitionIdCreated); function worldsMigrateExhibition( uint256 exhibitionId, address curator ) external returns (string memory name, uint16 takeRateInBasisPoints); function worldsMigrateExhibitionListings( uint256 exhibitionId, INFTMarketExhibitionMigration.NFTListing[] calldata nftListings ) external returns (address[] memory nftSellers); }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; interface IWorldsDropMarket { function addToWorldByCollection(uint256 worldId, address nftContract, uint16 takeRateInBasisPoints) external; function getAssociationByCollection( address nftContract, address seller ) external view returns (uint256 worldId, uint16 takeRateInBasisPoints); function soldInWorldByCollection( address seller, address nftContract, uint256 count, uint256 totalSalePrice ) external returns (uint256 worldId, address payable worldPaymentAddress, uint16 takeRateInBasisPoints); }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; interface IWorldsInventoryBySplit { function soldInWorldBySplit( address market, uint256 value ) external returns (address payable worldPaymentAddress, uint256 curatorTakeInWei); function soldInWorldBySplitWorldPaymentFailed(address market, uint256 valueInWei) external; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; interface IWorldsNFTMarket { //////////////////////////////////////////////////////////////// // World management //////////////////////////////////////////////////////////////// function mint( uint16 defaultTakeRateInBasisPoints, address payable worldPaymentAddress, string calldata name ) external returns (uint256 worldId); function burn(uint256 worldId) external; function getWorldName(uint256 worldId) external view returns (string memory name); //////////////////////////////////////////////////////////////// // Allowlist //////////////////////////////////////////////////////////////// function addToAllowlistBySeller(uint256 worldId, address seller) external; function isSellerAllowed(uint256 worldId, address seller) external view returns (bool isAllowed); //////////////////////////////////////////////////////////////// // NFT specific //////////////////////////////////////////////////////////////// function addToWorldByNft( uint256 worldId, address nftContract, uint256 nftTokenId, uint16 takeRateInBasisPoints ) external; function getAssociationByNft( address nftContract, uint256 nftTokenId, address seller ) external view returns (uint256 worldId, uint16 takeRateInBasisPoints); function removeFromWorldByNft(address nftContract, uint256 nftTokenId) external; function soldInWorldByNft( address seller, address nftContract, uint256 nftTokenId, address buyer, uint256 salePrice ) external returns (uint256 worldId, address payable worldPaymentAddress, uint16 takeRateInBasisPoints); }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; interface IWorldSplit { function initialize(address payable ownerAndAssetRecipient) external; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; interface IWorldsSharedMarket { function getDefaultTakeRate(uint256 worldId) external view returns (uint16 defaultTakeRateInBasisPoints); function getPaymentAddress(uint256 worldId) external view returns (address payable worldPaymentAddress); }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; /** * @notice Interface for AdminRole which wraps the default admin role from * OpenZeppelin's AccessControl for easy integration. * @author batu-inal & HardlyDifficult */ interface IAdminRole { function isAdmin(address account) external view returns (bool); }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; /** * @notice Interface for OperatorRole which wraps a role from * OpenZeppelin's AccessControl for easy integration. * @author batu-inal & HardlyDifficult */ interface IOperatorRole { function isOperator(address account) external view returns (bool); }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; interface IWorldsNftUserRoles { function revokeAllRolesForUser(uint256 worldId, address user) external; function setAdminRole(uint256 worldId, address user) external; function setEditorRole(uint256 worldId, address user) external; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; /// From https://eips.ethereum.org/EIPS/eip-173 /// @title ERC-173 Contract Ownership Standard /// Note: the ERC-165 identifier for this interface is 0x7f5828d0 interface IOwnable { /// @notice Get the address of the owner /// @return The address of the owner. function owner() external view returns (address); /// @notice Set the address of the new owner of the contract /// @dev Set _newOwner to address(0) to renounce any ownership. /// @param _newOwner The address of the new owner of the contract function transferOwnership(address _newOwner) external; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; error RouteCallLibrary_Call_Failed_Without_Revert_Reason(); /** * @title A library for calling external contracts with an address appended to the calldata. * @author HardlyDifficult */ library RouteCallLibrary { /** * @notice Routes a call to the specified contract, appending the from address to the end of the calldata. * If the call reverts, this will revert the transaction and the original reason is bubbled up. * @param from The address to use as the msg sender when calling the contract. * @param to The contract address to call. * @param callData The call data to use when calling the contract, without the sender appended. */ function routeCallTo(address from, address to, bytes memory callData) internal returns (bytes memory returnData) { // Forward the call, with the packed from address appended, to the specified contract. bool success; (success, returnData) = tryRouteCallTo(from, to, callData); // If the call failed, bubble up the revert reason. if (!success) { revertWithError(returnData); } } /** * @notice Routes a call to the specified contract, appending the from address to the end of the calldata. * This will not revert even if the external call fails. * @param from The address to use as the msg sender when calling the contract. * @param to The contract address to call. * @param callData The call data to use when calling the contract, without the sender appended. * @dev Consumers should look for positive confirmation that if the transaction is not successful, the returned revert * reason is expected as an acceptable reason to ignore. Generically ignoring reverts will lead to out-of-gas errors * being ignored and result in unexpected behavior. */ function tryRouteCallTo( address from, address to, bytes memory callData ) internal returns (bool success, bytes memory returnData) { // Forward the call, with the packed from address appended, to the specified contract. // solhint-disable-next-line avoid-low-level-calls (success, returnData) = to.call(abi.encodePacked(callData, from)); } /** * @notice Bubbles up the original revert reason of a low-level call failure where possible. * @dev Copied from OZ's `Address.sol` library, with a minor modification to the final revert scenario. * This should only be used when a low-level call fails. */ function revertWithError(bytes memory returnData) internal 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 RouteCallLibrary_Call_Failed_Without_Revert_Reason(); } } /** * @notice Extracts the appended sender address from the calldata. * @dev This uses the last 20 bytes of the calldata, with no guarantees that an address has indeed been appended. * If this is used for a call that was not routed with `routeCallTo`, the address returned will be incorrect (and * may be address(0)). */ function extractAppendedSenderAddress() internal pure returns (address sender) { assembly { // The router appends the msg.sender to the end of the calldata // source: https://github.com/opengsn/gsn/blob/v3.0.0-beta.3/packages/contracts/src/ERC2771Recipient.sol#L48 sender := shr(96, calldataload(sub(calldatasize(), 20))) } } }
// SPDX-License-Identifier: CC0-1.0 pragma solidity ^0.8.18; import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; /** * @title ERC-4906: Metadata Update Events. * @dev See https://eips.ethereum.org/EIPS/eip-4906 */ contract ERC4906 is ERC165Upgradeable { /** * @notice This event emits when the metadata of a token is changed. So that the third-party platforms such as an NFT * market could timely update the images and related attributes of the NFT. * @param tokenId The ID of the NFT whose metadata is changed. */ event MetadataUpdate(uint256 tokenId); /** * @notice This event emits when the metadata of a range of tokens is changed. So that the third-party platforms such * as an NFT market could timely update the images and related attributes of the NFTs. * @param fromTokenId The ID of the first NFT whose metadata is changed. * @param toTokenId The ID of the last NFT whose metadata is changed. */ event BatchMetadataUpdate(uint256 fromTokenId, uint256 toTokenId); function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool isSupported) { // 0x49064906 is a magic number based on the EIP number. isSupported = interfaceId == bytes4(0x49064906) || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; /** * @title Defines storage and access of users roles for individual ERC721 tokens. * @author reggieag & HardlyDifficult */ abstract contract ERC721UserRoles { /// @notice Stores user roles per-token as a bitfield. Consumers should define the significance of each bit, /// referenced as `role` below. mapping(uint256 tokenId => mapping(uint256 nonce => mapping(address user => bytes32 roles))) private $tokenIdToNonceToUserToRoles; /// @notice The nonce to use for every access to `$tokenIdToNonceToUserToRoles`. /// @dev This structures storage to allow a user controlled `nonce` in the future, enabling delete all. uint256 private constant DEFAULT_NONCE = 0; /** * @notice Emitted when all token roles for a user are revoked. * @param tokenId The token for which this user had their roles revoked. * @param user The address of the user who had their roles revoked. */ event UserRolesRevoked(uint256 indexed tokenId, address indexed user); error ERC721UserRoles_User_Has_No_Roles(); error ERC721UserRoles_User_Must_Not_Be_Zero_Address(); error ERC721UserRoles_User_Role_Already_Set(); /** * @notice Sets a user role for a given token. Overwrites any existing roles. * @dev No events are emitted, the caller should emit if required allowing for user friendly naming. */ function _setUserRole(uint256 tokenId, address user, uint8 role) internal { if (_hasUserRole(tokenId, user, role)) { revert ERC721UserRoles_User_Role_Already_Set(); } $tokenIdToNonceToUserToRoles[tokenId][DEFAULT_NONCE][user] = bytes32(1 << role); } function _hasUserRole(uint256 tokenId, address user, uint8 role) internal view returns (bool userHasRole) { userHasRole = (uint256($tokenIdToNonceToUserToRoles[tokenId][DEFAULT_NONCE][user]) >> role) & 1 != 0; } /// @notice Revokes all roles for a user on a given token. function _revokeAllRolesForUser(uint256 tokenId, address user) internal { if ($tokenIdToNonceToUserToRoles[tokenId][DEFAULT_NONCE][user] == 0) { revert ERC721UserRoles_User_Has_No_Roles(); } delete $tokenIdToNonceToUserToRoles[tokenId][DEFAULT_NONCE][user]; emit UserRolesRevoked(tokenId, user); } /** * @notice This empty reserved space is put in place to allow future versions to add new variables without shifting * down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps * @dev This file uses a total of 200 slots. */ uint256[199] private __gap; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; /// Constant values shared across mixins. /** * @dev 100% in basis points. */ uint256 constant BASIS_POINTS = 10_000; /** * @dev The default admin role defined by OZ ACL modules. */ bytes32 constant DEFAULT_ADMIN_ROLE = 0x00; //////////////////////////////////////////////////////////////// // Royalties & Take Rates //////////////////////////////////////////////////////////////// /** * @dev The max take rate an exhibition can have. */ uint256 constant MAX_WORLD_TAKE_RATE = 5_000; /** * @dev Cap the number of royalty recipients. * A cap is required to ensure gas costs are not too high when a sale is settled. */ uint256 constant MAX_ROYALTY_RECIPIENTS = 5; /** * @dev Default royalty cut paid out on secondary sales. * Set to 10% of the secondary sale. */ uint96 constant ROYALTY_IN_BASIS_POINTS = 1_000; /** * @dev Reward paid to referrers when a sale is made. * Set to 1% of the sale amount. This 1% is deducted from the protocol fee. */ uint96 constant BUY_REFERRER_IN_BASIS_POINTS = 100; /** * @dev 10%, expressed as a denominator for more efficient calculations. */ uint256 constant ROYALTY_RATIO = BASIS_POINTS / ROYALTY_IN_BASIS_POINTS; /** * @dev 1%, expressed as a denominator for more efficient calculations. */ uint256 constant BUY_REFERRER_RATIO = BASIS_POINTS / BUY_REFERRER_IN_BASIS_POINTS; //////////////////////////////////////////////////////////////// // Gas Limits //////////////////////////////////////////////////////////////// /** * @dev The gas limit used when making external read-only calls. * This helps to ensure that external calls does not prevent the market from executing. */ uint256 constant READ_ONLY_GAS_LIMIT = 40_000; /** * @dev The gas limit to send ETH to multiple recipients, enough for a 5-way split. */ uint256 constant SEND_VALUE_GAS_LIMIT_MULTIPLE_RECIPIENTS = 210_000; /** * @dev The gas limit to send ETH to a single recipient, enough for a contract with a simple receiver. */ uint256 constant SEND_VALUE_GAS_LIMIT_SINGLE_RECIPIENT = 20_000; //////////////////////////////////////////////////////////////// // Collection Type Names //////////////////////////////////////////////////////////////// /** * @dev The NFT collection type. */ string constant NFT_COLLECTION_TYPE = "NFT Collection"; /** * @dev The NFT drop collection type. */ string constant NFT_DROP_COLLECTION_TYPE = "NFT Drop Collection"; /** * @dev The NFT timed edition collection type. */ string constant NFT_TIMED_EDITION_COLLECTION_TYPE = "NFT Timed Edition Collection"; /** * @dev The NFT limited edition collection type. */ string constant NFT_LIMITED_EDITION_COLLECTION_TYPE = "NFT Limited Edition Collection"; //////////////////////////////////////////////////////////////// // Business Logic //////////////////////////////////////////////////////////////// /** * @dev Limits scheduled start/end times to be less than 2 years in the future. */ uint256 constant MAX_SCHEDULED_TIME_IN_THE_FUTURE = 365 days * 2; /** * @dev The minimum increase of 10% required when making an offer or placing a bid. */ uint256 constant MIN_PERCENT_INCREMENT_DENOMINATOR = BASIS_POINTS / 1_000; /** * @dev Protocol fee for edition mints in basis points. */ uint256 constant EDITION_PROTOCOL_FEE_IN_BASIS_POINTS = 500; /** * @dev Hash of the edition type names. * This is precalculated in order to save gas on use. * `keccak256(abi.encodePacked(NFT_TIMED_EDITION_COLLECTION_TYPE))` */ bytes32 constant timedEditionTypeHash = 0xee2afa3f960e108aca17013728aafa363a0f4485661d9b6f41c6b4ddb55008ee; bytes32 constant limitedEditionTypeHash = 0x7df1f68d01ab1a6ee0448a4c3fbda832177331ff72c471b12b0051c96742eef5;
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { IDelegateView } from "../../interfaces/internal/IDelegateView.sol"; /** * @title Helper functions for using delegatecall in order to move some logic to another contract, saving space. * @author HardlyDifficult */ abstract contract DelegateForwarder { error DelegateForwarder_For_Internal_Use_Only(); /** * @notice Delegates the current call to `implementation`. * @param implementation The contract to delegate calls to. * @dev This function does not return to its internal call site, it will return directly to the external caller. * From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0/contracts/proxy/Proxy.sol#L22 */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @notice Used internally in order to delegate a call to `implementation` in a read-only context. The return data * or revert reason is returned directly to the external caller. * @dev Execution ends after calling this helper function. * @param implementation The contract to delegate calls to. */ function _delegateView(address implementation) internal view { (bool success, ) = address(this).staticcall( abi.encodePacked(IDelegateView._delegateView.selector, msg.data, implementation) ); assembly { // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch success // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @notice An external function used by the helper above. This allows us to call delegatecall in a read-only context, * but it loses the relevant msg.sender. * @dev This is only callable by this contract. */ function _delegateView() external { if (msg.sender != address(this)) { revert DelegateForwarder_For_Internal_Use_Only(); } assembly { // The relevant msg.data is sandwiched between a 4-byte selector and a 20-byte address. let size := sub(calldatasize(), 24) // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 4, size) // Load the implementation address from the end of the calldata. let implementation := shr(96, calldataload(sub(calldatasize(), 20))) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, size, 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } // This mixin uses 0 slots. }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "../../interfaces/internal/roles/IAdminRole.sol"; import "../../interfaces/internal/roles/IOperatorRole.sol"; /** * @title Stores a reference to Foundation's treasury contract for other mixins to leverage. * @notice The treasury collects fees and defines admin/operator roles. * @author batu-inal & HardlyDifficult */ abstract contract FoundationTreasuryNode { using AddressUpgradeable for address payable; /// @notice The address of the treasury contract. address payable private immutable treasury; error FoundationTreasuryNode_Address_Is_Not_A_Contract(); error FoundationTreasuryNode_Caller_Not_Admin(); /// @notice Requires the caller is a Foundation admin. modifier onlyFoundationAdmin() { if (!IAdminRole(treasury).isAdmin(msg.sender)) { revert FoundationTreasuryNode_Caller_Not_Admin(); } _; } /** * @notice Set immutable variables for the implementation contract. * @dev Assigns the treasury contract address. */ constructor(address payable _treasury) { if (!_treasury.isContract()) { revert FoundationTreasuryNode_Address_Is_Not_A_Contract(); } treasury = _treasury; } /** * @notice Gets the Foundation treasury contract. * @dev This call is used in the royalty registry contract. * @return treasuryAddress The address of the Foundation treasury contract. */ function getFoundationTreasury() public view returns (address payable treasuryAddress) { treasuryAddress = treasury; } // This mixin uses 0 slots. }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; /** * @title Stores a reference to Foundation's NFTDropMarket contract for other mixins to leverage. * @author HardlyDifficult */ abstract contract NFTDropMarketNode { using AddressUpgradeable for address; address internal immutable nftDropMarket; error NFTDropMarketNode_Address_Is_Not_A_Contract(); constructor(address _nftDropMarket) { if (!_nftDropMarket.isContract()) { revert NFTDropMarketNode_Address_Is_Not_A_Contract(); } nftDropMarket = _nftDropMarket; } /** * @notice Returns the address of the NFTDropMarket contract. */ function getNftDropMarketAddress() external view returns (address market) { market = nftDropMarket; } // This mixin uses 0 slots. }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; /** * @title Stores a reference to Foundation's NFTMarket contract for other mixins to leverage. * @author HardlyDifficult */ abstract contract NFTMarketNode { using AddressUpgradeable for address; address internal immutable nftMarket; error NFTMarketNode_Address_Is_Not_A_Contract(); constructor(address _nftMarket) { if (!_nftMarket.isContract()) { revert NFTMarketNode_Address_Is_Not_A_Contract(); } nftMarket = _nftMarket; } /** * @notice Returns the address of the NFTMarket contract. */ function getNftMarketAddress() external view returns (address market) { market = nftMarket; } // This mixin uses 0 slots. }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "../../libraries/RouteCallLibrary.sol"; /** * @title Enables trusted contracts to override the usual msg.sender address. * @author HardlyDifficult & reggieag */ abstract contract RouterContextTriple is ContextUpgradeable { using AddressUpgradeable for address; address private immutable approvedRouterA; address private immutable approvedRouterB; address private immutable approvedRouterC; error RouterContextTriple_Address_Is_Not_A_Contract(); constructor(address routerA, address routerB, address routerC) { if (!routerA.isContract()) { revert RouterContextTriple_Address_Is_Not_A_Contract(); } if (!routerB.isContract()) { revert RouterContextTriple_Address_Is_Not_A_Contract(); } if (!routerC.isContract()) { revert RouterContextTriple_Address_Is_Not_A_Contract(); } approvedRouterA = routerA; approvedRouterB = routerB; approvedRouterC = routerC; } /** * @notice Returns the contracts which are able to override the msg.sender address. * @return routerA The address of the 1st trusted router. * @return routerB The address of the 2nd trusted router. * @return routerC The address of the 3rd trusted router. */ function getApprovedRouterAddresses() external view returns (address routerA, address routerB, address routerC) { routerA = approvedRouterA; routerB = approvedRouterB; routerC = approvedRouterC; } /** * @notice Gets the sender of the transaction to use, overriding the usual msg.sender if the caller is a trusted * router. * @dev If the msg.sender is a trusted router contract, then the last 20 bytes of the calldata represents the * authorized sender to use. * If this is used for a call that was not routed with `routeCallTo`, the address returned will be incorrect (and * may be address(0)). */ function _msgSender() internal view virtual override returns (address sender) { sender = super._msgSender(); if (sender == approvedRouterA || sender == approvedRouterB || sender == approvedRouterC) { sender = RouteCallLibrary.extractAppendedSenderAddress(); } } // This mixin uses 0 slots. }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { MAX_WORLD_TAKE_RATE } from "../shared/Constants.sol"; import { WorldsAllowlistBySeller } from "./WorldsAllowlistBySeller.sol"; /** * @title Coordinates worlds permissions across potentially several allowlist types. * @author HardlyDifficult */ abstract contract WorldsAllowlist is WorldsAllowlistBySeller { error WorldsAllowlist_Take_Rate_Above_Max(uint256 maxTakeRate); /// @notice Reverts if a requested inventory addition is not allowed. modifier onlyAllowedInventoryAddition(uint256 worldId, uint16 takeRateInBasisPoints) { _requireMinted(worldId); if (takeRateInBasisPoints > MAX_WORLD_TAKE_RATE) { revert WorldsAllowlist_Take_Rate_Above_Max(MAX_WORLD_TAKE_RATE); } _authorizeBySeller(worldId, takeRateInBasisPoints, _msgSender()); _; } /** * @notice This empty reserved space is put in place to allow future versions to add new variables without shifting * down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps * @dev This file uses a total of 10,000 slots. */ uint256[10_000] private __gap; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { ERC721Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import { IWorldsNFTMarket } from "../../interfaces/internal/IWorldsNFTMarket.sol"; import { WorldsPaymentInfo } from "./WorldsPaymentInfo.sol"; import { WorldsUserRoles } from "./WorldsUserRoles.sol"; /** * @title Allows curators to grant permissions to list with a World, authorized by the NFT's seller's address. * @author HardlyDifficult */ abstract contract WorldsAllowlistBySeller is IWorldsNFTMarket, WorldsUserRoles, WorldsPaymentInfo { struct SellerPermissions { bool isAllowed; // Per-seller take rates and other configuration may be added in the future. } /// @notice Stores permissions for individual sellers on a per-World basis. mapping(uint256 worldId => mapping(address seller => SellerPermissions permissions)) private $worldIdToSellerToPermissions; /** * @notice Emitted when a seller is added to an allowlist. * @param worldId The World the seller was added to. * @param seller The seller which was given permissions to list with a World. */ event AddToAllowlistBySeller(uint256 indexed worldId, address indexed seller); /** * @notice Emitted when a seller is removed from an allowlist. * @param worldId The World the seller was removed from. * @param seller The seller which was removed from the allowlist. */ event RemoveFromAllowlistBySeller(uint256 indexed worldId, address indexed seller); error WorldsAllowlistBySeller_Address_0_May_Not_Be_Added(); error WorldsAllowlistBySeller_No_Sellers_Provided(); error WorldsAllowlistBySeller_Seller_Already_On_Allowlist(); error WorldsAllowlistBySeller_Seller_Not_Allowed(); error WorldsAllowlistBySeller_Take_Rate_Too_Low(uint16 minimumTakeRateInBasisPoints); //////////////////////////////////////////////////////////////// // Management //////////////////////////////////////////////////////////////// /** * @notice Adds a seller to the allowlist for a World. * @param worldId The World the seller is being added to. * @param seller The seller to give permissions to list with a World. * @dev Callable by the World owner, admin, or editor. */ function addToAllowlistBySeller(uint256 worldId, address seller) external onlyEditor(worldId) { _addToAllowlistBySeller(worldId, seller); } /** * @notice Adds a list of sellers to the allowlist for a World. * @param worldId The World the seller is being added to. * @param sellers The list of sellers to give permissions to list with a World. * @dev Callable by the World owner, admin, or editor. */ function addToAllowlistBySellers(uint256 worldId, address[] calldata sellers) external onlyEditor(worldId) { if (sellers.length == 0) { revert WorldsAllowlistBySeller_No_Sellers_Provided(); } _addToAllowlistBySellers(worldId, sellers); } /// @dev Assumes that permission checks have already been performed. function _addToAllowlistBySellers(uint256 worldId, address[] calldata sellers) internal { for (uint256 i = 0; i < sellers.length; ++i) { _addToAllowlistBySeller(worldId, sellers[i]); } } function _addToAllowlistBySeller(uint256 worldId, address seller) internal { if (seller == address(0)) { revert WorldsAllowlistBySeller_Address_0_May_Not_Be_Added(); } SellerPermissions storage permissions = $worldIdToSellerToPermissions[worldId][seller]; if (permissions.isAllowed) { revert WorldsAllowlistBySeller_Seller_Already_On_Allowlist(); } permissions.isAllowed = true; emit AddToAllowlistBySeller(worldId, seller); } /** * @notice Removes a seller from the allowlist for a World. * @param worldId The World the seller is being removed from. * @param seller The seller to remove permissions to list with a World. * @dev Callable by the World owner, admin, or editor. */ function removeFromAllowlistBySeller(uint256 worldId, address seller) external onlyEditor(worldId) { SellerPermissions storage permissions = $worldIdToSellerToPermissions[worldId][seller]; if (!permissions.isAllowed) { revert WorldsAllowlistBySeller_Seller_Not_Allowed(); } delete $worldIdToSellerToPermissions[worldId][seller]; emit RemoveFromAllowlistBySeller(worldId, seller); } //////////////////////////////////////////////////////////////// // Authorization //////////////////////////////////////////////////////////////// /** * @notice Reverts if the seller is not allowed to list with a World. * @param worldId The World the seller is trying to list with. * @param seller The seller trying to list with a World. */ function _authorizeBySeller(uint256 worldId, uint16 takeRateInBasisPoints, address seller) internal view { if (!$worldIdToSellerToPermissions[worldId][seller].isAllowed) { revert WorldsAllowlistBySeller_Seller_Not_Allowed(); } if (takeRateInBasisPoints < getDefaultTakeRate(worldId)) { revert WorldsAllowlistBySeller_Take_Rate_Too_Low(getDefaultTakeRate(worldId)); } } /** * @notice Returns true if the seller is allowed to list with a World. * @param worldId The World the seller is trying to list with. * @param seller The seller trying to list with a World. * @dev Always returns false if the World DNE or has been burned. */ function isSellerAllowed(uint256 worldId, address seller) external view returns (bool isAllowed) { if (_ownerOf(worldId) != address(0)) { isAllowed = $worldIdToSellerToPermissions[worldId][seller].isAllowed; } } //////////////////////////////////////////////////////////////// // Inheritance Requirements // (no-ops to avoid compile errors) //////////////////////////////////////////////////////////////// function _burn(uint256 tokenId) internal virtual override(ERC721Upgradeable, WorldsPaymentInfo) { super._burn(tokenId); } /** * @notice This empty reserved space is put in place to allow future versions to add new variables without shifting * down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps * @dev This file uses a total of 1,000 slots. */ uint256[999] private __gap; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; /** * @title A place for common modifiers and functions used by various Worlds mixins, if any. * @author HardlyDifficult */ abstract contract WorldsCore { /** * @notice This empty reserved space is put in place to allow future versions to add new variables without shifting * down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps * @dev This file uses a total of 10,000 slots. */ uint256[10_000] private __gap; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { SafeCast } from "@openzeppelin/contracts-v5/utils/math/SafeCast.sol"; import { IWorldsDropMarket } from "../../interfaces/internal/IWorldsDropMarket.sol"; import { WorldsAllowlist } from "./WorldsAllowlist.sol"; /** * @title Allows listing collections with a World. * @author HardlyDifficult */ abstract contract WorldsInventoryByCollection is IWorldsDropMarket, WorldsAllowlist { using SafeCast for uint256; struct CollectionInventorySettings { uint32 worldId; uint16 takeRateInBasisPoints; } /// @notice The settings for each Collection that is listed with a World. mapping(address seller => mapping(address nftContract => CollectionInventorySettings settings)) private $sellerToNftContractToSettings; /** * @notice Emitted when an NFT Collection is added to a World. * @param worldId The ID of the World that the NFT Collection was added to. * @param seller The address of the seller that added the NFT Collection to the World. * @param nftContract The address of the collection that was added to the World. * @param takeRateInBasisPoints The take rate the seller agreed to pay if the NFT Collection is sold. * @param listingIdentifier An optional, curator approved identifier for this listing. */ event AddToWorldByCollection( uint256 indexed worldId, address indexed seller, address indexed nftContract, uint16 takeRateInBasisPoints, string listingIdentifier ); /** * @notice Emitted when NFT(s) from a collection in a World is sold. * @param worldId The ID of the World that was credited with the sale. * @param marketplace The address of the marketplace that sold the NFT(s). * @param seller The address of the seller that added the NFT Collection to the World. * @param nftContract The address of the collection that was added to the World. * @param count The number of NFT(s) sold. * @param totalSalePrice The total sale price of the NFT(s) sold. * @param takeRateInBasisPoints The take rate the seller agreed to pay when NFTs are sold. */ event SoldInWorldByCollection( uint256 indexed worldId, address indexed marketplace, address indexed seller, address nftContract, uint256 count, uint256 totalSalePrice, uint16 takeRateInBasisPoints ); error WorldsInventoryByCollection_Already_In_This_World(); //////////////////////////////////////////////////////////////// // Inventory Management //////////////////////////////////////////////////////////////// /** * @notice Add an NFT Collection to a World for the msg.sender as the seller. * @dev A trusted router can select the seller which is used here. * @param worldId The ID of the World to add the NFT Collection to. * @param nftContract The address of the NFT Collection to add to the World. * @param takeRateInBasisPoints The take rate the seller agrees to pay if the NFT Collection is sold. */ function addToWorldByCollection( uint256 worldId, address nftContract, uint16 takeRateInBasisPoints ) external onlyAllowedInventoryAddition(worldId, takeRateInBasisPoints) { _addToWorldByCollection(worldId, _msgSender(), nftContract, takeRateInBasisPoints); } function _addToWorldByCollection( uint256 worldId, address seller, address nftContract, uint16 takeRateInBasisPoints ) internal { if ( worldId == $sellerToNftContractToSettings[seller][nftContract].worldId && takeRateInBasisPoints == $sellerToNftContractToSettings[seller][nftContract].takeRateInBasisPoints ) { // Revert if the request is a no-op. revert WorldsInventoryByCollection_Already_In_This_World(); } $sellerToNftContractToSettings[seller][nftContract] = CollectionInventorySettings( worldId.toUint32(), takeRateInBasisPoints ); emit AddToWorldByCollection(worldId, seller, nftContract, takeRateInBasisPoints, ""); } /** * @notice Returns the World association for an NFT Collection that is listed with a World, or zeros if not listed. * @param nftContract The address of the NFT Collection that was added to the World. * @param seller The address of the seller that added the NFT Collection to the World. * @return worldId The ID of the World that the NFT Collection was added to. * @return takeRateInBasisPoints The take rate the seller agreed to pay if the NFT Collection is sold. */ function getAssociationByCollection( address nftContract, address seller ) external view returns (uint256 worldId, uint16 takeRateInBasisPoints) { worldId = $sellerToNftContractToSettings[seller][nftContract].worldId; if (_ownerOf(worldId) != address(0)) { // If a World association was found and has not been burned, then return the take rate as well. takeRateInBasisPoints = $sellerToNftContractToSettings[seller][nftContract].takeRateInBasisPoints; } else { // Otherwise return (0, 0). worldId = 0; } } //////////////////////////////////////////////////////////////// // Sales //////////////////////////////////////////////////////////////// /** * @notice Called by the marketplace when an NFT is sold, emitting sale details and returning the expected payment * info. * @param seller The address of the seller that added the NFT Collection to the World. * @param nftContract The address of the collection that was added to the World. * @param count The number of NFT(s) sold. * @param totalSalePrice The total sale price of the NFT(s) sold. * @return worldId The ID of the World that was credited with the sale. * @return worldPaymentAddress The address that should receive the payment for the sale. * @return takeRateInBasisPoints The take rate the seller agreed to pay when NFTs are sold. */ function soldInWorldByCollection( address seller, address nftContract, uint256 count, uint256 totalSalePrice ) external returns (uint256 worldId, address payable worldPaymentAddress, uint16 takeRateInBasisPoints) { worldId = $sellerToNftContractToSettings[seller][nftContract].worldId; if (worldId != 0) { worldPaymentAddress = getPaymentAddress(worldId); if (worldPaymentAddress == address(0)) { // The World has since been burned, so ignore the relationship. worldId = 0; worldPaymentAddress = payable(0); } else { takeRateInBasisPoints = $sellerToNftContractToSettings[seller][nftContract].takeRateInBasisPoints; emit SoldInWorldByCollection({ worldId: worldId, marketplace: msg.sender, seller: seller, nftContract: nftContract, count: count, totalSalePrice: totalSalePrice, takeRateInBasisPoints: takeRateInBasisPoints }); } } } /** * @notice This empty reserved space is put in place to allow future versions to add new variables without shifting * down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps * @dev This file uses a total of 500 slots. */ uint256[499] private __gap; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { SafeCast } from "@openzeppelin/contracts-v5/utils/math/SafeCast.sol"; import { IWorldsNFTMarket } from "../../interfaces/internal/IWorldsNFTMarket.sol"; import { WorldsAllowlist } from "./WorldsAllowlist.sol"; /** * @title Allows listing NFTs with a World. * @author HardlyDifficult */ abstract contract WorldsInventoryByNft is IWorldsNFTMarket, WorldsAllowlist { using SafeCast for uint256; struct NftInventorySettings { uint32 worldId; uint16 takeRateInBasisPoints; } /// @notice The settings for each NFT that is listed with a World. // solhint-disable-next-line max-line-length mapping(address seller => mapping(address nftContract => mapping(uint256 nftTokenId => NftInventorySettings settings))) private $sellerToNftContractToTokenIdToSettings; /** * @notice Emitted when an NFT is added to a World. * @param worldId The ID of the World that the NFT was added to. * @param seller The address of the seller that added the NFT to the World. * @param nftContract The address of the collection for the NFT that was added to the World. * @param nftTokenId The tokenID of the NFT that was added to the World. * @param takeRateInBasisPoints The take rate the seller agreed to pay if the NFT is sold. * @param listingIdentifier An optional, curator approved identifier for this listing. */ event AddToWorldByNft( uint256 indexed worldId, address indexed seller, address indexed nftContract, uint256 nftTokenId, uint16 takeRateInBasisPoints, string listingIdentifier ); /** * @notice Emitted when an NFT is remove from a World. * @param worldId The ID of the World that the NFT was previous a part of. * @param seller The address of the seller that removed the NFT from the World. * @param nftContract The address of the collection for the NFT that was removed from the World. * @param nftTokenId The tokenID of the NFT that was removed from the World. */ event RemoveFromWorldByNft( uint256 indexed worldId, address indexed seller, address indexed nftContract, uint256 nftTokenId ); /** * @notice Emitted when an NFT in a World is sold. * @param worldId The ID of the World that was credited with the sale. * @param marketplace The address of the marketplace that sold the NFT. * @param seller The address of the seller that added the NFT to the World. * @param nftContract The address of the collection for the NFT that was added to the World. * @param nftTokenId The tokenID of the NFT that was added to the World. * @param buyer The address of the buyer that purchased the NFT. * @param salePrice The total sale price of the NFT sold. * @param takeRateInBasisPoints The take rate the seller agreed to pay when NFTs are sold. */ event SoldInWorldByNft( uint256 indexed worldId, address indexed marketplace, address indexed seller, address nftContract, uint256 nftTokenId, address buyer, uint256 salePrice, uint16 takeRateInBasisPoints ); error WorldsInventoryByNft_Already_In_This_World(); error WorldsInventoryByNft_Not_In_A_World(); //////////////////////////////////////////////////////////////// // Inventory Management //////////////////////////////////////////////////////////////// /** * @notice Add an NFT to a World for the msg.sender as the seller. * @dev A trusted router can select the seller which is used here. * @param worldId The ID of the World to add the NFT to. * @param nftContract The address of the collection for the NFT to add to the World. * @param nftTokenId The tokenID of the NFT to add to the World. * @param takeRateInBasisPoints The take rate the seller agrees to pay if the NFT is sold. */ function addToWorldByNft( uint256 worldId, address nftContract, uint256 nftTokenId, uint16 takeRateInBasisPoints ) external onlyAllowedInventoryAddition(worldId, takeRateInBasisPoints) { _addToWorldByNft(worldId, _msgSender(), nftContract, nftTokenId, takeRateInBasisPoints); } function _addToWorldByNft( uint256 worldId, address seller, address nftContract, uint256 nftTokenId, uint16 takeRateInBasisPoints ) internal { if ( worldId == $sellerToNftContractToTokenIdToSettings[seller][nftContract][nftTokenId].worldId && takeRateInBasisPoints == $sellerToNftContractToTokenIdToSettings[seller][nftContract][nftTokenId].takeRateInBasisPoints ) { // Revert if the request is a no-op. revert WorldsInventoryByNft_Already_In_This_World(); } $sellerToNftContractToTokenIdToSettings[seller][nftContract][nftTokenId] = NftInventorySettings( worldId.toUint32(), takeRateInBasisPoints ); emit AddToWorldByNft(worldId, seller, nftContract, nftTokenId, takeRateInBasisPoints, ""); } /** * @notice Remove an NFT from a World for the sender as the seller. * @param nftContract The address of the collection for the NFT to remove from the World it currently belongs to. * @param nftTokenId The tokenID of the NFT to remove from the World it currently belongs to. */ function removeFromWorldByNft(address nftContract, uint256 nftTokenId) external { address seller = _msgSender(); uint256 previousWorldId = $sellerToNftContractToTokenIdToSettings[seller][nftContract][nftTokenId].worldId; if (previousWorldId == 0) { revert WorldsInventoryByNft_Not_In_A_World(); } delete $sellerToNftContractToTokenIdToSettings[seller][nftContract][nftTokenId]; emit RemoveFromWorldByNft(previousWorldId, seller, nftContract, nftTokenId); } /** * @notice Returns the World association for an NFT that is listed with a World, or zeros if not listed. * @param nftContract The address of the collection for the NFT that was added to a World. * @param nftTokenId The tokenID of the NFT that was added to a World. * @param seller The address of the seller that added the NFT to a World. * @return worldId The ID of the World that the NFT was added to. * @return takeRateInBasisPoints The take rate the seller agreed to pay if the NFT is sold. */ function getAssociationByNft( address nftContract, uint256 nftTokenId, address seller ) external view returns (uint256 worldId, uint16 takeRateInBasisPoints) { worldId = $sellerToNftContractToTokenIdToSettings[seller][nftContract][nftTokenId].worldId; if (worldId != 0 && _ownerOf(worldId) != address(0)) { // If a World association was found and has not been burned, then return the take rate as well. takeRateInBasisPoints = $sellerToNftContractToTokenIdToSettings[seller][nftContract][nftTokenId] .takeRateInBasisPoints; } else { // Otherwise return (0, 0). worldId = 0; } } //////////////////////////////////////////////////////////////// // Sales //////////////////////////////////////////////////////////////// /** * @notice Called by the marketplace when an NFT is sold, emitting sale details and returning the expected payment * info. * @param seller The address of the seller that added the NFT to the World. * @param nftContract The address of the collection that was added to the World. * @param nftTokenId The tokenID of the NFT that was added to the World. * @param buyer The address of the buyer that purchased the NFT. * @param salePrice The sale price of the NFT sold. * @return worldId The ID of the World that was credited with the sale. * @return worldPaymentAddress The address that should receive the payment for the sale. * @return takeRateInBasisPoints The take rate the seller agreed to pay when NFTs are sold. */ function soldInWorldByNft( address seller, address nftContract, uint256 nftTokenId, address buyer, uint256 salePrice ) external returns (uint256 worldId, address payable worldPaymentAddress, uint16 takeRateInBasisPoints) { worldId = $sellerToNftContractToTokenIdToSettings[seller][nftContract][nftTokenId].worldId; if (worldId != 0) { worldPaymentAddress = getPaymentAddress(worldId); if (worldPaymentAddress == address(0)) { // The World has since been burned, so ignore the relationship. worldId = 0; worldPaymentAddress = payable(0); } else { takeRateInBasisPoints = $sellerToNftContractToTokenIdToSettings[seller][nftContract][nftTokenId] .takeRateInBasisPoints; // Cannot clear on sale here since the market is not authorized emit SoldInWorldByNft( worldId, msg.sender, seller, nftContract, nftTokenId, buyer, salePrice, takeRateInBasisPoints ); } } } /** * @notice This empty reserved space is put in place to allow future versions to add new variables without shifting * down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps * @dev This file uses a total of 1,000 slots. */ uint256[999] private __gap; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { IOwnable } from "../../interfaces/standards/IOwnable.sol"; import { IWorldSplit } from "../../interfaces/internal/IWorldSplit.sol"; import { IWorldsInventoryBySplit } from "../../interfaces/internal/IWorldsInventoryBySplit.sol"; import { AddressUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import { Clones } from "@openzeppelin/contracts-v5/proxy/Clones.sol"; import { SafeCast } from "@openzeppelin/contracts-v5/utils/math/SafeCast.sol"; import { WorldsAllowlist } from "./WorldsAllowlist.sol"; import { BASIS_POINTS } from "../shared/Constants.sol"; /** * @title Allows listing collections with a World which uses a split contract to share revenue with the World curator. * @author HardlyDifficult */ abstract contract WorldsInventoryBySplit is IWorldsInventoryBySplit, WorldsAllowlist { using AddressUpgradeable for address; using Clones for address; using SafeCast for uint256; /// @notice Stores the configuration for each active World Split contract. struct SplitInventorySettings { address nftContract; uint32 worldId; uint16 takeRateInBasisPoints; address seller; } /// @notice Stores the World Split address by seller & nftContract. mapping(address seller => mapping(address nftContract => address payable split)) private $sellerToNftContractToSplit; /// @notice Stores the configuration for each active World Split contract. mapping(address split => SplitInventorySettings settings) private $splitToSettings; /// @notice The template used when creating new World Split contracts. address private immutable splitTemplate; /** * @notice Emitted when a collection is added to a World using a World Split contract for payments. * @param worldId The ID of the World that the NFT Collection was added to. * @param seller The address of the seller that added the NFT Collection to the World. * @param nftContract The address of the NFT Collection that was added to the World. * @param split The address of the contract that was created for this listing where payments should be sent. * @param takeRateInBasisPoints The take rate the seller agrees to pay if the NFT Collection is sold. * @param listingIdentifier An optional, curator approved identifier for this listing. */ event AddToWorldBySplit( uint256 indexed worldId, address indexed seller, address indexed nftContract, address split, uint16 takeRateInBasisPoints, string listingIdentifier ); /** * @notice Emitted when a sale occurs in a World using a World Split contract for payments. * @param worldId The ID of the World that the NFT Collection was added to. * @param marketplace The address of the marketplace where the sale occurred. * @param split The address of the World Split contract that was used for this sale. * @param valueInWei The amount of ETH that was sent to the split contract. * @param curatorTakeInWei The amount of ETH that should be sent to the World's payment address. */ event SoldInWorldBySplit( uint256 indexed worldId, address indexed marketplace, address indexed split, uint256 valueInWei, uint256 curatorTakeInWei ); /** * @notice Emitted when a sale occurs in a World using a World Split contract for payments, but the payment to the * World's payment address reverts. When this occurs, funds which would have gone to the World are sent to the creator * instead. * @param worldId The ID of the World that the NFT Collection was added to. * @param marketplace The address of the marketplace where the sale occurred. * @param split The address of the World Split contract that was used for this sale. * @param worldPaymentAddress The address of the World's payment address. * @param valueInWei The amount of ETH that was sent to the split contract. * @param curatorTakeInWei The amount of ETH that should be sent to the World's payment address. */ event SoldInWorldBySplitWorldPaymentFailed( uint256 indexed worldId, address indexed marketplace, address indexed split, address worldPaymentAddress, uint256 valueInWei, uint256 curatorTakeInWei ); error WorldsInventoryBySplit_Already_In_This_World(); error WorldsInventoryBySplit_Not_A_Valid_Split(); error WorldsInventoryBySplit_Not_Listed_In_A_World(); error WorldsInventoryBySplit_Split_Implementation_Not_A_Contract(); //////////////////////////////////////////////////////////////// // Setup //////////////////////////////////////////////////////////////// constructor(address _splitTemplate) { if (!_splitTemplate.isContract()) { revert WorldsInventoryBySplit_Split_Implementation_Not_A_Contract(); } splitTemplate = _splitTemplate; } /** * @notice Returns the World Split template used when new splits are created. */ function getWorldSplitTemplateAddress() external view returns (address worldSplitTemplate) { worldSplitTemplate = splitTemplate; } //////////////////////////////////////////////////////////////// // Inventory Management //////////////////////////////////////////////////////////////// /** * @notice Associate a collection with a World by way of a World Split contract. * @dev This function may be used to change associated worlds, take rate, or payment address. * If the payment address changes, a new split is created, otherwise it will reuse the existing split contract. * @param worldId The ID of the World to add the NFT Collection to. * @param nftContract The address of the NFT Collection to add to the World. * @param takeRateInBasisPoints The take rate the seller agrees to pay if the NFT Collection is sold. * @param creatorPaymentAddress The address to receive creator revenue from sales. */ function addToWorldBySplit( uint256 worldId, address nftContract, uint16 takeRateInBasisPoints, address payable creatorPaymentAddress ) external onlyAllowedInventoryAddition(worldId, takeRateInBasisPoints) returns (address payable split) { address payable seller = payable(_msgSender()); split = $sellerToNftContractToSplit[seller][nftContract]; if (split != address(0) && (IOwnable(split).owner() == creatorPaymentAddress || creatorPaymentAddress == split)) { // An existing split has already been created and can be reused. if ( $splitToSettings[split].worldId == worldId && $splitToSettings[split].takeRateInBasisPoints == takeRateInBasisPoints ) { // Revert if the request is a no-op. revert WorldsInventoryBySplit_Already_In_This_World(); } // Otherwise update with the new configuration. $splitToSettings[split].worldId = worldId.toUint32(); $splitToSettings[split].takeRateInBasisPoints = takeRateInBasisPoints; } else { if (split != address(0)) { // A split was previously created for this seller & contract, but the payment address has changed. // Retire the old split, allowing it to fallback to sending all ETH received to the seller. delete $splitToSettings[split]; } // Create a new split contract. split = payable(splitTemplate.clone()); IWorldSplit(split).initialize(creatorPaymentAddress); // Store settings $sellerToNftContractToSplit[seller][nftContract] = split; $splitToSettings[split] = SplitInventorySettings(nftContract, worldId.toUint32(), takeRateInBasisPoints, seller); } emit AddToWorldBySplit(worldId, seller, nftContract, split, takeRateInBasisPoints, ""); } /** * @notice Returns the World association for an NFT Collection that is listed with a World via a World Split or zeros * if not listed. * @param nftContract The address of the NFT Collection that was added to the World. * @param seller The address of the seller that added the NFT Collection to the World. * @return split The address of the World Split contract that was created for this listing. * @return worldId The ID of the World that the NFT Collection was added to. * @return takeRateInBasisPoints The take rate the seller agreed to pay if the NFT Collection is sold. */ function getAssociationBySplit( address nftContract, address seller ) external view returns (address payable split, uint256 worldId, uint16 takeRateInBasisPoints) { split = $sellerToNftContractToSplit[seller][nftContract]; if (split != address(0)) { worldId = $splitToSettings[split].worldId; if (_ownerOf(worldId) != address(0)) { // If a World association was found and has not been burned, then return the take rate as well. takeRateInBasisPoints = $splitToSettings[split].takeRateInBasisPoints; } else { // Otherwise return (split, 0, 0). worldId = 0; } } } /** * @notice Returns the World association for a World Split contract, or zeros if not currently listed. * @param split The address of the World Split contract that was created for this listing. * @return worldId The ID of the World that the NFT Collection was added to. * @return nftContract The address of the NFT Collection that was added to the World. * @return seller The address of the seller that added the NFT Collection to the World. * @return takeRateInBasisPoints The take rate the seller agreed to pay if the NFT Collection is sold. */ function getAssociationBySplitAddress( address split ) external view returns (uint256 worldId, address nftContract, address seller, uint16 takeRateInBasisPoints) { SplitInventorySettings storage settings = $splitToSettings[split]; worldId = settings.worldId; if (_ownerOf(worldId) != address(0)) { // If a World association was found and has not been burned, then return the take rate as well. nftContract = settings.nftContract; seller = settings.seller; takeRateInBasisPoints = settings.takeRateInBasisPoints; } else { // Otherwise return zeros. worldId = 0; } } //////////////////////////////////////////////////////////////// // Sales //////////////////////////////////////////////////////////////// /** * @notice Not for direct use. * @dev Called by the split contract when a sale occurs. * @param market The address of the marketplace where the sale occurred. * @param valueInWei The amount of ETH that was sent to the split contract. * @return worldPaymentAddress The address of the World's payment address. * @return curatorTakeInWei The amount of ETH that should be sent to the World's payment address. */ function soldInWorldBySplit( address market, uint256 valueInWei ) external returns (address payable worldPaymentAddress, uint256 curatorTakeInWei) { uint256 worldId; (worldId, worldPaymentAddress, curatorTakeInWei) = _calcWorldSplit(valueInWei); emit SoldInWorldBySplit({ worldId: worldId, marketplace: market, split: msg.sender, valueInWei: valueInWei, curatorTakeInWei: curatorTakeInWei }); } /** * @notice Not for direct use. * @dev Called by the split contract if payment to the World's payment address reverts. When this occurs, funds which * would have gone to the World are sent to the creator instead. * @param market The address of the marketplace where the sale occurred. * @param valueInWei The amount of ETH that was sent to the split contract. */ function soldInWorldBySplitWorldPaymentFailed(address market, uint256 valueInWei) external { (uint256 worldId, address payable worldPaymentAddress, uint256 curatorTakeInWei) = _calcWorldSplit(valueInWei); emit SoldInWorldBySplitWorldPaymentFailed({ worldId: worldId, marketplace: market, split: msg.sender, worldPaymentAddress: worldPaymentAddress, valueInWei: valueInWei, curatorTakeInWei: curatorTakeInWei }); } /// @notice Shared logic to determine how to split the value sent to a World Split contract. function _calcWorldSplit( uint256 valueInWei ) private view returns (uint256 worldId, address payable worldPaymentAddress, uint256 curatorTakeInWei) { SplitInventorySettings storage settings = $splitToSettings[msg.sender]; worldId = settings.worldId; worldPaymentAddress = getPaymentAddress(worldId); if (worldPaymentAddress == address(0)) { if (worldId == 0) { // A more specific error message for this scenario. revert WorldsInventoryBySplit_Not_A_Valid_Split(); } // The World has since been burned. revert WorldsInventoryBySplit_Not_Listed_In_A_World(); } unchecked { // Safe math is not required since we trust the split implementation to pass forward value in terms of ETH which // will be significantly less than 256 bits and takeRateInBasisPoints is capped to 10k. curatorTakeInWei = (valueInWei * settings.takeRateInBasisPoints) / BASIS_POINTS; } } /** * @notice This empty reserved space is put in place to allow future versions to add new variables without shifting * down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps * @dev This file uses a total of 500 slots. */ uint256[498] private __gap; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { IWorldsNFTMarket } from "../../interfaces/internal/IWorldsNFTMarket.sol"; import { ERC721Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import { SafeCast } from "@openzeppelin/contracts-v5/utils/math/SafeCast.sol"; import { WorldsAllowlistBySeller } from "./WorldsAllowlistBySeller.sol"; import { WorldsMetadata } from "./WorldsMetadata.sol"; import { WorldsPaymentInfo } from "./WorldsPaymentInfo.sol"; import { WorldsUserRoles } from "./WorldsUserRoles.sol"; /** * @title Allows curators to mint and burn worlds. * @author HardlyDifficult */ abstract contract WorldsManagement is IWorldsNFTMarket, WorldsUserRoles, WorldsMetadata, WorldsPaymentInfo, WorldsAllowlistBySeller { using SafeCast for uint256; /// @notice The sequence id for worlds, set to the most recent World created. /// @dev Capping the size of this variable to 32 bits allows us to save gas by using uint32s elsewhere. uint32 private $latestWorldIdMinted; error WorldsManagement_Worlds_Not_Migrated(); /// @notice Prevent minting new worlds until the migration is complete. /// @dev This ensures og IDs are not taken before they are able to migrate. modifier onlyIfMigrated() { // Only the latter check is necessary, but the former is included to save gas in the happy path. if ($latestWorldIdMinted == 0 && _getInitializedVersion() < 2) { revert WorldsManagement_Worlds_Not_Migrated(); } _; } //////////////////////////////////////////////////////////////// // Setup //////////////////////////////////////////////////////////////// /// @notice Stores the next tokenID to use when minting new Worlds, after the migration is complete. function _initializeWorldsManagement(uint256 lastExhibitionIdCreated) internal { $latestWorldIdMinted = lastExhibitionIdCreated.toUint32(); } //////////////////////////////////////////////////////////////// // Management //////////////////////////////////////////////////////////////// /** * @notice Allows a curator to mint a new World NFT. * @param defaultTakeRateInBasisPoints The curator's take rate for sales of curated pieces in supported marketplaces. * @param worldPaymentAddress The address that will receive curator payments for the World. * @param name The World's name. */ function mint( uint16 defaultTakeRateInBasisPoints, address payable worldPaymentAddress, string calldata name ) public onlyIfMigrated returns (uint256 worldId) { // Checked math ensures that the worldId won't overflow 32 bits. worldId = ++$latestWorldIdMinted; _mintWorld(worldId, defaultTakeRateInBasisPoints, worldPaymentAddress, name); } /** * @notice Allows a curator to mint a new World NFT and populate the seller allowlist. * @param defaultTakeRateInBasisPoints The curator's take rate for sales of curated pieces in supported marketplaces. * @param worldPaymentAddress The address that will receive curator payments for the World. * @param name The World's name. * @param sellers The list of sellers to give permissions to list with a World. */ function mintWithSellerAllowlist( uint16 defaultTakeRateInBasisPoints, address payable worldPaymentAddress, string calldata name, address[] calldata sellers ) external returns (uint256 worldId) { // Checked math ensures that the worldId won't overflow 32 bits. worldId = mint(defaultTakeRateInBasisPoints, worldPaymentAddress, name); _addToAllowlistBySellers(worldId, sellers); } function _mintWorld( uint256 worldId, uint16 defaultTakeRateInBasisPoints, address payable worldPaymentAddress, string memory name ) internal { _mintWorldsPaymentInfo(worldId, defaultTakeRateInBasisPoints, worldPaymentAddress); _mintMetadata(worldId, name); _safeMint(_msgSender(), worldId); } /** * @notice Allows a curator to burn a World NFT they own. * @param worldId The id of the World NFT to burn. */ function burn(uint256 worldId) external onlyOwner(worldId) { _burn(worldId); } //////////////////////////////////////////////////////////////// // Inheritance Requirements // (no-ops to avoid compile errors) //////////////////////////////////////////////////////////////// function _burn( uint256 tokenId ) internal virtual override(ERC721Upgradeable, WorldsMetadata, WorldsPaymentInfo, WorldsAllowlistBySeller) { super._burn(tokenId); } function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721Upgradeable, WorldsMetadata) returns (bool isSupported) { isSupported = super.supportsInterface(interfaceId); } function tokenURI( uint256 worldId ) public view virtual override(ERC721Upgradeable, WorldsMetadata) returns (string memory uri) { uri = super.tokenURI(worldId); } /** * @notice This empty reserved space is put in place to allow future versions to add new variables without shifting * down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps * @dev This file uses a total of 1,000 slots. */ uint256[999] private __gap; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { IWorldsNFTMarket } from "../../interfaces/internal/IWorldsNFTMarket.sol"; import { ERC721Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import { DelegateForwarder } from "../shared/DelegateForwarder.sol"; import { ERC4906 } from "../collections/ERC4906.sol"; import { ERC721UserRoles } from "../roles/ERC721UserRoles.sol"; import { WorldsCore } from "./WorldsCore.sol"; import { WorldsUserRoles } from "./WorldsUserRoles.sol"; /** * @title Defines a unique tokenURI for each World NFT. * @author HardlyDifficult */ abstract contract WorldsMetadata is IWorldsNFTMarket, DelegateForwarder, ERC721Upgradeable, ERC4906, ERC721UserRoles, WorldsCore, WorldsUserRoles { /// @notice Stores the name of each World. mapping(uint256 worldId => string name) private $worldIdToName; /// @notice An admin managed template for the tokenURI image of each World. string private $svgTemplate; address private immutable metadataDelegate; error WorldsMetadata_Invalid_Svg_Template(); error WorldsMetadata_Name_Already_Set(); error WorldsMetadata_Name_Required(); error WorldsMetadata_Svg_Template_Already_Set(); //////////////////////////////////////////////////////////////// // Setup //////////////////////////////////////////////////////////////// /** * @notice Set immutable variables for the implementation contract. * @param _worldsMetadataDelegate The contract which will handle some metadata requests for Worlds. */ constructor(address _worldsMetadataDelegate) { metadataDelegate = _worldsMetadataDelegate; } /** * @notice Returns the contract which handles some metadata requests for Worlds. * @dev Passthrough to this delegate contract is transparent to users. */ function getWorldsMetadataDelegateAddress() external view returns (address worldsMetadataDelegate) { worldsMetadataDelegate = metadataDelegate; } /** * @notice Called by a Foundation admin to set the SVG template used by the tokenURI image of each World. * @param svgTemplate The plaintext svg with {{worldId}} as a placeholder for the World's ID. */ function adminUpdateSvgTemplate(string calldata svgTemplate) external { svgTemplate; // silence unused variable compiler warning _delegate(metadataDelegate); } //////////////////////////////////////////////////////////////// // On Mint //////////////////////////////////////////////////////////////// /** * @notice Set the metadata for a given World when that World is initially created. * @param worldId The World to set metadata for. * @param name The name of the World. */ function _mintMetadata(uint256 worldId, string memory name) internal { if (bytes(name).length == 0) { revert WorldsMetadata_Name_Required(); } $worldIdToName[worldId] = name; } //////////////////////////////////////////////////////////////// // World Name //////////////////////////////////////////////////////////////// /** * @notice Allows a curator to update the tokenURI for a World NFT. * @param worldId The id of the World NFT to updates * @param name The name of the World. * @dev Callable by the World owner, admin, or editor. */ function updateWorldName(uint256 worldId, string calldata name) external { worldId; // silence unused variable compiler warning name; _delegate(metadataDelegate); } /** * @notice Returns the name of a given World. */ function getWorldName(uint256 worldId) external view returns (string memory name) { worldId; // silence unused variable compiler warning name; _delegateView(metadataDelegate); } //////////////////////////////////////////////////////////////// // ERC-721 Metadata Standard //////////////////////////////////////////////////////////////// /** * @notice Returns the World's metadata JSON including an SVG image. * @param worldId The ID of the World. */ function tokenURI(uint256 worldId) public view virtual override returns (string memory uri) { worldId; // silence unused variable compiler warning uri; _delegateView(metadataDelegate); } //////////////////////////////////////////////////////////////// // Cleanup //////////////////////////////////////////////////////////////// /// @dev Cleans up a World's metadata when it's burned. function _burn(uint256 worldId) internal virtual override { delete $worldIdToName[worldId]; super._burn(worldId); } //////////////////////////////////////////////////////////////// // Inheritance Requirements // (no-ops to avoid compile errors) //////////////////////////////////////////////////////////////// function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC4906, ERC721Upgradeable) returns (bool isSupported) { isSupported = super.supportsInterface(interfaceId); } /** * @notice This empty reserved space is put in place to allow future versions to add new variables without shifting * down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps * @dev This file uses a total of 1,000 slots. */ uint256[998] private __gap; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { ERC721Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import { INFTDropMarketExhibitionMigration } from "../../interfaces/internal/INFTDropMarketExhibitionMigration.sol"; import { INFTMarketExhibitionMigration } from "../../interfaces/internal/INFTMarketExhibitionMigration.sol"; import { FoundationTreasuryNode } from "../shared/FoundationTreasuryNode.sol"; import { NFTDropMarketNode } from "../shared/NFTDropMarketNode.sol"; import { NFTMarketNode } from "../shared/NFTMarketNode.sol"; import { WorldsAllowlistBySeller } from "./WorldsAllowlistBySeller.sol"; import { WorldsInventoryByCollection } from "./WorldsInventoryByCollection.sol"; import { WorldsInventoryByNft } from "./WorldsInventoryByNft.sol"; import { WorldsManagement } from "./WorldsManagement.sol"; /** * @title Coordinates the migration of NFTMarket contract's exhibitions to the Worlds contract. * @author HardlyDifficult */ abstract contract WorldsNftMarketExhibitionMigration is NFTMarketNode, NFTDropMarketNode, FoundationTreasuryNode, WorldsAllowlistBySeller, WorldsInventoryByCollection, WorldsInventoryByNft, WorldsManagement { error WorldsNftMarketExhibitionMigration_Caller_Is_Not_The_Curator(); error WorldsNftMarketExhibitionMigration_Collection_Not_Listed_With_Exhibition(address nftContract); error WorldsNftMarketExhibitionMigration_Exhibition_Does_Not_Exist(); error WorldsNftMarketExhibitionMigration_NFT_Not_Listed_With_Exhibition(address nftContract, uint256 nftTokenId); error WorldsNftMarketExhibitionMigration_No_Listings_Provided(); //////////////////////////////////////////////////////////////// // Setup //////////////////////////////////////////////////////////////// /** * @notice Called by Foundation once after the Worlds contract is deployed and market contracts upgraded in order to * complete the migration and allow World NFTs to be minted. */ function initializeWorldsNftMarketExhibitionMigration() external reinitializer(2) onlyFoundationAdmin { uint256 lastExhibitionIdCreated = INFTMarketExhibitionMigration(nftMarket).worldsInitializeMigration(); _initializeWorldsManagement(lastExhibitionIdCreated); } //////////////////////////////////////////////////////////////// // Migration //////////////////////////////////////////////////////////////// /** * @notice Migrate an exhibition from the NFTMarket and NFTDropMarket contracts to the Worlds contract. * @param exhibitionId The ID of the exhibition to migrate. * @param sellers The sellers which should be added to the World's seller allowlist. * These sellers may or may not already be added to the exhibition. * @param nftListings The NFT listings which already exist in the NFTMarket for this exhibition, and should be * added to the World's NFT inventory. * @param collectionListings The collection listings which already exist in the NFTDropMarket for this exhibition, and * should be added to the World's collection inventory. * @dev We are unable to guarantee that all state is migrated. Any sellers not provided will no longer be associated * with the World or exhibition. Markets will continue to respect any missed listings, but they will not be recognized * by the World and eventually that data will be obsoleted. */ function migrateFromExhibition( uint256 exhibitionId, address[] calldata sellers, INFTMarketExhibitionMigration.NFTListing[] calldata nftListings, address[] calldata collectionListings ) external onlyIfMigrated { address curator = _msgSender(); // Verify and clean up NFTMarket state. (string memory name, uint16 takeRateInBasisPoints) = INFTMarketExhibitionMigration(nftMarket) .worldsMigrateExhibition(exhibitionId, curator); // Mint the World NFT _mintWorld({ worldId: exhibitionId, defaultTakeRateInBasisPoints: takeRateInBasisPoints, worldPaymentAddress: payable(curator), name: name }); // Store the sellers specified. Verification not required since this list was originally provided by the curator. for (uint256 i = 0; i < sellers.length; ) { _addToAllowlistBySeller(exhibitionId, sellers[i]); unchecked { ++i; } } // Migrate listings. _resumeMigrateFromExhibition(exhibitionId, takeRateInBasisPoints, nftListings, collectionListings); } /** * @notice Migrate any additional exhibition listings from the NFTMarket and NFTDropMarket contracts to the Worlds * contract. * @param exhibitionId The ID of the exhibition to migrate. * @param nftListings The NFT listings which already exist in the NFTMarket for this exhibition, and should be * added to the World's NFT inventory. * @param collectionListings The collection listings which already exist in the NFTDropMarket for this exhibition, and * should be added to the World's collection inventory. * @dev This is a permissionless call, anyone can resume migrating missed listings. */ function resumeMigrateFromExhibition( uint256 exhibitionId, INFTMarketExhibitionMigration.NFTListing[] calldata nftListings, address[] calldata collectionListings ) external { _requireMinted(exhibitionId); if (nftListings.length == 0 && collectionListings.length == 0) { revert WorldsNftMarketExhibitionMigration_No_Listings_Provided(); } _resumeMigrateFromExhibition(exhibitionId, getDefaultTakeRate(exhibitionId), nftListings, collectionListings); } function _resumeMigrateFromExhibition( uint256 exhibitionId, uint16 takeRateInBasisPoints, INFTMarketExhibitionMigration.NFTListing[] calldata nftListings, address[] calldata collectionListings ) private { // Migrate NFT listings (only verified listings) if (nftListings.length > 0) { // Verify listings, clean up NFTMarket state, and return the seller for each. address[] memory nftSellers = INFTMarketExhibitionMigration(nftMarket).worldsMigrateExhibitionListings( exhibitionId, nftListings ); // Store each listing locally. for (uint256 i = 0; i < nftListings.length; ) { _addToWorldByNft( exhibitionId, nftSellers[i], nftListings[i].nftContract, nftListings[i].nftTokenId, takeRateInBasisPoints ); unchecked { ++i; } } } // Migrate World listings (only verified listings) if (collectionListings.length > 0) { // Verify listings, clean up NFTDropMarket state, and return the seller for each. address[] memory collectionSellers = INFTDropMarketExhibitionMigration(nftDropMarket) .worldsMigrateExhibitionListings(exhibitionId, collectionListings); // Store each listing locally. for (uint256 i = 0; i < collectionListings.length; ) { _addToWorldByCollection(exhibitionId, collectionSellers[i], collectionListings[i], takeRateInBasisPoints); unchecked { ++i; } } } } //////////////////////////////////////////////////////////////// // Inheritance Requirements // (no-ops to avoid compile errors) //////////////////////////////////////////////////////////////// function _burn(uint256 worldId) internal virtual override(WorldsAllowlistBySeller, WorldsManagement) { super._burn(worldId); } function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721Upgradeable, WorldsManagement) returns (bool isSupported) { isSupported = super.supportsInterface(interfaceId); } function tokenURI( uint256 worldId ) public view virtual override(ERC721Upgradeable, WorldsManagement) returns (string memory uri) { uri = super.tokenURI(worldId); } // This mixin uses 0 slots. }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { ERC721Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; /** * @title Standard functions which are not currently implemented in Worlds. * @author HardlyDifficult & reggieag. */ abstract contract WorldsNotImplemented is ERC721Upgradeable { error WorldsNotImplemented_Function_Not_Implemented(); /** * @notice [NOT IMPLEMENTED] Use `beginTransfer` instead. * @dev Override the default transfer behavior to prevent direct transfers. * Direct transfers are disabled to prevent a user from spamming a user with unwanted worlds. * Direct transfers will be implemented once the use-case for them becomes clear. */ function safeTransferFrom( address /* from */, address /* to */, uint256 /* tokenId */, bytes memory /* data */ ) public pure virtual override { revert WorldsNotImplemented_Function_Not_Implemented(); } /** * @notice [NOT IMPLEMENTED] Use `beginTransfer` instead. * @dev Override the default transfer behavior to prevent direct transfers. * Direct transfers are disabled to prevent a user from spamming a user with unwanted worlds. * Direct transfers will be implemented once the use-case for them becomes clear. */ function transferFrom(address /* from */, address /* to */, uint256 /* tokenId */) public pure virtual override { revert WorldsNotImplemented_Function_Not_Implemented(); } }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { ERC721Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import { IWorldsSharedMarket } from "../../interfaces/internal/IWorldsSharedMarket.sol"; import { MAX_WORLD_TAKE_RATE } from "../shared/Constants.sol"; import { WorldsUserRoles } from "./WorldsUserRoles.sol"; /** * @title Defines payment details to be used for a World. * @author HardlyDifficult, reggieag */ abstract contract WorldsPaymentInfo is IWorldsSharedMarket, ERC721Upgradeable, WorldsUserRoles { struct PaymentInfo { // Slot 0 uint16 defaultTakeRateInBasisPoints; address payable worldPaymentAddress; // (94-bits free space) } /// @notice Stores payment details for each World. mapping(uint256 worldId => PaymentInfo takeRateInfo) private $worldIdToPaymentInfo; //////////////////////////////////////////////////////////////// // Events //////////////////////////////////////////////////////////////// /** * Emitted when the default take rate for a World is assigned. * @param worldId The ID of the World. * @param defaultTakeRateInBasisPoints The default take rate for the World, in basis points. */ event DefaultTakeRateSet(uint256 indexed worldId, uint16 defaultTakeRateInBasisPoints); /** * @notice Emitted when the payment address is set. * @param worldId The ID of the World. * @param worldPaymentAddress The payment address for the World. */ event PaymentAddressSet(uint256 indexed worldId, address indexed worldPaymentAddress); error WorldsPaymentInfo_Cannot_Set_Zero_Payment_Address(); error WorldsPaymentInfo_Exceeds_Max_World_Take_Rate(uint256 maxTakeRate); error WorldsPaymentInfo_Payment_Address_Already_Set(); //////////////////////////////////////////////////////////////// // Setup //////////////////////////////////////////////////////////////// /// @notice Called on mint of a new World to configure the default payment info. function _mintWorldsPaymentInfo( uint256 worldId, uint16 defaultTakeRateInBasisPoints, address payable worldPaymentAddress ) internal { if (defaultTakeRateInBasisPoints > MAX_WORLD_TAKE_RATE) { revert WorldsPaymentInfo_Exceeds_Max_World_Take_Rate(MAX_WORLD_TAKE_RATE); } $worldIdToPaymentInfo[worldId].defaultTakeRateInBasisPoints = defaultTakeRateInBasisPoints; emit DefaultTakeRateSet(worldId, defaultTakeRateInBasisPoints); _setPaymentAddress(worldId, worldPaymentAddress); } //////////////////////////////////////////////////////////////// // Payment address //////////////////////////////////////////////////////////////// /** * @notice Set the payment address for the World. * @param worldId The ID of the World to set the payment address for. * @param worldPaymentAddress The payment address for the World. */ function setPaymentAddress(uint256 worldId, address payable worldPaymentAddress) external onlyAdmin(worldId) { _setPaymentAddress(worldId, worldPaymentAddress); } function _setPaymentAddress(uint256 worldId, address payable worldPaymentAddress) private { if (worldPaymentAddress == payable(address(0))) { revert WorldsPaymentInfo_Cannot_Set_Zero_Payment_Address(); } if ($worldIdToPaymentInfo[worldId].worldPaymentAddress == worldPaymentAddress) { // Revert if the transaction is a no-op. revert WorldsPaymentInfo_Payment_Address_Already_Set(); } $worldIdToPaymentInfo[worldId].worldPaymentAddress = worldPaymentAddress; emit PaymentAddressSet(worldId, worldPaymentAddress); } /** * @notice Get the payment address for a World. * @param worldId The ID of the World to get the payment address for. * @return worldPaymentAddress The payment address for the World. */ function getPaymentAddress(uint256 worldId) public view returns (address payable worldPaymentAddress) { worldPaymentAddress = $worldIdToPaymentInfo[worldId].worldPaymentAddress; } //////////////////////////////////////////////////////////////// // Take rate //////////////////////////////////////////////////////////////// /** * @notice Get the default take rate for a World. * The actual take rate applied to sales may differ per inventory item listed with a World. * @param worldId The ID of the World to get the default take rate for. * @return defaultTakeRateInBasisPoints The default take rate for the World. */ function getDefaultTakeRate(uint256 worldId) public view returns (uint16 defaultTakeRateInBasisPoints) { defaultTakeRateInBasisPoints = $worldIdToPaymentInfo[worldId].defaultTakeRateInBasisPoints; } //////////////////////////////////////////////////////////////// // Cleanup //////////////////////////////////////////////////////////////// function _burn(uint256 worldId) internal virtual override { // When a World is burned, remove the stored payment info. delete $worldIdToPaymentInfo[worldId]; super._burn(worldId); } /** * @notice This empty reserved space is put in place to allow future versions to add new variables without shifting * down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps * @dev This file uses a total of 1,000 slots. */ uint256[999] private __gap; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { ERC721Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import { WorldsUserRoles } from "../../mixins/worlds/WorldsUserRoles.sol"; /** * @title Introduces 2 step transfers for World NFTs. * @author reggieag */ abstract contract WorldsTransfer2Step is ERC721Upgradeable, WorldsUserRoles { /// @notice Stores the pending owner for a token ID. mapping(uint256 worldId => address pendingOwner) private $worldIdToPendingOwner; /** * @notice Emitted when a transfer is started or cancelled. * @param to The pending recipient's address. * When the `to address` is the zero address, this indicates that the transfer has been canceled. * @param worldId The ID of the token. */ event BeginTransfer(address indexed to, uint256 indexed worldId); error WorldsTransfer2Step_Caller_Not_Token_Owner_Or_Approved(); error WorldsTransfer2Step_Not_Pending_Owner_For_Token_Id(address pendingOwner); error WorldsTransfer2Step_Transfer_To_Already_Initiated(); error WorldsTransfer2Step_Cannot_Transfer_To_Current_Owner(); //////////////////////////////////////////////////////////////// // Transfer flow //////////////////////////////////////////////////////////////// /** * @notice Begins a 2 step transfer by setting the pending owner. The recipient can complete the process by calling * `acceptTransfer`. * @param to The pending recipient's address. * To cancel a transfer for a World, call this function with the `to` set to address(0). * @param worldId The ID of the World to transfer. * @dev Callable by the World owner or an approved address. */ function beginTransfer(address to, uint256 worldId) external { if (!_isApprovedOrOwner(_msgSender(), worldId)) { revert WorldsTransfer2Step_Caller_Not_Token_Owner_Or_Approved(); } if ($worldIdToPendingOwner[worldId] == to) { revert WorldsTransfer2Step_Transfer_To_Already_Initiated(); } if (to == ownerOf(worldId)) { revert WorldsTransfer2Step_Cannot_Transfer_To_Current_Owner(); } $worldIdToPendingOwner[worldId] = to; emit BeginTransfer(to, worldId); } /** * @notice Accept a pending 2 step transfer by the pending owner, completing the transfer. * @param worldId The ID of the World to receive. * @dev The previous owner will be granted the admin user role for the World. */ function acceptTransfer(uint256 worldId) external { address pendingOwner = $worldIdToPendingOwner[worldId]; if (pendingOwner != _msgSender()) { revert WorldsTransfer2Step_Not_Pending_Owner_For_Token_Id(pendingOwner); } address previousOwner = ownerOf(worldId); _transfer(previousOwner, pendingOwner, worldId); // Grant the previous owner the admin role if they do not already have it. if (!hasAdminRole(worldId, previousOwner)) { setAdminRole(worldId, previousOwner); } } /** * @notice Get the pending owner for a worldId. * @param worldId The ID of the token to transfer. * @return pendingOwner The pending owner which can `acceptTransfer`. Returns address(0) if no transfer is pending or * the token ID does not exist. */ function getPendingOwner(uint256 worldId) external view returns (address pendingOwner) { pendingOwner = $worldIdToPendingOwner[worldId]; } //////////////////////////////////////////////////////////////// // Cleanup //////////////////////////////////////////////////////////////// function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual override { if (from != address(0)) { // Clear pending owner after a transfer or burn. This is not required on Mint since tokenIDs are not reused. delete $worldIdToPendingOwner[firstTokenId]; } super._afterTokenTransfer(from, to, firstTokenId, batchSize); } /** * @notice This empty reserved space is put in place to allow future versions to add new variables without shifting * down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps * @dev This file uses a total of 1,000 slots. */ uint256[999] private __gap; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.18; import { ERC721Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import { ERC721UserRoles } from "../roles/ERC721UserRoles.sol"; import { IWorldsNftUserRoles } from "../../interfaces/internal/routes/IWorldsNftUserRoles.sol"; /** * @title Defines ACLs for individual World NFTs. * @author HardlyDifficult & reggieag */ abstract contract WorldsUserRoles is IWorldsNftUserRoles, ERC721Upgradeable, ERC721UserRoles { enum Roles { ADMIN, EDITOR // Additional roles may be added in the future, append only. } /** * @notice Emitted when an admin role is set for a World and a user. * @param worldId The ID of the World. * @param user The address of the user that is granted an admin role. * @dev All existing roles are overwritten. */ event AdminRoleSet(uint256 indexed worldId, address indexed user); /** * @notice Emitted when an editor role is set for a World and a user. * @param worldId The ID of the World. * @param user The address of the user that is granted and editor role. * @dev All existing roles are overwritten. */ event EditorRoleSet(uint256 indexed worldId, address indexed user); error WorldsUserRoles_Sender_Does_Not_Have_Admin_User_Role(); error WorldsUserRoles_Sender_Does_Not_Have_Editor_User_Role(); error WorldsUserRoles_Sender_Is_Not_World_Owner(); //////////////////////////////////////////////////////////////// // Owner //////////////////////////////////////////////////////////////// /// @dev Requires that the caller is the owner of the specified World. modifier onlyOwner(uint256 worldId) { if (ownerOf(worldId) != _msgSender()) { revert WorldsUserRoles_Sender_Is_Not_World_Owner(); } _; } //////////////////////////////////////////////////////////////// // Admin //////////////////////////////////////////////////////////////// /// @dev Requires that the caller has admin permissions for the specified World. modifier onlyAdmin(uint256 worldId) { if (!hasAdminRole(worldId, _msgSender())) { revert WorldsUserRoles_Sender_Does_Not_Have_Admin_User_Role(); } _; } /** * @notice Sets an admin role for a World and a user. * @param worldId The ID of the World. * @param user The address of the user that is granted an admin role. * @dev Callable by the World owner or admin. Any existing roles for this user are overwritten. */ function setAdminRole(uint256 worldId, address user) public onlyAdmin(worldId) { _setUserRole(worldId, user, uint8(Roles.ADMIN)); emit AdminRoleSet(worldId, user); } /** * @notice Returns true if a user has an admin role granted for a World. * @param worldId The ID of the World. * @param user The address of the user to check for an admin role. * @dev Admin permissions are implicitly granted to the owner. */ function hasAdminRole(uint256 worldId, address user) public view returns (bool hasRole) { hasRole = ownerOf(worldId) == user || _hasUserRole(worldId, user, uint8(Roles.ADMIN)); } //////////////////////////////////////////////////////////////// // Editor //////////////////////////////////////////////////////////////// /// @dev Requires that the caller has editor permissions for the specified World. modifier onlyEditor(uint256 worldId) { if (!hasEditorRole(worldId, _msgSender())) { revert WorldsUserRoles_Sender_Does_Not_Have_Editor_User_Role(); } _; } /** * @notice Sets an editor role for a World and a user. * @param worldId The ID of the World. * @param user The address of the user that is granted an admin role. * @dev Callable by the World owner or admin. Any existing roles for this user are overwritten. */ function setEditorRole(uint256 worldId, address user) external onlyAdmin(worldId) { _setUserRole(worldId, user, uint8(Roles.EDITOR)); emit EditorRoleSet(worldId, user); } /** * @notice Returns true if a user has an editor role granted for a World. * @param worldId The ID of the World. * @param user The address of the user to check for an editor role. * @dev Editor permissions are implicitly granted to the owner and admin user roles. */ function hasEditorRole(uint256 worldId, address user) public view returns (bool hasRole) { hasRole = hasAdminRole(worldId, user) || _hasUserRole(worldId, user, uint8(Roles.EDITOR)); } //////////////////////////////////////////////////////////////// // Removing roles //////////////////////////////////////////////////////////////// /** * @notice Allows the caller to their current role within a World. * @param worldId The ID of the World. */ function renounceAllRoles(uint256 worldId) external { _revokeAllRolesForUser(worldId, _msgSender()); } /** * @notice Revokes all roles for a World and a user. * @param worldId The ID of the World. * @param user The address of the user whose roles are being revoked. * @dev Callable by the World owner or admin. */ function revokeAllRolesForUser(uint256 worldId, address user) external onlyAdmin(worldId) { _revokeAllRolesForUser(worldId, user); } /** * @notice This empty reserved space is put in place to allow future versions to add new variables without shifting * down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps * @dev This file uses a total of 800 slots. */ uint256[800] private __gap; }
{ "evmVersion": "shanghai", "optimizer": { "enabled": true, "runs": 1337000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address payable","name":"treasury","type":"address"},{"internalType":"address","name":"nftMarket","type":"address"},{"internalType":"address","name":"nftDropMarket","type":"address"},{"internalType":"address","name":"nftMarketRouter","type":"address"},{"internalType":"address","name":"worldsMetadataDelegate","type":"address"},{"internalType":"address","name":"splitTemplate","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"DelegateForwarder_For_Internal_Use_Only","type":"error"},{"inputs":[],"name":"ERC1167FailedCreateClone","type":"error"},{"inputs":[],"name":"ERC721UserRoles_User_Has_No_Roles","type":"error"},{"inputs":[],"name":"ERC721UserRoles_User_Must_Not_Be_Zero_Address","type":"error"},{"inputs":[],"name":"ERC721UserRoles_User_Role_Already_Set","type":"error"},{"inputs":[],"name":"FoundationTreasuryNode_Address_Is_Not_A_Contract","type":"error"},{"inputs":[],"name":"FoundationTreasuryNode_Caller_Not_Admin","type":"error"},{"inputs":[],"name":"NFTDropMarketNode_Address_Is_Not_A_Contract","type":"error"},{"inputs":[],"name":"NFTMarketNode_Address_Is_Not_A_Contract","type":"error"},{"inputs":[],"name":"RouterContextTriple_Address_Is_Not_A_Contract","type":"error"},{"inputs":[{"internalType":"uint8","name":"bits","type":"uint8"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintDowncast","type":"error"},{"inputs":[],"name":"WorldsAllowlistBySeller_Address_0_May_Not_Be_Added","type":"error"},{"inputs":[],"name":"WorldsAllowlistBySeller_No_Sellers_Provided","type":"error"},{"inputs":[],"name":"WorldsAllowlistBySeller_Seller_Already_On_Allowlist","type":"error"},{"inputs":[],"name":"WorldsAllowlistBySeller_Seller_Not_Allowed","type":"error"},{"inputs":[{"internalType":"uint16","name":"minimumTakeRateInBasisPoints","type":"uint16"}],"name":"WorldsAllowlistBySeller_Take_Rate_Too_Low","type":"error"},{"inputs":[{"internalType":"uint256","name":"maxTakeRate","type":"uint256"}],"name":"WorldsAllowlist_Take_Rate_Above_Max","type":"error"},{"inputs":[],"name":"WorldsInventoryByCollection_Already_In_This_World","type":"error"},{"inputs":[],"name":"WorldsInventoryByNft_Already_In_This_World","type":"error"},{"inputs":[],"name":"WorldsInventoryByNft_Not_In_A_World","type":"error"},{"inputs":[],"name":"WorldsInventoryBySplit_Already_In_This_World","type":"error"},{"inputs":[],"name":"WorldsInventoryBySplit_Not_A_Valid_Split","type":"error"},{"inputs":[],"name":"WorldsInventoryBySplit_Not_Listed_In_A_World","type":"error"},{"inputs":[],"name":"WorldsInventoryBySplit_Split_Implementation_Not_A_Contract","type":"error"},{"inputs":[],"name":"WorldsManagement_Worlds_Not_Migrated","type":"error"},{"inputs":[],"name":"WorldsMetadata_Invalid_Svg_Template","type":"error"},{"inputs":[],"name":"WorldsMetadata_Name_Already_Set","type":"error"},{"inputs":[],"name":"WorldsMetadata_Name_Required","type":"error"},{"inputs":[],"name":"WorldsMetadata_Svg_Template_Already_Set","type":"error"},{"inputs":[],"name":"WorldsNftMarketExhibitionMigration_Caller_Is_Not_The_Curator","type":"error"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"}],"name":"WorldsNftMarketExhibitionMigration_Collection_Not_Listed_With_Exhibition","type":"error"},{"inputs":[],"name":"WorldsNftMarketExhibitionMigration_Exhibition_Does_Not_Exist","type":"error"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"nftTokenId","type":"uint256"}],"name":"WorldsNftMarketExhibitionMigration_NFT_Not_Listed_With_Exhibition","type":"error"},{"inputs":[],"name":"WorldsNftMarketExhibitionMigration_No_Listings_Provided","type":"error"},{"inputs":[],"name":"WorldsNotImplemented_Function_Not_Implemented","type":"error"},{"inputs":[],"name":"WorldsPaymentInfo_Cannot_Set_Zero_Payment_Address","type":"error"},{"inputs":[{"internalType":"uint256","name":"maxTakeRate","type":"uint256"}],"name":"WorldsPaymentInfo_Exceeds_Max_World_Take_Rate","type":"error"},{"inputs":[],"name":"WorldsPaymentInfo_Payment_Address_Already_Set","type":"error"},{"inputs":[],"name":"WorldsTransfer2Step_Caller_Not_Token_Owner_Or_Approved","type":"error"},{"inputs":[],"name":"WorldsTransfer2Step_Cannot_Transfer_To_Current_Owner","type":"error"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"WorldsTransfer2Step_Not_Pending_Owner_For_Token_Id","type":"error"},{"inputs":[],"name":"WorldsTransfer2Step_Transfer_To_Already_Initiated","type":"error"},{"inputs":[],"name":"WorldsUserRoles_Sender_Does_Not_Have_Admin_User_Role","type":"error"},{"inputs":[],"name":"WorldsUserRoles_Sender_Does_Not_Have_Editor_User_Role","type":"error"},{"inputs":[],"name":"WorldsUserRoles_Sender_Is_Not_World_Owner","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"}],"name":"AddToAllowlistBySeller","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"},{"indexed":false,"internalType":"string","name":"listingIdentifier","type":"string"}],"name":"AddToWorldByCollection","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftTokenId","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"},{"indexed":false,"internalType":"string","name":"listingIdentifier","type":"string"}],"name":"AddToWorldByNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"address","name":"split","type":"address"},{"indexed":false,"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"},{"indexed":false,"internalType":"string","name":"listingIdentifier","type":"string"}],"name":"AddToWorldBySplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"AdminRoleSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"}],"name":"BeginTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"defaultTakeRateInBasisPoints","type":"uint16"}],"name":"DefaultTakeRateSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"EditorRoleSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":true,"internalType":"address","name":"worldPaymentAddress","type":"address"}],"name":"PaymentAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"}],"name":"RemoveFromAllowlistBySeller","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftTokenId","type":"uint256"}],"name":"RemoveFromWorldByNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":true,"internalType":"address","name":"marketplace","type":"address"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"count","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalSalePrice","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"}],"name":"SoldInWorldByCollection","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":true,"internalType":"address","name":"marketplace","type":"address"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftTokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"salePrice","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"}],"name":"SoldInWorldByNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":true,"internalType":"address","name":"marketplace","type":"address"},{"indexed":true,"internalType":"address","name":"split","type":"address"},{"indexed":false,"internalType":"uint256","name":"valueInWei","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"curatorTakeInWei","type":"uint256"}],"name":"SoldInWorldBySplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"worldId","type":"uint256"},{"indexed":true,"internalType":"address","name":"marketplace","type":"address"},{"indexed":true,"internalType":"address","name":"split","type":"address"},{"indexed":false,"internalType":"address","name":"worldPaymentAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"valueInWei","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"curatorTakeInWei","type":"uint256"}],"name":"SoldInWorldBySplitWorldPaymentFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"UserRolesRevoked","type":"event"},{"inputs":[],"name":"_delegateView","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"}],"name":"acceptTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address","name":"seller","type":"address"}],"name":"addToAllowlistBySeller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address[]","name":"sellers","type":"address[]"}],"name":"addToAllowlistBySellers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"}],"name":"addToWorldByCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"nftTokenId","type":"uint256"},{"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"}],"name":"addToWorldByNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"},{"internalType":"address payable","name":"creatorPaymentAddress","type":"address"}],"name":"addToWorldBySplit","outputs":[{"internalType":"address payable","name":"split","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"svgTemplate","type":"string"}],"name":"adminUpdateSvgTemplate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"worldId","type":"uint256"}],"name":"beginTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getApprovedRouterAddresses","outputs":[{"internalType":"address","name":"routerA","type":"address"},{"internalType":"address","name":"routerB","type":"address"},{"internalType":"address","name":"routerC","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"seller","type":"address"}],"name":"getAssociationByCollection","outputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"nftTokenId","type":"uint256"},{"internalType":"address","name":"seller","type":"address"}],"name":"getAssociationByNft","outputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"seller","type":"address"}],"name":"getAssociationBySplit","outputs":[{"internalType":"address payable","name":"split","type":"address"},{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"split","type":"address"}],"name":"getAssociationBySplitAddress","outputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"seller","type":"address"},{"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"}],"name":"getDefaultTakeRate","outputs":[{"internalType":"uint16","name":"defaultTakeRateInBasisPoints","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFoundationTreasury","outputs":[{"internalType":"address payable","name":"treasuryAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNftDropMarketAddress","outputs":[{"internalType":"address","name":"market","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNftMarketAddress","outputs":[{"internalType":"address","name":"market","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"}],"name":"getPaymentAddress","outputs":[{"internalType":"address payable","name":"worldPaymentAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"}],"name":"getPendingOwner","outputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"}],"name":"getWorldName","outputs":[{"internalType":"string","name":"name","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWorldSplitTemplateAddress","outputs":[{"internalType":"address","name":"worldSplitTemplate","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWorldsMetadataDelegateAddress","outputs":[{"internalType":"address","name":"worldsMetadataDelegate","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"hasAdminRole","outputs":[{"internalType":"bool","name":"hasRole","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"hasEditorRole","outputs":[{"internalType":"bool","name":"hasRole","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initializeWorldsNftMarketExhibitionMigration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address","name":"seller","type":"address"}],"name":"isSellerAllowed","outputs":[{"internalType":"bool","name":"isAllowed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"exhibitionId","type":"uint256"},{"internalType":"address[]","name":"sellers","type":"address[]"},{"components":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"nftTokenId","type":"uint256"}],"internalType":"struct INFTMarketExhibitionMigration.NFTListing[]","name":"nftListings","type":"tuple[]"},{"internalType":"address[]","name":"collectionListings","type":"address[]"}],"name":"migrateFromExhibition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"defaultTakeRateInBasisPoints","type":"uint16"},{"internalType":"address payable","name":"worldPaymentAddress","type":"address"},{"internalType":"string","name":"name","type":"string"}],"name":"mint","outputs":[{"internalType":"uint256","name":"worldId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"defaultTakeRateInBasisPoints","type":"uint16"},{"internalType":"address payable","name":"worldPaymentAddress","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"address[]","name":"sellers","type":"address[]"}],"name":"mintWithSellerAllowlist","outputs":[{"internalType":"uint256","name":"worldId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address","name":"seller","type":"address"}],"name":"removeFromAllowlistBySeller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"nftTokenId","type":"uint256"}],"name":"removeFromWorldByNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"}],"name":"renounceAllRoles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"exhibitionId","type":"uint256"},{"components":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"nftTokenId","type":"uint256"}],"internalType":"struct INFTMarketExhibitionMigration.NFTListing[]","name":"nftListings","type":"tuple[]"},{"internalType":"address[]","name":"collectionListings","type":"address[]"}],"name":"resumeMigrateFromExhibition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"revokeAllRolesForUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"setAdminRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"setEditorRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address payable","name":"worldPaymentAddress","type":"address"}],"name":"setPaymentAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seller","type":"address"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"count","type":"uint256"},{"internalType":"uint256","name":"totalSalePrice","type":"uint256"}],"name":"soldInWorldByCollection","outputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address payable","name":"worldPaymentAddress","type":"address"},{"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seller","type":"address"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"uint256","name":"nftTokenId","type":"uint256"},{"internalType":"address","name":"buyer","type":"address"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"soldInWorldByNft","outputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"address payable","name":"worldPaymentAddress","type":"address"},{"internalType":"uint16","name":"takeRateInBasisPoints","type":"uint16"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"market","type":"address"},{"internalType":"uint256","name":"valueInWei","type":"uint256"}],"name":"soldInWorldBySplit","outputs":[{"internalType":"address payable","name":"worldPaymentAddress","type":"address"},{"internalType":"uint256","name":"curatorTakeInWei","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"market","type":"address"},{"internalType":"uint256","name":"valueInWei","type":"uint256"}],"name":"soldInWorldBySplitWorldPaymentFailed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"isSupported","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"uri","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"worldId","type":"uint256"},{"internalType":"string","name":"name","type":"string"}],"name":"updateWorldName","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
61018060405234801562000011575f80fd5b506040516200605b3803806200605b833981016040819052620000349162000280565b80828686868a82846001600160a01b0381163b62000065576040516348dc361f60e01b815260040160405180910390fd5b6001600160a01b0390811660805281163b62000094576040516376d10ccd60e11b815260040160405180910390fd5b6001600160a01b0390811660a05281163b620000c35760405163028bba2560e61b815260040160405180910390fd5b6001600160a01b0390811660c05283163b620000f257604051633671046160e11b815260040160405180910390fd5b6001600160a01b0382163b6200011b57604051633671046160e11b815260040160405180910390fd5b6001600160a01b0381163b6200014457604051633671046160e11b815260040160405180910390fd5b6001600160a01b0392831660e052908216610100528116610120529081166101405281163b62000187576040516371f1cb3d60e01b815260040160405180910390fd5b6001600160a01b0316610160526200019e620001aa565b50505050505062000310565b5f54610100900460ff1615620002165760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff9081161462000266575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b03811681146200027d575f80fd5b50565b5f805f805f8060c0878903121562000296575f80fd5b8651620002a38162000268565b6020880151909650620002b68162000268565b6040880151909550620002c98162000268565b6060880151909450620002dc8162000268565b6080880151909350620002ef8162000268565b60a0880151909250620003028162000268565b809150509295509295509295565b60805160a05160c05160e05161010051610120516101405161016051615c9b620003c05f395f8181610843015261252501525f81816108d5015281816114a50152818161208401526120af01525f818161075001526144e101525f8181610728015261448b01525f8181610703015261446101525f8181610a2f0152612c1801525f81816109210152613b8201525f818161054801528181611d1e01528181612cba0152613a250152615c9b5ff3fe608060405234801561000f575f80fd5b506004361061037d575f3560e01c8063718522aa116101d4578063af44422c11610109578063cec32ca5116100a9578063f0294f4b11610079578063f0294f4b14610a12578063f3991be614610a25578063f7a2da2314610a2d578063fd2eab6914610a53575f80fd5b8063cec32ca514610991578063d5adf489146109a4578063e3faf504146109b7578063e985e9c5146109ca575f80fd5b8063b88d4fde116100e4578063b88d4fde14610945578063c5b2486914610958578063c87b56dd1461096b578063cb97397c1461097e575f80fd5b8063af44422c146108f9578063b4a0f56f1461090c578063b590104e1461091f575f80fd5b80638c59fb731161017457806393251fba1161014f57806393251fba146108a557806395d89b41146108b8578063a22cb465146108c0578063ae3a4253146108d3575f80fd5b80638c59fb73146108415780638d6ed42c146108675780638f40f3781461087a575f80fd5b80638129fc1c116101af5780638129fc1c146107bb578063844b71a3146107c3578063865a2f0f146107cb5780638abf92c91461080a575f80fd5b8063718522aa1461069457806372215bea146106e8578063724ef5011461077f575f80fd5b806332217821116102b557806342842e0e1161025557806363a74d601161022557806363a74d601461064857806368b16b3f1461065b578063691aa51a1461066e57806370a0823114610681575f80fd5b806342842e0e146105fc57806342966c681461060f57806347de74be146106225780636352211e14610635575f80fd5b80633695f607116102905780633695f6071461056c578063389fb0f31461058d5780633b60d097146105a057806340ef10b8146105e9575f80fd5b806332217821146104ec57806332ac730f14610533578063331aaf9e14610546575f80fd5b8063140e6a091161032057806324ee1885116102fb57806324ee18851461047d578063274fae7c146104905780632c1e9006146104a35780632d4f2b01146104b6575f80fd5b8063140e6a0914610444578063200776bc1461045757806323b872dd1461046a575f80fd5b8063081812fc1161035b578063081812fc146103d3578063090d18b31461040b578063095ea7b31461041e578063095f0c7014610431575f80fd5b806301ffc9a71461038157806305d8d4f2146103a957806306fdde03146103be575b5f80fd5b61039461038f366004614ea3565b610a66565b60405190151581526020015b60405180910390f35b6103bc6103b7366004614edf565b610a76565b005b6103c6610ac8565b6040516103a09190614f78565b6103e66103e1366004614f8a565b610b58565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103a0565b6103bc610419366004614edf565b610b8a565b6103bc61042c366004614fa1565b610bd7565b6103bc61043f366004614edf565b610d81565b6103bc610452366004614fda565b610e16565b610394610465366004614edf565b610e91565b6103bc610478366004615019565b610ef7565b6103bc61048b366004614fa1565b610f02565b6103bc61049e366004614f8a565b610f7e565b6103bc6104b1366004614f8a565b611056565b6103e66104c4366004614f8a565b5f908152616a0f602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b6104ff6104fa366004615057565b61106a565b6040805193845273ffffffffffffffffffffffffffffffffffffffff909216602084015261ffff16908201526060016103a0565b610394610541366004614edf565b61119b565b7f00000000000000000000000000000000000000000000000000000000000000006103e6565b61057f61057a36600461512d565b6111fd565b6040519081526020016103a0565b6103bc61059b3660046151fd565b611221565b6105b36105ae366004615271565b611294565b6040805173ffffffffffffffffffffffffffffffffffffffff9094168452602084019290925261ffff16908201526060016103a0565b6103bc6105f7366004614edf565b6113b7565b6103bc61060a366004615019565b611404565b6103bc61061d366004614f8a565b61141e565b6103bc61063036600461529d565b6114a0565b6103e6610643366004614f8a565b6114c9565b6103bc6106563660046152dc565b611554565b6103bc610669366004614fa1565b6115cc565b6103bc61067c366004614edf565b61175b565b61057f61068f366004615323565b6117f1565b6106a76106a2366004615323565b6118bd565b6040516103a0949392919093845273ffffffffffffffffffffffffffffffffffffffff92831660208501529116604083015261ffff16606082015260800190565b6040805173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811682527f0000000000000000000000000000000000000000000000000000000000000000811660208301527f000000000000000000000000000000000000000000000000000000000000000016918101919091526060016103a0565b6103e661078d366004614f8a565b5f908152612f77602052604090205462010000900473ffffffffffffffffffffffffffffffffffffffff1690565b6103bc6119a7565b6103bc611b9f565b6107de6107d9366004614fa1565b611c42565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016103a0565b61082e610818366004614f8a565b5f908152612f77602052604090205461ffff1690565b60405161ffff90911681526020016103a0565b7f00000000000000000000000000000000000000000000000000000000000000006103e6565b6103bc61087536600461533e565b611cb4565b61088d6108883660046153da565b611e63565b6040805192835261ffff9091166020830152016103a0565b6103bc6108b3366004614fa1565b611f36565b6103c661205e565b6103bc6108ce36600461541b565b61206d565b7f00000000000000000000000000000000000000000000000000000000000000006103e6565b6103bc610907366004615447565b61207f565b6103c661091a366004614f8a565b6120a8565b7f00000000000000000000000000000000000000000000000000000000000000006103e6565b6103bc610953366004615550565b6120d8565b6103bc6109663660046155f8565b6120ea565b6103c6610979366004614f8a565b612172565b6103e661098c366004615633565b61217d565b6104ff61099f366004615678565b61281a565b61057f6109b23660046156bb565b612932565b61088d6109c5366004615271565b612a13565b6103946109d8366004615271565b73ffffffffffffffffffffffffffffffffffffffff9182165f908152606a6020908152604080832093909416825291909152205460ff1690565b610394610a20366004614edf565b612ab0565b6103bc612af9565b7f00000000000000000000000000000000000000000000000000000000000000006103e6565b6103bc610a61366004614edf565b612dac565b5f610a7082612ede565b92915050565b81610a8381610a20612ee8565b610ab9576040517fb730a3eb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ac38383612ef6565b505050565b606060658054610ad79061571c565b80601f0160208091040260200160405190810160405280929190818152602001828054610b039061571c565b8015610b4e5780601f10610b2557610100808354040283529160200191610b4e565b820191905f5260205f20905b815481529060010190602001808311610b3157829003601f168201915b5050505050905090565b5f610b6282612fcc565b505f9081526069602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b81610b9781610a20612ee8565b610bcd576040517fb730a3eb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ac38383613056565b5f610be1826114c9565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610ca3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610cc2612ee8565b73ffffffffffffffffffffffffffffffffffffffff161480610ceb5750610ceb816109d8612ee8565b610d77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610c9a565b610ac3838361318f565b81610d8e81610a20612ee8565b610dc4576040517fb730a3eb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610dcf83835f61322e565b60405173ffffffffffffffffffffffffffffffffffffffff83169084907f1f0f31fb98449c6c6d9042af0dad644b67c406b4bc9996b2581c77c0108cba48905f90a3505050565b8281610e2182612fcc565b6113888161ffff161115610e65576040517f9a5b7c1b0000000000000000000000000000000000000000000000000000000081526113886004820152602401610c9a565b610e778282610e72612ee8565b6132ea565b610e8a85610e83612ee8565b86866133c1565b5050505050565b5f610e9c8383612ab0565b80610ef05750610ef0838360015b5f928352609760209081526040808520858052825280852073ffffffffffffffffffffffffffffffffffffffff9094168552929052912054600160ff9092161c16151590565b9392505050565b610ac3838383613562565b5f805f610f0e84613594565b6040805173ffffffffffffffffffffffffffffffffffffffff8085168252602082018a9052918101839052939650919450925033919087169085907fa7e3741a0b4c9ccc7effed91a2572c1274703b3c573e2079b5963171de00b107906060015b60405180910390a45050505050565b5f818152616a0f602052604090205473ffffffffffffffffffffffffffffffffffffffff16610fab612ee8565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611027576040517f1a065e4200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610c9a565b5f611031836114c9565b905061103e8183856136b6565b6110488382612ab0565b610ac357610ac38382610d81565b61106781611062612ee8565b612ef6565b50565b73ffffffffffffffffffffffffffffffffffffffff8086165f90815261623f60209081526040808320938816835292815282822086835290529081205463ffffffff1690808215611190575f838152612f77602052604090205462010000900473ffffffffffffffffffffffffffffffffffffffff169150816110f2575f92505f9150611190565b5073ffffffffffffffffffffffffffffffffffffffff8781165f81815261623f602090815260408083208b86168085529083528184208b85528352928190205481519384529183018a9052938816828501526060820187905261ffff64010000000090910416608082018190529251339186917f04224969448af01888ee9b82ab14d1cf761cc9aacf7a51195e63d512a7a8149b9181900360a00190a45b955095509592505050565b5f8281526067602052604081205473ffffffffffffffffffffffffffffffffffffffff1615610a7057505f91825261335f6020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b5f61120a87878787612932565b90506112178184846139b8565b9695505050505050565b61122a85612fcc565b82158015611236575080155b1561126d576040517fdba56a1100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e8a8561128b875f908152612f77602052604090205461ffff1690565b868686866139e0565b73ffffffffffffffffffffffffffffffffffffffff8082165f90815261604b602090815260408083208685168452909152812054909116908082156113b05773ffffffffffffffffffffffffffffffffffffffff83165f90815261604c602052604081205463ffffffff74010000000000000000000000000000000000000000909104169250611345835f9081526067602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16146113ac575073ffffffffffffffffffffffffffffffffffffffff82165f90815261604c60205260409020547801000000000000000000000000000000000000000000000000900461ffff166113b0565b5f91505b9250925092565b816113c481610465612ee8565b6113fa576040517f9925908400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ac38383613c84565b610ac383838360405180602001604052805f8152506120d8565b80611427612ee8565b73ffffffffffffffffffffffffffffffffffffffff16611446826114c9565b73ffffffffffffffffffffffffffffffffffffffff1614611493576040517f92c311b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61149c82613dac565b5050565b61149c7f0000000000000000000000000000000000000000000000000000000000000000613db5565b5f8181526067602052604081205473ffffffffffffffffffffffffffffffffffffffff1680610a70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610c9a565b838161155f82612fcc565b6113888161ffff1611156115a3576040517f9a5b7c1b0000000000000000000000000000000000000000000000000000000081526113886004820152602401610c9a565b6115b08282610e72612ee8565b6115c4866115bc612ee8565b878787613dcf565b505050505050565b6115dd6115d7612ee8565b82613f94565b611613576040517f62272c1f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f818152616a0f602052604090205473ffffffffffffffffffffffffffffffffffffffff808416911603611673576040517fdef5088a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61167c816114c9565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116e0576040517ffd461d2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f818152616a0f602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8616908117909155905183927fca67ac802f4ee7e410b499c4141b330c34c3cb8c16186c36ab8e8e1dee87c00191a35050565b8161176881610a20612ee8565b61179e576040517fb730a3eb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117aa8383600161322e565b60405173ffffffffffffffffffffffffffffffffffffffff83169084907f7ff28266011814b6ef705d4afbdc5acdcfc98bc4121ff51fa9e8b38dfdc7c4b9905f90a3505050565b5f73ffffffffffffffffffffffffffffffffffffffff8216611895576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610c9a565b5073ffffffffffffffffffffffffffffffffffffffff165f9081526068602052604090205490565b73ffffffffffffffffffffffffffffffffffffffff81165f90815261604c60205260408120805463ffffffff740100000000000000000000000000000000000000009091041691908190819081611935865f9081526067602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff161461199b578054600182015473ffffffffffffffffffffffffffffffffffffffff80831696501693507801000000000000000000000000000000000000000000000000900461ffff16915061199f565b5f94505b509193509193565b5f54610100900460ff16158080156119c557505f54600160ff909116105b806119de5750303b1580156119de57505f5460ff166001145b611a6a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610c9a565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015611ac6575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b611b3a6040518060400160405280600681526020017f576f726c647300000000000000000000000000000000000000000000000000008152506040518060400160405280600581526020017f574f524c44000000000000000000000000000000000000000000000000000000815250614051565b8015611067575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b333014611bd8576040517feab5a03f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe836018060045f375f80825f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c5af490503d5f803e808015611c3e573d5ff35b3d5ffd5b5f805f611c4e84613594565b6040805188815260208101839052929650909450919250339173ffffffffffffffffffffffffffffffffffffffff88169184917fa89bd13a0c7d13b451ac594826a0ae0852a3cee796872087c3fe4ef607271203910160405180910390a4509250929050565b6166275463ffffffff16158015611cd857506002611cd35f5460ff1690565b60ff16105b15611d0f576040517fe4c2279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f611d18612ee8565b90505f807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633e9e8bf88b856040518363ffffffff1660e01b8152600401611d9692919091825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b5f604051808303815f875af1158015611db1573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611df6919081019061576d565b91509150611e068a828585614100565b5f5b88811015611e4857611e408b8b8b84818110611e2657611e266157eb565b9050602002016020810190611e3b9190615323565b613c84565b600101611e08565b50611e578a82898989896139e0565b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8082165f90815261623f60209081526040808320938716835292815282822085835290529081205463ffffffff16908115801590611ed857505f8281526067602052604090205473ffffffffffffffffffffffffffffffffffffffff1615155b15611f2a575073ffffffffffffffffffffffffffffffffffffffff8281165f90815261623f60209081526040808320938816835292815282822086835290522054640100000000900461ffff16611f2e565b5f91505b935093915050565b5f611f3f612ee8565b73ffffffffffffffffffffffffffffffffffffffff8082165f90815261623f60209081526040808320938816835292815282822086835290529081205491925063ffffffff90911690819003611fc1576040517f693ab87c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8281165f81815261623f6020908152604080832094891680845294825280832088845282529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000169055905186815284917f0e2d557782991164095499aab37a3d8177adfb1f97fce0a12f8d7b49466336b391015b60405180910390a450505050565b606060668054610ad79061571c565b61149c612078612ee8565b8383614126565b610ac37f0000000000000000000000000000000000000000000000000000000000000000613db5565b60606120d37f0000000000000000000000000000000000000000000000000000000000000000614252565b919050565b6120e484848484613562565b50505050565b826120f781610465612ee8565b61212d576040517f9925908400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f829003612167576040517ff12c846f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6120e48484846139b8565b6060610a7082614315565b5f848361218982612fcc565b6113888161ffff1611156121cd576040517f9a5b7c1b0000000000000000000000000000000000000000000000000000000081526113886004820152602401610c9a565b6121da8282610e72612ee8565b5f6121e3612ee8565b73ffffffffffffffffffffffffffffffffffffffff8082165f90815261604b602090815260408083208c85168452909152902054169450905083158015906122f757508473ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612286573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122aa9190615818565b73ffffffffffffffffffffffffffffffffffffffff1614806122f757508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16145b1561248f5773ffffffffffffffffffffffffffffffffffffffff84165f90815261604c602052604090205474010000000000000000000000000000000000000000900463ffffffff1688148015612395575073ffffffffffffffffffffffffffffffffffffffff84165f90815261604c602052604090205461ffff878116780100000000000000000000000000000000000000000000000090920416145b156123cc576040517fe48d39c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6123d588614320565b73ffffffffffffffffffffffffffffffffffffffff85165f90815261604c6020526040902080547fffffffffffff000000000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff93909316929092027fffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffff1691909117780100000000000000000000000000000000000000000000000061ffff891602179055612774565b73ffffffffffffffffffffffffffffffffffffffff8416156125205773ffffffffffffffffffffffffffffffffffffffff84165f90815261604c6020526040902080547fffffffffffff000000000000000000000000000000000000000000000000000016815560010180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b61255f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661436d565b6040517fc4d66de800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301529195509085169063c4d66de8906024015f604051808303815f87803b1580156125c9575f80fd5b505af11580156125db573d5f803e3d5ffd5b5050505073ffffffffffffffffffffffffffffffffffffffff8181165f90815261604b602090815260408083208b85168085529083529281902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001694891694909417909355825160808101909352908252810161265a8a614320565b63ffffffff908116825261ffff89811660208085019190915273ffffffffffffffffffffffffffffffffffffffff8681166040958601528981165f90815261604c83528590208651815493880151968801519083167fffffffffffffffff00000000000000000000000000000000000000000000000090941693909317740100000000000000000000000000000000000000009690951695909502939093177fffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffff1678010000000000000000000000000000000000000000000000009190921602178255606090920151600190910180547fffffffffffffffffffffffff000000000000000000000000000000000000000016919092161790555b8673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16897fd6ac66cf5ef5678b17b10f8b48c2765185f4f2b139842894bc5e7fce2aff9d2e878a60405161280792919073ffffffffffffffffffffffffffffffffffffffff92909216825261ffff1660208201526060604082018190525f9082015260800190565b60405180910390a4505050949350505050565b73ffffffffffffffffffffffffffffffffffffffff8085165f908152615e576020908152604080832093871683529290529081205463ffffffff1690808215612928575f838152612f77602052604090205462010000900473ffffffffffffffffffffffffffffffffffffffff1691508161289a575f92505f9150612928565b5073ffffffffffffffffffffffffffffffffffffffff8681165f818152615e5760209081526040808320948a1680845294825291829020548251948552908401889052908301869052640100000000900461ffff166060830181905291339085907e516abd10b395e6c97f8299bd4a334d6b6e95b4be5c2b31f1ae4cd5bae072499060800160405180910390a45b9450945094915050565b616627545f9063ffffffff16158015612958575060026129535f5460ff1690565b60ff16105b1561298f576040517fe4c2279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61662780545f906129a59063ffffffff16615833565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff169050612a0b81868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061410092505050565b949350505050565b73ffffffffffffffffffffffffffffffffffffffff8181165f908152615e5760209081526040808320868516845282528083205463ffffffff16808452606790925282205490921615612aa5575073ffffffffffffffffffffffffffffffffffffffff8281165f908152615e576020908152604080832093871683529290522054640100000000900461ffff16612aa9565b5f91505b9250929050565b5f8173ffffffffffffffffffffffffffffffffffffffff16612ad1846114c9565b73ffffffffffffffffffffffffffffffffffffffff161480610ef05750610ef083835f610eaa565b5f54600290610100900460ff16158015612b1957505f5460ff8083169116105b612ba5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610c9a565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001660ff8316176101001790556040517f24d7806c00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906324d7806c90602401602060405180830381865afa158015612c5d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612c81919061587a565b612cb7576040517faf8db33300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370f0c5d96040518163ffffffff1660e01b81526004016020604051808303815f875af1158015612d22573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612d469190615895565b9050612d51816143fd565b505f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602001611b94565b81612db981610465612ee8565b612def576040517f9925908400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f83815261335f6020908152604080832073ffffffffffffffffffffffffffffffffffffffff861684529091529020805460ff16612e59576040517f090daa9100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f84815261335f6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551909186917f49e43845376b004b5c6ea76194d6de04333118e0f6c9c068f657d3a32cc5b33a9190a350505050565b5f610a708261443f565b5f612ef1614449565b905090565b5f828152609760209081526040808320838052825280832073ffffffffffffffffffffffffffffffffffffffff851684529091528120549003612f65576040517f74f8519400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f828152609760209081526040808320838052825280832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832083905551909184917f15b346905c3358a4c6206e8d53796ff94c13e1acfeb566d58ba34274033fe78a9190a35050565b5f8181526067602052604090205473ffffffffffffffffffffffffffffffffffffffff16611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610c9a565b73ffffffffffffffffffffffffffffffffffffffff81166130a3576040517f1d7b9e2200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f828152612f77602052604090205473ffffffffffffffffffffffffffffffffffffffff808316620100009092041603613109576040517f2acbabd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f828152612f77602052604080822080547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff8616908102919091179091559051909184917f815a7b07588e7ea8e1215949a7ff4e6b7ad525fd783567ad41ca1093dde1c1219190a35050565b5f81815260696020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841690811790915581906131e8826114c9565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b5f838152609760209081526040808320838052825280832073ffffffffffffffffffffffffffffffffffffffff8616845290915290205460ff82161c600116156132a4576040517fbdf15e9000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f928352609760209081526040808520858052825280852073ffffffffffffffffffffffffffffffffffffffff90941685529290529120600160ff9092169190911b9055565b5f83815261335f6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16613353576040517f090daa9100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f838152612f77602052604090205461ffff1661ffff168261ffff161015610ac3575f838152612f77602052604090205461ffff166040517f55320e0000000000000000000000000000000000000000000000000000000000815261ffff9091166004820152602401610c9a565b73ffffffffffffffffffffffffffffffffffffffff8084165f908152615e57602090815260408083209386168352929052205463ffffffff1684148015613448575073ffffffffffffffffffffffffffffffffffffffff8084165f908152615e57602090815260408083209386168352929052205461ffff82811664010000000090920416145b1561347f576040517f37d7b2a400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051806040016040528061349386614320565b63ffffffff908116825261ffff848116602093840181905273ffffffffffffffffffffffffffffffffffffffff8881165f818152615e5787526040808220938b16808352938852808220895181549a8a015198167fffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000909a169990991764010000000097909616969096029490941790965583519182529381018390529182015290919086907fea85788422f4b4e71907159b221a46645cb0e9c8ade05637904689e1c15e093190606001612050565b6040517fd7e493c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f90815261604c60205260408120805463ffffffff7401000000000000000000000000000000000000000090910416919081906135fb845f908152612f77602052604090205473ffffffffffffffffffffffffffffffffffffffff620100009091041690565b925073ffffffffffffffffffffffffffffffffffffffff831661368357835f03613651576040517fef05ec8700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f895e1a5c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8054612710907801000000000000000000000000000000000000000000000000900461ffff168602049150509193909250565b8273ffffffffffffffffffffffffffffffffffffffff166136d6826114c9565b73ffffffffffffffffffffffffffffffffffffffff1614613779576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610c9a565b73ffffffffffffffffffffffffffffffffffffffff821661381b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610c9a565b8273ffffffffffffffffffffffffffffffffffffffff1661383b826114c9565b73ffffffffffffffffffffffffffffffffffffffff16146138de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610c9a565b5f81815260696020908152604080832080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811690915573ffffffffffffffffffffffffffffffffffffffff8781168086526068855283862080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905590871680865283862080546001019055868652606790945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610ac38383836001614562565b5f5b818110156120e4576139d884848484818110611e2657611e266157eb565b6001016139ba565b8215613b3d576040517f401cf1500000000000000000000000000000000000000000000000000000000081525f9073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063401cf15090613a5e908a90899089906004016158ac565b5f604051808303815f875af1158015613a79573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052613abe919081019061591a565b90505f5b84811015613b3a57613b3288838381518110613ae057613ae06157eb565b6020026020010151888885818110613afa57613afa6157eb565b613b109260206040909202019081019150615323565b898986818110613b2257613b226157eb565b905060400201602001358b613dcf565b600101613ac2565b50505b80156115c4576040517f618b43b40000000000000000000000000000000000000000000000000000000081525f9073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063618b43b490613bbb908a90879087906004016159c7565b5f604051808303815f875af1158015613bd6573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052613c1b919081019061591a565b90505f5b82811015613c7a57613c7288838381518110613c3d57613c3d6157eb565b6020026020010151868685818110613c5757613c576157eb565b9050602002016020810190613c6c9190615323565b8a6133c1565b600101613c1f565b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116613cd1576040517f1d7a89cf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f82815261335f6020908152604080832073ffffffffffffffffffffffffffffffffffffffff851684529091529020805460ff1615613d3c576040517fdbd1a8d900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117815560405173ffffffffffffffffffffffffffffffffffffffff83169084907f1f2c9050d0cb7496cc1729c2ab051bafda1ebc461ce72e3505e2c3ffe18678bc905f90a3505050565b6110678161456e565b365f80375f80365f845af43d5f803e808015611c3e573d5ff35b73ffffffffffffffffffffffffffffffffffffffff8085165f90815261623f6020908152604080832093871683529281528282208583529052205463ffffffff1685148015613e66575073ffffffffffffffffffffffffffffffffffffffff8085165f90815261623f6020908152604080832093871683529281528282208583529052205461ffff82811664010000000090920416145b15613e9d576040517f1c55a14000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040518060400160405280613eb187614320565b63ffffffff908116825261ffff80851660209384015273ffffffffffffffffffffffffffffffffffffffff8089165f81815261623f86526040808220938b168083529387528082208a8352875290819020875181549890970151909416640100000000027fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000090971695909416949094179490941790555187907fcc129567ae9a8e3c55e1ad3156090375e3c062bbbfdb78098a15bdf158a73b2b90610f6f908790879091825261ffff1660208201526060604082018190525f9082015260800190565b5f80613f9f836114c9565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061400c575073ffffffffffffffffffffffffffffffffffffffff8082165f908152606a602090815260408083209388168352929052205460ff165b80612a0b57508373ffffffffffffffffffffffffffffffffffffffff1661403284610b58565b73ffffffffffffffffffffffffffffffffffffffff1614949350505050565b5f54610100900460ff166140e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c9a565b60656140f38382615a6f565b506066610ac38282615a6f565b61410b848484614577565b6141158482614638565b6120e4614120612ee8565b8561468a565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036141bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c9a565b73ffffffffffffffffffffffffffffffffffffffff8381165f818152606a602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6040515f90309061428d907f844b71a30000000000000000000000000000000000000000000000000000000090849036908790602001615b87565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526142c591615bf1565b5f60405180830381855afa9150503d805f81146142fd576040519150601f19603f3d011682016040523d82523d5f602084013e614302565b606091505b505090503d5f803e808015611c3e573d5ff35b6060610a70826146a3565b5f63ffffffff821115614369576040517f6dfcc6500000000000000000000000000000000000000000000000000000000081526020600482015260248101839052604401610c9a565b5090565b5f763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c175f526e5af43d82803e903d91602b57fd5bf38260781b17602052603760095ff0905073ffffffffffffffffffffffffffffffffffffffff81166120d3576040517fc2f868f400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61440681614320565b61662780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff9290921691909117905550565b5f610a70826146ae565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168114806144d957507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b8061452f57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b1561455f57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c90565b90565b6120e4848484846146b8565b6110678161470e565b6113888261ffff1611156145bb576040517f9027b87e0000000000000000000000000000000000000000000000000000000081526113886004820152602401610c9a565b5f838152612f77602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff8616908117909155915191825284917f7fe5681e1690fe17cf4e6eb3ab89d245aefd82ebcbdb10922d9a19c92a64df31910160405180910390a2610ac38382613056565b80515f03614672576040517f446150f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f828152612b8f60205260409020610ac38282615a6f565b61149c828260405180602001604052805f815250614717565b6060610a70826120a8565b5f610a70826147b9565b73ffffffffffffffffffffffffffffffffffffffff841615614709575f828152616a0f6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b6120e4565b6110678161480e565b6147218383614817565b61472d5f848484614a42565b610ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610c9a565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f49064906000000000000000000000000000000000000000000000000000000001480610a705750610a7082614c1c565b61106781614cfe565b73ffffffffffffffffffffffffffffffffffffffff8216614894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c9a565b5f8181526067602052604090205473ffffffffffffffffffffffffffffffffffffffff161561491f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c9a565b5f8181526067602052604090205473ffffffffffffffffffffffffffffffffffffffff16156149aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c9a565b73ffffffffffffffffffffffffffffffffffffffff82165f81815260686020908152604080832080546001019055848352606790915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461149c5f83836001614562565b5f73ffffffffffffffffffffffffffffffffffffffff84163b15614c14578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02614a84612ee8565b8786866040518563ffffffff1660e01b8152600401614aa69493929190615c0c565b6020604051808303815f875af1925050508015614afe575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252614afb91810190615c4a565b60015b614bc9573d808015614b2b576040519150601f19603f3d011682016040523d82523d5f602084013e614b30565b606091505b5080515f03614bc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610c9a565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050612a0b565b506001612a0b565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480614cae57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610a7057507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610a70565b5f818152612f776020526040902080547fffffffffffffffffffff00000000000000000000000000000000000000000000169055611067815f818152612b8f60205260408120614d4d91614e30565b611067815f614d5b826114c9565b9050614d66826114c9565b5f83815260696020908152604080832080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811690915573ffffffffffffffffffffffffffffffffffffffff85168085526068845282852080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190558785526067909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a461149c815f846001614562565b508054614e3c9061571c565b5f825580601f10614e4b575050565b601f0160209004905f5260205f209081019061106791905b80821115614369575f8155600101614e63565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611067575f80fd5b5f60208284031215614eb3575f80fd5b8135610ef081614e76565b73ffffffffffffffffffffffffffffffffffffffff81168114611067575f80fd5b5f8060408385031215614ef0575f80fd5b823591506020830135614f0281614ebe565b809150509250929050565b5f5b83811015614f27578181015183820152602001614f0f565b50505f910152565b5f8151808452614f46816020860160208601614f0d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f610ef06020830184614f2f565b5f60208284031215614f9a575f80fd5b5035919050565b5f8060408385031215614fb2575f80fd5b8235614fbd81614ebe565b946020939093013593505050565b61ffff81168114611067575f80fd5b5f805f60608486031215614fec575f80fd5b833592506020840135614ffe81614ebe565b9150604084013561500e81614fcb565b809150509250925092565b5f805f6060848603121561502b575f80fd5b833561503681614ebe565b9250602084013561504681614ebe565b929592945050506040919091013590565b5f805f805f60a0868803121561506b575f80fd5b853561507681614ebe565b9450602086013561508681614ebe565b935060408601359250606086013561509d81614ebe565b949793965091946080013592915050565b5f8083601f8401126150be575f80fd5b50813567ffffffffffffffff8111156150d5575f80fd5b602083019150836020828501011115612aa9575f80fd5b5f8083601f8401126150fc575f80fd5b50813567ffffffffffffffff811115615113575f80fd5b6020830191508360208260051b8501011115612aa9575f80fd5b5f805f805f8060808789031215615142575f80fd5b863561514d81614fcb565b9550602087013561515d81614ebe565b9450604087013567ffffffffffffffff80821115615179575f80fd5b6151858a838b016150ae565b9096509450606089013591508082111561519d575f80fd5b506151aa89828a016150ec565b979a9699509497509295939492505050565b5f8083601f8401126151cc575f80fd5b50813567ffffffffffffffff8111156151e3575f80fd5b6020830191508360208260061b8501011115612aa9575f80fd5b5f805f805f60608688031215615211575f80fd5b85359450602086013567ffffffffffffffff8082111561522f575f80fd5b61523b89838a016151bc565b90965094506040880135915080821115615253575f80fd5b50615260888289016150ec565b969995985093965092949392505050565b5f8060408385031215615282575f80fd5b823561528d81614ebe565b91506020830135614f0281614ebe565b5f80602083850312156152ae575f80fd5b823567ffffffffffffffff8111156152c4575f80fd5b6152d0858286016150ae565b90969095509350505050565b5f805f80608085870312156152ef575f80fd5b84359350602085013561530181614ebe565b925060408501359150606085013561531881614fcb565b939692955090935050565b5f60208284031215615333575f80fd5b8135610ef081614ebe565b5f805f805f805f6080888a031215615354575f80fd5b87359650602088013567ffffffffffffffff80821115615372575f80fd5b61537e8b838c016150ec565b909850965060408a0135915080821115615396575f80fd5b6153a28b838c016151bc565b909650945060608a01359150808211156153ba575f80fd5b506153c78a828b016150ec565b989b979a50959850939692959293505050565b5f805f606084860312156153ec575f80fd5b83356153f781614ebe565b925060208401359150604084013561500e81614ebe565b8015158114611067575f80fd5b5f806040838503121561542c575f80fd5b823561543781614ebe565b91506020830135614f028161540e565b5f805f60408486031215615459575f80fd5b83359250602084013567ffffffffffffffff811115615476575f80fd5b615482868287016150ae565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156155035761550361548f565b604052919050565b5f67ffffffffffffffff8211156155245761552461548f565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f805f8060808587031215615563575f80fd5b843561556e81614ebe565b9350602085013561557e81614ebe565b925060408501359150606085013567ffffffffffffffff8111156155a0575f80fd5b8501601f810187136155b0575f80fd5b80356155c36155be8261550b565b6154bc565b8181528860208385010111156155d7575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f805f6040848603121561560a575f80fd5b83359250602084013567ffffffffffffffff811115615627575f80fd5b615482868287016150ec565b5f805f8060808587031215615646575f80fd5b84359350602085013561565881614ebe565b9250604085013561566881614fcb565b9150606085013561531881614ebe565b5f805f806080858703121561568b575f80fd5b843561569681614ebe565b935060208501356156a681614ebe565b93969395505050506040820135916060013590565b5f805f80606085870312156156ce575f80fd5b84356156d981614fcb565b935060208501356156e981614ebe565b9250604085013567ffffffffffffffff811115615704575f80fd5b615710878288016150ae565b95989497509550505050565b600181811c9082168061573057607f821691505b602082108103615767577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b5f806040838503121561577e575f80fd5b825167ffffffffffffffff811115615794575f80fd5b8301601f810185136157a4575f80fd5b80516157b26155be8261550b565b8181528660208385010111156157c6575f80fd5b6157d7826020830160208601614f0d565b8094505050506020830151614f0281614fcb565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215615828575f80fd5b8151610ef081614ebe565b5f63ffffffff808316818103615870577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b6001019392505050565b5f6020828403121561588a575f80fd5b8151610ef08161540e565b5f602082840312156158a5575f80fd5b5051919050565b838152604060208083018290528282018490525f9190859060608501845b8781101561590d5783356158dd81614ebe565b73ffffffffffffffffffffffffffffffffffffffff168252838301358383015292840192908401906001016158ca565b5098975050505050505050565b5f602080838503121561592b575f80fd5b825167ffffffffffffffff80821115615942575f80fd5b818501915085601f830112615955575f80fd5b8151818111156159675761596761548f565b8060051b91506159788483016154bc565b8181529183018401918481019088841115615991575f80fd5b938501935b838510156159bb57845192506159ab83614ebe565b8282529385019390850190615996565b98975050505050505050565b838152604060208083018290529082018390525f90849060608401835b86811015615a1f5783356159f781614ebe565b73ffffffffffffffffffffffffffffffffffffffff16825292820192908201906001016159e4565b50979650505050505050565b601f821115610ac357805f5260205f20601f840160051c81016020851015615a505750805b601f840160051c820191505b81811015610e8a575f8155600101615a5c565b815167ffffffffffffffff811115615a8957615a8961548f565b615a9d81615a97845461571c565b84615a2b565b602080601f831160018114615aef575f8415615ab95750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b1785556115c4565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015615b3b57888601518255948401946001909101908401615b1c565b5085821015615b7757878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b7fffffffff00000000000000000000000000000000000000000000000000000000851681528284600483013760609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166004919092019081019190915260180192915050565b5f8251615c02818460208701614f0d565b9190910192915050565b5f73ffffffffffffffffffffffffffffffffffffffff8087168352808616602084015250836040830152608060608301526112176080830184614f2f565b5f60208284031215615c5a575f80fd5b8151610ef081614e7656fea2646970667358221220251f44b759124064335b7666769ee71f413e30184f8d9a1906d85f154393ba1464736f6c6343000817003300000000000000000000000067df244584b67e8c51b10ad610aaffa9a402fdb6000000000000000000000000cda72070e455bb31c7690a170224ce43623d0b6f00000000000000000000000053f451165ba6fdbe39a134673d13948261b2334a000000000000000000000000762340b8a40cdd5bfc3edd94265899fda345d0e3000000000000000000000000de00c8b5cf7df6e29238dbf41915ef5ec5252be10000000000000000000000000605df9bde1b7f7538f46841daadc307cb2f2c80
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061037d575f3560e01c8063718522aa116101d4578063af44422c11610109578063cec32ca5116100a9578063f0294f4b11610079578063f0294f4b14610a12578063f3991be614610a25578063f7a2da2314610a2d578063fd2eab6914610a53575f80fd5b8063cec32ca514610991578063d5adf489146109a4578063e3faf504146109b7578063e985e9c5146109ca575f80fd5b8063b88d4fde116100e4578063b88d4fde14610945578063c5b2486914610958578063c87b56dd1461096b578063cb97397c1461097e575f80fd5b8063af44422c146108f9578063b4a0f56f1461090c578063b590104e1461091f575f80fd5b80638c59fb731161017457806393251fba1161014f57806393251fba146108a557806395d89b41146108b8578063a22cb465146108c0578063ae3a4253146108d3575f80fd5b80638c59fb73146108415780638d6ed42c146108675780638f40f3781461087a575f80fd5b80638129fc1c116101af5780638129fc1c146107bb578063844b71a3146107c3578063865a2f0f146107cb5780638abf92c91461080a575f80fd5b8063718522aa1461069457806372215bea146106e8578063724ef5011461077f575f80fd5b806332217821116102b557806342842e0e1161025557806363a74d601161022557806363a74d601461064857806368b16b3f1461065b578063691aa51a1461066e57806370a0823114610681575f80fd5b806342842e0e146105fc57806342966c681461060f57806347de74be146106225780636352211e14610635575f80fd5b80633695f607116102905780633695f6071461056c578063389fb0f31461058d5780633b60d097146105a057806340ef10b8146105e9575f80fd5b806332217821146104ec57806332ac730f14610533578063331aaf9e14610546575f80fd5b8063140e6a091161032057806324ee1885116102fb57806324ee18851461047d578063274fae7c146104905780632c1e9006146104a35780632d4f2b01146104b6575f80fd5b8063140e6a0914610444578063200776bc1461045757806323b872dd1461046a575f80fd5b8063081812fc1161035b578063081812fc146103d3578063090d18b31461040b578063095ea7b31461041e578063095f0c7014610431575f80fd5b806301ffc9a71461038157806305d8d4f2146103a957806306fdde03146103be575b5f80fd5b61039461038f366004614ea3565b610a66565b60405190151581526020015b60405180910390f35b6103bc6103b7366004614edf565b610a76565b005b6103c6610ac8565b6040516103a09190614f78565b6103e66103e1366004614f8a565b610b58565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103a0565b6103bc610419366004614edf565b610b8a565b6103bc61042c366004614fa1565b610bd7565b6103bc61043f366004614edf565b610d81565b6103bc610452366004614fda565b610e16565b610394610465366004614edf565b610e91565b6103bc610478366004615019565b610ef7565b6103bc61048b366004614fa1565b610f02565b6103bc61049e366004614f8a565b610f7e565b6103bc6104b1366004614f8a565b611056565b6103e66104c4366004614f8a565b5f908152616a0f602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b6104ff6104fa366004615057565b61106a565b6040805193845273ffffffffffffffffffffffffffffffffffffffff909216602084015261ffff16908201526060016103a0565b610394610541366004614edf565b61119b565b7f000000000000000000000000cda72070e455bb31c7690a170224ce43623d0b6f6103e6565b61057f61057a36600461512d565b6111fd565b6040519081526020016103a0565b6103bc61059b3660046151fd565b611221565b6105b36105ae366004615271565b611294565b6040805173ffffffffffffffffffffffffffffffffffffffff9094168452602084019290925261ffff16908201526060016103a0565b6103bc6105f7366004614edf565b6113b7565b6103bc61060a366004615019565b611404565b6103bc61061d366004614f8a565b61141e565b6103bc61063036600461529d565b6114a0565b6103e6610643366004614f8a565b6114c9565b6103bc6106563660046152dc565b611554565b6103bc610669366004614fa1565b6115cc565b6103bc61067c366004614edf565b61175b565b61057f61068f366004615323565b6117f1565b6106a76106a2366004615323565b6118bd565b6040516103a0949392919093845273ffffffffffffffffffffffffffffffffffffffff92831660208501529116604083015261ffff16606082015260800190565b6040805173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000cda72070e455bb31c7690a170224ce43623d0b6f811682527f00000000000000000000000053f451165ba6fdbe39a134673d13948261b2334a811660208301527f000000000000000000000000762340b8a40cdd5bfc3edd94265899fda345d0e316918101919091526060016103a0565b6103e661078d366004614f8a565b5f908152612f77602052604090205462010000900473ffffffffffffffffffffffffffffffffffffffff1690565b6103bc6119a7565b6103bc611b9f565b6107de6107d9366004614fa1565b611c42565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016103a0565b61082e610818366004614f8a565b5f908152612f77602052604090205461ffff1690565b60405161ffff90911681526020016103a0565b7f0000000000000000000000000605df9bde1b7f7538f46841daadc307cb2f2c806103e6565b6103bc61087536600461533e565b611cb4565b61088d6108883660046153da565b611e63565b6040805192835261ffff9091166020830152016103a0565b6103bc6108b3366004614fa1565b611f36565b6103c661205e565b6103bc6108ce36600461541b565b61206d565b7f000000000000000000000000de00c8b5cf7df6e29238dbf41915ef5ec5252be16103e6565b6103bc610907366004615447565b61207f565b6103c661091a366004614f8a565b6120a8565b7f00000000000000000000000053f451165ba6fdbe39a134673d13948261b2334a6103e6565b6103bc610953366004615550565b6120d8565b6103bc6109663660046155f8565b6120ea565b6103c6610979366004614f8a565b612172565b6103e661098c366004615633565b61217d565b6104ff61099f366004615678565b61281a565b61057f6109b23660046156bb565b612932565b61088d6109c5366004615271565b612a13565b6103946109d8366004615271565b73ffffffffffffffffffffffffffffffffffffffff9182165f908152606a6020908152604080832093909416825291909152205460ff1690565b610394610a20366004614edf565b612ab0565b6103bc612af9565b7f00000000000000000000000067df244584b67e8c51b10ad610aaffa9a402fdb66103e6565b6103bc610a61366004614edf565b612dac565b5f610a7082612ede565b92915050565b81610a8381610a20612ee8565b610ab9576040517fb730a3eb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ac38383612ef6565b505050565b606060658054610ad79061571c565b80601f0160208091040260200160405190810160405280929190818152602001828054610b039061571c565b8015610b4e5780601f10610b2557610100808354040283529160200191610b4e565b820191905f5260205f20905b815481529060010190602001808311610b3157829003601f168201915b5050505050905090565b5f610b6282612fcc565b505f9081526069602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b81610b9781610a20612ee8565b610bcd576040517fb730a3eb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ac38383613056565b5f610be1826114c9565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610ca3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610cc2612ee8565b73ffffffffffffffffffffffffffffffffffffffff161480610ceb5750610ceb816109d8612ee8565b610d77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610c9a565b610ac3838361318f565b81610d8e81610a20612ee8565b610dc4576040517fb730a3eb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610dcf83835f61322e565b60405173ffffffffffffffffffffffffffffffffffffffff83169084907f1f0f31fb98449c6c6d9042af0dad644b67c406b4bc9996b2581c77c0108cba48905f90a3505050565b8281610e2182612fcc565b6113888161ffff161115610e65576040517f9a5b7c1b0000000000000000000000000000000000000000000000000000000081526113886004820152602401610c9a565b610e778282610e72612ee8565b6132ea565b610e8a85610e83612ee8565b86866133c1565b5050505050565b5f610e9c8383612ab0565b80610ef05750610ef0838360015b5f928352609760209081526040808520858052825280852073ffffffffffffffffffffffffffffffffffffffff9094168552929052912054600160ff9092161c16151590565b9392505050565b610ac3838383613562565b5f805f610f0e84613594565b6040805173ffffffffffffffffffffffffffffffffffffffff8085168252602082018a9052918101839052939650919450925033919087169085907fa7e3741a0b4c9ccc7effed91a2572c1274703b3c573e2079b5963171de00b107906060015b60405180910390a45050505050565b5f818152616a0f602052604090205473ffffffffffffffffffffffffffffffffffffffff16610fab612ee8565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611027576040517f1a065e4200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610c9a565b5f611031836114c9565b905061103e8183856136b6565b6110488382612ab0565b610ac357610ac38382610d81565b61106781611062612ee8565b612ef6565b50565b73ffffffffffffffffffffffffffffffffffffffff8086165f90815261623f60209081526040808320938816835292815282822086835290529081205463ffffffff1690808215611190575f838152612f77602052604090205462010000900473ffffffffffffffffffffffffffffffffffffffff169150816110f2575f92505f9150611190565b5073ffffffffffffffffffffffffffffffffffffffff8781165f81815261623f602090815260408083208b86168085529083528184208b85528352928190205481519384529183018a9052938816828501526060820187905261ffff64010000000090910416608082018190529251339186917f04224969448af01888ee9b82ab14d1cf761cc9aacf7a51195e63d512a7a8149b9181900360a00190a45b955095509592505050565b5f8281526067602052604081205473ffffffffffffffffffffffffffffffffffffffff1615610a7057505f91825261335f6020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b5f61120a87878787612932565b90506112178184846139b8565b9695505050505050565b61122a85612fcc565b82158015611236575080155b1561126d576040517fdba56a1100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e8a8561128b875f908152612f77602052604090205461ffff1690565b868686866139e0565b73ffffffffffffffffffffffffffffffffffffffff8082165f90815261604b602090815260408083208685168452909152812054909116908082156113b05773ffffffffffffffffffffffffffffffffffffffff83165f90815261604c602052604081205463ffffffff74010000000000000000000000000000000000000000909104169250611345835f9081526067602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16146113ac575073ffffffffffffffffffffffffffffffffffffffff82165f90815261604c60205260409020547801000000000000000000000000000000000000000000000000900461ffff166113b0565b5f91505b9250925092565b816113c481610465612ee8565b6113fa576040517f9925908400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ac38383613c84565b610ac383838360405180602001604052805f8152506120d8565b80611427612ee8565b73ffffffffffffffffffffffffffffffffffffffff16611446826114c9565b73ffffffffffffffffffffffffffffffffffffffff1614611493576040517f92c311b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61149c82613dac565b5050565b61149c7f000000000000000000000000de00c8b5cf7df6e29238dbf41915ef5ec5252be1613db5565b5f8181526067602052604081205473ffffffffffffffffffffffffffffffffffffffff1680610a70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610c9a565b838161155f82612fcc565b6113888161ffff1611156115a3576040517f9a5b7c1b0000000000000000000000000000000000000000000000000000000081526113886004820152602401610c9a565b6115b08282610e72612ee8565b6115c4866115bc612ee8565b878787613dcf565b505050505050565b6115dd6115d7612ee8565b82613f94565b611613576040517f62272c1f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f818152616a0f602052604090205473ffffffffffffffffffffffffffffffffffffffff808416911603611673576040517fdef5088a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61167c816114c9565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116e0576040517ffd461d2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f818152616a0f602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8616908117909155905183927fca67ac802f4ee7e410b499c4141b330c34c3cb8c16186c36ab8e8e1dee87c00191a35050565b8161176881610a20612ee8565b61179e576040517fb730a3eb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117aa8383600161322e565b60405173ffffffffffffffffffffffffffffffffffffffff83169084907f7ff28266011814b6ef705d4afbdc5acdcfc98bc4121ff51fa9e8b38dfdc7c4b9905f90a3505050565b5f73ffffffffffffffffffffffffffffffffffffffff8216611895576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610c9a565b5073ffffffffffffffffffffffffffffffffffffffff165f9081526068602052604090205490565b73ffffffffffffffffffffffffffffffffffffffff81165f90815261604c60205260408120805463ffffffff740100000000000000000000000000000000000000009091041691908190819081611935865f9081526067602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff161461199b578054600182015473ffffffffffffffffffffffffffffffffffffffff80831696501693507801000000000000000000000000000000000000000000000000900461ffff16915061199f565b5f94505b509193509193565b5f54610100900460ff16158080156119c557505f54600160ff909116105b806119de5750303b1580156119de57505f5460ff166001145b611a6a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610c9a565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015611ac6575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b611b3a6040518060400160405280600681526020017f576f726c647300000000000000000000000000000000000000000000000000008152506040518060400160405280600581526020017f574f524c44000000000000000000000000000000000000000000000000000000815250614051565b8015611067575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b333014611bd8576040517feab5a03f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe836018060045f375f80825f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c5af490503d5f803e808015611c3e573d5ff35b3d5ffd5b5f805f611c4e84613594565b6040805188815260208101839052929650909450919250339173ffffffffffffffffffffffffffffffffffffffff88169184917fa89bd13a0c7d13b451ac594826a0ae0852a3cee796872087c3fe4ef607271203910160405180910390a4509250929050565b6166275463ffffffff16158015611cd857506002611cd35f5460ff1690565b60ff16105b15611d0f576040517fe4c2279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f611d18612ee8565b90505f807f000000000000000000000000cda72070e455bb31c7690a170224ce43623d0b6f73ffffffffffffffffffffffffffffffffffffffff16633e9e8bf88b856040518363ffffffff1660e01b8152600401611d9692919091825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b5f604051808303815f875af1158015611db1573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611df6919081019061576d565b91509150611e068a828585614100565b5f5b88811015611e4857611e408b8b8b84818110611e2657611e266157eb565b9050602002016020810190611e3b9190615323565b613c84565b600101611e08565b50611e578a82898989896139e0565b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8082165f90815261623f60209081526040808320938716835292815282822085835290529081205463ffffffff16908115801590611ed857505f8281526067602052604090205473ffffffffffffffffffffffffffffffffffffffff1615155b15611f2a575073ffffffffffffffffffffffffffffffffffffffff8281165f90815261623f60209081526040808320938816835292815282822086835290522054640100000000900461ffff16611f2e565b5f91505b935093915050565b5f611f3f612ee8565b73ffffffffffffffffffffffffffffffffffffffff8082165f90815261623f60209081526040808320938816835292815282822086835290529081205491925063ffffffff90911690819003611fc1576040517f693ab87c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8281165f81815261623f6020908152604080832094891680845294825280832088845282529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000169055905186815284917f0e2d557782991164095499aab37a3d8177adfb1f97fce0a12f8d7b49466336b391015b60405180910390a450505050565b606060668054610ad79061571c565b61149c612078612ee8565b8383614126565b610ac37f000000000000000000000000de00c8b5cf7df6e29238dbf41915ef5ec5252be1613db5565b60606120d37f000000000000000000000000de00c8b5cf7df6e29238dbf41915ef5ec5252be1614252565b919050565b6120e484848484613562565b50505050565b826120f781610465612ee8565b61212d576040517f9925908400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f829003612167576040517ff12c846f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6120e48484846139b8565b6060610a7082614315565b5f848361218982612fcc565b6113888161ffff1611156121cd576040517f9a5b7c1b0000000000000000000000000000000000000000000000000000000081526113886004820152602401610c9a565b6121da8282610e72612ee8565b5f6121e3612ee8565b73ffffffffffffffffffffffffffffffffffffffff8082165f90815261604b602090815260408083208c85168452909152902054169450905083158015906122f757508473ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612286573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122aa9190615818565b73ffffffffffffffffffffffffffffffffffffffff1614806122f757508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16145b1561248f5773ffffffffffffffffffffffffffffffffffffffff84165f90815261604c602052604090205474010000000000000000000000000000000000000000900463ffffffff1688148015612395575073ffffffffffffffffffffffffffffffffffffffff84165f90815261604c602052604090205461ffff878116780100000000000000000000000000000000000000000000000090920416145b156123cc576040517fe48d39c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6123d588614320565b73ffffffffffffffffffffffffffffffffffffffff85165f90815261604c6020526040902080547fffffffffffff000000000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff93909316929092027fffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffff1691909117780100000000000000000000000000000000000000000000000061ffff891602179055612774565b73ffffffffffffffffffffffffffffffffffffffff8416156125205773ffffffffffffffffffffffffffffffffffffffff84165f90815261604c6020526040902080547fffffffffffff000000000000000000000000000000000000000000000000000016815560010180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b61255f7f0000000000000000000000000605df9bde1b7f7538f46841daadc307cb2f2c8073ffffffffffffffffffffffffffffffffffffffff1661436d565b6040517fc4d66de800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301529195509085169063c4d66de8906024015f604051808303815f87803b1580156125c9575f80fd5b505af11580156125db573d5f803e3d5ffd5b5050505073ffffffffffffffffffffffffffffffffffffffff8181165f90815261604b602090815260408083208b85168085529083529281902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001694891694909417909355825160808101909352908252810161265a8a614320565b63ffffffff908116825261ffff89811660208085019190915273ffffffffffffffffffffffffffffffffffffffff8681166040958601528981165f90815261604c83528590208651815493880151968801519083167fffffffffffffffff00000000000000000000000000000000000000000000000090941693909317740100000000000000000000000000000000000000009690951695909502939093177fffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffff1678010000000000000000000000000000000000000000000000009190921602178255606090920151600190910180547fffffffffffffffffffffffff000000000000000000000000000000000000000016919092161790555b8673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16897fd6ac66cf5ef5678b17b10f8b48c2765185f4f2b139842894bc5e7fce2aff9d2e878a60405161280792919073ffffffffffffffffffffffffffffffffffffffff92909216825261ffff1660208201526060604082018190525f9082015260800190565b60405180910390a4505050949350505050565b73ffffffffffffffffffffffffffffffffffffffff8085165f908152615e576020908152604080832093871683529290529081205463ffffffff1690808215612928575f838152612f77602052604090205462010000900473ffffffffffffffffffffffffffffffffffffffff1691508161289a575f92505f9150612928565b5073ffffffffffffffffffffffffffffffffffffffff8681165f818152615e5760209081526040808320948a1680845294825291829020548251948552908401889052908301869052640100000000900461ffff166060830181905291339085907e516abd10b395e6c97f8299bd4a334d6b6e95b4be5c2b31f1ae4cd5bae072499060800160405180910390a45b9450945094915050565b616627545f9063ffffffff16158015612958575060026129535f5460ff1690565b60ff16105b1561298f576040517fe4c2279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61662780545f906129a59063ffffffff16615833565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff169050612a0b81868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061410092505050565b949350505050565b73ffffffffffffffffffffffffffffffffffffffff8181165f908152615e5760209081526040808320868516845282528083205463ffffffff16808452606790925282205490921615612aa5575073ffffffffffffffffffffffffffffffffffffffff8281165f908152615e576020908152604080832093871683529290522054640100000000900461ffff16612aa9565b5f91505b9250929050565b5f8173ffffffffffffffffffffffffffffffffffffffff16612ad1846114c9565b73ffffffffffffffffffffffffffffffffffffffff161480610ef05750610ef083835f610eaa565b5f54600290610100900460ff16158015612b1957505f5460ff8083169116105b612ba5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610c9a565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001660ff8316176101001790556040517f24d7806c00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000067df244584b67e8c51b10ad610aaffa9a402fdb616906324d7806c90602401602060405180830381865afa158015612c5d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612c81919061587a565b612cb7576040517faf8db33300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f000000000000000000000000cda72070e455bb31c7690a170224ce43623d0b6f73ffffffffffffffffffffffffffffffffffffffff166370f0c5d96040518163ffffffff1660e01b81526004016020604051808303815f875af1158015612d22573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612d469190615895565b9050612d51816143fd565b505f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602001611b94565b81612db981610465612ee8565b612def576040517f9925908400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f83815261335f6020908152604080832073ffffffffffffffffffffffffffffffffffffffff861684529091529020805460ff16612e59576040517f090daa9100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f84815261335f6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551909186917f49e43845376b004b5c6ea76194d6de04333118e0f6c9c068f657d3a32cc5b33a9190a350505050565b5f610a708261443f565b5f612ef1614449565b905090565b5f828152609760209081526040808320838052825280832073ffffffffffffffffffffffffffffffffffffffff851684529091528120549003612f65576040517f74f8519400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f828152609760209081526040808320838052825280832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832083905551909184917f15b346905c3358a4c6206e8d53796ff94c13e1acfeb566d58ba34274033fe78a9190a35050565b5f8181526067602052604090205473ffffffffffffffffffffffffffffffffffffffff16611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610c9a565b73ffffffffffffffffffffffffffffffffffffffff81166130a3576040517f1d7b9e2200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f828152612f77602052604090205473ffffffffffffffffffffffffffffffffffffffff808316620100009092041603613109576040517f2acbabd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f828152612f77602052604080822080547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff8616908102919091179091559051909184917f815a7b07588e7ea8e1215949a7ff4e6b7ad525fd783567ad41ca1093dde1c1219190a35050565b5f81815260696020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841690811790915581906131e8826114c9565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b5f838152609760209081526040808320838052825280832073ffffffffffffffffffffffffffffffffffffffff8616845290915290205460ff82161c600116156132a4576040517fbdf15e9000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f928352609760209081526040808520858052825280852073ffffffffffffffffffffffffffffffffffffffff90941685529290529120600160ff9092169190911b9055565b5f83815261335f6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16613353576040517f090daa9100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f838152612f77602052604090205461ffff1661ffff168261ffff161015610ac3575f838152612f77602052604090205461ffff166040517f55320e0000000000000000000000000000000000000000000000000000000000815261ffff9091166004820152602401610c9a565b73ffffffffffffffffffffffffffffffffffffffff8084165f908152615e57602090815260408083209386168352929052205463ffffffff1684148015613448575073ffffffffffffffffffffffffffffffffffffffff8084165f908152615e57602090815260408083209386168352929052205461ffff82811664010000000090920416145b1561347f576040517f37d7b2a400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051806040016040528061349386614320565b63ffffffff908116825261ffff848116602093840181905273ffffffffffffffffffffffffffffffffffffffff8881165f818152615e5787526040808220938b16808352938852808220895181549a8a015198167fffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000909a169990991764010000000097909616969096029490941790965583519182529381018390529182015290919086907fea85788422f4b4e71907159b221a46645cb0e9c8ade05637904689e1c15e093190606001612050565b6040517fd7e493c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f90815261604c60205260408120805463ffffffff7401000000000000000000000000000000000000000090910416919081906135fb845f908152612f77602052604090205473ffffffffffffffffffffffffffffffffffffffff620100009091041690565b925073ffffffffffffffffffffffffffffffffffffffff831661368357835f03613651576040517fef05ec8700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f895e1a5c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8054612710907801000000000000000000000000000000000000000000000000900461ffff168602049150509193909250565b8273ffffffffffffffffffffffffffffffffffffffff166136d6826114c9565b73ffffffffffffffffffffffffffffffffffffffff1614613779576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610c9a565b73ffffffffffffffffffffffffffffffffffffffff821661381b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610c9a565b8273ffffffffffffffffffffffffffffffffffffffff1661383b826114c9565b73ffffffffffffffffffffffffffffffffffffffff16146138de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610c9a565b5f81815260696020908152604080832080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811690915573ffffffffffffffffffffffffffffffffffffffff8781168086526068855283862080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905590871680865283862080546001019055868652606790945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610ac38383836001614562565b5f5b818110156120e4576139d884848484818110611e2657611e266157eb565b6001016139ba565b8215613b3d576040517f401cf1500000000000000000000000000000000000000000000000000000000081525f9073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000cda72070e455bb31c7690a170224ce43623d0b6f169063401cf15090613a5e908a90899089906004016158ac565b5f604051808303815f875af1158015613a79573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052613abe919081019061591a565b90505f5b84811015613b3a57613b3288838381518110613ae057613ae06157eb565b6020026020010151888885818110613afa57613afa6157eb565b613b109260206040909202019081019150615323565b898986818110613b2257613b226157eb565b905060400201602001358b613dcf565b600101613ac2565b50505b80156115c4576040517f618b43b40000000000000000000000000000000000000000000000000000000081525f9073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000053f451165ba6fdbe39a134673d13948261b2334a169063618b43b490613bbb908a90879087906004016159c7565b5f604051808303815f875af1158015613bd6573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052613c1b919081019061591a565b90505f5b82811015613c7a57613c7288838381518110613c3d57613c3d6157eb565b6020026020010151868685818110613c5757613c576157eb565b9050602002016020810190613c6c9190615323565b8a6133c1565b600101613c1f565b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116613cd1576040517f1d7a89cf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f82815261335f6020908152604080832073ffffffffffffffffffffffffffffffffffffffff851684529091529020805460ff1615613d3c576040517fdbd1a8d900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117815560405173ffffffffffffffffffffffffffffffffffffffff83169084907f1f2c9050d0cb7496cc1729c2ab051bafda1ebc461ce72e3505e2c3ffe18678bc905f90a3505050565b6110678161456e565b365f80375f80365f845af43d5f803e808015611c3e573d5ff35b73ffffffffffffffffffffffffffffffffffffffff8085165f90815261623f6020908152604080832093871683529281528282208583529052205463ffffffff1685148015613e66575073ffffffffffffffffffffffffffffffffffffffff8085165f90815261623f6020908152604080832093871683529281528282208583529052205461ffff82811664010000000090920416145b15613e9d576040517f1c55a14000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040518060400160405280613eb187614320565b63ffffffff908116825261ffff80851660209384015273ffffffffffffffffffffffffffffffffffffffff8089165f81815261623f86526040808220938b168083529387528082208a8352875290819020875181549890970151909416640100000000027fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000090971695909416949094179490941790555187907fcc129567ae9a8e3c55e1ad3156090375e3c062bbbfdb78098a15bdf158a73b2b90610f6f908790879091825261ffff1660208201526060604082018190525f9082015260800190565b5f80613f9f836114c9565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061400c575073ffffffffffffffffffffffffffffffffffffffff8082165f908152606a602090815260408083209388168352929052205460ff165b80612a0b57508373ffffffffffffffffffffffffffffffffffffffff1661403284610b58565b73ffffffffffffffffffffffffffffffffffffffff1614949350505050565b5f54610100900460ff166140e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c9a565b60656140f38382615a6f565b506066610ac38282615a6f565b61410b848484614577565b6141158482614638565b6120e4614120612ee8565b8561468a565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036141bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c9a565b73ffffffffffffffffffffffffffffffffffffffff8381165f818152606a602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6040515f90309061428d907f844b71a30000000000000000000000000000000000000000000000000000000090849036908790602001615b87565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526142c591615bf1565b5f60405180830381855afa9150503d805f81146142fd576040519150601f19603f3d011682016040523d82523d5f602084013e614302565b606091505b505090503d5f803e808015611c3e573d5ff35b6060610a70826146a3565b5f63ffffffff821115614369576040517f6dfcc6500000000000000000000000000000000000000000000000000000000081526020600482015260248101839052604401610c9a565b5090565b5f763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c175f526e5af43d82803e903d91602b57fd5bf38260781b17602052603760095ff0905073ffffffffffffffffffffffffffffffffffffffff81166120d3576040517fc2f868f400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61440681614320565b61662780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff9290921691909117905550565b5f610a70826146ae565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000cda72070e455bb31c7690a170224ce43623d0b6f168114806144d957507f00000000000000000000000053f451165ba6fdbe39a134673d13948261b2334a73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b8061452f57507f000000000000000000000000762340b8a40cdd5bfc3edd94265899fda345d0e373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b1561455f57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c90565b90565b6120e4848484846146b8565b6110678161470e565b6113888261ffff1611156145bb576040517f9027b87e0000000000000000000000000000000000000000000000000000000081526113886004820152602401610c9a565b5f838152612f77602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff8616908117909155915191825284917f7fe5681e1690fe17cf4e6eb3ab89d245aefd82ebcbdb10922d9a19c92a64df31910160405180910390a2610ac38382613056565b80515f03614672576040517f446150f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f828152612b8f60205260409020610ac38282615a6f565b61149c828260405180602001604052805f815250614717565b6060610a70826120a8565b5f610a70826147b9565b73ffffffffffffffffffffffffffffffffffffffff841615614709575f828152616a0f6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b6120e4565b6110678161480e565b6147218383614817565b61472d5f848484614a42565b610ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610c9a565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f49064906000000000000000000000000000000000000000000000000000000001480610a705750610a7082614c1c565b61106781614cfe565b73ffffffffffffffffffffffffffffffffffffffff8216614894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c9a565b5f8181526067602052604090205473ffffffffffffffffffffffffffffffffffffffff161561491f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c9a565b5f8181526067602052604090205473ffffffffffffffffffffffffffffffffffffffff16156149aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c9a565b73ffffffffffffffffffffffffffffffffffffffff82165f81815260686020908152604080832080546001019055848352606790915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461149c5f83836001614562565b5f73ffffffffffffffffffffffffffffffffffffffff84163b15614c14578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02614a84612ee8565b8786866040518563ffffffff1660e01b8152600401614aa69493929190615c0c565b6020604051808303815f875af1925050508015614afe575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252614afb91810190615c4a565b60015b614bc9573d808015614b2b576040519150601f19603f3d011682016040523d82523d5f602084013e614b30565b606091505b5080515f03614bc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610c9a565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050612a0b565b506001612a0b565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480614cae57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610a7057507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610a70565b5f818152612f776020526040902080547fffffffffffffffffffff00000000000000000000000000000000000000000000169055611067815f818152612b8f60205260408120614d4d91614e30565b611067815f614d5b826114c9565b9050614d66826114c9565b5f83815260696020908152604080832080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811690915573ffffffffffffffffffffffffffffffffffffffff85168085526068845282852080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190558785526067909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a461149c815f846001614562565b508054614e3c9061571c565b5f825580601f10614e4b575050565b601f0160209004905f5260205f209081019061106791905b80821115614369575f8155600101614e63565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611067575f80fd5b5f60208284031215614eb3575f80fd5b8135610ef081614e76565b73ffffffffffffffffffffffffffffffffffffffff81168114611067575f80fd5b5f8060408385031215614ef0575f80fd5b823591506020830135614f0281614ebe565b809150509250929050565b5f5b83811015614f27578181015183820152602001614f0f565b50505f910152565b5f8151808452614f46816020860160208601614f0d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f610ef06020830184614f2f565b5f60208284031215614f9a575f80fd5b5035919050565b5f8060408385031215614fb2575f80fd5b8235614fbd81614ebe565b946020939093013593505050565b61ffff81168114611067575f80fd5b5f805f60608486031215614fec575f80fd5b833592506020840135614ffe81614ebe565b9150604084013561500e81614fcb565b809150509250925092565b5f805f6060848603121561502b575f80fd5b833561503681614ebe565b9250602084013561504681614ebe565b929592945050506040919091013590565b5f805f805f60a0868803121561506b575f80fd5b853561507681614ebe565b9450602086013561508681614ebe565b935060408601359250606086013561509d81614ebe565b949793965091946080013592915050565b5f8083601f8401126150be575f80fd5b50813567ffffffffffffffff8111156150d5575f80fd5b602083019150836020828501011115612aa9575f80fd5b5f8083601f8401126150fc575f80fd5b50813567ffffffffffffffff811115615113575f80fd5b6020830191508360208260051b8501011115612aa9575f80fd5b5f805f805f8060808789031215615142575f80fd5b863561514d81614fcb565b9550602087013561515d81614ebe565b9450604087013567ffffffffffffffff80821115615179575f80fd5b6151858a838b016150ae565b9096509450606089013591508082111561519d575f80fd5b506151aa89828a016150ec565b979a9699509497509295939492505050565b5f8083601f8401126151cc575f80fd5b50813567ffffffffffffffff8111156151e3575f80fd5b6020830191508360208260061b8501011115612aa9575f80fd5b5f805f805f60608688031215615211575f80fd5b85359450602086013567ffffffffffffffff8082111561522f575f80fd5b61523b89838a016151bc565b90965094506040880135915080821115615253575f80fd5b50615260888289016150ec565b969995985093965092949392505050565b5f8060408385031215615282575f80fd5b823561528d81614ebe565b91506020830135614f0281614ebe565b5f80602083850312156152ae575f80fd5b823567ffffffffffffffff8111156152c4575f80fd5b6152d0858286016150ae565b90969095509350505050565b5f805f80608085870312156152ef575f80fd5b84359350602085013561530181614ebe565b925060408501359150606085013561531881614fcb565b939692955090935050565b5f60208284031215615333575f80fd5b8135610ef081614ebe565b5f805f805f805f6080888a031215615354575f80fd5b87359650602088013567ffffffffffffffff80821115615372575f80fd5b61537e8b838c016150ec565b909850965060408a0135915080821115615396575f80fd5b6153a28b838c016151bc565b909650945060608a01359150808211156153ba575f80fd5b506153c78a828b016150ec565b989b979a50959850939692959293505050565b5f805f606084860312156153ec575f80fd5b83356153f781614ebe565b925060208401359150604084013561500e81614ebe565b8015158114611067575f80fd5b5f806040838503121561542c575f80fd5b823561543781614ebe565b91506020830135614f028161540e565b5f805f60408486031215615459575f80fd5b83359250602084013567ffffffffffffffff811115615476575f80fd5b615482868287016150ae565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156155035761550361548f565b604052919050565b5f67ffffffffffffffff8211156155245761552461548f565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f805f8060808587031215615563575f80fd5b843561556e81614ebe565b9350602085013561557e81614ebe565b925060408501359150606085013567ffffffffffffffff8111156155a0575f80fd5b8501601f810187136155b0575f80fd5b80356155c36155be8261550b565b6154bc565b8181528860208385010111156155d7575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f805f6040848603121561560a575f80fd5b83359250602084013567ffffffffffffffff811115615627575f80fd5b615482868287016150ec565b5f805f8060808587031215615646575f80fd5b84359350602085013561565881614ebe565b9250604085013561566881614fcb565b9150606085013561531881614ebe565b5f805f806080858703121561568b575f80fd5b843561569681614ebe565b935060208501356156a681614ebe565b93969395505050506040820135916060013590565b5f805f80606085870312156156ce575f80fd5b84356156d981614fcb565b935060208501356156e981614ebe565b9250604085013567ffffffffffffffff811115615704575f80fd5b615710878288016150ae565b95989497509550505050565b600181811c9082168061573057607f821691505b602082108103615767577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b5f806040838503121561577e575f80fd5b825167ffffffffffffffff811115615794575f80fd5b8301601f810185136157a4575f80fd5b80516157b26155be8261550b565b8181528660208385010111156157c6575f80fd5b6157d7826020830160208601614f0d565b8094505050506020830151614f0281614fcb565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215615828575f80fd5b8151610ef081614ebe565b5f63ffffffff808316818103615870577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b6001019392505050565b5f6020828403121561588a575f80fd5b8151610ef08161540e565b5f602082840312156158a5575f80fd5b5051919050565b838152604060208083018290528282018490525f9190859060608501845b8781101561590d5783356158dd81614ebe565b73ffffffffffffffffffffffffffffffffffffffff168252838301358383015292840192908401906001016158ca565b5098975050505050505050565b5f602080838503121561592b575f80fd5b825167ffffffffffffffff80821115615942575f80fd5b818501915085601f830112615955575f80fd5b8151818111156159675761596761548f565b8060051b91506159788483016154bc565b8181529183018401918481019088841115615991575f80fd5b938501935b838510156159bb57845192506159ab83614ebe565b8282529385019390850190615996565b98975050505050505050565b838152604060208083018290529082018390525f90849060608401835b86811015615a1f5783356159f781614ebe565b73ffffffffffffffffffffffffffffffffffffffff16825292820192908201906001016159e4565b50979650505050505050565b601f821115610ac357805f5260205f20601f840160051c81016020851015615a505750805b601f840160051c820191505b81811015610e8a575f8155600101615a5c565b815167ffffffffffffffff811115615a8957615a8961548f565b615a9d81615a97845461571c565b84615a2b565b602080601f831160018114615aef575f8415615ab95750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b1785556115c4565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015615b3b57888601518255948401946001909101908401615b1c565b5085821015615b7757878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b7fffffffff00000000000000000000000000000000000000000000000000000000851681528284600483013760609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166004919092019081019190915260180192915050565b5f8251615c02818460208701614f0d565b9190910192915050565b5f73ffffffffffffffffffffffffffffffffffffffff8087168352808616602084015250836040830152608060608301526112176080830184614f2f565b5f60208284031215615c5a575f80fd5b8151610ef081614e7656fea2646970667358221220251f44b759124064335b7666769ee71f413e30184f8d9a1906d85f154393ba1464736f6c63430008170033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000067df244584b67e8c51b10ad610aaffa9a402fdb6000000000000000000000000cda72070e455bb31c7690a170224ce43623d0b6f00000000000000000000000053f451165ba6fdbe39a134673d13948261b2334a000000000000000000000000762340b8a40cdd5bfc3edd94265899fda345d0e3000000000000000000000000de00c8b5cf7df6e29238dbf41915ef5ec5252be10000000000000000000000000605df9bde1b7f7538f46841daadc307cb2f2c80
-----Decoded View---------------
Arg [0] : treasury (address): 0x67Df244584b67E8C51B10aD610aAfFa9a402FdB6
Arg [1] : nftMarket (address): 0xcDA72070E455bb31C7690a170224Ce43623d0B6f
Arg [2] : nftDropMarket (address): 0x53F451165Ba6fdbe39A134673d13948261B2334A
Arg [3] : nftMarketRouter (address): 0x762340B8a40Cdd5BFC3eDD94265899FDa345D0E3
Arg [4] : worldsMetadataDelegate (address): 0xDe00c8b5cf7df6E29238DbF41915Ef5eC5252bE1
Arg [5] : splitTemplate (address): 0x0605df9bde1B7f7538f46841DaAdc307Cb2f2C80
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 00000000000000000000000067df244584b67e8c51b10ad610aaffa9a402fdb6
Arg [1] : 000000000000000000000000cda72070e455bb31c7690a170224ce43623d0b6f
Arg [2] : 00000000000000000000000053f451165ba6fdbe39a134673d13948261b2334a
Arg [3] : 000000000000000000000000762340b8a40cdd5bfc3edd94265899fda345d0e3
Arg [4] : 000000000000000000000000de00c8b5cf7df6e29238dbf41915ef5ec5252be1
Arg [5] : 0000000000000000000000000605df9bde1b7f7538f46841daadc307cb2f2c80
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.