ERC-721
Overview
Max Total Supply
555 AP
Holders
337
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 APLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
GmStudioApollo
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED // Copyright (c) 2022 gmDAO pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@divergencetech/ethier/contracts/erc721/ERC721ACommon.sol"; import "@divergencetech/ethier/contracts/crypto/SignatureChecker.sol"; import "@divergencetech/ethier-0-39/contracts/factories/PaymentSplitterDeployer.sol"; import "operator-filter-registry/src/DefaultOperatorFilterer.sol"; import "../../utils/ERC2981SinglePercentual.sol"; // __ __ __ // | \ | \ \ // ______ ______ ____ _______ _| ▓▓_ __ __ ____| ▓▓\▓▓ ______ // / \| \ \ / \ ▓▓ \ | \ | \/ ▓▓ \/ \ // | ▓▓▓▓▓▓\ ▓▓▓▓▓▓\▓▓▓▓\ | ▓▓▓▓▓▓▓\▓▓▓▓▓▓ | ▓▓ | ▓▓ ▓▓▓▓▓▓▓ ▓▓ ▓▓▓▓▓▓\ // | ▓▓ | ▓▓ ▓▓ | ▓▓ | ▓▓ \▓▓ \ | ▓▓ __| ▓▓ | ▓▓ ▓▓ | ▓▓ ▓▓ ▓▓ | ▓▓ // | ▓▓__| ▓▓ ▓▓ | ▓▓ | ▓▓__ _\▓▓▓▓▓▓\ | ▓▓| \ ▓▓__/ ▓▓ ▓▓__| ▓▓ ▓▓ ▓▓__/ ▓▓ // \▓▓ ▓▓ ▓▓ | ▓▓ | ▓▓ \ | ▓▓ \▓▓ ▓▓\▓▓ ▓▓\▓▓ ▓▓ ▓▓\▓▓ ▓▓ // _\▓▓▓▓▓▓▓\▓▓ \▓▓ \▓▓\▓▓ \▓▓▓▓▓▓▓ \▓▓▓▓ \▓▓▓▓▓▓ \▓▓▓▓▓▓▓\▓▓ \▓▓▓▓▓▓ // | \__| ▓▓ // \▓▓ ▓▓ // \▓▓▓▓▓▓ // contract GmStudioApollo is ERC721ACommon, ReentrancyGuard, DefaultOperatorFilterer, ERC2981SinglePercentual { using EnumerableSet for EnumerableSet.AddressSet; using SignatureChecker for EnumerableSet.AddressSet; using Address for address payable; /// @notice Price for minting uint256 public constant MINT_PRICE = 0.25 ether; /// @notice Splits payments between the Studio and the artist. address payable public immutable paymentSplitter; /// @notice Splits payments between the Studio and the artist. address payable public immutable paymentSplitterRoyalties; /// @notice Total maximum amount of tokens uint32 public constant MAX_NUM_TOKENS = 555; /// @notice Number of mints throught the early access minting interface. uint32 internal constant NUM_EARLY_ACCESS_MINTS = 555; /// @notice Number of mints for reserved the studio/artist. uint32 internal constant NUM_RESERVED_MINTS = 6; /// @notice Locks the mintReserve function bool internal reserveMinted; /// @notice Timestamps to enables/eisables minting interfaces /// @dev The following order is assumed /// signedMintOpeningTimestamp < publicMintOpeningTimestamp < mintClosingTimestamp struct MintConfig { uint64 signedMintOpeningTimestamp; uint64 publicMintOpeningTimestamp; uint64 mintClosingTimestamp; } /// @notice The minting configuration MintConfig public mintConfig; /// @notice Stores the number of tokens minted from a signature during the /// early access stage. /// @dev Used in `mintEarlyAccess` mapping(bytes32 => uint256) public numEarlyAccessMintsFrom; /// @notice Stores the number of tokens minted from a signature during the /// public minting stage. /// @dev Used in `mintPublic` mapping(bytes32 => uint256) private _numPublicMintsFrom; /// @notice Signature signers for the early access stage. /// @dev Removing signers invalidates the corresponding signatures. EnumerableSet.AddressSet private _signersEarlyAccess; /// @notice Signature signers for the early access stage. /// @dev Removing signers invalidates the corresponding signatures. EnumerableSet.AddressSet private _signersPublic; /// @notice tokenURI() base path. /// @dev Without trailing slash string internal _baseTokenURI; constructor( address newOwner, address signerEarlyAccess, address signerPublic, string memory baseTokenURI, MintConfig memory config, address[] memory payees, uint256[] memory shares, uint256[] memory sharesRoyalties ) ERC721ACommon("Apollo by Asaf Slook", "AP") { _signersEarlyAccess.add(signerEarlyAccess); _signersPublic.add(signerPublic); _baseTokenURI = baseTokenURI; mintConfig = config; paymentSplitter = payable( PaymentSplitterDeployer.instance().deploy(payees, shares) ); paymentSplitterRoyalties = payable( PaymentSplitterDeployer.instance().deploy(payees, sharesRoyalties) ); _setRoyaltyPercentage(750); _setRoyaltyReceiver(paymentSplitterRoyalties); transferOwnership(newOwner); } // ------------------------------------------------------------------------- // // Minting // // ------------------------------------------------------------------------- /// @notice Toggle minting relevant flags. function setMintConfig(MintConfig calldata config) external onlyOwner { mintConfig = config; } /* solhint-disable not-rely-on-time */ /// @dev Reverts if we are not in the early access minting window or the if /// `mintConfig` has not been set yet. modifier onlyDuringEarlyAccessMintingPeriod() { if ( // solhint-disable-next-line not-rely-on-time block.timestamp < mintConfig.signedMintOpeningTimestamp || block.timestamp > mintConfig.publicMintOpeningTimestamp ) revert MintDisabled(); _; } /// @dev Reverts if we are not in the public minting window or the if /// `mintConfig` has not been set yet. modifier onlyDuringPublicMintingPeriod() { if ( block.timestamp < mintConfig.publicMintOpeningTimestamp || block.timestamp > mintConfig.mintClosingTimestamp ) revert MintDisabled(); _; } /* solhint-enable not-rely-on-time */ /// @dev Reverts if called by a contract. modifier onlyEOA() { /* solhint-disable-next-line avoid-tx-origin */ if (tx.origin != msg.sender) { revert OnlyEOA(); } _; } /// @notice Mints tokens to a given address using a signed message. /// @dev The minter might be different than the receiver. /// @param to Token receiver /// @param num Number of tokens to be minted. /// @param numMax Max number of tokens that can be minted to the receiver. /// @param nonce additional signature salt. /// @param signature to prove that the receiver is allowed to get mints. /// @dev The signed messages is generated by concatenating /// `address(this) || to || numMax || nonce`. function _mintSigned( address to, uint16 num, uint16 numMax, uint128 nonce, bytes calldata signature, EnumerableSet.AddressSet storage signers, mapping(bytes32 => uint256) storage numMintedFrom ) internal { // General checks if (num * MINT_PRICE != msg.value) revert InvalidPayment(); // Signature related checks bytes32 message = ECDSA.toEthSignedMessageHash( abi.encodePacked(address(this), to, numMax, nonce) ); if (num + numMintedFrom[message] > numMax) revert TooManyMintsRequested(); signers.requireValidSignature(message, signature); numMintedFrom[message] += num; _processPayment(); _processMint(to, num); } /// @notice Mints tokens to a given address using a signed message during /// the early access stage. /// @dev The minter might be different than the receiver. /// @param to Token receiver /// @param num Number of tokens to be minted. /// @param numMax Max number of tokens that can be minted to the receiver. /// @param nonce additional signature salt. /// @param signature to prove that the receiver is allowed to get mints. function mintEarlyAccess( address to, uint16 num, uint16 numMax, uint128 nonce, bytes calldata signature ) external payable onlyDuringEarlyAccessMintingPeriod nonReentrant { if (num > _numEarlyAccessMintsRemaining()) revert InsufficientTokensRemanining(); _mintSigned( to, num, numMax, nonce, signature, _signersEarlyAccess, numEarlyAccessMintsFrom ); } /// @notice Computes the number of remaining early access mints. /// @dev This takes into account whether or not the reserve was alredy minted. function _numEarlyAccessMintsRemaining() internal view returns (uint256) { uint256 maxMints = reserveMinted ? NUM_EARLY_ACCESS_MINTS + NUM_RESERVED_MINTS : NUM_EARLY_ACCESS_MINTS; return maxMints - totalSupply(); } /// @notice Mints tokens for the sender using a signed message during /// the public minting stage. /// @param num Number of tokens to be minted. /// @param numMax Max number of tokens that can be minted. /// @param nonce additional signature salt. /// @param signature to prove that the receiver is allowed to get mints. function mintPublic( uint16 num, uint16 numMax, uint128 nonce, bytes calldata signature ) external payable onlyDuringPublicMintingPeriod onlyEOA { _mintSigned( msg.sender, num, numMax, nonce, signature, _signersPublic, _numPublicMintsFrom ); } /// @notice Receiver of reserve mints. /// @dev `to` corresponds to the address of the receiver and `num` to the /// number of tokens to be minted. struct ReserveReceiver { address to; uint32 num; } /// @notice Mints the initial token reserve. /// @param receivers Array of token receivers /// @dev The minter might be different than the receiver. /// @dev Reverts if the number of minted tokens does not equal /// NUM_RESERVED_MINTS function mintReserve(ReserveReceiver[] calldata receivers) external onlyOwner { if (reserveMinted) revert MintDisabled(); reserveMinted = true; uint256 numReceivers = receivers.length; uint256 minted = 0; for (uint256 idx = 0; idx < numReceivers; ++idx) { minted += receivers[idx].num; _processMint(receivers[idx].to, receivers[idx].num); } if (minted != NUM_RESERVED_MINTS) revert WrongNumberOfReserveMints(); } /// @notice Mints new tokens for the recipient. function _processMint(address to, uint256 num) internal { if (totalSupply() + num > MAX_NUM_TOKENS) revert InsufficientTokensRemanining(); _mint(to, num); } /// @notice Computes a pseudorandom seed for a mint batch. /// @dev Even though this process can be gamed in principle, it is extremly /// difficult to do so in practise. Therefore we can still rely on this to /// derive fair seeds. function _computeBatchSeed(address to) private view returns (uint24) { return uint24( bytes3( keccak256( abi.encodePacked( block.timestamp, block.difficulty, blockhash(block.number - 1), to ) ) ) ); } /// @dev Sets the extra data field during token transfers function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual override returns (uint24) { // if minting, compute a batch seed if (from == address(0)) { return _computeBatchSeed(to); } // else return the current value return previousExtraData; } // ------------------------------------------------------------------------- // // Signature validataion // // ------------------------------------------------------------------------- /// @notice The different minting stages enum MintingStage { EarlyAccess, Public } /// @notice Helper function the retrieves the correct set of signers for /// a given minting stage. function _getSigners(MintingStage stage) internal view returns (EnumerableSet.AddressSet storage) { if (stage == MintingStage.EarlyAccess) return _signersEarlyAccess; if (stage == MintingStage.Public) return _signersPublic; revert WrongMintingStage(); } /// @notice Removes and adds addresses to the set of allowed signers. /// @dev Removal is performed before addition. function changeSigners( MintingStage stage, address[] calldata delSigners, address[] calldata addSigners ) external onlyOwner { EnumerableSet.AddressSet storage _signers = _getSigners(stage); for (uint256 idx; idx < delSigners.length; ++idx) { _signers.remove(delSigners[idx]); } for (uint256 idx; idx < addSigners.length; ++idx) { _signers.add(addSigners[idx]); } } /// @notice Returns the addresses that are used for signature verification /// for a given minting stage. function getSigners(MintingStage stage) external view returns (address[] memory signers) { EnumerableSet.AddressSet storage _signers = _getSigners(stage); uint256 len = _signers.length(); signers = new address[](len); for (uint256 idx = 0; idx < len; ++idx) { signers[idx] = _signers.at(idx); } } // ------------------------------------------------------------------------- // // Payment // // ------------------------------------------------------------------------- /// @notice Processes an incoming payment and sends it to the payment /// splitter. function _processPayment() internal { paymentSplitter.sendValue(msg.value); } // ------------------------------------------------------------------------- // // Metadata // // ------------------------------------------------------------------------- /// @notice Change tokenURI() base path. /// @param uri The new base path (must not contain trailing slash) function setBaseTokenURI(string calldata uri) external onlyOwner { _baseTokenURI = uri; } /// @notice Returns the URI for token metadata. function tokenURI(uint256 tokenId) public view override tokenExists(tokenId) returns (string memory) { return string( abi.encodePacked( _baseTokenURI, "/", Strings.toString(tokenId), ".json" ) ); } /// @notice Returns the seed of a token. /// @dev The seed is computed from the seed of the batch in which the given /// token was minted. function tokenSeed(uint256 tokenId) public view tokenExists(tokenId) returns (bytes32) { uint24 batchSeed = _ownershipOf(tokenId).extraData; return keccak256(abi.encodePacked(address(this), batchSeed, tokenId)); } // ------------------------------------------------------------------------- // // Operator filtering // // ------------------------------------------------------------------------- function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) { super.approve(operator, tokenId); } function transferFrom( address from, address to, uint256 tokenId ) public override onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } // ------------------------------------------------------------------------- // // Internals // // ------------------------------------------------------------------------- /// @dev See {IERC165-supportsInterface}. function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721ACommon, ERC2981) returns (bool) { return ERC721ACommon.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); } // ------------------------------------------------------------------------- // // Errors // // ------------------------------------------------------------------------- error MintDisabled(); error TooManyMintsRequested(); error InsufficientTokensRemanining(); error InvalidPayment(); error OnlyEOA(); error WrongNumberOfReserveMints(); error SignatureAlreadyUsed(); error WrongMintingStage(); }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; interface IPaymentSplitterFactory { /// @notice Deploys a minimal contract proxy to a PaymentSplitter. function deploy(address[] memory payees, uint256[] memory shares) external returns (address); /** @notice Deploys a minimal contract proxy to a PaymentSplitter, at a deterministic address. @dev Use predictDeploymentAddress() with the same salt to predit the address before calling deployDeterministic(). See OpenZeppelin's proxy/Clones.sol for details and caveats, primarily that this will revert if a salt is reused. */ function deployDeterministic( bytes32 salt, address[] memory payees, uint256[] memory shares ) external returns (address); /** @notice Returns the address at which a new PaymentSplitter will be deployed if using the same salt as passed to this function. */ function predictDeploymentAddress(bytes32 salt) external view returns (address); }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "./IPaymentSplitterFactory.sol"; /** @notice Convenience library for using ethier's PaymentSplitterFactory for cheap deployment of OpenZeppelin PaymentSplitters via minimal proxy contracts. A single factory contract is deployed on supported chains, the respective addresses of which are determined via the chainid() and returned by this library's instance() function. */ library PaymentSplitterDeployer { /*** @notice Returns the ethier PaymentSplitterFactory instance for the current chain. */ function instance() internal view returns (IPaymentSplitterFactory) { address factory; assembly { switch chainid() case 1 { // mainnet factory := 0xf034d6a4b1a64f0e6038632d87746ca24b79d325 } case 5 { // Görli factory := 0x7F4Ae949da2eD37E0a4b37e0b15B22Ad5c94DE65 } case 1337 { // The geth SimulatedBackend iff used with the ethier // factorytest package. factory := 0xa516d2c64ED7Fe2004A93Bc123854B229F3Bb738 } } require( factory != address(0), "PaymentSplitterFactory: not deployed on current chain" ); return IPaymentSplitterFactory(factory); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; /** @title SignatureChecker @notice Additional functions for EnumerableSet.Addresset that require a valid ECDSA signature of a standardized message, signed by any member of the set. */ library SignatureChecker { using EnumerableSet for EnumerableSet.AddressSet; /** @notice Requires that the message has not been used previously and that the recovered signer is contained in the signers AddressSet. @dev Convenience wrapper for message generation + signature verification + marking message as used @param signers Set of addresses from which signatures are accepted. @param usedMessages Set of already-used messages. @param signature ECDSA signature of message. */ function requireValidSignature( EnumerableSet.AddressSet storage signers, bytes memory data, bytes calldata signature, mapping(bytes32 => bool) storage usedMessages ) internal { bytes32 message = generateMessage(data); require( !usedMessages[message], "SignatureChecker: Message already used" ); usedMessages[message] = true; requireValidSignature(signers, message, signature); } /** @notice Requires that the message has not been used previously and that the recovered signer is contained in the signers AddressSet. @dev Convenience wrapper for message generation + signature verification. */ function requireValidSignature( EnumerableSet.AddressSet storage signers, bytes memory data, bytes calldata signature ) internal view { bytes32 message = generateMessage(data); requireValidSignature(signers, message, signature); } /** @notice Requires that the message has not been used previously and that the recovered signer is contained in the signers AddressSet. @dev Convenience wrapper for message generation from address + signature verification. */ function requireValidSignature( EnumerableSet.AddressSet storage signers, address a, bytes calldata signature ) internal view { bytes32 message = generateMessage(abi.encodePacked(a)); requireValidSignature(signers, message, signature); } /** @notice Common validator logic, checking if the recovered signer is contained in the signers AddressSet. */ function validSignature( EnumerableSet.AddressSet storage signers, bytes32 message, bytes calldata signature ) internal view returns (bool) { return signers.contains(ECDSA.recover(message, signature)); } /** @notice Requires that the recovered signer is contained in the signers AddressSet. @dev Convenience wrapper that reverts if the signature validation fails. */ function requireValidSignature( EnumerableSet.AddressSet storage signers, bytes32 message, bytes calldata signature ) internal view { require( validSignature(signers, message, signature), "SignatureChecker: Invalid signature" ); } /** @notice Generates a message for a given data input that will be signed off-chain using ECDSA. @dev For multiple data fields, a standard concatenation using `abi.encodePacked` is commonly used to build data. */ function generateMessage(bytes memory data) internal pure returns (bytes32) { return ECDSA.toEthSignedMessageHash(data); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2022 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "./ERC721APreApproval.sol"; import "../utils/OwnerPausable.sol"; /** @notice An ERC721A contract with common functionality: - OpenSea gas-free listings - Pausable with toggling functions exposed to Owner only */ contract ERC721ACommon is ERC721APreApproval, OwnerPausable { constructor(string memory name, string memory symbol) ERC721A(name, symbol) {} // solhint-disable-line no-empty-blocks /// @notice Requires that the token exists. modifier tokenExists(uint256 tokenId) { require(ERC721A._exists(tokenId), "ERC721ACommon: Token doesn't exist"); _; } /// @notice Requires that msg.sender owns or is approved for the token. modifier onlyApprovedOrOwner(uint256 tokenId) { require( _ownershipOf(tokenId).addr == _msgSender() || getApproved(tokenId) == _msgSender(), "ERC721ACommon: Not approved nor owner" ); _; } function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual override { require(!paused(), "ERC721ACommon: paused"); super._beforeTokenTransfers(from, to, startTokenId, quantity); } /// @notice Overrides supportsInterface as required by inheritance. function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/utils/Context.sol"; import "../thirdparty/opensea/OpenSeaGasFreeListing.sol"; import "erc721a/contracts/ERC721A.sol"; /// @notice Pre-approval of OpenSea proxies for gas-less listing /// @dev This wrapper allows users to revoke the pre-approval of their /// associated proxy and emits the corresponding events. This is necessary for /// external tools to index approvals correctly and inform the user. /// @dev The pre-approval is triggered on a per-wallet basis during the first /// transfer transactions. It will only be enabled for wallets with an existing /// proxy. Not having a proxy incurs a gas overhead. /// @dev This wrapper optimizes for the following scenario: /// - The majority of users already have a wyvern proxy /// - Most of them want to transfer tokens via wyvern exchanges abstract contract ERC721APreApproval is ERC721A, Context { /// @dev It is important that Active remains at first position, since this /// is the scenario that we are trying to optimize for. enum State { Active, Inactive } /// @notice The state of the pre-approval for a given owner mapping(address => State) private state; /// @dev Returns true if either standard `isApprovedForAll()` or if the /// `operator` is the OpenSea proxy for the `owner` provided the /// pre-approval is active. function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { if (super.isApprovedForAll(owner, operator)) { return true; } return state[owner] == State.Active && OpenSeaGasFreeListing.isApprovedForAll(owner, operator); } /// @dev Uses the standard `setApprovalForAll` or toggles the pre-approval /// state if `operator` is the OpenSea proxy for the sender. function setApprovalForAll(address operator, bool approved) public virtual override { address owner = _msgSender(); if (operator == OpenSeaGasFreeListing.proxyFor(owner)) { state[owner] = approved ? State.Active : State.Inactive; emit ApprovalForAll(owner, operator, approved); } else { super.setApprovalForAll(operator, approved); } } /// @dev Checks if the receiver has an existing proxy. If not, the /// pre-approval is disabled. function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual override { super._beforeTokenTransfers(from, to, startTokenId, quantity); // Exclude burns and inactive pre-approvals if (to == address(0) || state[to] == State.Inactive) { return; } address operator = OpenSeaGasFreeListing.proxyFor(to); // Disable if `to` has no proxy if (operator == address(0)) { state[to] = State.Inactive; return; } // Avoid emitting unnecessary events. if (balanceOf(to) == 0) { emit ApprovalForAll(to, operator, true); } } }
// 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 // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; /// @notice A Pausable contract that can only be toggled by the Owner. contract OwnerPausable is Ownable, Pausable { /// @notice Pauses the contract. function pause() public onlyOwner { Pausable._pause(); } /// @notice Unpauses the contract. function unpause() public onlyOwner { Pausable._unpause(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.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 Pausable is Context { /** * @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. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { 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()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "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"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(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) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(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) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @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] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // Copyright 2021 David Huber (@cxkoda) pragma solidity >=0.8.0 <0.9.0; import "./IERC2981.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; /** * @notice ERC2981 royalty info base contract * @dev Implements `supportsInterface` */ abstract contract ERC2981 is IERC2981, ERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // Copyright 2021 David Huber (@cxkoda) pragma solidity >=0.8.0 <0.9.0; import "./ERC2981.sol"; /** * @notice ERC2981 royalty info implementation for a single beneficiary * receving a percentage of sales prices. * @author David Huber (@cxkoda) */ contract ERC2981SinglePercentual is ERC2981 { /** * @dev The royalty percentage (in units of 0.01%) */ uint96 private _percentage; /** * @dev The address to receive the royalties */ address private _receiver; /** * @dev See {IERC2981-royaltyInfo}. */ function royaltyInfo(uint256, uint256 salePrice) external view override returns (address receiver, uint256 royaltyAmount) { royaltyAmount = (salePrice / 10000) * _percentage; receiver = _receiver; } /** * @dev Sets the royalty percentage (in units of 0.01%) */ function _setRoyaltyPercentage(uint96 percentage_) internal { _percentage = percentage_; } /** * @dev Sets the address to receive the royalties */ function _setRoyaltyReceiver(address receiver_) internal { _receiver = receiver_; } }
// SPDX-License-Identifier: None pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard * @author Taken from https://eips.ethereum.org/EIPS/eip-2981 */ interface IERC2981 is IERC165 { /** * @notice Called with the sale price to determine how much royalty * is owed and to whom. * @param tokenId - the NFT asset queried for royalty information * @param salePrice - the sale price of the NFT asset specified by _tokenId * @return receiver - address of who should be sent the royalty payment * @return royaltyAmount - the royalty payment amount for _salePrice */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.2 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Reference type for token approval. struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _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 {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return _currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary 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 virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ 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, _toString(tokenId))) : ''; } /** * @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, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { uint256 packed = _packedOwnerships[curr]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `curr` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @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) public virtual override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId].value; } /** * @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) public virtual override { if (operator == _msgSenderERC721A()) revert ApproveToCaller(); _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @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. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId]`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * 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 ) public virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // 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 { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @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 memory _data ) public virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @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 Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @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 for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, 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. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @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 { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // 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 { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * 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 _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), // but we allocate 0x80 bytes to keep the free memory pointer 32-byte word aliged. // We will need 1 32-byte word to store the length, // and 3 32-byte words to store a maximum of 78 digits. Total: 0x20 + 3 * 0x20 = 0x80. str := add(mload(0x40), 0x80) // Update the free memory pointer to allocate. mstore(0x40, str) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.2 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721A { /** * 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(); /** * 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(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @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`, * 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 be 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, bytes calldata data ) external; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * 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); // ============================================================= // IERC721Metadata // ============================================================= /** * @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); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {OperatorFilterer} from "./OperatorFilterer.sol"; /** * @title DefaultOperatorFilterer * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription. */ abstract contract DefaultOperatorFilterer is OperatorFilterer { address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { function isOperatorAllowed(address registrant, address operator) external view returns (bool); function register(address registrant) external; function registerAndSubscribe(address registrant, address subscription) external; function registerAndCopyEntries(address registrant, address registrantToCopy) external; function unregister(address addr) external; function updateOperator(address registrant, address operator, bool filtered) external; function updateOperators(address registrant, address[] calldata operators, bool filtered) external; function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; function subscribe(address registrant, address registrantToSubscribe) external; function unsubscribe(address registrant, bool copyExistingEntries) external; function subscriptionOf(address addr) external returns (address registrant); function subscribers(address registrant) external returns (address[] memory); function subscriberAt(address registrant, uint256 index) external returns (address); function copyEntriesOf(address registrant, address registrantToCopy) external; function isOperatorFiltered(address registrant, address operator) external returns (bool); function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); function filteredOperators(address addr) external returns (address[] memory); function filteredCodeHashes(address addr) external returns (bytes32[] memory); function filteredOperatorAt(address registrant, uint256 index) external returns (address); function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); function isRegistered(address addr) external returns (bool); function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol"; /** * @title OperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. */ abstract contract OperatorFilterer { error OperatorNotAllowed(address operator); IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY = IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); constructor(address subscriptionOrRegistrantToCopy, bool subscribe) { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (subscribe) { OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { OPERATOR_FILTER_REGISTRY.register(address(this)); } } } } modifier onlyAllowedOperator(address from) virtual { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from != msg.sender) { _checkFilterOperator(msg.sender); } _; } modifier onlyAllowedOperatorApproval(address operator) virtual { _checkFilterOperator(operator); _; } function _checkFilterOperator(address operator) internal view virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"newOwner","type":"address"},{"internalType":"address","name":"signerEarlyAccess","type":"address"},{"internalType":"address","name":"signerPublic","type":"address"},{"internalType":"string","name":"baseTokenURI","type":"string"},{"components":[{"internalType":"uint64","name":"signedMintOpeningTimestamp","type":"uint64"},{"internalType":"uint64","name":"publicMintOpeningTimestamp","type":"uint64"},{"internalType":"uint64","name":"mintClosingTimestamp","type":"uint64"}],"internalType":"struct GmStudioApollo.MintConfig","name":"config","type":"tuple"},{"internalType":"address[]","name":"payees","type":"address[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"},{"internalType":"uint256[]","name":"sharesRoyalties","type":"uint256[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InsufficientTokensRemanining","type":"error"},{"inputs":[],"name":"InvalidPayment","type":"error"},{"inputs":[],"name":"MintDisabled","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OnlyEOA","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"SignatureAlreadyUsed","type":"error"},{"inputs":[],"name":"TooManyMintsRequested","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"},{"inputs":[],"name":"WrongMintingStage","type":"error"},{"inputs":[],"name":"WrongNumberOfReserveMints","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":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","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":[],"name":"MAX_NUM_TOKENS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum GmStudioApollo.MintingStage","name":"stage","type":"uint8"},{"internalType":"address[]","name":"delSigners","type":"address[]"},{"internalType":"address[]","name":"addSigners","type":"address[]"}],"name":"changeSigners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum GmStudioApollo.MintingStage","name":"stage","type":"uint8"}],"name":"getSigners","outputs":[{"internalType":"address[]","name":"signers","type":"address[]"}],"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":[],"name":"mintConfig","outputs":[{"internalType":"uint64","name":"signedMintOpeningTimestamp","type":"uint64"},{"internalType":"uint64","name":"publicMintOpeningTimestamp","type":"uint64"},{"internalType":"uint64","name":"mintClosingTimestamp","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint16","name":"num","type":"uint16"},{"internalType":"uint16","name":"numMax","type":"uint16"},{"internalType":"uint128","name":"nonce","type":"uint128"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mintEarlyAccess","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"num","type":"uint16"},{"internalType":"uint16","name":"numMax","type":"uint16"},{"internalType":"uint128","name":"nonce","type":"uint128"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mintPublic","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint32","name":"num","type":"uint32"}],"internalType":"struct GmStudioApollo.ReserveReceiver[]","name":"receivers","type":"tuple[]"}],"name":"mintReserve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"numEarlyAccessMintsFrom","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":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentSplitter","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentSplitterRoyalties","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","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":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setBaseTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"signedMintOpeningTimestamp","type":"uint64"},{"internalType":"uint64","name":"publicMintOpeningTimestamp","type":"uint64"},{"internalType":"uint64","name":"mintClosingTimestamp","type":"uint64"}],"internalType":"struct GmStudioApollo.MintConfig","name":"config","type":"tuple"}],"name":"setMintConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenSeed","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c06040523480156200001157600080fd5b50604051620041d8380380620041d8833981016040819052620000349162000941565b733cc6cdda760b79bafa08df41ecfa224f810dceb660016040518060400160405280601481526020017f41706f6c6c6f206279204173616620536c6f6f6b00000000000000000000000081525060405180604001604052806002815260200161041560f41b81525081818160029081620000af919062000ad8565b506003620000be828262000ad8565b50506000805550620000d0336200042a565b50506009805460ff60a01b191690556001600a556daaeb6d7670e522a718067333cd4e3b15620002295780156200017757604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200015857600080fd5b505af11580156200016d573d6000803e3d6000fd5b5050505062000229565b6001600160a01b03821615620001c85760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af2903906044016200013d565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b1580156200020f57600080fd5b505af115801562000224573d6000803e3d6000fd5b505050505b5050620002468760106200047c60201b620010c11790919060201c565b50620002628660126200047c60201b620010c11790919060201c565b50601462000271868262000ad8565b508351600d805460208088015160408901516001600160401b03908116600160801b02600160801b600160c01b031992821668010000000000000000026001600160801b031990951691909616179290921791909116929092179055620002e190620010d66200049c821b17901c565b6001600160a01b0316634f62f4d184846040518363ffffffff1660e01b81526004016200031092919062000ba4565b6020604051808303816000875af115801562000330573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000356919062000c2c565b6001600160a01b0316608052620003786200049c602090811b620010d617901c565b6001600160a01b0316634f62f4d184836040518363ffffffff1660e01b8152600401620003a792919062000ba4565b6020604051808303816000875af1158015620003c7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003ed919062000c2c565b6001600160a01b031660a08190526c01000000000000000000000000026102ee17600b556200041c886200059c565b505050505050505062000c4a565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600062000493836001600160a01b0384166200066d565b90505b92915050565b6000804660018114620004c25760058114620004df576105398114620004fc5762000514565b73f034d6a4b1a64f0e6038632d87746ca24b79d325915062000514565b737f4ae949da2ed37e0a4b37e0b15b22ad5c94de65915062000514565b73a516d2c64ed7fe2004a93bc123854b229f3bb73891505b506001600160a01b038116620005975760405162461bcd60e51b815260206004820152603560248201527f5061796d656e7453706c6974746572466163746f72793a206e6f74206465706c60448201527f6f796564206f6e2063757272656e7420636861696e000000000000000000000060648201526084015b60405180910390fd5b919050565b6009546001600160a01b03163314620005f85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200058e565b6001600160a01b0381166200065f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200058e565b6200066a816200042a565b50565b6000818152600183016020526040812054620006b65750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000496565b50600062000496565b80516001600160a01b03811681146200059757600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620007185762000718620006d7565b604052919050565b600082601f8301126200073257600080fd5b81516001600160401b038111156200074e576200074e620006d7565b602062000764601f8301601f19168201620006ed565b82815285828487010111156200077957600080fd5b60005b83811015620007995785810183015182820184015282016200077c565b506000928101909101919091529392505050565b80516001600160401b03811681146200059757600080fd5b600060608284031215620007d857600080fd5b604051606081016001600160401b0381118282101715620007fd57620007fd620006d7565b6040529050806200080e83620007ad565b81526200081e60208401620007ad565b60208201526200083160408401620007ad565b60408201525092915050565b60006001600160401b03821115620008595762000859620006d7565b5060051b60200190565b600082601f8301126200087557600080fd5b815160206200088e62000888836200083d565b620006ed565b82815260059290921b84018101918181019086841115620008ae57600080fd5b8286015b84811015620008d457620008c681620006bf565b8352918301918301620008b2565b509695505050505050565b600082601f830112620008f157600080fd5b815160206200090462000888836200083d565b82815260059290921b840181019181810190868411156200092457600080fd5b8286015b84811015620008d4578051835291830191830162000928565b600080600080600080600080610140898b0312156200095f57600080fd5b6200096a89620006bf565b97506200097a60208a01620006bf565b96506200098a60408a01620006bf565b60608a01519096506001600160401b0380821115620009a857600080fd5b620009b68c838d0162000720565b9650620009c78c60808d01620007c5565b955060e08b0151915080821115620009de57600080fd5b620009ec8c838d0162000863565b94506101008b015191508082111562000a0457600080fd5b62000a128c838d01620008df565b93506101208b015191508082111562000a2a57600080fd5b5062000a398b828c01620008df565b9150509295985092959890939650565b600181811c9082168062000a5e57607f821691505b60208210810362000a7f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000ad357600081815260208120601f850160051c8101602086101562000aae5750805b601f850160051c820191505b8181101562000acf5782815560010162000aba565b5050505b505050565b81516001600160401b0381111562000af45762000af4620006d7565b62000b0c8162000b05845462000a49565b8462000a85565b602080601f83116001811462000b44576000841562000b2b5750858301515b600019600386901b1c1916600185901b17855562000acf565b600085815260208120601f198616915b8281101562000b755788860151825594840194600190910190840162000b54565b508582101562000b945787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604080825283519082018190526000906020906060840190828701845b8281101562000be85781516001600160a01b03168452928401929084019060010162000bc1565b5050508381038285015284518082528583019183019060005b8181101562000c1f5783518352928401929184019160010162000c01565b5090979650505050505050565b60006020828403121562000c3f57600080fd5b6200049382620006bf565b60805160a05161356162000c7760003960006105c40152600081816106c7015261225d01526135616000f3fe60806040526004361061020f5760003560e01c806370a0823111610118578063bf964b4e116100a0578063e7cc72441161006f578063e7cc724414610635578063e985e9c514610695578063ed4a6b0c146106b5578063ed92d4f7146106e9578063f2fde38b1461070957600080fd5b8063bf964b4e146105b2578063c002d23d146105e6578063c615a7b214610602578063c87b56dd1461061557600080fd5b80638da5cb5b116100e75780638da5cb5b1461052c57806395d89b411461054a578063a22cb4651461055f578063b88d4fde1461057f578063bd2e4abd1461059f57600080fd5b806370a08231146104b7578063715018a6146104d7578063718e6adb146104ec5780638456cb591461051757600080fd5b80632a55205a1161019b57806342842e0e1161016a57806342842e0e146104185780635c975abb146104385780635f516836146104575780636352211e146104775780636b7813ee1461049757600080fd5b80632a55205a1461038257806330176e13146103c15780633f4ba83a146103e157806341f43434146103f657600080fd5b80630ae9f4ae116101e25780630ae9f4ae146102c557806318160ddd146102e557806323b872dd14610308578063249c4b481461032857806328c5846f1461035557600080fd5b806301ffc9a71461021457806306fdde0314610249578063081812fc1461026b578063095ea7b3146102a3575b600080fd5b34801561022057600080fd5b5061023461022f3660046129f8565b610729565b60405190151581526020015b60405180910390f35b34801561025557600080fd5b5061025e610749565b6040516102409190612a65565b34801561027757600080fd5b5061028b610286366004612a78565b6107db565b6040516001600160a01b039091168152602001610240565b3480156102af57600080fd5b506102c36102be366004612aa6565b61081f565b005b3480156102d157600080fd5b506102c36102e0366004612ad2565b610838565b3480156102f157600080fd5b50600154600054035b604051908152602001610240565b34801561031457600080fd5b506102c3610323366004612b46565b61097d565b34801561033457600080fd5b50610348610343366004612b96565b6109a2565b6040516102409190612bb1565b34801561036157600080fd5b506102fa610370366004612a78565b600e6020526000908152604090205481565b34801561038e57600080fd5b506103a261039d366004612bfe565b610a59565b604080516001600160a01b039093168352602083019190915201610240565b3480156103cd57600080fd5b506102c36103dc366004612c61565b610aa2565b3480156103ed57600080fd5b506102c3610ad9565b34801561040257600080fd5b5061028b6daaeb6d7670e522a718067333cd4e81565b34801561042457600080fd5b506102c3610433366004612b46565b610b0d565b34801561044457600080fd5b50600954600160a01b900460ff16610234565b34801561046357600080fd5b506102fa610472366004612a78565b610b32565b34801561048357600080fd5b5061028b610492366004612a78565b610bc1565b3480156104a357600080fd5b506102c36104b2366004612ca2565b610bcc565b3480156104c357600080fd5b506102fa6104d2366004612cb4565b610c03565b3480156104e357600080fd5b506102c3610c51565b3480156104f857600080fd5b5061050261022b81565b60405163ffffffff9091168152602001610240565b34801561052357600080fd5b506102c3610c85565b34801561053857600080fd5b506009546001600160a01b031661028b565b34801561055657600080fd5b5061025e610cb7565b34801561056b57600080fd5b506102c361057a366004612cdf565b610cc6565b34801561058b57600080fd5b506102c361059a366004612d2e565b610cda565b6102c36105ad366004612e36565b610d07565b3480156105be57600080fd5b5061028b7f000000000000000000000000000000000000000000000000000000000000000081565b3480156105f257600080fd5b506102fa6703782dace9d9000081565b6102c3610610366004612ebd565b610df1565b34801561062157600080fd5b5061025e610630366004612a78565b610e72565b34801561064157600080fd5b50600d5461066b906001600160401b0380821691600160401b8104821691600160801b9091041683565b604080516001600160401b0394851681529284166020840152921691810191909152606001610240565b3480156106a157600080fd5b506102346106b0366004612f32565b610ecd565b3480156106c157600080fd5b5061028b7f000000000000000000000000000000000000000000000000000000000000000081565b3480156106f557600080fd5b506102c3610704366004612fa4565b610f4b565b34801561071557600080fd5b506102c3610724366004612cb4565b611026565b6000610734826111c2565b806107435750610743826111cd565b92915050565b60606002805461075890613013565b80601f016020809104026020016040519081016040528092919081815260200182805461078490613013565b80156107d15780601f106107a6576101008083540402835291602001916107d1565b820191906000526020600020905b8154815290600101906020018083116107b457829003601f168201915b5050505050905090565b60006107e682611202565b610803576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b8161082981611229565b61083383836112e2565b505050565b6009546001600160a01b0316331461086b5760405162461bcd60e51b815260040161086290613047565b60405180910390fd5b600c5460ff161561088f576040516317efbd6b60e01b815260040160405180910390fd5b600c805460ff19166001179055806000805b82811015610955578484828181106108bb576108bb61307c565b90506040020160200160208101906108d39190613092565b6108e39063ffffffff16836130ce565b91506109458585838181106108fa576108fa61307c565b6109109260206040909202019081019150612cb4565b8686848181106109225761092261307c565b905060400201602001602081019061093a9190613092565b63ffffffff16611382565b61094e816130e1565b90506108a1565b5060068114610977576040516378e2ffa360e01b815260040160405180910390fd5b50505050565b826001600160a01b03811633146109975761099733611229565b6109778484846113ca565b606060006109af8361158c565b905060006109bc826115e8565b9050806001600160401b038111156109d6576109d6612d18565b6040519080825280602002602001820160405280156109ff578160200160208202803683370190505b50925060005b81811015610a5157610a1783826115f2565b848281518110610a2957610a2961307c565b6001600160a01b0390921660209283029190910190910152610a4a816130e1565b9050610a05565b505050919050565b600b5460009081906bffffffffffffffffffffffff16610a7b61271085613110565b610a859190613124565b600b54600160601b90046001600160a01b03169590945092505050565b6009546001600160a01b03163314610acc5760405162461bcd60e51b815260040161086290613047565b6014610833828483613181565b6009546001600160a01b03163314610b035760405162461bcd60e51b815260040161086290613047565b610b0b6115fe565b565b826001600160a01b0381163314610b2757610b2733611229565b61097784848461169b565b600081610b3e81611202565b610b5a5760405162461bcd60e51b815260040161086290613240565b6000610b65846116b6565b6060908101516040513090921b6001600160601b031916602083015260e881901b6001600160e81b0319166034830152603782018690529150605701604051602081830303815290604052805190602001209250505b50919050565b60006107438261172d565b6009546001600160a01b03163314610bf65760405162461bcd60e51b815260040161086290613047565b80600d610833828261329b565b60006001600160a01b038216610c2c576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6009546001600160a01b03163314610c7b5760405162461bcd60e51b815260040161086290613047565b610b0b6000611794565b6009546001600160a01b03163314610caf5760405162461bcd60e51b815260040161086290613047565b610b0b6117e6565b60606003805461075890613013565b81610cd081611229565b610833838361186e565b836001600160a01b0381163314610cf457610cf433611229565b610d0085858585611933565b5050505050565b600d546001600160401b0316421080610d315750600d54600160401b90046001600160401b031642115b15610d4f576040516317efbd6b60e01b815260040160405180910390fd5b6002600a5403610da15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610862565b6002600a55610dae611977565b8561ffff161115610dd257604051630f196e0f60e21b815260040160405180910390fd5b610de48686868686866010600e6119c0565b50506001600a5550505050565b600d54600160401b90046001600160401b0316421080610e225750600d54600160801b90046001600160401b031642115b15610e40576040516317efbd6b60e01b815260040160405180910390fd5b323314610e6057604051639f8129d160e01b815260040160405180910390fd5b610d003386868686866012600f6119c0565b606081610e7e81611202565b610e9a5760405162461bcd60e51b815260040161086290613240565b6014610ea584611afe565b604051602001610eb6929190613326565b604051602081830303815290604052915050919050565b6001600160a01b03808316600090815260076020908152604080832093851683529290529081205460ff1615610f0557506001610743565b6001600160a01b03831660009081526008602052604081205460ff166001811115610f3257610f326133cc565b148015610f445750610f448383611c06565b9392505050565b6009546001600160a01b03163314610f755760405162461bcd60e51b815260040161086290613047565b6000610f808661158c565b905060005b84811015610fcf57610fbe868683818110610fa257610fa261307c565b9050602002016020810190610fb79190612cb4565b8390611c44565b50610fc8816130e1565b9050610f85565b5060005b8281101561101d5761100c848483818110610ff057610ff061307c565b90506020020160208101906110059190612cb4565b83906110c1565b50611016816130e1565b9050610fd3565b50505050505050565b6009546001600160a01b031633146110505760405162461bcd60e51b815260040161086290613047565b6001600160a01b0381166110b55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610862565b6110be81611794565b50565b6000610f44836001600160a01b038416611c59565b60008046600181146110f8576005811461111457610539811461113057611148565b73f034d6a4b1a64f0e6038632d87746ca24b79d3259150611148565b737f4ae949da2ed37e0a4b37e0b15b22ad5c94de659150611148565b73a516d2c64ed7fe2004a93bc123854b229f3bb73891505b506001600160a01b0381166111bd5760405162461bcd60e51b815260206004820152603560248201527f5061796d656e7453706c6974746572466163746f72793a206e6f74206465706c60448201527437bcb2b21037b71031bab93932b73a1031b430b4b760591b6064820152608401610862565b919050565b600061074382611ca8565b60006001600160e01b0319821663152a902d60e11b148061074357506301ffc9a760e01b6001600160e01b0319831614610743565b6000805482108015610743575050600090815260046020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b156110be57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611296573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ba91906133e2565b6110be57604051633b79c77360e21b81526001600160a01b0382166004820152602401610862565b60006112ed82610bc1565b9050336001600160a01b03821614611326576113098133610ecd565b611326576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b61022b816113936001546000540390565b61139d91906130ce565b11156113bc57604051630f196e0f60e21b815260040160405180910390fd5b6113c68282611cf6565b5050565b60006113d58261172d565b9050836001600160a01b0316816001600160a01b0316146114085760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b03881690911417611455576114388633610ecd565b61145557604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661147c57604051633a954ecd60e21b815260040160405180910390fd5b6114898686866001611e2f565b801561149457600082555b6001600160a01b038087166000908152600560205260408082208054600019019055918716815220805460010190556114ed856114d2888287611e8d565b600160e11b174260a01b176001600160a01b03919091161790565b600085815260046020526040812091909155600160e11b84169003611542576001840160008181526004602052604081205490036115405760005481146115405760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b6000808260018111156115a1576115a16133cc565b036115ae57506010919050565b60018260018111156115c2576115c26133cc565b036115cf57506012919050565b6040516327d0b10d60e01b815260040160405180910390fd5b6000610743825490565b6000610f448383611eb0565b600954600160a01b900460ff1661164e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610862565b6009805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b61083383838360405180602001604052806000815250610cda565b6040805160808101825260008082526020820181905291810182905260608101919091526107436116e68361172d565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b60008160005481101561177b5760008181526004602052604081205490600160e01b82169003611779575b80600003610f44575060001901600081815260046020526040902054611758565b505b604051636f96cda160e11b815260040160405180910390fd5b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600954600160a01b900460ff16156118335760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610862565b6009805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861167e3390565b3361187881611eda565b6001600160a01b0316836001600160a01b031603611929578161189c57600161189f565b60005b6001600160a01b0382166000908152600860205260409020805460ff1916600183818111156118d0576118d06133cc565b0217905550826001600160a01b0316816001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318460405161191c911515815260200190565b60405180910390a3505050565b6108338383612031565b61193e84848461097d565b6001600160a01b0383163b156109775761195a848484846120c6565b610977576040516368d2bf6b60e11b815260040160405180910390fd5b600c54600090819060ff1661198e5761022b61199b565b61199b600661022b6133ff565b63ffffffff1690506119b06001546000540390565b6119ba908261341c565b91505090565b346119d76703782dace9d9000061ffff8a16613124565b146119f55760405163078d696560e31b815260040160405180910390fd5b6040516001600160601b031930606090811b821660208401528a901b1660348201526001600160f01b031960f088901b1660488201526fffffffffffffffffffffffffffffffff19608087901b16604a820152600090611a6690605a016040516020818303038152906040526121b1565b60008181526020849052604090205490915061ffff80891691611a8a918b166130ce565b1115611aa95760405163342e754760e21b815260040160405180910390fd5b611ab5838287876121ec565b6000818152602083905260408120805461ffff8b169290611ad79084906130ce565b90915550611ae59050612250565b611af3898961ffff16611382565b505050505050505050565b606081600003611b255750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611b4f5780611b39816130e1565b9150611b489050600a83613110565b9150611b29565b6000816001600160401b03811115611b6957611b69612d18565b6040519080825280601f01601f191660200182016040528015611b93576020820181803683370190505b5090505b8415611bfe57611ba860018361341c565b9150611bb5600a8661342f565b611bc09060306130ce565b60f81b818381518110611bd557611bd561307c565b60200101906001600160f81b031916908160001a905350611bf7600a86613110565b9450611b97565b949350505050565b600080611c1284611eda565b90506001600160a01b03811615801590611bfe5750826001600160a01b0316816001600160a01b031614949350505050565b6000610f44836001600160a01b038416612283565b6000818152600183016020526040812054611ca057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610743565b506000610743565b60006301ffc9a760e01b6001600160e01b031983161480611cd957506380ac58cd60e01b6001600160e01b03198316145b806107435750506001600160e01b031916635b5e139f60e01b1490565b6000805490829003611d1b5760405163b562e8dd60e01b815260040160405180910390fd5b611d286000848385611e2f565b6001600160a01b03831660009081526005602052604081208054680100000000000000018502019055611d7f908490611d62908281611e8d565b6001851460e11b174260a01b176001600160a01b03919091161790565b6000828152600460205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114611e0557808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101611dcd565b5081600003611e2657604051622e076360e81b815260040160405180910390fd5b60005550505050565b600954600160a01b900460ff1615611e815760405162461bcd60e51b8152602060048201526015602482015274115490cdcc8c5050dbdb5b5bdb8e881c185d5cd959605a1b6044820152606401610862565b6109778484848461237d565b600060e882811c90611ea086868461246e565b62ffffff16901b95945050505050565b6000826000018281548110611ec757611ec761307c565b9060005260206000200154905092915050565b600080468060018114611f0f5760898114611f2b5760048114611f4757620138818114611f63576105398114611f7f57611f97565b73a5409ec958c83c3f309868babaca7c86dcb077c19250611f97565b7358807bad0b376efc12f5ad86aac70e78ed67deae9250611f97565b73f57b2c51ded3a29e6891aba85459d600256cf3179250611f97565b73ff7ca10af37178bdd056628ef42fd7f799fac77c9250611f97565b73e1a2bbc877b29adbc56d2659dbcb0ae14ee6207192505b506001600160a01b0382161580611fae5750806089145b80611fbb57508062013881145b15611fc7575092915050565b60405163c455279160e01b81526001600160a01b03858116600483015283169063c455279190602401602060405180830381865afa15801561200d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bfe9190613443565b336001600160a01b0383160361205a5760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906120fb903390899088908890600401613460565b6020604051808303816000875af1925050508015612136575060408051601f3d908101601f191682019092526121339181019061349d565b60015b612194573d808015612164576040519150601f19603f3d011682016040523d82523d6000602084013e612169565b606091505b50805160000361218c576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b60006121bd8251611afe565b826040516020016121cf9291906134ba565b604051602081830303815290604052805190602001209050919050565b6121f88484848461248e565b6109775760405162461bcd60e51b815260206004820152602360248201527f5369676e6174757265436865636b65723a20496e76616c6964207369676e617460448201526275726560e81b6064820152608401610862565b610b0b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016346124e3565b6000818152600183016020526040812054801561236c5760006122a760018361341c565b85549091506000906122bb9060019061341c565b90508181146123205760008660000182815481106122db576122db61307c565b90600052602060002001549050808760000184815481106122fe576122fe61307c565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061233157612331613515565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610743565b6000915050610743565b5092915050565b6001600160a01b03831615806123bf575060016001600160a01b03841660009081526008602052604090205460ff1660018111156123bd576123bd6133cc565b145b6109775760006123ce84611eda565b90506001600160a01b03811661240757506001600160a01b0383166000908152600860205260409020805460ff19166001179055610977565b61241084610c03565b600003610d0057806001600160a01b0316846001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31600160405161245f911515815260200190565b60405180910390a35050505050565b60006001600160a01b03841661237657612487836125fc565b9050610f44565b60006124da6124d38585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061265c92505050565b8690612680565b95945050505050565b804710156125335760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610862565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612580576040519150601f19603f3d011682016040523d82523d6000602084013e612585565b606091505b50509050806108335760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610862565b6000424461260b60014361341c565b6040805160208101949094528301919091524060608083019190915283901b6001600160601b03191660808201526094016040516020818303038152906040528051906020012060e81c9050919050565b600080600061266b85856126a2565b9150915061267881612710565b509392505050565b6001600160a01b03811660009081526001830160205260408120541515610f44565b60008082516041036126d85760208301516040840151606085015160001a6126cc878285856128c6565b94509450505050612709565b825160400361270157602083015160408401516126f68683836129b3565b935093505050612709565b506000905060025b9250929050565b6000816004811115612724576127246133cc565b0361272c5750565b6001816004811115612740576127406133cc565b0361278d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610862565b60028160048111156127a1576127a16133cc565b036127ee5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610862565b6003816004811115612802576128026133cc565b0361285a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610862565b600481600481111561286e5761286e6133cc565b036110be5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610862565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156128fd57506000905060036129aa565b8460ff16601b1415801561291557508460ff16601c14155b1561292657506000905060046129aa565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561297a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166129a3576000600192509250506129aa565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016129d4878288856128c6565b935093505050935093915050565b6001600160e01b0319811681146110be57600080fd5b600060208284031215612a0a57600080fd5b8135610f44816129e2565b60005b83811015612a30578181015183820152602001612a18565b50506000910152565b60008151808452612a51816020860160208601612a15565b601f01601f19169290920160200192915050565b602081526000610f446020830184612a39565b600060208284031215612a8a57600080fd5b5035919050565b6001600160a01b03811681146110be57600080fd5b60008060408385031215612ab957600080fd5b8235612ac481612a91565b946020939093013593505050565b60008060208385031215612ae557600080fd5b82356001600160401b0380821115612afc57600080fd5b818501915085601f830112612b1057600080fd5b813581811115612b1f57600080fd5b8660208260061b8501011115612b3457600080fd5b60209290920196919550909350505050565b600080600060608486031215612b5b57600080fd5b8335612b6681612a91565b92506020840135612b7681612a91565b929592945050506040919091013590565b8035600281106111bd57600080fd5b600060208284031215612ba857600080fd5b610f4482612b87565b6020808252825182820181905260009190848201906040850190845b81811015612bf25783516001600160a01b031683529284019291840191600101612bcd565b50909695505050505050565b60008060408385031215612c1157600080fd5b50508035926020909101359150565b60008083601f840112612c3257600080fd5b5081356001600160401b03811115612c4957600080fd5b60208301915083602082850101111561270957600080fd5b60008060208385031215612c7457600080fd5b82356001600160401b03811115612c8a57600080fd5b612c9685828601612c20565b90969095509350505050565b600060608284031215610bbb57600080fd5b600060208284031215612cc657600080fd5b8135610f4481612a91565b80151581146110be57600080fd5b60008060408385031215612cf257600080fd5b8235612cfd81612a91565b91506020830135612d0d81612cd1565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215612d4457600080fd5b8435612d4f81612a91565b93506020850135612d5f81612a91565b92506040850135915060608501356001600160401b0380821115612d8257600080fd5b818701915087601f830112612d9657600080fd5b813581811115612da857612da8612d18565b604051601f8201601f19908116603f01168101908382118183101715612dd057612dd0612d18565b816040528281528a6020848701011115612de957600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b803561ffff811681146111bd57600080fd5b80356001600160801b03811681146111bd57600080fd5b60008060008060008060a08789031215612e4f57600080fd5b8635612e5a81612a91565b9550612e6860208801612e0d565b9450612e7660408801612e0d565b9350612e8460608801612e1f565b925060808701356001600160401b03811115612e9f57600080fd5b612eab89828a01612c20565b979a9699509497509295939492505050565b600080600080600060808688031215612ed557600080fd5b612ede86612e0d565b9450612eec60208701612e0d565b9350612efa60408701612e1f565b925060608601356001600160401b03811115612f1557600080fd5b612f2188828901612c20565b969995985093965092949392505050565b60008060408385031215612f4557600080fd5b8235612f5081612a91565b91506020830135612d0d81612a91565b60008083601f840112612f7257600080fd5b5081356001600160401b03811115612f8957600080fd5b6020830191508360208260051b850101111561270957600080fd5b600080600080600060608688031215612fbc57600080fd5b612fc586612b87565b945060208601356001600160401b0380821115612fe157600080fd5b612fed89838a01612f60565b9096509450604088013591508082111561300657600080fd5b50612f2188828901612f60565b600181811c9082168061302757607f821691505b602082108103610bbb57634e487b7160e01b600052602260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156130a457600080fd5b813563ffffffff81168114610f4457600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610743576107436130b8565b6000600182016130f3576130f36130b8565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261311f5761311f6130fa565b500490565b8082028115828204841417610743576107436130b8565b601f82111561083357600081815260208120601f850160051c810160208610156131625750805b601f850160051c820191505b818110156115845782815560010161316e565b6001600160401b0383111561319857613198612d18565b6131ac836131a68354613013565b8361313b565b6000601f8411600181146131e057600085156131c85750838201355b600019600387901b1c1916600186901b178355610d00565b600083815260209020601f19861690835b8281101561321157868501358255602094850194600190920191016131f1565b508682101561322e5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208082526022908201527f45524337323141436f6d6d6f6e3a20546f6b656e20646f65736e2774206578696040820152611cdd60f21b606082015260800190565b600081356001600160401b038116811461074357600080fd5b6001600160401b036132ac83613282565b168154816001600160401b031982161783556fffffffffffffffff00000000000000006132db60208601613282565b60401b1680836001600160801b03198416171784556001600160401b0360801b61330760408701613282565b60801b16836001600160401b0360c01b84161782171784555050505050565b600080845461333481613013565b6001828116801561334c576001811461336157613390565b60ff1984168752821515830287019450613390565b8860005260208060002060005b858110156133875781548a82015290840190820161336e565b50505082870194505b50602f60f81b8452865192506133ac8382860160208a01612a15565b64173539b7b760d91b939092019182019290925260060195945050505050565b634e487b7160e01b600052602160045260246000fd5b6000602082840312156133f457600080fd5b8151610f4481612cd1565b63ffffffff818116838216019080821115612376576123766130b8565b81810381811115610743576107436130b8565b60008261343e5761343e6130fa565b500690565b60006020828403121561345557600080fd5b8151610f4481612a91565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061349390830184612a39565b9695505050505050565b6000602082840312156134af57600080fd5b8151610f44816129e2565b7f19457468657265756d205369676e6564204d6573736167653a0a0000000000008152600083516134f281601a850160208801612a15565b83519083019061350981601a840160208801612a15565b01601a01949350505050565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220005c257297d9c66ef2bbd7e0137dfeeb4557a3af5b2209eda4114eab2c96536964736f6c63430008110033000000000000000000000000edb7c032fef116163214fcdb6ca481e94794b1870000000000000000000000005312fa01617678dcf4940c66b3adb5a468bc7cef000000000000000000000000924ed53fc89c8a4aa21cfb4d7bda7aa2dc78e10a000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000639d851000000000000000000000000000000000000000000000000000000000639dd9700000000000000000000000000000000000000000000000000000000063a713f000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000003168747470733a2f2f6170692e676d73747564696f2e6172742f636f6c6c656374696f6e732f61706f6c6c6f2f746f6b656e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e1a4cb40a1d672bb7901b646bb18eb7b70bd59520000000000000000000000003bf3ba6469c80a1e835d2afd9e59fc4de8d947ff0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000055000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002
Deployed Bytecode
0x60806040526004361061020f5760003560e01c806370a0823111610118578063bf964b4e116100a0578063e7cc72441161006f578063e7cc724414610635578063e985e9c514610695578063ed4a6b0c146106b5578063ed92d4f7146106e9578063f2fde38b1461070957600080fd5b8063bf964b4e146105b2578063c002d23d146105e6578063c615a7b214610602578063c87b56dd1461061557600080fd5b80638da5cb5b116100e75780638da5cb5b1461052c57806395d89b411461054a578063a22cb4651461055f578063b88d4fde1461057f578063bd2e4abd1461059f57600080fd5b806370a08231146104b7578063715018a6146104d7578063718e6adb146104ec5780638456cb591461051757600080fd5b80632a55205a1161019b57806342842e0e1161016a57806342842e0e146104185780635c975abb146104385780635f516836146104575780636352211e146104775780636b7813ee1461049757600080fd5b80632a55205a1461038257806330176e13146103c15780633f4ba83a146103e157806341f43434146103f657600080fd5b80630ae9f4ae116101e25780630ae9f4ae146102c557806318160ddd146102e557806323b872dd14610308578063249c4b481461032857806328c5846f1461035557600080fd5b806301ffc9a71461021457806306fdde0314610249578063081812fc1461026b578063095ea7b3146102a3575b600080fd5b34801561022057600080fd5b5061023461022f3660046129f8565b610729565b60405190151581526020015b60405180910390f35b34801561025557600080fd5b5061025e610749565b6040516102409190612a65565b34801561027757600080fd5b5061028b610286366004612a78565b6107db565b6040516001600160a01b039091168152602001610240565b3480156102af57600080fd5b506102c36102be366004612aa6565b61081f565b005b3480156102d157600080fd5b506102c36102e0366004612ad2565b610838565b3480156102f157600080fd5b50600154600054035b604051908152602001610240565b34801561031457600080fd5b506102c3610323366004612b46565b61097d565b34801561033457600080fd5b50610348610343366004612b96565b6109a2565b6040516102409190612bb1565b34801561036157600080fd5b506102fa610370366004612a78565b600e6020526000908152604090205481565b34801561038e57600080fd5b506103a261039d366004612bfe565b610a59565b604080516001600160a01b039093168352602083019190915201610240565b3480156103cd57600080fd5b506102c36103dc366004612c61565b610aa2565b3480156103ed57600080fd5b506102c3610ad9565b34801561040257600080fd5b5061028b6daaeb6d7670e522a718067333cd4e81565b34801561042457600080fd5b506102c3610433366004612b46565b610b0d565b34801561044457600080fd5b50600954600160a01b900460ff16610234565b34801561046357600080fd5b506102fa610472366004612a78565b610b32565b34801561048357600080fd5b5061028b610492366004612a78565b610bc1565b3480156104a357600080fd5b506102c36104b2366004612ca2565b610bcc565b3480156104c357600080fd5b506102fa6104d2366004612cb4565b610c03565b3480156104e357600080fd5b506102c3610c51565b3480156104f857600080fd5b5061050261022b81565b60405163ffffffff9091168152602001610240565b34801561052357600080fd5b506102c3610c85565b34801561053857600080fd5b506009546001600160a01b031661028b565b34801561055657600080fd5b5061025e610cb7565b34801561056b57600080fd5b506102c361057a366004612cdf565b610cc6565b34801561058b57600080fd5b506102c361059a366004612d2e565b610cda565b6102c36105ad366004612e36565b610d07565b3480156105be57600080fd5b5061028b7f00000000000000000000000066a7772e83b2164b08791a5e2b154ef1d94489b581565b3480156105f257600080fd5b506102fa6703782dace9d9000081565b6102c3610610366004612ebd565b610df1565b34801561062157600080fd5b5061025e610630366004612a78565b610e72565b34801561064157600080fd5b50600d5461066b906001600160401b0380821691600160401b8104821691600160801b9091041683565b604080516001600160401b0394851681529284166020840152921691810191909152606001610240565b3480156106a157600080fd5b506102346106b0366004612f32565b610ecd565b3480156106c157600080fd5b5061028b7f000000000000000000000000799408f402e540d0e5ac8d88a73428089a4fa55d81565b3480156106f557600080fd5b506102c3610704366004612fa4565b610f4b565b34801561071557600080fd5b506102c3610724366004612cb4565b611026565b6000610734826111c2565b806107435750610743826111cd565b92915050565b60606002805461075890613013565b80601f016020809104026020016040519081016040528092919081815260200182805461078490613013565b80156107d15780601f106107a6576101008083540402835291602001916107d1565b820191906000526020600020905b8154815290600101906020018083116107b457829003601f168201915b5050505050905090565b60006107e682611202565b610803576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b8161082981611229565b61083383836112e2565b505050565b6009546001600160a01b0316331461086b5760405162461bcd60e51b815260040161086290613047565b60405180910390fd5b600c5460ff161561088f576040516317efbd6b60e01b815260040160405180910390fd5b600c805460ff19166001179055806000805b82811015610955578484828181106108bb576108bb61307c565b90506040020160200160208101906108d39190613092565b6108e39063ffffffff16836130ce565b91506109458585838181106108fa576108fa61307c565b6109109260206040909202019081019150612cb4565b8686848181106109225761092261307c565b905060400201602001602081019061093a9190613092565b63ffffffff16611382565b61094e816130e1565b90506108a1565b5060068114610977576040516378e2ffa360e01b815260040160405180910390fd5b50505050565b826001600160a01b03811633146109975761099733611229565b6109778484846113ca565b606060006109af8361158c565b905060006109bc826115e8565b9050806001600160401b038111156109d6576109d6612d18565b6040519080825280602002602001820160405280156109ff578160200160208202803683370190505b50925060005b81811015610a5157610a1783826115f2565b848281518110610a2957610a2961307c565b6001600160a01b0390921660209283029190910190910152610a4a816130e1565b9050610a05565b505050919050565b600b5460009081906bffffffffffffffffffffffff16610a7b61271085613110565b610a859190613124565b600b54600160601b90046001600160a01b03169590945092505050565b6009546001600160a01b03163314610acc5760405162461bcd60e51b815260040161086290613047565b6014610833828483613181565b6009546001600160a01b03163314610b035760405162461bcd60e51b815260040161086290613047565b610b0b6115fe565b565b826001600160a01b0381163314610b2757610b2733611229565b61097784848461169b565b600081610b3e81611202565b610b5a5760405162461bcd60e51b815260040161086290613240565b6000610b65846116b6565b6060908101516040513090921b6001600160601b031916602083015260e881901b6001600160e81b0319166034830152603782018690529150605701604051602081830303815290604052805190602001209250505b50919050565b60006107438261172d565b6009546001600160a01b03163314610bf65760405162461bcd60e51b815260040161086290613047565b80600d610833828261329b565b60006001600160a01b038216610c2c576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6009546001600160a01b03163314610c7b5760405162461bcd60e51b815260040161086290613047565b610b0b6000611794565b6009546001600160a01b03163314610caf5760405162461bcd60e51b815260040161086290613047565b610b0b6117e6565b60606003805461075890613013565b81610cd081611229565b610833838361186e565b836001600160a01b0381163314610cf457610cf433611229565b610d0085858585611933565b5050505050565b600d546001600160401b0316421080610d315750600d54600160401b90046001600160401b031642115b15610d4f576040516317efbd6b60e01b815260040160405180910390fd5b6002600a5403610da15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610862565b6002600a55610dae611977565b8561ffff161115610dd257604051630f196e0f60e21b815260040160405180910390fd5b610de48686868686866010600e6119c0565b50506001600a5550505050565b600d54600160401b90046001600160401b0316421080610e225750600d54600160801b90046001600160401b031642115b15610e40576040516317efbd6b60e01b815260040160405180910390fd5b323314610e6057604051639f8129d160e01b815260040160405180910390fd5b610d003386868686866012600f6119c0565b606081610e7e81611202565b610e9a5760405162461bcd60e51b815260040161086290613240565b6014610ea584611afe565b604051602001610eb6929190613326565b604051602081830303815290604052915050919050565b6001600160a01b03808316600090815260076020908152604080832093851683529290529081205460ff1615610f0557506001610743565b6001600160a01b03831660009081526008602052604081205460ff166001811115610f3257610f326133cc565b148015610f445750610f448383611c06565b9392505050565b6009546001600160a01b03163314610f755760405162461bcd60e51b815260040161086290613047565b6000610f808661158c565b905060005b84811015610fcf57610fbe868683818110610fa257610fa261307c565b9050602002016020810190610fb79190612cb4565b8390611c44565b50610fc8816130e1565b9050610f85565b5060005b8281101561101d5761100c848483818110610ff057610ff061307c565b90506020020160208101906110059190612cb4565b83906110c1565b50611016816130e1565b9050610fd3565b50505050505050565b6009546001600160a01b031633146110505760405162461bcd60e51b815260040161086290613047565b6001600160a01b0381166110b55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610862565b6110be81611794565b50565b6000610f44836001600160a01b038416611c59565b60008046600181146110f8576005811461111457610539811461113057611148565b73f034d6a4b1a64f0e6038632d87746ca24b79d3259150611148565b737f4ae949da2ed37e0a4b37e0b15b22ad5c94de659150611148565b73a516d2c64ed7fe2004a93bc123854b229f3bb73891505b506001600160a01b0381166111bd5760405162461bcd60e51b815260206004820152603560248201527f5061796d656e7453706c6974746572466163746f72793a206e6f74206465706c60448201527437bcb2b21037b71031bab93932b73a1031b430b4b760591b6064820152608401610862565b919050565b600061074382611ca8565b60006001600160e01b0319821663152a902d60e11b148061074357506301ffc9a760e01b6001600160e01b0319831614610743565b6000805482108015610743575050600090815260046020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b156110be57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611296573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ba91906133e2565b6110be57604051633b79c77360e21b81526001600160a01b0382166004820152602401610862565b60006112ed82610bc1565b9050336001600160a01b03821614611326576113098133610ecd565b611326576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b61022b816113936001546000540390565b61139d91906130ce565b11156113bc57604051630f196e0f60e21b815260040160405180910390fd5b6113c68282611cf6565b5050565b60006113d58261172d565b9050836001600160a01b0316816001600160a01b0316146114085760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b03881690911417611455576114388633610ecd565b61145557604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661147c57604051633a954ecd60e21b815260040160405180910390fd5b6114898686866001611e2f565b801561149457600082555b6001600160a01b038087166000908152600560205260408082208054600019019055918716815220805460010190556114ed856114d2888287611e8d565b600160e11b174260a01b176001600160a01b03919091161790565b600085815260046020526040812091909155600160e11b84169003611542576001840160008181526004602052604081205490036115405760005481146115405760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b6000808260018111156115a1576115a16133cc565b036115ae57506010919050565b60018260018111156115c2576115c26133cc565b036115cf57506012919050565b6040516327d0b10d60e01b815260040160405180910390fd5b6000610743825490565b6000610f448383611eb0565b600954600160a01b900460ff1661164e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610862565b6009805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b61083383838360405180602001604052806000815250610cda565b6040805160808101825260008082526020820181905291810182905260608101919091526107436116e68361172d565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b60008160005481101561177b5760008181526004602052604081205490600160e01b82169003611779575b80600003610f44575060001901600081815260046020526040902054611758565b505b604051636f96cda160e11b815260040160405180910390fd5b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600954600160a01b900460ff16156118335760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610862565b6009805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861167e3390565b3361187881611eda565b6001600160a01b0316836001600160a01b031603611929578161189c57600161189f565b60005b6001600160a01b0382166000908152600860205260409020805460ff1916600183818111156118d0576118d06133cc565b0217905550826001600160a01b0316816001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318460405161191c911515815260200190565b60405180910390a3505050565b6108338383612031565b61193e84848461097d565b6001600160a01b0383163b156109775761195a848484846120c6565b610977576040516368d2bf6b60e11b815260040160405180910390fd5b600c54600090819060ff1661198e5761022b61199b565b61199b600661022b6133ff565b63ffffffff1690506119b06001546000540390565b6119ba908261341c565b91505090565b346119d76703782dace9d9000061ffff8a16613124565b146119f55760405163078d696560e31b815260040160405180910390fd5b6040516001600160601b031930606090811b821660208401528a901b1660348201526001600160f01b031960f088901b1660488201526fffffffffffffffffffffffffffffffff19608087901b16604a820152600090611a6690605a016040516020818303038152906040526121b1565b60008181526020849052604090205490915061ffff80891691611a8a918b166130ce565b1115611aa95760405163342e754760e21b815260040160405180910390fd5b611ab5838287876121ec565b6000818152602083905260408120805461ffff8b169290611ad79084906130ce565b90915550611ae59050612250565b611af3898961ffff16611382565b505050505050505050565b606081600003611b255750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611b4f5780611b39816130e1565b9150611b489050600a83613110565b9150611b29565b6000816001600160401b03811115611b6957611b69612d18565b6040519080825280601f01601f191660200182016040528015611b93576020820181803683370190505b5090505b8415611bfe57611ba860018361341c565b9150611bb5600a8661342f565b611bc09060306130ce565b60f81b818381518110611bd557611bd561307c565b60200101906001600160f81b031916908160001a905350611bf7600a86613110565b9450611b97565b949350505050565b600080611c1284611eda565b90506001600160a01b03811615801590611bfe5750826001600160a01b0316816001600160a01b031614949350505050565b6000610f44836001600160a01b038416612283565b6000818152600183016020526040812054611ca057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610743565b506000610743565b60006301ffc9a760e01b6001600160e01b031983161480611cd957506380ac58cd60e01b6001600160e01b03198316145b806107435750506001600160e01b031916635b5e139f60e01b1490565b6000805490829003611d1b5760405163b562e8dd60e01b815260040160405180910390fd5b611d286000848385611e2f565b6001600160a01b03831660009081526005602052604081208054680100000000000000018502019055611d7f908490611d62908281611e8d565b6001851460e11b174260a01b176001600160a01b03919091161790565b6000828152600460205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114611e0557808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101611dcd565b5081600003611e2657604051622e076360e81b815260040160405180910390fd5b60005550505050565b600954600160a01b900460ff1615611e815760405162461bcd60e51b8152602060048201526015602482015274115490cdcc8c5050dbdb5b5bdb8e881c185d5cd959605a1b6044820152606401610862565b6109778484848461237d565b600060e882811c90611ea086868461246e565b62ffffff16901b95945050505050565b6000826000018281548110611ec757611ec761307c565b9060005260206000200154905092915050565b600080468060018114611f0f5760898114611f2b5760048114611f4757620138818114611f63576105398114611f7f57611f97565b73a5409ec958c83c3f309868babaca7c86dcb077c19250611f97565b7358807bad0b376efc12f5ad86aac70e78ed67deae9250611f97565b73f57b2c51ded3a29e6891aba85459d600256cf3179250611f97565b73ff7ca10af37178bdd056628ef42fd7f799fac77c9250611f97565b73e1a2bbc877b29adbc56d2659dbcb0ae14ee6207192505b506001600160a01b0382161580611fae5750806089145b80611fbb57508062013881145b15611fc7575092915050565b60405163c455279160e01b81526001600160a01b03858116600483015283169063c455279190602401602060405180830381865afa15801561200d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bfe9190613443565b336001600160a01b0383160361205a5760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906120fb903390899088908890600401613460565b6020604051808303816000875af1925050508015612136575060408051601f3d908101601f191682019092526121339181019061349d565b60015b612194573d808015612164576040519150601f19603f3d011682016040523d82523d6000602084013e612169565b606091505b50805160000361218c576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b60006121bd8251611afe565b826040516020016121cf9291906134ba565b604051602081830303815290604052805190602001209050919050565b6121f88484848461248e565b6109775760405162461bcd60e51b815260206004820152602360248201527f5369676e6174757265436865636b65723a20496e76616c6964207369676e617460448201526275726560e81b6064820152608401610862565b610b0b6001600160a01b037f000000000000000000000000799408f402e540d0e5ac8d88a73428089a4fa55d16346124e3565b6000818152600183016020526040812054801561236c5760006122a760018361341c565b85549091506000906122bb9060019061341c565b90508181146123205760008660000182815481106122db576122db61307c565b90600052602060002001549050808760000184815481106122fe576122fe61307c565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061233157612331613515565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610743565b6000915050610743565b5092915050565b6001600160a01b03831615806123bf575060016001600160a01b03841660009081526008602052604090205460ff1660018111156123bd576123bd6133cc565b145b6109775760006123ce84611eda565b90506001600160a01b03811661240757506001600160a01b0383166000908152600860205260409020805460ff19166001179055610977565b61241084610c03565b600003610d0057806001600160a01b0316846001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31600160405161245f911515815260200190565b60405180910390a35050505050565b60006001600160a01b03841661237657612487836125fc565b9050610f44565b60006124da6124d38585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061265c92505050565b8690612680565b95945050505050565b804710156125335760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610862565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612580576040519150601f19603f3d011682016040523d82523d6000602084013e612585565b606091505b50509050806108335760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610862565b6000424461260b60014361341c565b6040805160208101949094528301919091524060608083019190915283901b6001600160601b03191660808201526094016040516020818303038152906040528051906020012060e81c9050919050565b600080600061266b85856126a2565b9150915061267881612710565b509392505050565b6001600160a01b03811660009081526001830160205260408120541515610f44565b60008082516041036126d85760208301516040840151606085015160001a6126cc878285856128c6565b94509450505050612709565b825160400361270157602083015160408401516126f68683836129b3565b935093505050612709565b506000905060025b9250929050565b6000816004811115612724576127246133cc565b0361272c5750565b6001816004811115612740576127406133cc565b0361278d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610862565b60028160048111156127a1576127a16133cc565b036127ee5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610862565b6003816004811115612802576128026133cc565b0361285a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610862565b600481600481111561286e5761286e6133cc565b036110be5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610862565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156128fd57506000905060036129aa565b8460ff16601b1415801561291557508460ff16601c14155b1561292657506000905060046129aa565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561297a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166129a3576000600192509250506129aa565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016129d4878288856128c6565b935093505050935093915050565b6001600160e01b0319811681146110be57600080fd5b600060208284031215612a0a57600080fd5b8135610f44816129e2565b60005b83811015612a30578181015183820152602001612a18565b50506000910152565b60008151808452612a51816020860160208601612a15565b601f01601f19169290920160200192915050565b602081526000610f446020830184612a39565b600060208284031215612a8a57600080fd5b5035919050565b6001600160a01b03811681146110be57600080fd5b60008060408385031215612ab957600080fd5b8235612ac481612a91565b946020939093013593505050565b60008060208385031215612ae557600080fd5b82356001600160401b0380821115612afc57600080fd5b818501915085601f830112612b1057600080fd5b813581811115612b1f57600080fd5b8660208260061b8501011115612b3457600080fd5b60209290920196919550909350505050565b600080600060608486031215612b5b57600080fd5b8335612b6681612a91565b92506020840135612b7681612a91565b929592945050506040919091013590565b8035600281106111bd57600080fd5b600060208284031215612ba857600080fd5b610f4482612b87565b6020808252825182820181905260009190848201906040850190845b81811015612bf25783516001600160a01b031683529284019291840191600101612bcd565b50909695505050505050565b60008060408385031215612c1157600080fd5b50508035926020909101359150565b60008083601f840112612c3257600080fd5b5081356001600160401b03811115612c4957600080fd5b60208301915083602082850101111561270957600080fd5b60008060208385031215612c7457600080fd5b82356001600160401b03811115612c8a57600080fd5b612c9685828601612c20565b90969095509350505050565b600060608284031215610bbb57600080fd5b600060208284031215612cc657600080fd5b8135610f4481612a91565b80151581146110be57600080fd5b60008060408385031215612cf257600080fd5b8235612cfd81612a91565b91506020830135612d0d81612cd1565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215612d4457600080fd5b8435612d4f81612a91565b93506020850135612d5f81612a91565b92506040850135915060608501356001600160401b0380821115612d8257600080fd5b818701915087601f830112612d9657600080fd5b813581811115612da857612da8612d18565b604051601f8201601f19908116603f01168101908382118183101715612dd057612dd0612d18565b816040528281528a6020848701011115612de957600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b803561ffff811681146111bd57600080fd5b80356001600160801b03811681146111bd57600080fd5b60008060008060008060a08789031215612e4f57600080fd5b8635612e5a81612a91565b9550612e6860208801612e0d565b9450612e7660408801612e0d565b9350612e8460608801612e1f565b925060808701356001600160401b03811115612e9f57600080fd5b612eab89828a01612c20565b979a9699509497509295939492505050565b600080600080600060808688031215612ed557600080fd5b612ede86612e0d565b9450612eec60208701612e0d565b9350612efa60408701612e1f565b925060608601356001600160401b03811115612f1557600080fd5b612f2188828901612c20565b969995985093965092949392505050565b60008060408385031215612f4557600080fd5b8235612f5081612a91565b91506020830135612d0d81612a91565b60008083601f840112612f7257600080fd5b5081356001600160401b03811115612f8957600080fd5b6020830191508360208260051b850101111561270957600080fd5b600080600080600060608688031215612fbc57600080fd5b612fc586612b87565b945060208601356001600160401b0380821115612fe157600080fd5b612fed89838a01612f60565b9096509450604088013591508082111561300657600080fd5b50612f2188828901612f60565b600181811c9082168061302757607f821691505b602082108103610bbb57634e487b7160e01b600052602260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156130a457600080fd5b813563ffffffff81168114610f4457600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610743576107436130b8565b6000600182016130f3576130f36130b8565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261311f5761311f6130fa565b500490565b8082028115828204841417610743576107436130b8565b601f82111561083357600081815260208120601f850160051c810160208610156131625750805b601f850160051c820191505b818110156115845782815560010161316e565b6001600160401b0383111561319857613198612d18565b6131ac836131a68354613013565b8361313b565b6000601f8411600181146131e057600085156131c85750838201355b600019600387901b1c1916600186901b178355610d00565b600083815260209020601f19861690835b8281101561321157868501358255602094850194600190920191016131f1565b508682101561322e5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208082526022908201527f45524337323141436f6d6d6f6e3a20546f6b656e20646f65736e2774206578696040820152611cdd60f21b606082015260800190565b600081356001600160401b038116811461074357600080fd5b6001600160401b036132ac83613282565b168154816001600160401b031982161783556fffffffffffffffff00000000000000006132db60208601613282565b60401b1680836001600160801b03198416171784556001600160401b0360801b61330760408701613282565b60801b16836001600160401b0360c01b84161782171784555050505050565b600080845461333481613013565b6001828116801561334c576001811461336157613390565b60ff1984168752821515830287019450613390565b8860005260208060002060005b858110156133875781548a82015290840190820161336e565b50505082870194505b50602f60f81b8452865192506133ac8382860160208a01612a15565b64173539b7b760d91b939092019182019290925260060195945050505050565b634e487b7160e01b600052602160045260246000fd5b6000602082840312156133f457600080fd5b8151610f4481612cd1565b63ffffffff818116838216019080821115612376576123766130b8565b81810381811115610743576107436130b8565b60008261343e5761343e6130fa565b500690565b60006020828403121561345557600080fd5b8151610f4481612a91565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061349390830184612a39565b9695505050505050565b6000602082840312156134af57600080fd5b8151610f44816129e2565b7f19457468657265756d205369676e6564204d6573736167653a0a0000000000008152600083516134f281601a850160208801612a15565b83519083019061350981601a840160208801612a15565b01601a01949350505050565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220005c257297d9c66ef2bbd7e0137dfeeb4557a3af5b2209eda4114eab2c96536964736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000edb7c032fef116163214fcdb6ca481e94794b1870000000000000000000000005312fa01617678dcf4940c66b3adb5a468bc7cef000000000000000000000000924ed53fc89c8a4aa21cfb4d7bda7aa2dc78e10a000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000639d851000000000000000000000000000000000000000000000000000000000639dd9700000000000000000000000000000000000000000000000000000000063a713f000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000003168747470733a2f2f6170692e676d73747564696f2e6172742f636f6c6c656374696f6e732f61706f6c6c6f2f746f6b656e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e1a4cb40a1d672bb7901b646bb18eb7b70bd59520000000000000000000000003bf3ba6469c80a1e835d2afd9e59fc4de8d947ff0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000055000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002
-----Decoded View---------------
Arg [0] : newOwner (address): 0xeDb7c032feF116163214FCDb6ca481E94794b187
Arg [1] : signerEarlyAccess (address): 0x5312fa01617678dCF4940c66b3adb5A468BC7Cef
Arg [2] : signerPublic (address): 0x924eD53fC89C8A4Aa21cFB4d7bda7aA2dC78e10A
Arg [3] : baseTokenURI (string): https://api.gmstudio.art/collections/apollo/token
Arg [4] : config (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [5] : payees (address[]): 0xe1a4cb40A1D672Bb7901b646Bb18Eb7B70BD5952,0x3BF3bA6469C80A1e835d2afD9E59FC4De8d947FF
Arg [6] : shares (uint256[]): 15,85
Arg [7] : sharesRoyalties (uint256[]): 1,2
-----Encoded View---------------
22 Constructor Arguments found :
Arg [0] : 000000000000000000000000edb7c032fef116163214fcdb6ca481e94794b187
Arg [1] : 0000000000000000000000005312fa01617678dcf4940c66b3adb5a468bc7cef
Arg [2] : 000000000000000000000000924ed53fc89c8a4aa21cfb4d7bda7aa2dc78e10a
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [4] : 00000000000000000000000000000000000000000000000000000000639d8510
Arg [5] : 00000000000000000000000000000000000000000000000000000000639dd970
Arg [6] : 0000000000000000000000000000000000000000000000000000000063a713f0
Arg [7] : 00000000000000000000000000000000000000000000000000000000000001a0
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000200
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000260
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000031
Arg [11] : 68747470733a2f2f6170692e676d73747564696f2e6172742f636f6c6c656374
Arg [12] : 696f6e732f61706f6c6c6f2f746f6b656e000000000000000000000000000000
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [14] : 000000000000000000000000e1a4cb40a1d672bb7901b646bb18eb7b70bd5952
Arg [15] : 0000000000000000000000003bf3ba6469c80a1e835d2afd9e59fc4de8d947ff
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [17] : 000000000000000000000000000000000000000000000000000000000000000f
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000055
Arg [19] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [20] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [21] : 0000000000000000000000000000000000000000000000000000000000000002
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.