Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
ZooverseGen2
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; import 'erc721a-upgradeable/contracts/ERC721AUpgradeable.sol'; import 'erc721a-upgradeable/contracts/extensions/ERC721AQueryableUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol'; import '@divergencetech/ethier/contracts/thirdparty/opensea/OpenSeaGasFreeListing.sol'; import './AdminControllerUpgradeable.sol'; import './interfaces/IFactions.sol'; contract ZooverseGen2 is Initializable, ERC721AUpgradeable, ERC721AQueryableUpgradeable, AdminControllerUpgradeable { string public baseURI; uint256 public supply; mapping(uint256 => bool) private _locked; mapping(uint256 => uint256) private _level; event LevelChanged(uint256 id, uint256 exp); function initialize( string calldata name, string calldata symbol ) public initializer { __AdminController__init(); __ERC721A_init(name, symbol); __ERC721AQueryable_init(); supply = 4000; baseURI = 'https://ipfs.io/ipfs/QmNSqm58HqNobgdkmSpUQv5H9f9hYbNAMyrWN3xD8ucvvj/'; } function mint(address to, uint256 quantity) external adminOnly { require(totalSupply() + quantity <= supply, 'Exceeds supply'); _safeMint(to, quantity); } function getLevel(uint256 id) public view returns (uint256) { return _level[id]; } function _baseURI() internal view override(ERC721AUpgradeable) returns (string memory) { return baseURI; } function setURI(string memory _uri) external adminOnly { baseURI = _uri; } function setSupply(uint256 _supply) public adminOnly { supply = _supply; } function isApprovedForAll( address _owner, address _operator ) public view override(ERC721AUpgradeable, IERC721Upgradeable) returns (bool) { return super.isApprovedForAll(_owner, _operator) || OpenSeaGasFreeListing.isApprovedForAll(_owner, _operator) || isAdmin(msg.sender); } function setLocked(uint256 id, bool value) public adminOnly { _locked[id] = value; } function mutateLevel(uint256 id, uint256 exp) public adminOnly { _level[id] = exp; emit LevelChanged(id, exp); } function numberMinted(address owner) external view returns (uint256) { return _numberMinted(owner); } function getAux(address owner) external view returns (uint256) { return _getAux(owner); } function setAux(address owner, uint64 aux) external adminOnly { return _setAux(owner, aux); } IFactions public factions; function setFactions(IFactions _factions) external adminOnly { factions = _factions; } address public staking; function setStaking(address _staking) external adminOnly { staking = _staking; } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; // Inspired by BaseOpenSea by Simon Fremaux (@dievardump) but without the need // to pass specific addresses depending on deployment network. // https://gist.github.com/dievardump/483eb43bc6ed30b14f01e01842e3339b/ import "./ProxyRegistry.sol"; /// @notice Library to achieve gas-free listings on OpenSea. library OpenSeaGasFreeListing { /** @notice Returns whether the operator is an OpenSea proxy for the owner, thus allowing it to list without the token owner paying gas. @dev ERC{721,1155}.isApprovedForAll should be overriden to also check if this function returns true. */ function isApprovedForAll(address owner, address operator) internal view returns (bool) { address proxy = proxyFor(owner); return proxy != address(0) && proxy == operator; } /** @notice Returns the OpenSea proxy address for the owner. */ function proxyFor(address owner) internal view returns (address) { address registry; uint256 chainId; assembly { chainId := chainid() switch chainId // Production networks are placed higher to minimise the number of // checks performed and therefore reduce gas. By the same rationale, // mainnet comes before Polygon as it's more expensive. case 1 { // mainnet registry := 0xa5409ec958c83c3f309868babaca7c86dcb077c1 } case 137 { // polygon registry := 0x58807baD0B376efc12F5AD86aAc70E78ed67deaE } case 4 { // rinkeby registry := 0xf57b2c51ded3a29e6891aba85459d600256cf317 } case 80001 { // mumbai registry := 0xff7Ca10aF37178BdD056628eF42fD7F799fAc77c } case 1337 { // The geth SimulatedBackend iff used with the ethier // openseatest package. This is mocked as a Wyvern proxy as it's // more complex than the 0x ones. registry := 0xE1a2bbc877b29ADBC56D2659DBcb0ae14ee62071 } } // Unlike Wyvern, the registry itself is the proxy for all owners on 0x // chains. if (registry == address(0) || chainId == 137 || chainId == 80001) { return registry; } return address(ProxyRegistry(registry).proxies(owner)); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; /// @notice A minimal interface describing OpenSea's Wyvern proxy registry. contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } /** @dev This pattern of using an empty contract is cargo-culted directly from OpenSea's example code. TODO: it's likely that the above mapping can be changed to address => address without affecting anything, but further investigation is needed (i.e. is there a subtle reason that OpenSea released it like this?). */ // solhint-disable-next-line no-empty-blocks contract OwnableDelegateProxy { }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @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[49] private __gap; }
// 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.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @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[49] 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 (last updated v4.9.4) (utils/Context.sol) pragma solidity ^0.8.0; import {Initializable} from "../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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } /** * @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 {Initializable} from "../../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 pragma solidity 0.8.13; import './IAdminController.sol'; import '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol'; import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol'; abstract contract AdminControllerUpgradeable is IAdminController, Initializable, OwnableUpgradeable, PausableUpgradeable { mapping(address => bool) public _admins; function __AdminController__init() internal onlyInitializing { __Ownable_init(); __Pausable_init(); } function isAdmin(address to) public view returns (bool) { return _admins[to]; } modifier adminOnly() { require(_admins[msg.sender] || msg.sender == owner(), 'Not authorised'); _; } function setPaused(bool value) public adminOnly { if (value) { _pause(); } else { _unpause(); } } function setAdmins(address to, bool value) public adminOnly { _admins[to] = value; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; interface IAdminController { function setAdmins(address to, bool value) external; function isAdmin(address) external view returns (bool); }
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; interface IFaction { function balanceOf(address to) external returns (uint256); function initialize( string memory _name, string memory _symbol, address admin_ ) external; function mint(address account, uint256 amount) external; function burn(address account, uint256 amount) external; function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import './IFaction.sol'; interface IFactions { function getFaction(uint256 id) external returns (IFaction); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import "./IERC721AUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721AUpgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721AUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // The tokenId of the next token to be minted. uint256 internal _currentIndex; // The number of tokens burned. uint256 internal _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // 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; function __ERC721A_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721A_init_unchained(name_, symbol_); } function __ERC721A_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } /** * To change the starting tokenId, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens. */ function totalSupply() public view override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than _currentIndex - _startTokenId() times unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view returns (uint256) { // Counter underflow is impossible as _currentIndex does not decrement, // and it is initialized to _startTokenId() unchecked { return _currentIndex - _startTokenId(); } } /** * @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 override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return uint256(_addressData[owner].balance); } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberMinted); } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberBurned); } /** * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return _addressData[owner].aux; } /** * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal { _addressData[owner].aux = aux; } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; if (!ownership.burned) { if (ownership.addr != address(0)) { return ownership; } // Invariant: // There will always be an ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. while (true) { curr--; ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return ownership; } } } } } revert OwnerQueryForNonexistentToken(); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return _ownershipOf(tokenId).addr; } /** * @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) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); 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 overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { address owner = ERC721AUpgradeable.ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner) if(!isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); } _approve(to, tokenId, owner); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { if (operator == _msgSender()) revert ApproveToCaller(); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_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 { _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 { _transfer(from, to, tokenId); if (to.isContract()) if(!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @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`), */ function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned; } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal { _safeMint(to, quantity, ''); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; if (to.isContract()) { do { emit Transfer(address(0), to, updatedIndex); if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (updatedIndex < end); // Reentrancy protection if (_currentIndex != startTokenId) revert(); } else { do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex < end); } _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint(address to, uint256 quantity) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex < end); _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Transfers `tokenId` from `from` to `to`. * * 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 ) private { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { _addressData[from].balance -= 1; _addressData[to].balance += 1; TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = to; currSlot.startTimestamp = uint64(block.timestamp); // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); address from = prevOwnership.addr; if (approvalCheck) { bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { AddressData storage addressData = _addressData[from]; addressData.balance -= 1; addressData.numberBurned += 1; // Keep track of who burned the token, and the timestamp of burning. TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = from; currSlot.startTimestamp = uint64(block.timestamp); currSlot.burned = true; // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target 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 _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * And also called before burning one token. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * And also called after one token has been burned. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @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[42] private __gap; }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import "./IERC721AQueryableUpgradeable.sol"; import "../ERC721AUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @title ERC721A Queryable * @dev ERC721A subclass with convenience query functions. */ abstract contract ERC721AQueryableUpgradeable is Initializable, ERC721AUpgradeable, IERC721AQueryableUpgradeable { function __ERC721AQueryable_init() internal onlyInitializing { } function __ERC721AQueryable_init_unchained() internal onlyInitializing { } /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * - `addr` = `address(0)` * - `startTimestamp` = `0` * - `burned` = `false` * * If the `tokenId` is burned: * - `addr` = `<Address of owner before token was burned>` * - `startTimestamp` = `<Timestamp when token was burned>` * - `burned = `true` * * Otherwise: * - `addr` = `<Address of owner>` * - `startTimestamp` = `<Timestamp of start of ownership>` * - `burned = `false` */ function explicitOwnershipOf(uint256 tokenId) public view override returns (TokenOwnership memory) { TokenOwnership memory ownership; if (tokenId < _startTokenId() || tokenId >= _currentIndex) { return ownership; } ownership = _ownerships[tokenId]; if (ownership.burned) { return ownership; } return _ownershipOf(tokenId); } /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view override returns (TokenOwnership[] memory) { unchecked { uint256 tokenIdsLength = tokenIds.length; TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength); for (uint256 i; i != tokenIdsLength; ++i) { ownerships[i] = explicitOwnershipOf(tokenIds[i]); } return ownerships; } } /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start` < `stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view override returns (uint256[] memory) { unchecked { if (start >= stop) revert InvalidQueryRange(); uint256 tokenIdsIdx; uint256 stopLimit = _currentIndex; // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) { start = _startTokenId(); } // Set `stop = min(stop, _currentIndex)`. if (stop > stopLimit) { stop = stopLimit; } uint256 tokenIdsMaxLength = balanceOf(owner); // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`, // to cater for cases where `balanceOf(owner)` is too big. if (start < stop) { uint256 rangeLength = stop - start; if (rangeLength < tokenIdsMaxLength) { tokenIdsMaxLength = rangeLength; } } else { tokenIdsMaxLength = 0; } uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength); if (tokenIdsMaxLength == 0) { return tokenIds; } // We need to call `explicitOwnershipOf(start)`, // because the slot at `start` may not be initialized. TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr; // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`. // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range. if (!ownership.burned) { currOwnershipAddr = ownership.addr; } for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) { ownership = _ownerships[i]; if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } // Downsize the array to fit. assembly { mstore(tokenIds, tokenIdsIdx) } return tokenIds; } } /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(totalSupply) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K pfp collections should be fine). */ function tokensOfOwner(address owner) external view override returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; address currOwnershipAddr; uint256 tokenIdsLength = balanceOf(owner); uint256[] memory tokenIds = new uint256[](tokenIdsLength); TokenOwnership memory ownership; for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) { ownership = _ownerships[i]; if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } /** * @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 // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import "../IERC721AUpgradeable.sol"; /** * @dev Interface of an ERC721AQueryable compliant contract. */ interface IERC721AQueryableUpgradeable is IERC721AUpgradeable { /** * Invalid query range (`start` >= `stop`). */ error InvalidQueryRange(); /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * - `addr` = `address(0)` * - `startTimestamp` = `0` * - `burned` = `false` * * If the `tokenId` is burned: * - `addr` = `<Address of owner before token was burned>` * - `startTimestamp` = `<Timestamp when token was burned>` * - `burned = `true` * * Otherwise: * - `addr` = `<Address of owner>` * - `startTimestamp` = `<Timestamp of start of ownership>` * - `burned = `false` */ function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory); /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory); /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start` < `stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view returns (uint256[] memory); /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(totalSupply) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K pfp collections should be fine). */ function tokensOfOwner(address owner) external view returns (uint256[] memory); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol"; /** * @dev Interface of an ERC721A compliant contract. */ interface IERC721AUpgradeable is IERC721Upgradeable, IERC721MetadataUpgradeable { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * The caller cannot approve to their own address. */ error ApproveToCaller(); /** * The caller cannot approve to the current owner. */ error ApprovalToCurrentOwner(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); // Compiler will pack this into a single 256bit word. struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; } // Compiler will pack this into a single 256bit word. struct AddressData { // Realistically, 2**64-1 is more than enough. uint64 balance; // Keeps track of mint count with minimal overhead for tokenomics. uint64 numberMinted; // Keeps track of burn count with minimal overhead for tokenomics. uint64 numberBurned; // For miscellaneous variable(s) pertaining to the address // (e.g. number of whitelist mint slots used). // If there are multiple variables, please pack them into a uint64. uint64 aux; } /** * @dev Returns the total amount of tokens stored by the contract. * * Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens. */ function totalSupply() external view returns (uint256); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exp","type":"uint256"}],"name":"LevelChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_admins","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"}],"internalType":"struct IERC721AUpgradeable.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"}],"internalType":"struct IERC721AUpgradeable.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factions","outputs":[{"internalType":"contract IFactions","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"getAux","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"exp","type":"uint256"}],"name":"mutateLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"numberMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"bool","name":"value","type":"bool"}],"name":"setAdmins","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":"address","name":"owner","type":"address"},{"internalType":"uint64","name":"aux","type":"uint64"}],"name":"setAux","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IFactions","name":"_factions","type":"address"}],"name":"setFactions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bool","name":"value","type":"bool"}],"name":"setLocked","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"value","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_staking","type":"address"}],"name":"setStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_supply","type":"uint256"}],"name":"setSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"staking","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50612bb2806100206000396000f3fe608060405234801561001057600080fd5b506004361061025e5760003560e01c80635bbb21771161014657806395d89b41116100c3578063c23dc68f11610087578063c23dc68f1461058e578063c65310fd146105ae578063c87b56dd146105c1578063dc33e681146105d4578063e985e9c5146105e7578063f2fde38b146105fa57600080fd5b806395d89b411461051457806399a2557a1461051c578063a22cb4651461052f578063b88d4fde14610542578063bf0b175e1461055557600080fd5b8063715018a61161010a578063715018a6146104a75780638462151c146104af57806386481d40146104cf5780638da5cb5b146104f05780638ff390991461050157600080fd5b80635bbb21771461044e5780635c975abb1461046e5780636352211e146104795780636c0360eb1461048c57806370a082311461049457600080fd5b80631bb1b575116101df5780633b4c4b25116101a35780633b4c4b25146103db57806340c10f19146103ee57806342842e0e14610401578063453ab141146104145780634cd88b76146104275780634cf088d91461043a57600080fd5b80631bb1b5751461036157806323b872dd1461037457806324d7806c1461038757806331cd5c09146103b4578063351b0380146103c757600080fd5b8063095ea7b311610226578063095ea7b3146102f85780630a3cc9891461030b5780630d5e20531461031e57806316c38b3c1461034257806318160ddd1461035557600080fd5b806301ffc9a71461026357806302fe53051461028b578063047fc9aa146102a057806306fdde03146102b8578063081812fc146102cd575b600080fd5b610276610271366004612384565b61060d565b60405190151581526020015b60405180910390f35b61029e61029936600461243e565b61065f565b005b6102aa61012f5481565b604051908152602001610282565b6102c06106c5565b60405161028291906124de565b6102e06102db3660046124f1565b610757565b6040516001600160a01b039091168152602001610282565b61029e61030636600461251f565b61079b565b61029e610319366004612560565b610821565b61027661032c36600461258c565b61012d6020526000908152604090205460ff1681565b61029e6103503660046125a9565b610887565b606654606554036102aa565b61029e61036f36600461258c565b6108e5565b61029e6103823660046125c4565b61094d565b61027661039536600461258c565b6001600160a01b0316600090815261012d602052604090205460ff1690565b61029e6103c2366004612605565b610958565b610132546102e0906001600160a01b031681565b61029e6103e93660046124f1565b6109c9565b61029e6103fc36600461251f565b610a14565b61029e61040f3660046125c4565b610abe565b61029e610422366004612631565b610ad9565b61029e6104353660046126be565b610b58565b610133546102e0906001600160a01b031681565b61046161045c366004612729565b610d1d565b60405161028291906127ce565b60fb5460ff16610276565b6102e06104873660046124f1565b610de3565b6102c0610df5565b6102aa6104a236600461258c565b610e84565b61029e610ed2565b6104c26104bd36600461258c565b610ee6565b6040516102829190612838565b6102aa6104dd3660046124f1565b6000908152610131602052604090205490565b60c9546001600160a01b03166102e0565b61029e61050f36600461258c565b61102b565b6102c0611093565b6104c261052a366004612870565b6110a2565b61029e61053d366004612605565b611257565b61029e6105503660046128a5565b6112ec565b6102aa61056336600461258c565b6001600160a01b03166000908152606a6020526040902054600160c01b90046001600160401b031690565b6105a161059c3660046124f1565b611336565b6040516102829190612924565b61029e6105bc366004612959565b6113e4565b6102c06105cf3660046124f1565b611479565b6102aa6105e236600461258c565b6114fc565b6102766105f536600461297b565b61152a565b61029e61060836600461258c565b611586565b60006001600160e01b031982166380ac58cd60e01b148061063e57506001600160e01b03198216635b5e139f60e01b145b8061065957506301ffc9a760e01b6001600160e01b03198316145b92915050565b33600090815261012d602052604090205460ff1680610688575060c9546001600160a01b031633145b6106ad5760405162461bcd60e51b81526004016106a4906129a9565b60405180910390fd5b80516106c19061012e9060208401906122d5565b5050565b6060606780546106d4906129d1565b80601f0160208091040260200160405190810160405280929190818152602001828054610700906129d1565b801561074d5780601f106107225761010080835404028352916020019161074d565b820191906000526020600020905b81548152906001019060200180831161073057829003601f168201915b5050505050905090565b6000610762826115fc565b61077f576040516333d1c03960e21b815260040160405180910390fd5b506000908152606b60205260409020546001600160a01b031690565b60006107a682610de3565b9050806001600160a01b0316836001600160a01b0316036107da5760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614610811576107f4813361152a565b610811576040516367d9dca160e11b815260040160405180910390fd5b61081c838383611628565b505050565b33600090815261012d602052604090205460ff168061084a575060c9546001600160a01b031633145b6108665760405162461bcd60e51b81526004016106a4906129a9565b60009182526101306020526040909120805460ff1916911515919091179055565b33600090815261012d602052604090205460ff16806108b0575060c9546001600160a01b031633145b6108cc5760405162461bcd60e51b81526004016106a4906129a9565b80156108dd576108da611684565b50565b6108da6116de565b33600090815261012d602052604090205460ff168061090e575060c9546001600160a01b031633145b61092a5760405162461bcd60e51b81526004016106a4906129a9565b61013280546001600160a01b0319166001600160a01b0392909216919091179055565b61081c838383611717565b33600090815261012d602052604090205460ff1680610981575060c9546001600160a01b031633145b61099d5760405162461bcd60e51b81526004016106a4906129a9565b6001600160a01b0391909116600090815261012d60205260409020805460ff1916911515919091179055565b33600090815261012d602052604090205460ff16806109f2575060c9546001600160a01b031633145b610a0e5760405162461bcd60e51b81526004016106a4906129a9565b61012f55565b33600090815261012d602052604090205460ff1680610a3d575060c9546001600160a01b031633145b610a595760405162461bcd60e51b81526004016106a4906129a9565b61012f5481610a6b6066546065540390565b610a759190612a0b565b1115610ab45760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320737570706c7960901b60448201526064016106a4565b6106c18282611902565b61081c838383604051806020016040528060008152506112ec565b33600090815261012d602052604090205460ff1680610b02575060c9546001600160a01b031633145b610b1e5760405162461bcd60e51b81526004016106a4906129a9565b6001600160a01b0382166000908152606a6020526040902080546001600160c01b0316600160c01b6001600160401b038416021790555050565b600054610100900460ff1615808015610b785750600054600160ff909116105b80610b925750303b158015610b92575060005460ff166001145b610bf55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016106a4565b6000805460ff191660011790558015610c18576000805461ff0019166101001790555b610c2061191c565b610c9385858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8901819004810282018101909252878152925087915086908190840183828082843760009201919091525061195392505050565b610c9b611984565b610fa061012f5560408051608081019091526044808252612b3960208301398051610ccf9161012e916020909101906122d5565b508015610d16576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b80516060906000816001600160401b03811115610d3c57610d3c6123a1565b604051908082528060200260200182016040528015610d8757816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181610d5a5790505b50905060005b828114610ddb57610db6858281518110610da957610da9612a31565b6020026020010151611336565b828281518110610dc857610dc8612a31565b6020908102919091010152600101610d8d565b509392505050565b6000610dee826119ab565b5192915050565b61012e8054610e03906129d1565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2f906129d1565b8015610e7c5780601f10610e5157610100808354040283529160200191610e7c565b820191906000526020600020905b815481529060010190602001808311610e5f57829003601f168201915b505050505081565b60006001600160a01b038216610ead576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152606a60205260409020546001600160401b031690565b610eda611ac5565b610ee46000611b1f565b565b60606000806000610ef685610e84565b90506000816001600160401b03811115610f1257610f126123a1565b604051908082528060200260200182016040528015610f3b578160200160208202803683370190505b509050610f61604080516060810182526000808252602082018190529181019190915290565b60005b83861461101f57600081815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905292506110175781516001600160a01b031615610fd857815194505b876001600160a01b0316856001600160a01b031603611017578083878060010198508151811061100a5761100a612a31565b6020026020010181815250505b600101610f64565b50909695505050505050565b33600090815261012d602052604090205460ff1680611054575060c9546001600160a01b031633145b6110705760405162461bcd60e51b81526004016106a4906129a9565b61013380546001600160a01b0319166001600160a01b0392909216919091179055565b6060606880546106d4906129d1565b60608183106110c457604051631960ccad60e11b815260040160405180910390fd5b606554600090808411156110d6578093505b60006110e187610e84565b90508486101561110057858503818110156110fa578091505b50611104565b5060005b6000816001600160401b0381111561111e5761111e6123a1565b604051908082528060200260200182016040528015611147578160200160208202803683370190505b5090508160000361115d57935061125092505050565b600061116888611336565b905060008160400151611179575080515b885b88811415801561118b5750848714155b1561124457600081815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052935061123c5782516001600160a01b0316156111fd57825191505b8a6001600160a01b0316826001600160a01b03160361123c578084888060010199508151811061122f5761122f612a31565b6020026020010181815250505b60010161117b565b50505092835250909150505b9392505050565b336001600160a01b038316036112805760405163b06307db60e01b815260040160405180910390fd5b336000818152606c602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6112f7848484611717565b6001600160a01b0383163b156113305761131384848484611b71565b611330576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b604080516060808201835260008083526020808401829052838501829052845192830185528183528201819052928101839052909150606554831061137b5792915050565b50600082815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff1615801592820192909252906113db5792915050565b611250836119ab565b33600090815261012d602052604090205460ff168061140d575060c9546001600160a01b031633145b6114295760405162461bcd60e51b81526004016106a4906129a9565b6000828152610131602090815260409182902083905581518481529081018390527f8bdaee675270281b7bc2d5b9ced20517ecf5ce96158973ef78072a7bc1491b44910160405180910390a15050565b6060611484826115fc565b6114a157604051630a14c4b560e41b815260040160405180910390fd5b60006114ab611c5d565b905080516000036114cb5760405180602001604052806000815250611250565b806114d584611c6d565b6040516020016114e6929190612a47565b6040516020818303038152906040529392505050565b6001600160a01b0381166000908152606a6020526040812054600160401b90046001600160401b0316610659565b6001600160a01b038083166000908152606c6020908152604080832093851683529290529081205460ff168061156557506115658383611cff565b80611250575033600090815261012d602052604090205460ff169392505050565b61158e611ac5565b6001600160a01b0381166115f35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106a4565b6108da81611b1f565b600060655482108015610659575050600090815260696020526040902054600160e01b900460ff161590565b6000828152606b602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b61168c611d3d565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116c13390565b6040516001600160a01b03909116815260200160405180910390a1565b6116e6611d83565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336116c1565b6000611722826119ab565b9050836001600160a01b031681600001516001600160a01b0316146117595760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b03861614806117775750611777853361152a565b8061179257503361178784610757565b6001600160a01b0316145b9050806117b257604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0384166117d957604051633a954ecd60e21b815260040160405180910390fd5b6117e560008487611628565b6001600160a01b038581166000908152606a60209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652606990945282852080546001600160e01b031916909417600160a01b429092169190910217835587018084529220805491939091166118b95760655482146118b957805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610d16565b6106c1828260405180602001604052806000815250611dcc565b600054610100900460ff166119435760405162461bcd60e51b81526004016106a490612a76565b61194b611f8d565b610ee4611fbc565b600054610100900460ff1661197a5760405162461bcd60e51b81526004016106a490612a76565b6106c18282611feb565b600054610100900460ff16610ee45760405162461bcd60e51b81526004016106a490612a76565b604080516060810182526000808252602082018190529181019190915281606554811015611aac57600081815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905290611aaa5780516001600160a01b031615611a41579392505050565b5060001901600081815260696020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215611aa5579392505050565b611a41565b505b604051636f96cda160e11b815260040160405180910390fd5b60c9546001600160a01b03163314610ee45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a4565b60c980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611ba6903390899088908890600401612ac1565b6020604051808303816000875af1925050508015611be1575060408051601f3d908101601f19168201909252611bde91810190612afe565b60015b611c3f573d808015611c0f576040519150601f19603f3d011682016040523d82523d6000602084013e611c14565b606091505b508051600003611c37576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b606061012e80546106d4906129d1565b60606000611c7a83612043565b60010190506000816001600160401b03811115611c9957611c996123a1565b6040519080825280601f01601f191660200182016040528015611cc3576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611ccd57509392505050565b600080611d0b8461211b565b90506001600160a01b03811615801590611c555750826001600160a01b0316816001600160a01b031614949350505050565b60fb5460ff1615610ee45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106a4565b60fb5460ff16610ee45760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016106a4565b6065546001600160a01b038416611df557604051622e076360e81b815260040160405180910390fd5b82600003611e165760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0384166000818152606a6020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168b018116918217600160401b67ffffffffffffffff1990941690921783900481168b01811690920217909155858452606990925290912080546001600160e01b0319168317600160a01b42909316929092029190911790558190818501903b15611f39575b60405182906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4611f026000878480600101955087611b71565b611f1f576040516368d2bf6b60e11b815260040160405180910390fd5b808210611eb7578260655414611f3457600080fd5b611f7e565b5b6040516001830192906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808210611f3a575b50606555611330600085838684565b600054610100900460ff16611fb45760405162461bcd60e51b81526004016106a490612a76565b610ee4612272565b600054610100900460ff16611fe35760405162461bcd60e51b81526004016106a490612a76565b610ee46122a2565b600054610100900460ff166120125760405162461bcd60e51b81526004016106a490612a76565b81516120259060679060208501906122d5565b5080516120399060689060208401906122d5565b5060006065555050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106120825772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106120ae576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106120cc57662386f26fc10000830492506010015b6305f5e10083106120e4576305f5e100830492506008015b61271083106120f857612710830492506004015b6064831061210a576064830492506002015b600a83106106595760010192915050565b600080468060018114612150576089811461216c5760048114612188576201388181146121a45761053981146121c0576121d8565b73a5409ec958c83c3f309868babaca7c86dcb077c192506121d8565b7358807bad0b376efc12f5ad86aac70e78ed67deae92506121d8565b73f57b2c51ded3a29e6891aba85459d600256cf31792506121d8565b73ff7ca10af37178bdd056628ef42fd7f799fac77c92506121d8565b73e1a2bbc877b29adbc56d2659dbcb0ae14ee6207192505b506001600160a01b03821615806121ef5750806089145b806121fc57508062013881145b15612208575092915050565b60405163c455279160e01b81526001600160a01b03858116600483015283169063c455279190602401602060405180830381865afa15801561224e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c559190612b1b565b600054610100900460ff166122995760405162461bcd60e51b81526004016106a490612a76565b610ee433611b1f565b600054610100900460ff166122c95760405162461bcd60e51b81526004016106a490612a76565b60fb805460ff19169055565b8280546122e1906129d1565b90600052602060002090601f0160209004810192826123035760008555612349565b82601f1061231c57805160ff1916838001178555612349565b82800160010185558215612349579182015b8281111561234957825182559160200191906001019061232e565b50612355929150612359565b5090565b5b80821115612355576000815560010161235a565b6001600160e01b0319811681146108da57600080fd5b60006020828403121561239657600080fd5b81356112508161236e565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156123df576123df6123a1565b604052919050565b60006001600160401b03831115612400576124006123a1565b612413601f8401601f19166020016123b7565b905082815283838301111561242757600080fd5b828260208301376000602084830101529392505050565b60006020828403121561245057600080fd5b81356001600160401b0381111561246657600080fd5b8201601f8101841361247757600080fd5b611c55848235602084016123e7565b60005b838110156124a1578181015183820152602001612489565b838111156113305750506000910152565b600081518084526124ca816020860160208601612486565b601f01601f19169290920160200192915050565b60208152600061125060208301846124b2565b60006020828403121561250357600080fd5b5035919050565b6001600160a01b03811681146108da57600080fd5b6000806040838503121561253257600080fd5b823561253d8161250a565b946020939093013593505050565b8035801515811461255b57600080fd5b919050565b6000806040838503121561257357600080fd5b823591506125836020840161254b565b90509250929050565b60006020828403121561259e57600080fd5b81356112508161250a565b6000602082840312156125bb57600080fd5b6112508261254b565b6000806000606084860312156125d957600080fd5b83356125e48161250a565b925060208401356125f48161250a565b929592945050506040919091013590565b6000806040838503121561261857600080fd5b82356126238161250a565b91506125836020840161254b565b6000806040838503121561264457600080fd5b823561264f8161250a565b915060208301356001600160401b038116811461266b57600080fd5b809150509250929050565b60008083601f84011261268857600080fd5b5081356001600160401b0381111561269f57600080fd5b6020830191508360208285010111156126b757600080fd5b9250929050565b600080600080604085870312156126d457600080fd5b84356001600160401b03808211156126eb57600080fd5b6126f788838901612676565b9096509450602087013591508082111561271057600080fd5b5061271d87828801612676565b95989497509550505050565b6000602080838503121561273c57600080fd5b82356001600160401b038082111561275357600080fd5b818501915085601f83011261276757600080fd5b813581811115612779576127796123a1565b8060051b915061278a8483016123b7565b81815291830184019184810190888411156127a457600080fd5b938501935b838510156127c2578435825293850193908501906127a9565b98975050505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561101f5761282583855180516001600160a01b031682526020808201516001600160401b0316908301526040908101511515910152565b92840192606092909201916001016127ea565b6020808252825182820181905260009190848201906040850190845b8181101561101f57835183529284019291840191600101612854565b60008060006060848603121561288557600080fd5b83356128908161250a565b95602085013595506040909401359392505050565b600080600080608085870312156128bb57600080fd5b84356128c68161250a565b935060208501356128d68161250a565b92506040850135915060608501356001600160401b038111156128f857600080fd5b8501601f8101871361290957600080fd5b612918878235602084016123e7565b91505092959194509250565b81516001600160a01b031681526020808301516001600160401b03169082015260408083015115159082015260608101610659565b6000806040838503121561296c57600080fd5b50508035926020909101359150565b6000806040838503121561298e57600080fd5b82356129998161250a565b9150602083013561266b8161250a565b6020808252600e908201526d139bdd08185d5d1a1bdc9a5cd95960921b604082015260600190565b600181811c908216806129e557607f821691505b602082108103612a0557634e487b7160e01b600052602260045260246000fd5b50919050565b60008219821115612a2c57634e487b7160e01b600052601160045260246000fd5b500190565b634e487b7160e01b600052603260045260246000fd5b60008351612a59818460208801612486565b835190830190612a6d818360208801612486565b01949350505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612af4908301846124b2565b9695505050505050565b600060208284031215612b1057600080fd5b81516112508161236e565b600060208284031215612b2d57600080fd5b81516112508161250a56fe68747470733a2f2f697066732e696f2f697066732f516d4e53716d353848714e6f6267646b6d537055517635483966396859624e414d7972574e33784438756376766a2fa2646970667358221220d8e07dddfad464cdf9365573cb3b98a855c3d59d1649139352e2ecc004cb8e5f64736f6c634300080d0033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061025e5760003560e01c80635bbb21771161014657806395d89b41116100c3578063c23dc68f11610087578063c23dc68f1461058e578063c65310fd146105ae578063c87b56dd146105c1578063dc33e681146105d4578063e985e9c5146105e7578063f2fde38b146105fa57600080fd5b806395d89b411461051457806399a2557a1461051c578063a22cb4651461052f578063b88d4fde14610542578063bf0b175e1461055557600080fd5b8063715018a61161010a578063715018a6146104a75780638462151c146104af57806386481d40146104cf5780638da5cb5b146104f05780638ff390991461050157600080fd5b80635bbb21771461044e5780635c975abb1461046e5780636352211e146104795780636c0360eb1461048c57806370a082311461049457600080fd5b80631bb1b575116101df5780633b4c4b25116101a35780633b4c4b25146103db57806340c10f19146103ee57806342842e0e14610401578063453ab141146104145780634cd88b76146104275780634cf088d91461043a57600080fd5b80631bb1b5751461036157806323b872dd1461037457806324d7806c1461038757806331cd5c09146103b4578063351b0380146103c757600080fd5b8063095ea7b311610226578063095ea7b3146102f85780630a3cc9891461030b5780630d5e20531461031e57806316c38b3c1461034257806318160ddd1461035557600080fd5b806301ffc9a71461026357806302fe53051461028b578063047fc9aa146102a057806306fdde03146102b8578063081812fc146102cd575b600080fd5b610276610271366004612384565b61060d565b60405190151581526020015b60405180910390f35b61029e61029936600461243e565b61065f565b005b6102aa61012f5481565b604051908152602001610282565b6102c06106c5565b60405161028291906124de565b6102e06102db3660046124f1565b610757565b6040516001600160a01b039091168152602001610282565b61029e61030636600461251f565b61079b565b61029e610319366004612560565b610821565b61027661032c36600461258c565b61012d6020526000908152604090205460ff1681565b61029e6103503660046125a9565b610887565b606654606554036102aa565b61029e61036f36600461258c565b6108e5565b61029e6103823660046125c4565b61094d565b61027661039536600461258c565b6001600160a01b0316600090815261012d602052604090205460ff1690565b61029e6103c2366004612605565b610958565b610132546102e0906001600160a01b031681565b61029e6103e93660046124f1565b6109c9565b61029e6103fc36600461251f565b610a14565b61029e61040f3660046125c4565b610abe565b61029e610422366004612631565b610ad9565b61029e6104353660046126be565b610b58565b610133546102e0906001600160a01b031681565b61046161045c366004612729565b610d1d565b60405161028291906127ce565b60fb5460ff16610276565b6102e06104873660046124f1565b610de3565b6102c0610df5565b6102aa6104a236600461258c565b610e84565b61029e610ed2565b6104c26104bd36600461258c565b610ee6565b6040516102829190612838565b6102aa6104dd3660046124f1565b6000908152610131602052604090205490565b60c9546001600160a01b03166102e0565b61029e61050f36600461258c565b61102b565b6102c0611093565b6104c261052a366004612870565b6110a2565b61029e61053d366004612605565b611257565b61029e6105503660046128a5565b6112ec565b6102aa61056336600461258c565b6001600160a01b03166000908152606a6020526040902054600160c01b90046001600160401b031690565b6105a161059c3660046124f1565b611336565b6040516102829190612924565b61029e6105bc366004612959565b6113e4565b6102c06105cf3660046124f1565b611479565b6102aa6105e236600461258c565b6114fc565b6102766105f536600461297b565b61152a565b61029e61060836600461258c565b611586565b60006001600160e01b031982166380ac58cd60e01b148061063e57506001600160e01b03198216635b5e139f60e01b145b8061065957506301ffc9a760e01b6001600160e01b03198316145b92915050565b33600090815261012d602052604090205460ff1680610688575060c9546001600160a01b031633145b6106ad5760405162461bcd60e51b81526004016106a4906129a9565b60405180910390fd5b80516106c19061012e9060208401906122d5565b5050565b6060606780546106d4906129d1565b80601f0160208091040260200160405190810160405280929190818152602001828054610700906129d1565b801561074d5780601f106107225761010080835404028352916020019161074d565b820191906000526020600020905b81548152906001019060200180831161073057829003601f168201915b5050505050905090565b6000610762826115fc565b61077f576040516333d1c03960e21b815260040160405180910390fd5b506000908152606b60205260409020546001600160a01b031690565b60006107a682610de3565b9050806001600160a01b0316836001600160a01b0316036107da5760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614610811576107f4813361152a565b610811576040516367d9dca160e11b815260040160405180910390fd5b61081c838383611628565b505050565b33600090815261012d602052604090205460ff168061084a575060c9546001600160a01b031633145b6108665760405162461bcd60e51b81526004016106a4906129a9565b60009182526101306020526040909120805460ff1916911515919091179055565b33600090815261012d602052604090205460ff16806108b0575060c9546001600160a01b031633145b6108cc5760405162461bcd60e51b81526004016106a4906129a9565b80156108dd576108da611684565b50565b6108da6116de565b33600090815261012d602052604090205460ff168061090e575060c9546001600160a01b031633145b61092a5760405162461bcd60e51b81526004016106a4906129a9565b61013280546001600160a01b0319166001600160a01b0392909216919091179055565b61081c838383611717565b33600090815261012d602052604090205460ff1680610981575060c9546001600160a01b031633145b61099d5760405162461bcd60e51b81526004016106a4906129a9565b6001600160a01b0391909116600090815261012d60205260409020805460ff1916911515919091179055565b33600090815261012d602052604090205460ff16806109f2575060c9546001600160a01b031633145b610a0e5760405162461bcd60e51b81526004016106a4906129a9565b61012f55565b33600090815261012d602052604090205460ff1680610a3d575060c9546001600160a01b031633145b610a595760405162461bcd60e51b81526004016106a4906129a9565b61012f5481610a6b6066546065540390565b610a759190612a0b565b1115610ab45760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320737570706c7960901b60448201526064016106a4565b6106c18282611902565b61081c838383604051806020016040528060008152506112ec565b33600090815261012d602052604090205460ff1680610b02575060c9546001600160a01b031633145b610b1e5760405162461bcd60e51b81526004016106a4906129a9565b6001600160a01b0382166000908152606a6020526040902080546001600160c01b0316600160c01b6001600160401b038416021790555050565b600054610100900460ff1615808015610b785750600054600160ff909116105b80610b925750303b158015610b92575060005460ff166001145b610bf55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016106a4565b6000805460ff191660011790558015610c18576000805461ff0019166101001790555b610c2061191c565b610c9385858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8901819004810282018101909252878152925087915086908190840183828082843760009201919091525061195392505050565b610c9b611984565b610fa061012f5560408051608081019091526044808252612b3960208301398051610ccf9161012e916020909101906122d5565b508015610d16576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b80516060906000816001600160401b03811115610d3c57610d3c6123a1565b604051908082528060200260200182016040528015610d8757816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181610d5a5790505b50905060005b828114610ddb57610db6858281518110610da957610da9612a31565b6020026020010151611336565b828281518110610dc857610dc8612a31565b6020908102919091010152600101610d8d565b509392505050565b6000610dee826119ab565b5192915050565b61012e8054610e03906129d1565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2f906129d1565b8015610e7c5780601f10610e5157610100808354040283529160200191610e7c565b820191906000526020600020905b815481529060010190602001808311610e5f57829003601f168201915b505050505081565b60006001600160a01b038216610ead576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152606a60205260409020546001600160401b031690565b610eda611ac5565b610ee46000611b1f565b565b60606000806000610ef685610e84565b90506000816001600160401b03811115610f1257610f126123a1565b604051908082528060200260200182016040528015610f3b578160200160208202803683370190505b509050610f61604080516060810182526000808252602082018190529181019190915290565b60005b83861461101f57600081815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905292506110175781516001600160a01b031615610fd857815194505b876001600160a01b0316856001600160a01b031603611017578083878060010198508151811061100a5761100a612a31565b6020026020010181815250505b600101610f64565b50909695505050505050565b33600090815261012d602052604090205460ff1680611054575060c9546001600160a01b031633145b6110705760405162461bcd60e51b81526004016106a4906129a9565b61013380546001600160a01b0319166001600160a01b0392909216919091179055565b6060606880546106d4906129d1565b60608183106110c457604051631960ccad60e11b815260040160405180910390fd5b606554600090808411156110d6578093505b60006110e187610e84565b90508486101561110057858503818110156110fa578091505b50611104565b5060005b6000816001600160401b0381111561111e5761111e6123a1565b604051908082528060200260200182016040528015611147578160200160208202803683370190505b5090508160000361115d57935061125092505050565b600061116888611336565b905060008160400151611179575080515b885b88811415801561118b5750848714155b1561124457600081815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052935061123c5782516001600160a01b0316156111fd57825191505b8a6001600160a01b0316826001600160a01b03160361123c578084888060010199508151811061122f5761122f612a31565b6020026020010181815250505b60010161117b565b50505092835250909150505b9392505050565b336001600160a01b038316036112805760405163b06307db60e01b815260040160405180910390fd5b336000818152606c602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6112f7848484611717565b6001600160a01b0383163b156113305761131384848484611b71565b611330576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b604080516060808201835260008083526020808401829052838501829052845192830185528183528201819052928101839052909150606554831061137b5792915050565b50600082815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff1615801592820192909252906113db5792915050565b611250836119ab565b33600090815261012d602052604090205460ff168061140d575060c9546001600160a01b031633145b6114295760405162461bcd60e51b81526004016106a4906129a9565b6000828152610131602090815260409182902083905581518481529081018390527f8bdaee675270281b7bc2d5b9ced20517ecf5ce96158973ef78072a7bc1491b44910160405180910390a15050565b6060611484826115fc565b6114a157604051630a14c4b560e41b815260040160405180910390fd5b60006114ab611c5d565b905080516000036114cb5760405180602001604052806000815250611250565b806114d584611c6d565b6040516020016114e6929190612a47565b6040516020818303038152906040529392505050565b6001600160a01b0381166000908152606a6020526040812054600160401b90046001600160401b0316610659565b6001600160a01b038083166000908152606c6020908152604080832093851683529290529081205460ff168061156557506115658383611cff565b80611250575033600090815261012d602052604090205460ff169392505050565b61158e611ac5565b6001600160a01b0381166115f35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106a4565b6108da81611b1f565b600060655482108015610659575050600090815260696020526040902054600160e01b900460ff161590565b6000828152606b602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b61168c611d3d565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116c13390565b6040516001600160a01b03909116815260200160405180910390a1565b6116e6611d83565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336116c1565b6000611722826119ab565b9050836001600160a01b031681600001516001600160a01b0316146117595760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b03861614806117775750611777853361152a565b8061179257503361178784610757565b6001600160a01b0316145b9050806117b257604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0384166117d957604051633a954ecd60e21b815260040160405180910390fd5b6117e560008487611628565b6001600160a01b038581166000908152606a60209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652606990945282852080546001600160e01b031916909417600160a01b429092169190910217835587018084529220805491939091166118b95760655482146118b957805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610d16565b6106c1828260405180602001604052806000815250611dcc565b600054610100900460ff166119435760405162461bcd60e51b81526004016106a490612a76565b61194b611f8d565b610ee4611fbc565b600054610100900460ff1661197a5760405162461bcd60e51b81526004016106a490612a76565b6106c18282611feb565b600054610100900460ff16610ee45760405162461bcd60e51b81526004016106a490612a76565b604080516060810182526000808252602082018190529181019190915281606554811015611aac57600081815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905290611aaa5780516001600160a01b031615611a41579392505050565b5060001901600081815260696020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215611aa5579392505050565b611a41565b505b604051636f96cda160e11b815260040160405180910390fd5b60c9546001600160a01b03163314610ee45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a4565b60c980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611ba6903390899088908890600401612ac1565b6020604051808303816000875af1925050508015611be1575060408051601f3d908101601f19168201909252611bde91810190612afe565b60015b611c3f573d808015611c0f576040519150601f19603f3d011682016040523d82523d6000602084013e611c14565b606091505b508051600003611c37576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b606061012e80546106d4906129d1565b60606000611c7a83612043565b60010190506000816001600160401b03811115611c9957611c996123a1565b6040519080825280601f01601f191660200182016040528015611cc3576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611ccd57509392505050565b600080611d0b8461211b565b90506001600160a01b03811615801590611c555750826001600160a01b0316816001600160a01b031614949350505050565b60fb5460ff1615610ee45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106a4565b60fb5460ff16610ee45760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016106a4565b6065546001600160a01b038416611df557604051622e076360e81b815260040160405180910390fd5b82600003611e165760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0384166000818152606a6020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168b018116918217600160401b67ffffffffffffffff1990941690921783900481168b01811690920217909155858452606990925290912080546001600160e01b0319168317600160a01b42909316929092029190911790558190818501903b15611f39575b60405182906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4611f026000878480600101955087611b71565b611f1f576040516368d2bf6b60e11b815260040160405180910390fd5b808210611eb7578260655414611f3457600080fd5b611f7e565b5b6040516001830192906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808210611f3a575b50606555611330600085838684565b600054610100900460ff16611fb45760405162461bcd60e51b81526004016106a490612a76565b610ee4612272565b600054610100900460ff16611fe35760405162461bcd60e51b81526004016106a490612a76565b610ee46122a2565b600054610100900460ff166120125760405162461bcd60e51b81526004016106a490612a76565b81516120259060679060208501906122d5565b5080516120399060689060208401906122d5565b5060006065555050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106120825772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106120ae576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106120cc57662386f26fc10000830492506010015b6305f5e10083106120e4576305f5e100830492506008015b61271083106120f857612710830492506004015b6064831061210a576064830492506002015b600a83106106595760010192915050565b600080468060018114612150576089811461216c5760048114612188576201388181146121a45761053981146121c0576121d8565b73a5409ec958c83c3f309868babaca7c86dcb077c192506121d8565b7358807bad0b376efc12f5ad86aac70e78ed67deae92506121d8565b73f57b2c51ded3a29e6891aba85459d600256cf31792506121d8565b73ff7ca10af37178bdd056628ef42fd7f799fac77c92506121d8565b73e1a2bbc877b29adbc56d2659dbcb0ae14ee6207192505b506001600160a01b03821615806121ef5750806089145b806121fc57508062013881145b15612208575092915050565b60405163c455279160e01b81526001600160a01b03858116600483015283169063c455279190602401602060405180830381865afa15801561224e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c559190612b1b565b600054610100900460ff166122995760405162461bcd60e51b81526004016106a490612a76565b610ee433611b1f565b600054610100900460ff166122c95760405162461bcd60e51b81526004016106a490612a76565b60fb805460ff19169055565b8280546122e1906129d1565b90600052602060002090601f0160209004810192826123035760008555612349565b82601f1061231c57805160ff1916838001178555612349565b82800160010185558215612349579182015b8281111561234957825182559160200191906001019061232e565b50612355929150612359565b5090565b5b80821115612355576000815560010161235a565b6001600160e01b0319811681146108da57600080fd5b60006020828403121561239657600080fd5b81356112508161236e565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156123df576123df6123a1565b604052919050565b60006001600160401b03831115612400576124006123a1565b612413601f8401601f19166020016123b7565b905082815283838301111561242757600080fd5b828260208301376000602084830101529392505050565b60006020828403121561245057600080fd5b81356001600160401b0381111561246657600080fd5b8201601f8101841361247757600080fd5b611c55848235602084016123e7565b60005b838110156124a1578181015183820152602001612489565b838111156113305750506000910152565b600081518084526124ca816020860160208601612486565b601f01601f19169290920160200192915050565b60208152600061125060208301846124b2565b60006020828403121561250357600080fd5b5035919050565b6001600160a01b03811681146108da57600080fd5b6000806040838503121561253257600080fd5b823561253d8161250a565b946020939093013593505050565b8035801515811461255b57600080fd5b919050565b6000806040838503121561257357600080fd5b823591506125836020840161254b565b90509250929050565b60006020828403121561259e57600080fd5b81356112508161250a565b6000602082840312156125bb57600080fd5b6112508261254b565b6000806000606084860312156125d957600080fd5b83356125e48161250a565b925060208401356125f48161250a565b929592945050506040919091013590565b6000806040838503121561261857600080fd5b82356126238161250a565b91506125836020840161254b565b6000806040838503121561264457600080fd5b823561264f8161250a565b915060208301356001600160401b038116811461266b57600080fd5b809150509250929050565b60008083601f84011261268857600080fd5b5081356001600160401b0381111561269f57600080fd5b6020830191508360208285010111156126b757600080fd5b9250929050565b600080600080604085870312156126d457600080fd5b84356001600160401b03808211156126eb57600080fd5b6126f788838901612676565b9096509450602087013591508082111561271057600080fd5b5061271d87828801612676565b95989497509550505050565b6000602080838503121561273c57600080fd5b82356001600160401b038082111561275357600080fd5b818501915085601f83011261276757600080fd5b813581811115612779576127796123a1565b8060051b915061278a8483016123b7565b81815291830184019184810190888411156127a457600080fd5b938501935b838510156127c2578435825293850193908501906127a9565b98975050505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561101f5761282583855180516001600160a01b031682526020808201516001600160401b0316908301526040908101511515910152565b92840192606092909201916001016127ea565b6020808252825182820181905260009190848201906040850190845b8181101561101f57835183529284019291840191600101612854565b60008060006060848603121561288557600080fd5b83356128908161250a565b95602085013595506040909401359392505050565b600080600080608085870312156128bb57600080fd5b84356128c68161250a565b935060208501356128d68161250a565b92506040850135915060608501356001600160401b038111156128f857600080fd5b8501601f8101871361290957600080fd5b612918878235602084016123e7565b91505092959194509250565b81516001600160a01b031681526020808301516001600160401b03169082015260408083015115159082015260608101610659565b6000806040838503121561296c57600080fd5b50508035926020909101359150565b6000806040838503121561298e57600080fd5b82356129998161250a565b9150602083013561266b8161250a565b6020808252600e908201526d139bdd08185d5d1a1bdc9a5cd95960921b604082015260600190565b600181811c908216806129e557607f821691505b602082108103612a0557634e487b7160e01b600052602260045260246000fd5b50919050565b60008219821115612a2c57634e487b7160e01b600052601160045260246000fd5b500190565b634e487b7160e01b600052603260045260246000fd5b60008351612a59818460208801612486565b835190830190612a6d818360208801612486565b01949350505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612af4908301846124b2565b9695505050505050565b600060208284031215612b1057600080fd5b81516112508161236e565b600060208284031215612b2d57600080fd5b81516112508161250a56fe68747470733a2f2f697066732e696f2f697066732f516d4e53716d353848714e6f6267646b6d537055517635483966396859624e414d7972574e33784438756376766a2fa2646970667358221220d8e07dddfad464cdf9365573cb3b98a855c3d59d1649139352e2ecc004cb8e5f64736f6c634300080d0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.