ERC-1155
Overview
Max Total Supply
854 AAAARM
Holders
309
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
AngryApeArmyArmoryCollection
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol"; import "erc721a/contracts/extensions/ERC721ABurnable.sol"; import "@massless.io/smart-contract-library/contracts/royalty/Royalty.sol"; import "@massless.io/smart-contract-library/contracts/interfaces/IContractURI.sol"; import "@massless.io/smart-contract-library/contracts/sale/SaleState.sol"; import "@massless.io/smart-contract-library/contracts/signature/Signature.sol"; import "@massless.io/smart-contract-library/contracts/utils/PreAuthorisable.sol"; import "@massless.io/smart-contract-library/contracts/utils/AdminPermissionable.sol"; error DeployerIsAdmin(); error NoTrailingSlash(); error ArrayLengthMismatch(); error BadArrayLength(); error NonExistTokenData(uint256 tokenId); error MustMintMinimumOne(uint256 tokenId); error SoldOut(uint256 tokenId); error WalletMintLimit(uint256 tokenId, uint32 limit); error NotEnoughEvoTokens(); error NotOwnerOfToken(uint256 tokenId); error MaxSupplyMustBeMinimumOne(); error PriceMustBeMinimumOne(); error InvalidTokenId(uint256 tokenId); contract AngryApeArmyArmoryCollection is AdminPermissionable, PreAuthorisable, ERC1155Supply, ERC1155Burnable, Royalty, Signature, SaleState { struct TokenData { uint32 maxSupply; uint32 price; } string private _name; string private _symbol; uint32 public constant MAX_MINT = 2; // token id to token data mapping(uint256 => TokenData) public tokenData; // token id to use when new token is added. Whenever new token is added, this value is increased by 1 uint256 public newTokenId = 9; // Evo contract ERC721ABurnable private _evoContract; // Events event MintBegins(); event MintEnds(); event URIUpdated(string uri_); event TokenDataSet(uint256 tokenId); constructor( address signer_, address admin_, address royaltyReceiver_, ERC721ABurnable evoContract_, address[] memory _preAuthorized ) ERC1155("https://massless-ipfs-public-gateway.mypinata.cloud/ipfs/") Signature(signer_) PreAuthorisable(_preAuthorized) { if (_msgSender() == admin_) revert DeployerIsAdmin(); _name = "Angry Ape Army Armory Collection"; _symbol = "AAAARM"; tokenData[1] = TokenData(400, 4); // 1. Golem tokenData[2] = TokenData(400, 4); // 2. Goliath tokenData[3] = TokenData(400, 2); // 3. Virus Horse tokenData[4] = TokenData(400, 2); // 4. Nano Horse tokenData[5] = TokenData(400, 1); // 5. Virus Weapon tokenData[6] = TokenData(400, 1); // 6. Nano Weapon tokenData[7] = TokenData(400, 1); // 7. Virus Wings tokenData[8] = TokenData(400, 1); // 8. Nano Backpack _evoContract = evoContract_; setRoyaltyReceiver(royaltyReceiver_); setRoyaltyBasisPoints(750); _grantRole(DEFAULT_ADMIN_ROLE, admin_); } modifier maxGiveawayLimit( uint256[] calldata tokenIds_, uint256[] calldata quantities_ ) { uint256 tokenIdsLength = tokenIds_.length; if (tokenIdsLength != quantities_.length) revert ArrayLengthMismatch(); if (tokenIdsLength == 0) revert BadArrayLength(); uint256[] memory tokenIdToQuantity = new uint256[](newTokenId); for (uint256 i; i < tokenIdsLength; i++) { uint256 tokenId = tokenIds_[i]; TokenData memory token = tokenData[tokenId]; // if token exists if (token.maxSupply > 0) { uint256 supplyLimit = token.maxSupply - totalSupply(tokenId); uint256 quantity = quantities_[i]; if (quantity == 0) revert MustMintMinimumOne(tokenId); tokenIdToQuantity[tokenId] = tokenIdToQuantity[tokenId] + quantity; if (tokenIdToQuantity[tokenId] > supplyLimit) revert SoldOut(tokenId); } else { revert NonExistTokenData(tokenId); } } _; } modifier validTokenData(uint32 maxSupply_, uint32 price_) { if (maxSupply_ == 0) revert MaxSupplyMustBeMinimumOne(); if (price_ == 0) revert PriceMustBeMinimumOne(); _; } // mint function mint( bytes calldata signature_, bytes32 salt_, uint256[] calldata tokenIds_, uint256[] calldata quantities_, uint256[] calldata evoTokenIds_ ) external whenSaleIsActive("Mint") onlySignedTx( keccak256( abi.encodePacked( _msgSender(), salt_, tokenIds_, quantities_, evoTokenIds_ ) ), signature_ ) { _checkMintLimitAndPrice(tokenIds_, quantities_, evoTokenIds_.length); for (uint256 i; i < evoTokenIds_.length; i++) { if (_evoContract.ownerOf(evoTokenIds_[i]) != _msgSender()) revert NotOwnerOfToken(evoTokenIds_[i]); _evoContract.burn(evoTokenIds_[i]); } _mintBatch(_msgSender(), tokenIds_, quantities_, ""); } function giveaway( address[] calldata to_, uint256[] calldata tokenIds_, uint256[] calldata quantities_ ) public onlyAdmin maxGiveawayLimit(tokenIds_, quantities_) { if (to_.length != tokenIds_.length) revert ArrayLengthMismatch(); if (to_.length == 0) revert BadArrayLength(); for (uint256 i; i < to_.length; i++) { _mint(to_[i], tokenIds_[i], quantities_[i], ""); } } function startMint() external onlyAdminOrModerator { _setSaleType("Mint"); _setSaleState(State.ACTIVE); emit MintBegins(); } function unpauseMint() external onlyAdminOrModerator { _unpause(); } function pauseMint() external onlyAdminOrModerator { _pause(); } function endMint() external onlyAdmin { if (getSaleState() != State.ACTIVE) revert NoActiveSale(); _setSaleState(State.FINISHED); emit MintEnds(); } function _checkMintLimitAndPrice( uint256[] calldata tokenIds_, uint256[] calldata quantities_, uint256 totalPrice ) private view { if (tokenIds_.length != quantities_.length) revert ArrayLengthMismatch(); if (tokenIds_.length == 0) revert BadArrayLength(); uint256 sumPrice; for (uint256 i; i < tokenIds_.length; i++) { uint256 tokenId = tokenIds_[i]; TokenData memory token = tokenData[tokenId]; // if token exists if (token.maxSupply > 0) { uint256 supplyLimit = token.maxSupply - totalSupply(tokenId); uint256 quantity = quantities_[i]; if (quantity == 0) revert MustMintMinimumOne(tokenId); if (quantity > supplyLimit) revert SoldOut(tokenId); if (balanceOf(_msgSender(), tokenId) + quantity > MAX_MINT) revert WalletMintLimit(tokenId, MAX_MINT); sumPrice = sumPrice + (token.price * quantity); } else { revert NonExistTokenData(tokenId); } } if (sumPrice != totalPrice) revert NotEnoughEvoTokens(); } // Metadata function setURI(string memory uri_) public onlyAdminOrModerator { if (bytes(uri_)[bytes(uri_).length - 1] != bytes1("/")) revert NoTrailingSlash(); _setURI(uri_); emit URIUpdated(uri_); } function uri(uint256 tokenId_) public view override returns (string memory) { return string(abi.encodePacked(ERC1155.uri(tokenId_), "token/{id}.json")); } function contractURI() public view returns (string memory) { return string(abi.encodePacked(ERC1155.uri(0), "contract.json")); } function name() public view virtual returns (string memory) { return _name; } function symbol() public view virtual returns (string memory) { return _symbol; } // Administration function setSignerAddress(address signerAddress_) public onlyAdminOrModerator { _setSignerAddress(signerAddress_); } function setRoyaltyReceiver(address royaltyReceiver_) public onlyAdmin { _setRoyaltyReceiver(royaltyReceiver_); } function setRoyaltyBasisPoints(uint32 royaltyBasisPoints_) public onlyAdmin { _setRoyaltyBasisPoints(royaltyBasisPoints_); } function setAuthorizedAddress(address authorizedAddress_, bool authorized_) public onlyAdmin { _setAuthorizedAddress(authorizedAddress_, authorized_); } function setTokenData( uint256 tokenId_, uint32 maxSupply_, uint32 price_ ) public onlyAdmin validTokenData(maxSupply_, price_) { // if new token data if (tokenData[tokenId_].maxSupply == 0) { if (tokenId_ == newTokenId) { newTokenId++; } else { revert InvalidTokenId(tokenId_); } } tokenData[tokenId_].maxSupply = maxSupply_; tokenData[tokenId_].price = price_; emit TokenDataSet(tokenId_); } // Overrides /** * @dev Override supportsInterface to ensure interfaces are reports as supported. */ function transferOwnership(address newOwner) public virtual override onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); _grantRole(DEFAULT_ADMIN_ROLE, newOwner); _revokeRole(DEFAULT_ADMIN_ROLE, owner()); _transferOwnership(newOwner); } /** * @dev Override supportsInterface to ensure interfaces are reports as supported. */ function supportsInterface(bytes4 interfaceId) public view override(ERC1155, Royalty, AccessControl) returns (bool) { return interfaceId == type(IAccessControl).interfaceId || interfaceId == type(IERC2981).interfaceId || interfaceId == type(IContractURI).interfaceId || interfaceId == type(IERC1155).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Override isApprovedForAll to whitelist the trusted accounts to enable gas-free listings. */ function isApprovedForAll(address _owner, address _operator) public view override returns (bool isOperator) { if (_isAuthorizedAddress(_operator)) { return true; } return super.isApprovedForAll(_owner, _operator); } /** * @dev See {ERC1155-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override(ERC1155Supply, ERC1155) { ERC1155Supply._beforeTokenTransfer( operator, from, to, ids, amounts, data ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155Supply.sol) pragma solidity ^0.8.0; import "../ERC1155.sol"; /** * @dev Extension of ERC1155 that adds tracking of total supply per id. * * Useful for scenarios where Fungible and Non-fungible tokens have to be * clearly identified. Note: While a totalSupply of 1 might mean the * corresponding is an NFT, there is no guarantees that no other token with the * same id are not going to be minted. */ abstract contract ERC1155Supply is ERC1155 { mapping(uint256 => uint256) private _totalSupply; /** * @dev Total amount of tokens in with a given id. */ function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply[id]; } /** * @dev Indicates whether any token exist with a given id, or not. */ function exists(uint256 id) public view virtual returns (bool) { return ERC1155Supply.totalSupply(id) > 0; } /** * @dev See {ERC1155-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); if (from == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { _totalSupply[ids[i]] += amounts[i]; } } if (to == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 supply = _totalSupply[id]; require(supply >= amount, "ERC1155: burn amount exceeds totalSupply"); unchecked { _totalSupply[id] = supply - amount; } } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol) pragma solidity ^0.8.0; import "../ERC1155.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. * * _Available since v3.1._ */ abstract contract ERC1155Burnable is ERC1155 { function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burnBatch(account, ids, values); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.1.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721ABurnable.sol'; import '../ERC721A.sol'; /** * @title ERC721A Burnable Token * @dev ERC721A Token that can be irreversibly burned (destroyed). */ abstract contract ERC721ABurnable is ERC721A, IERC721ABurnable { /** * @dev Burns `tokenId`. See {ERC721A-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual override { _burn(tokenId, true); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "./IERC2981.sol"; abstract contract Royalty is ERC165, IERC2981 { address public royaltyReceiver; uint32 public royaltyBasisPoints; // A integer representing 1/100th of 1% (fixed point with 100 = 1.00%) function _setRoyaltyReceiver(address receiver_) internal { royaltyReceiver = receiver_; } function _setRoyaltyBasisPoints(uint32 basisPoints_) internal { royaltyBasisPoints = basisPoints_; } function royaltyInfo(uint256, uint256 salePrice_) public view virtual override returns (address receiver, uint256 amount) { // All tokens return the same royalty amount to the receiver uint256 royaltyAmount = (salePrice_ * royaltyBasisPoints) / 10000; // Normalises in basis points reference. (10000 = 100.00%) return (royaltyReceiver, royaltyAmount); } // Compulsory overrides function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /// /// @dev Interface for the proposed contractURI standard /// interface IContractURI is IERC165 { /// ERC165 bytes to add to interface array - set in parent contract /// implementing this standard /// /// bytes4(keccak256("contractURI()")) == 0xe8a3d485 /// @notice Called to return the URI pertaining to the contract metadata /// @return contractURI - the URI that pertaining to the contract metadata function contractURI() external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; error NoActiveSale(); error IncorrectSaleType(); error AllSalesFinished(); error NoPausedSale(); abstract contract SaleState { enum State { NOT_STARTED, // 0 ACTIVE, // 1 PAUSED, // 2 FINISHED // 3 } struct Sale{ State state; string saleType; } event StateOfSale(State _state); event TypeOfSale(string _saleType); event IsPaused(bool _paused); Sale private _sale = Sale({saleType: "None", state: State.NOT_STARTED}); modifier whenSaleIsActive(string memory saleType) { if (_sale.state != State.ACTIVE) revert NoActiveSale(); if (keccak256(bytes(_sale.saleType)) != keccak256(bytes(saleType))) revert IncorrectSaleType(); _; } function _setSaleState(State state) internal { if (_sale.state == State.FINISHED) revert AllSalesFinished(); _sale.state = state; if (state == State.FINISHED) { _sale.saleType = "Finished"; emit TypeOfSale(_sale.saleType); } emit StateOfSale(_sale.state); } function _setSaleType(string memory saleType) internal { if (_sale.state == State.FINISHED) revert AllSalesFinished(); _sale.saleType = saleType; _sale.state = State.NOT_STARTED; emit TypeOfSale(_sale.saleType); } function getSaleState() public view returns (State) { return _sale.state; } function getSaleType() public view returns (string memory) { return _sale.saleType; } function _pause() internal { if (_sale.state != State.ACTIVE) revert NoActiveSale(); _sale.state = State.PAUSED; emit IsPaused(true); } function _unpause() internal { if (_sale.state != State.PAUSED) revert NoPausedSale(); _sale.state = State.ACTIVE; emit IsPaused(false); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; error HashUsed(); error SignatureFailed(address signatureAddress, address signer); abstract contract Signature { using ECDSA for bytes32; address private _signer; mapping(bytes32 => bool) private _isHashUsed; constructor(address signerAddress_){ _signer = signerAddress_; } function _setSignerAddress(address signerAddress_) internal { _signer = signerAddress_; } function signerAddress() public view returns(address) { return _signer; } // Signature verfification modifier onlySignedTx( bytes32 hash_, bytes calldata signature_ ) { if (_isHashUsed[hash_]) revert HashUsed(); address signatureAddress = hash_ .toEthSignedMessageHash() .recover(signature_); if (signatureAddress != _signer) revert SignatureFailed(signatureAddress, _signer); _isHashUsed[hash_] = true; _; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract PreAuthorisable { mapping(address => bool) private authorizedAddresses; constructor(address[] memory _preAuthorized) { for (uint256 i = 0; i < _preAuthorized.length; i++) { _setAuthorizedAddress(_preAuthorized[i], true); } } function _setAuthorizedAddress(address authorizedAddress, bool authorized) internal { authorizedAddresses[authorizedAddress] = authorized; } function _isAuthorizedAddress(address operator) internal view returns (bool) { return authorizedAddresses[operator]; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; abstract contract AdminPermissionable is AccessControl, Ownable { error NotAdminOrOwner(); error NotAdminOrModerator(); error ZeroAdminAddress(); bytes32 public constant MODERATOR_ROLE = keccak256("MODERATOR_ROLE"); modifier onlyAdmin() { if (!(owner() == _msgSender() || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()))) revert NotAdminOrOwner(); _; } modifier onlyAdminOrModerator() { if (!(owner() == _msgSender() || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()) || hasRole(MODERATOR_ROLE, _msgSender()))) revert NotAdminOrModerator(); _; } modifier checkAdminAddress(address _address) { if (_address == address(0)){ revert ZeroAdminAddress(); } _; } function setAdminPermission(address _address) external onlyAdmin checkAdminAddress(_address) { _grantRole(DEFAULT_ADMIN_ROLE, _address); } function removeAdminPermission(address _address) external onlyAdmin checkAdminAddress(_address) { _revokeRole(DEFAULT_ADMIN_ROLE, _address); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return 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.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.1.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import '../IERC721A.sol'; /** * @dev Interface of an ERC721ABurnable compliant contract. */ interface IERC721ABurnable is IERC721A { /** * @dev Burns `tokenId`. See {ERC721A-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) external; }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.1.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev ERC721 token receiver interface. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, * including the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at `_startTokenId()` * (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // 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 tokenId of the next token 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 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } /** * @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 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 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 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 returns (uint256) { return _burnCounter; } /** * @dev See {IERC165-supportsInterface}. */ 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: 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. } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view 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 { 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; } /** * 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 ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. // // We can directly compare the packed value. // If the address is zero, packed is zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * 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); } /** * Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @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 See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _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 ''; } /** * @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)) } } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { if (operator == _msgSenderERC721A()) revert ApproveToCaller(); _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), */ function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & BITMASK_BURNED == 0; // and not burned. } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal { _safeMint(to, quantity, ''); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { _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 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 { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` 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 tokenId = startTokenId; uint256 end = startTokenId + quantity; do { emit Transfer(address(0), to, tokenId++); } while (tokenId < end); _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 { 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 Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { mapping(uint256 => address) storage tokenApprovalsPtr = _tokenApprovals; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId]`. assembly { // Compute the slot. mstore(0x00, tokenId) mstore(0x20, tokenApprovalsPtr.slot) approvedAddressSlot := keccak256(0x00, 0x40) // Load the slot's value from storage. approvedAddress := sload(approvedAddressSlot) } } /** * @dev Returns whether the `approvedAddress` is equals to `from` or `msgSender`. */ function _isOwnerOrApproved( address approvedAddress, address from, address msgSender ) private pure returns (bool result) { assembly { // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean. from := and(from, BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, BITMASK_ADDRESS) // `msgSender == from || msgSender == approvedAddress`. result := or(eq(msgSender, from), eq(msgSender, approvedAddress)) } } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function 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) = _getApprovedAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isOwnerOrApproved(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 `_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) = _getApprovedAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isOwnerOrApproved(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++; } } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try 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)) } } } } /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal { 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 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; } /** * @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 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 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 returns (string memory ptr) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), // but we allocate 128 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: 32 + 3 * 32 = 128. ptr := add(mload(0x40), 128) // Update the free memory pointer to allocate. mstore(0x40, ptr) // Cache the end of the memory to calculate the length later. let end := ptr // We write the string from the rightmost digit to the leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // Costs a bit more than early returning for the zero case, // but cheaper in terms of deployment and overall runtime costs. for { // Initialize and perform the first pass without check. let temp := value // Move the pointer 1 byte leftwards to point to an empty character slot. ptr := sub(ptr, 1) // Write the character to the pointer. 48 is the ASCII index of '0'. mstore8(ptr, add(48, mod(temp, 10))) temp := div(temp, 10) } temp { // Keep dividing `temp` until zero. temp := div(temp, 10) } { // Body of the for loop. ptr := sub(ptr, 1) mstore8(ptr, add(48, mod(temp, 10))) } let length := sub(end, ptr) // Move the pointer 32 bytes leftwards to make room for the length. ptr := sub(ptr, 32) // Store the length. mstore(ptr, length) } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.1.0 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of an ERC721A compliant contract. */ 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(); struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set through `_extraData`. uint24 extraData; } /** * @dev Returns the total amount of tokens stored by the contract. * * Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens. */ function totalSupply() external view returns (uint256); // ============================== // 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); // ============================== // 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`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must 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 ) external; /** * @dev Transfers `tokenId` token 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 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.4; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /// /// @dev Interface for the NFT Royalty Standard /// interface IERC2981 is IERC165 { /// ERC165 bytes to add to interface array - set in parent contract /// implementing this standard /// /// bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a /// bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; /// _registerInterface(_INTERFACE_ID_ERC2981); /// @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 // OpenZeppelin Contracts (last updated v4.5.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 = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 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.1 (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.1 (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 (last updated v4.6.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"signer_","type":"address"},{"internalType":"address","name":"admin_","type":"address"},{"internalType":"address","name":"royaltyReceiver_","type":"address"},{"internalType":"contract ERC721ABurnable","name":"evoContract_","type":"address"},{"internalType":"address[]","name":"_preAuthorized","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AllSalesFinished","type":"error"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"BadArrayLength","type":"error"},{"inputs":[],"name":"DeployerIsAdmin","type":"error"},{"inputs":[],"name":"HashUsed","type":"error"},{"inputs":[],"name":"IncorrectSaleType","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"InvalidTokenId","type":"error"},{"inputs":[],"name":"MaxSupplyMustBeMinimumOne","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"MustMintMinimumOne","type":"error"},{"inputs":[],"name":"NoActiveSale","type":"error"},{"inputs":[],"name":"NoPausedSale","type":"error"},{"inputs":[],"name":"NoTrailingSlash","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NonExistTokenData","type":"error"},{"inputs":[],"name":"NotAdminOrModerator","type":"error"},{"inputs":[],"name":"NotAdminOrOwner","type":"error"},{"inputs":[],"name":"NotEnoughEvoTokens","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NotOwnerOfToken","type":"error"},{"inputs":[],"name":"PriceMustBeMinimumOne","type":"error"},{"inputs":[{"internalType":"address","name":"signatureAddress","type":"address"},{"internalType":"address","name":"signer","type":"address"}],"name":"SignatureFailed","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"SoldOut","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"limit","type":"uint32"}],"name":"WalletMintLimit","type":"error"},{"inputs":[],"name":"ZeroAdminAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_paused","type":"bool"}],"name":"IsPaused","type":"event"},{"anonymous":false,"inputs":[],"name":"MintBegins","type":"event"},{"anonymous":false,"inputs":[],"name":"MintEnds","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum SaleState.State","name":"_state","type":"uint8"}],"name":"StateOfSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenDataSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_saleType","type":"string"}],"name":"TypeOfSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"uri_","type":"string"}],"name":"URIUpdated","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MINT","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MODERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSaleState","outputs":[{"internalType":"enum SaleState.State","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSaleType","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"to_","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds_","type":"uint256[]"},{"internalType":"uint256[]","name":"quantities_","type":"uint256[]"}],"name":"giveaway","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isOperator","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature_","type":"bytes"},{"internalType":"bytes32","name":"salt_","type":"bytes32"},{"internalType":"uint256[]","name":"tokenIds_","type":"uint256[]"},{"internalType":"uint256[]","name":"quantities_","type":"uint256[]"},{"internalType":"uint256[]","name":"evoTokenIds_","type":"uint256[]"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"newTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"removeAdminPermission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyBasisPoints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","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":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setAdminPermission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"authorizedAddress_","type":"address"},{"internalType":"bool","name":"authorized_","type":"bool"}],"name":"setAuthorizedAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"royaltyBasisPoints_","type":"uint32"}],"name":"setRoyaltyBasisPoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"royaltyReceiver_","type":"address"}],"name":"setRoyaltyReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signerAddress_","type":"address"}],"name":"setSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"uint32","name":"maxSupply_","type":"uint32"},{"internalType":"uint32","name":"price_","type":"uint32"}],"name":"setTokenData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startMint","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":"","type":"uint256"}],"name":"tokenData","outputs":[{"internalType":"uint32","name":"maxSupply","type":"uint32"},{"internalType":"uint32","name":"price","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpauseMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60006080908152610100604052600460c0818152634e6f6e6560e01b60e090815260a091909152600a805460ff19168155916200003f91600b91620006db565b5050506009600f553480156200005457600080fd5b506040516200523f3803806200523f833981016040819052620000779162000793565b846040518060600160405280603981526020016200520660399139826200009e33620004bd565b60005b8151811015620000fb57620000e6828281518110620000d057634e487b7160e01b600052603260045260246000fd5b602002602001015160016200050f60201b60201c565b80620000f281620008fe565b915050620000a1565b50620001099050816200053a565b50600880546001600160a01b0319166001600160a01b039283161790558416620001303390565b6001600160a01b03161415620001595760405163bb0f48d760e01b815260040160405180910390fd5b6040805180820190915260208082527f416e677279204170652041726d792041726d6f727920436f6c6c656374696f6e9181019182526200019d91600c91620006db565b506040805180820190915260068082526541414141524d60d01b6020909201918252620001cd91600d91620006db565b506040805180820182526101908082526004602080840182815260016000818152600e80855296517fa7c5ba7114a813b50159add3a36832908dc83db71d0b9a24c2ad0f83be9582078054945163ffffffff9283166001600160401b0319968716176401000000009184168202179091558951808b018b5288815280870188815260028086528b895291517f9adb202b1492743bc00c81d33cdc6423fa8c79109027eb6a845391e8fc1f0481805492519186169289169290921790851684021790558a51808c018c52898152808801828152600386528b895290517fe0283e559c29e31ee7f56467acc9dd307779c843a883aeeb3bf5c6128c908144805492519186169289169290921790851684021790558a51808c018c5289815280880191825297845289875296517fa1d6913cd9e08c872be3e7525cca82e4fc0fc298a783f19022be725b19be685a80549851918416988716989098179083168202179096558851808a018a528781528086018481526005845289875290517fb9bec7e2561f624fe753ff070f1599b306cbf59fafd4e8d5a8184a1ea1841bce805492519184169287169290921790831688021790558851808a018a528781528086018481526006845289875290517f92b4482321f41ce3aa65f798bda23d0d12a60fc5f212868a548ddb00aa49de72805492519184169287169290921790831688021790558851808a018a528781528086018481526007845289875290517f376529bb8a2d41b4a589a133407fc64f3212472dbd74744348be1098bf7ba08d805492519184169287169290921790831688021790558851808a01909952958852878401918252600890529490915293517feab6bc3746954d8a0719de62c86ea908d362be2a58c781ada1046727253f9df28054945191841694909516939093179290911602179055601080546001600160a01b0319166001600160a01b038416179055620004988362000553565b620004a56102ee620005da565b620004b26000856200063b565b505050505062000952565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03919091166000908152600260205260409020805460ff1916911515919091179055565b80516200054f906005906020840190620006db565b5050565b6001546001600160a01b0316331480620005995750620005996000335b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b620005b757604051637bb62a2160e01b815260040160405180910390fd5b600780546001600160a01b0383166001600160a01b031990911617905550565b50565b6001546001600160a01b0316331480620005fc5750620005fc60003362000570565b6200061a57604051637bb62a2160e01b815260040160405180910390fd5b6007805463ffffffff60a01b1916600160a01b63ffffffff84160217905550565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200054f576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620006973390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b828054620006e990620008c1565b90600052602060002090601f0160209004810192826200070d576000855562000758565b82601f106200072857805160ff191683800117855562000758565b8280016001018555821562000758579182015b82811115620007585782518255916020019190600101906200073b565b50620007669291506200076a565b5090565b5b808211156200076657600081556001016200076b565b80516200078e816200093c565b919050565b600080600080600060a08688031215620007ab578081fd5b8551620007b8816200093c565b80955050602080870151620007cd816200093c565b6040880151909550620007e0816200093c565b6060880151909450620007f3816200093c565b60808801519093506001600160401b038082111562000810578384fd5b818901915089601f83011262000824578384fd5b81518181111562000839576200083962000926565b8060051b604051601f19603f8301168101818110858211171562000861576200086162000926565b604052828152858101935084860182860187018e101562000880578788fd5b8795505b83861015620008ad57620008988162000781565b85526001959095019493860193860162000884565b508096505050505050509295509295909350565b600181811c90821680620008d657607f821691505b60208210811415620008f857634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156200091f57634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114620005d757600080fd5b6148a480620009626000396000f3fe608060405234801561001057600080fd5b506004361061029f5760003560e01c80636b20c45411610167578063bd85b039116100ce578063e8a3d48511610087578063e8a3d48514610646578063e985e9c51461064e578063f0292a0314610661578063f242432a14610669578063f2fde38b1461067c578063f5298aca1461068f57600080fd5b8063bd85b039146105dd578063cd85cdb5146105fd578063d1b1934714610605578063d1e812a314610618578063d547741f14610620578063e23059d41461063357600080fd5b806395d89b411161012057806395d89b41146105455780639fbc87131461054d578063a217fddf14610560578063a22cb46514610568578063b4b5b48f1461057b578063b8886264146105ca57600080fd5b80636b20c454146104de578063715018a6146104f1578063797669c9146104f95780638da5cb5b1461050e5780638dc251e31461051f57806391d148541461053257600080fd5b80632a55205a1161020b578063404a1f37116101c4578063404a1f371461042557806342260b5d146104385780634e1273f4146104645780634f558e79146104845780635b7633d0146104a65780635c6fd90b146104cb57600080fd5b80632a55205a146103a95780632be09561146103db5780632eb2c2d6146103e35780632f2ff15d146103f6578063340754ed1461040957806336568abe1461041257600080fd5b80630e89341c1161025d5780630e89341c146103325780631351cf51146103455780631a8bd2da146103585780631cf015c614610360578063248a9ca31461037357806325bdb2a81461039657600080fd5b8062fdd58e146102a4578063017043a5146102ca57806301ffc9a7146102d457806302fe5305146102f7578063046dc1661461030a57806306fdde031461031d575b600080fd5b6102b76102b2366004613c21565b6106a2565b6040519081526020015b60405180910390f35b6102d261073e565b005b6102e76102e2366004613e1d565b6107f4565b60405190151581526020016102c1565b6102d2610305366004613f47565b61086a565b6102d26103183660046139ff565b610968565b6103256109e3565b6040516102c1919061433c565b610325610340366004613de1565b610a75565b6102d2610353366004613bf0565b610aa6565b6102d2610b0e565b6102d261036e366004613ff0565b610b72565b6102b7610381366004613de1565b60009081526020819052604090206001015490565b600a5460ff166040516102c19190614314565b6103bc6103b7366004613f94565b610bcf565b604080516001600160a01b0390931683526020830191909152016102c1565b6102d2610c17565b6102d26103f1366004613a6f565b610ccb565b6102d2610404366004613df9565b610d62565b6102b7600f5481565b6102d2610420366004613df9565b610d8c565b6102d26104333660046139ff565b610e06565b60075461044f90600160a01b900463ffffffff1681565b60405163ffffffff90911681526020016102c1565b610477610472366004613d15565b610e75565b6040516102c191906142d3565b6102e7610492366004613de1565b600090815260066020526040902054151590565b6008546001600160a01b03165b6040516001600160a01b0390911681526020016102c1565b6102d26104d93660046139ff565b610fd6565b6102d26104ec366004613b7e565b611045565b6102d2611088565b6102b760008051602061484f83398151915281565b6001546001600160a01b03166104b3565b6102d261052d3660046139ff565b6110ec565b6102e7610540366004613df9565b611146565b61032561116f565b6007546104b3906001600160a01b031681565b6102b7600081565b6102d2610576366004613bf0565b61117e565b6105ad610589366004613de1565b600e6020526000908152604090205463ffffffff8082169164010000000090041682565b6040805163ffffffff9384168152929091166020830152016102c1565b6102d26105d8366004613e55565b611189565b6102b76105eb366004613de1565b60009081526006602052604090205490565b6102d2611586565b6102d2610613366004613c80565b6115e8565b61032561198e565b6102d261062e366004613df9565b6119a0565b6102d2610641366004613fb5565b6119c5565b610325611b16565b6102e761065c366004613a37565b611b46565b61044f600281565b6102d2610677366004613b18565b611ba0565b6102d261068a3660046139ff565b611be5565b6102d261069d366004613c4c565b611cd4565b60006001600160a01b0383166107135760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b5060008181526003602090815260408083206001600160a01b03861684529091529020545b92915050565b6001546001600160a01b031633148061075d575061075d600033611146565b61077a57604051637bb62a2160e01b815260040160405180910390fd5b6001600a5460ff1660038111156107a157634e487b7160e01b600052602160045260246000fd5b146107bf57604051638ca755f560e01b815260040160405180910390fd5b6107c96003611d17565b6040517faf24d3bccd7e329975f60c4d13b81252ff061649fb46d1c416c9b6a13100bff190600090a1565b60006001600160e01b03198216637965db0b60e01b148061082557506001600160e01b0319821663152a902d60e11b145b8061084057506001600160e01b0319821663e8a3d48560e01b145b8061085b57506001600160e01b03198216636cdb3d1360e11b145b80610738575061073882611e58565b6001546001600160a01b03163314806108895750610889600033611146565b806108a757506108a760008051602061484f83398151915233611146565b6108c45760405163c5cca88d60e01b815260040160405180910390fd5b8051602f60f81b9082906108da9060019061467a565b815181106108f857634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916146109255760405163a467f6f560e01b815260040160405180910390fd5b61092e81611e7d565b7fe3afa94108b5f5e82e5f6e539d161ff4b5402a85f696c67b9768ec3ae54ce3668160405161095d919061433c565b60405180910390a150565b6001546001600160a01b03163314806109875750610987600033611146565b806109a557506109a560008051602061484f83398151915233611146565b6109c25760405163c5cca88d60e01b815260040160405180910390fd5b600880546001600160a01b0319166001600160a01b03831617905550565b50565b6060600c80546109f2906146d4565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1e906146d4565b8015610a6b5780601f10610a4057610100808354040283529160200191610a6b565b820191906000526020600020905b815481529060010190602001808311610a4e57829003601f168201915b5050505050905090565b6060610a8082611e90565b604051602001610a909190614188565b6040516020818303038152906040529050919050565b6001546001600160a01b0316331480610ac55750610ac5600033611146565b610ae257604051637bb62a2160e01b815260040160405180910390fd5b6001600160a01b0382166000908152600260205260409020805460ff19168215151790555050565b5050565b6001546001600160a01b0316331480610b2d5750610b2d600033611146565b80610b4b5750610b4b60008051602061484f83398151915233611146565b610b685760405163c5cca88d60e01b815260040160405180910390fd5b610b70611f24565b565b6001546001600160a01b0316331480610b915750610b91600033611146565b610bae57604051637bb62a2160e01b815260040160405180910390fd5b6007805463ffffffff60a01b1916600160a01b63ffffffff84160217905550565b6007546000908190819061271090610bf490600160a01b900463ffffffff168661465b565b610bfe919061463b565b6007546001600160a01b031693509150505b9250929050565b6001546001600160a01b0316331480610c365750610c36600033611146565b80610c545750610c5460008051602061484f83398151915233611146565b610c715760405163c5cca88d60e01b815260040160405180910390fd5b610c9660405180604001604052806004815260200163135a5b9d60e21b815250611fad565b610ca06001611d17565b6040517f96266d6a53ec58aa3297367be80d53849d07d09d8560baf4c5c8fe89e2aada7590600090a1565b6001600160a01b038516331480610ce75750610ce78533611b46565b610d4e5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b606482015260840161070a565b610d5b8585858585612042565b5050505050565b600082815260208190526040902060010154610d7d8161220b565b610d878383612215565b505050565b6001600160a01b0381163314610dfc5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161070a565b610b0a8282612299565b6001546001600160a01b0316331480610e255750610e25600033611146565b610e4257604051637bb62a2160e01b815260040160405180910390fd5b806001600160a01b038116610e6a57604051633ef39b8160e01b815260040160405180910390fd5b610b0a600083612299565b60608151835114610eda5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b606482015260840161070a565b600083516001600160401b03811115610f0357634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610f2c578160200160208202803683370190505b50905060005b8451811015610fce57610f93858281518110610f5e57634e487b7160e01b600052603260045260246000fd5b6020026020010151858381518110610f8657634e487b7160e01b600052603260045260246000fd5b60200260200101516106a2565b828281518110610fb357634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610fc78161473b565b9050610f32565b509392505050565b6001546001600160a01b0316331480610ff55750610ff5600033611146565b61101257604051637bb62a2160e01b815260040160405180910390fd5b806001600160a01b03811661103a57604051633ef39b8160e01b815260040160405180910390fd5b610b0a600083612215565b6001600160a01b03831633148061106157506110618333611b46565b61107d5760405162461bcd60e51b815260040161070a9061445c565b610d878383836122fe565b6001546001600160a01b031633146110e25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161070a565b610b7060006124bb565b6001546001600160a01b031633148061110b575061110b600033611146565b61112857604051637bb62a2160e01b815260040160405180910390fd5b600780546001600160a01b0319166001600160a01b03831617905550565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600d80546109f2906146d4565b610b0a33838361250d565b604080518082019091526004815263135a5b9d60e21b60208201526001600a5460ff1660038111156111cb57634e487b7160e01b600052602160045260246000fd5b146111e957604051638ca755f560e01b815260040160405180910390fd5b805160208201206040516111ff90600b906140e8565b60405180910390201461122557604051630a761c7560e31b815260040160405180910390fd5b338888888888888860405160200161124498979695949392919061409b565b60408051601f198184030181529181528151602092830120600081815260099093529120548b908b9060ff161561128e5760405163180567a360e31b815260040160405180910390fd5b60006112db83838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506112d592508891506125ee9050565b90612641565b6008549091506001600160a01b03808316911614611323576008546040516372ee54c960e01b81526001600160a01b038084166004830152909116602482015260440161070a565b6000848152600960205260409020805460ff191660011790556113498b8b8b8b8a61265d565b60005b868110156114e85760105433906001600160a01b0316636352211e8a8a8581811061138757634e487b7160e01b600052603260045260246000fd5b905060200201356040518263ffffffff1660e01b81526004016113ac91815260200190565b60206040518083038186803b1580156113c457600080fd5b505afa1580156113d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fc9190613a1b565b6001600160a01b03161461144d5787878281811061142a57634e487b7160e01b600052603260045260246000fd5b90506020020135604051633b94a19960e01b815260040161070a91815260200190565b6010546001600160a01b03166342966c6889898481811061147e57634e487b7160e01b600052603260045260246000fd5b905060200201356040518263ffffffff1660e01b81526004016114a391815260200190565b600060405180830381600087803b1580156114bd57600080fd5b505af11580156114d1573d6000803e3d6000fd5b5050505080806114e09061473b565b91505061134c565b50611576338c8c80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508b8b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525060408051602081019091529081529250612843915050565b5050505050505050505050505050565b6001546001600160a01b03163314806115a557506115a5600033611146565b806115c357506115c360008051602061484f83398151915233611146565b6115e05760405163c5cca88d60e01b815260040160405180910390fd5b610b706129ba565b6001546001600160a01b03163314806116075750611607600033611146565b61162457604051637bb62a2160e01b815260040160405180910390fd5b83838383828181146116495760405163512509d360e11b815260040160405180910390fd5b8061166757604051633296c17360e01b815260040160405180910390fd5b6000600f546001600160401b0381111561169157634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156116ba578160200160208202803683370190505b50905060005b828110156118885760008787838181106116ea57634e487b7160e01b600052603260045260246000fd5b602090810292909201356000818152600e845260409081902081518083019092525463ffffffff808216808452640100000000909204169482019490945290935091159050611857576000828152600660205260408120548251611754919063ffffffff1661467a565b9050600088888681811061177857634e487b7160e01b600052603260045260246000fd5b90506020020135905080600014156117a6576040516358288f5960e01b81526004810185905260240161070a565b808685815181106117c757634e487b7160e01b600052603260045260246000fd5b60200260200101516117d99190614623565b8685815181106117f957634e487b7160e01b600052603260045260246000fd5b6020026020010181815250508186858151811061182657634e487b7160e01b600052603260045260246000fd5b6020026020010151111561185057604051637e1f5a7760e01b81526004810185905260240161070a565b5050611873565b60405163b19df59760e01b81526004810183905260240161070a565b505080806118809061473b565b9150506116c0565b508a89146118a95760405163512509d360e11b815260040160405180910390fd5b8a6118c757604051633296c17360e01b815260040160405180910390fd5b60005b8b81101561197f5761196d8d8d838181106118f557634e487b7160e01b600052603260045260246000fd5b905060200201602081019061190a91906139ff565b8c8c8481811061192a57634e487b7160e01b600052603260045260246000fd5b905060200201358b8b8581811061195157634e487b7160e01b600052603260045260246000fd5b9050602002013560405180602001604052806000815250612a3d565b806119778161473b565b9150506118ca565b50505050505050505050505050565b6060600a60010180546109f2906146d4565b6000828152602081905260409020600101546119bb8161220b565b610d878383612299565b6001546001600160a01b03163314806119e457506119e4600033611146565b611a0157604051637bb62a2160e01b815260040160405180910390fd5b818163ffffffff8216611a265760405162f5b33f60e41b815260040160405180910390fd5b63ffffffff8116611a4957604051625e4ced60e21b815260040160405180910390fd5b6000858152600e602052604090205463ffffffff16611aa257600f54851415611a8657600f8054906000611a7c8361473b565b9190505550611aa2565b60405163ed15e6cf60e01b81526004810186905260240161070a565b6000858152600e602052604090819020805463ffffffff8681166401000000000267ffffffffffffffff1990921690881617179055517fc36abfa7304bfc9937cc9ac7763f3f6141eb88c5b0741bc8197ad41bf553417890611b079087815260200190565b60405180910390a15050505050565b6060611b226000611e90565b604051602001611b329190614157565b604051602081830303815290604052905090565b6001600160a01b03811660009081526002602052604081205460ff1615611b6f57506001610738565b6001600160a01b0380841660009081526004602090815260408083209386168352929052205460ff165b9392505050565b6001600160a01b038516331480611bbc5750611bbc8533611b46565b611bd85760405162461bcd60e51b815260040161070a9061445c565b610d5b8585858585612b28565b6001546001600160a01b03163314611c3f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161070a565b6001600160a01b038116611ca45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161070a565b611caf600082612215565b611ccb6000611cc66001546001600160a01b031690565b612299565b6109e0816124bb565b6001600160a01b038316331480611cf05750611cf08333611b46565b611d0c5760405162461bcd60e51b815260040161070a9061445c565b610d87838383612c64565b6003600a5460ff166003811115611d3e57634e487b7160e01b600052602160045260246000fd5b1415611d5d57604051630ddc900960e11b815260040160405180910390fd5b600a805482919060ff19166001836003811115611d8a57634e487b7160e01b600052602160045260246000fd5b02179055506003816003811115611db157634e487b7160e01b600052602160045260246000fd5b1415611e215760408051808201909152600880825267119a5b9a5cda195960c21b6020909201918252611de691600b9161381b565b506040517f73c24a7893680131e7c50fcccddb220f15bfc9f6968bef4235b6cc599404912490611e1890600b9061434f565b60405180910390a15b600a546040517f115b0a20885b9271082b68a739b15a23986a94c5e2807b824f9ad7dd918f8aeb9161095d9160ff90911690614314565b60006001600160e01b0319821663152a902d60e11b1480610738575061073882612d80565b8051610b0a90600590602084019061381b565b606060058054611e9f906146d4565b80601f0160208091040260200160405190810160405280929190818152602001828054611ecb906146d4565b8015611f185780601f10611eed57610100808354040283529160200191611f18565b820191906000526020600020905b815481529060010190602001808311611efb57829003601f168201915b50505050509050919050565b6002600a5460ff166003811115611f4b57634e487b7160e01b600052602160045260246000fd5b14611f6957604051635402932b60e01b815260040160405180910390fd5b600a805460ff19166001179055604051600081527fff4a5dbbab6b1963d10f5edd139f33a7987ecb3c4f65969be77ddba28d946594906020015b60405180910390a1565b6003600a5460ff166003811115611fd457634e487b7160e01b600052602160045260246000fd5b1415611ff357604051630ddc900960e11b815260040160405180910390fd5b805161200690600b90602084019061381b565b50600a805460ff191690556040517f73c24a7893680131e7c50fcccddb220f15bfc9f6968bef4235b6cc59940491249061095d90600b9061434f565b81518351146120635760405162461bcd60e51b815260040161070a90614577565b6001600160a01b0384166120895760405162461bcd60e51b815260040161070a906144a5565b33612098818787878787612dc0565b60005b845181101561219d5760008582815181106120c657634e487b7160e01b600052603260045260246000fd5b6020026020010151905060008583815181106120f257634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526003835260408082206001600160a01b038e1683529093529190912054909150818110156121435760405162461bcd60e51b815260040161070a9061452d565b60008381526003602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612182908490614623565b92505081905550505050806121969061473b565b905061209b565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516121ed9291906142e6565b60405180910390a4612203818787878787612dce565b505050505050565b6109e08133612f39565b61221f8282611146565b610b0a576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556122553390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6122a38282611146565b15610b0a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b0383166123245760405162461bcd60e51b815260040161070a906144ea565b80518251146123455760405162461bcd60e51b815260040161070a90614577565b600033905061236881856000868660405180602001604052806000815250612dc0565b60005b835181101561244c57600084828151811061239657634e487b7160e01b600052603260045260246000fd5b6020026020010151905060008483815181106123c257634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526003835260408082206001600160a01b038c1683529093529190912054909150818110156124135760405162461bcd60e51b815260040161070a90614418565b60009283526003602090815260408085206001600160a01b038b16865290915290922091039055806124448161473b565b91505061236b565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161249d9291906142e6565b60405180910390a46040805160208101909152600090525b50505050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156125815760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b606482015260840161070a565b6001600160a01b03838116600081815260046020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b60008060006126508585612f9d565b91509150610fce8161300a565b83821461267d5760405163512509d360e11b815260040160405180910390fd5b8361269b57604051633296c17360e01b815260040160405180910390fd5b6000805b858110156128225760008787838181106126c957634e487b7160e01b600052603260045260246000fd5b602090810292909201356000818152600e845260409081902081518083019092525463ffffffff808216808452640100000000909204169482019490945290935091159050611857576000828152600660205260408120548251612733919063ffffffff1661467a565b9050600088888681811061275757634e487b7160e01b600052603260045260246000fd5b9050602002013590508060001415612785576040516358288f5960e01b81526004810185905260240161070a565b818111156127a957604051637e1f5a7760e01b81526004810185905260240161070a565b6002816127b633876106a2565b6127c09190614623565b11156127e957604051632198e2fb60e11b8152600481018590526002602482015260440161070a565b80836020015163ffffffff166127ff919061465b565b6128099087614623565b955050505050808061281a9061473b565b91505061269f565b508181146122035760405163bb2c33c760e01b815260040160405180910390fd5b6001600160a01b0384166128695760405162461bcd60e51b815260040161070a906145bf565b815183511461288a5760405162461bcd60e51b815260040161070a90614577565b3361289a81600087878787612dc0565b60005b8451811015612952578381815181106128c657634e487b7160e01b600052603260045260246000fd5b6020026020010151600360008784815181106128f257634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b03168152602001908152602001600020600082825461293a9190614623565b9091555081905061294a8161473b565b91505061289d565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516129a39291906142e6565b60405180910390a4610d5b81600087878787612dce565b6001600a5460ff1660038111156129e157634e487b7160e01b600052602160045260246000fd5b146129ff57604051638ca755f560e01b815260040160405180910390fd5b600a805460ff19166002179055604051600181527fff4a5dbbab6b1963d10f5edd139f33a7987ecb3c4f65969be77ddba28d94659490602001611fa3565b6001600160a01b038416612a635760405162461bcd60e51b815260040161070a906145bf565b336000612a6f8561320b565b90506000612a7c8561320b565b9050612a8d83600089858589612dc0565b60008681526003602090815260408083206001600160a01b038b16845290915281208054879290612abf908490614623565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612b1f83600089898989613264565b50505050505050565b6001600160a01b038416612b4e5760405162461bcd60e51b815260040161070a906144a5565b336000612b5a8561320b565b90506000612b678561320b565b9050612b77838989858589612dc0565b60008681526003602090815260408083206001600160a01b038c16845290915290205485811015612bba5760405162461bcd60e51b815260040161070a9061452d565b60008781526003602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612bf9908490614623565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612c59848a8a8a8a8a613264565b505050505050505050565b6001600160a01b038316612c8a5760405162461bcd60e51b815260040161070a906144ea565b336000612c968461320b565b90506000612ca38461320b565b9050612cc383876000858560405180602001604052806000815250612dc0565b60008581526003602090815260408083206001600160a01b038a16845290915290205484811015612d065760405162461bcd60e51b815260040161070a90614418565b60008681526003602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052612b1f565b60006001600160e01b03198216636cdb3d1360e11b1480612db157506001600160e01b031982166303a24d0760e21b145b8061073857506107388261332e565b612203868686868686613363565b6001600160a01b0384163b156122035760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612e129089908990889088908890600401614230565b602060405180830381600087803b158015612e2c57600080fd5b505af1925050508015612e5c575060408051601f3d908101601f19168201909252612e5991810190613e39565b60015b612f0957612e68614782565b806308c379a01415612ea25750612e7d61479a565b80612e885750612ea4565b8060405162461bcd60e51b815260040161070a919061433c565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b606482015260840161070a565b6001600160e01b0319811663bc197c8160e01b14612b1f5760405162461bcd60e51b815260040161070a906143d0565b612f438282611146565b610b0a57612f5b816001600160a01b03166014613514565b612f66836020613514565b604051602001612f779291906141bb565b60408051601f198184030181529082905262461bcd60e51b825261070a9160040161433c565b600080825160411415612fd45760208301516040840151606085015160001a612fc8878285856136f5565b94509450505050610c10565b825160401415612ffe5760208301516040840151612ff38683836137e2565b935093505050610c10565b50600090506002610c10565b600081600481111561302c57634e487b7160e01b600052602160045260246000fd5b14156130355750565b600181600481111561305757634e487b7160e01b600052602160045260246000fd5b14156130a55760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161070a565b60028160048111156130c757634e487b7160e01b600052602160045260246000fd5b14156131155760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161070a565b600381600481111561313757634e487b7160e01b600052602160045260246000fd5b14156131905760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161070a565b60048160048111156131b257634e487b7160e01b600052602160045260246000fd5b14156109e05760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161070a565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061325357634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b6001600160a01b0384163b156122035760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906132a8908990899088908890889060040161428e565b602060405180830381600087803b1580156132c257600080fd5b505af19250505080156132f2575060408051601f3d908101601f191682019092526132ef91810190613e39565b60015b6132fe57612e68614782565b6001600160e01b0319811663f23a6e6160e01b14612b1f5760405162461bcd60e51b815260040161070a906143d0565b60006001600160e01b03198216637965db0b60e01b148061073857506301ffc9a760e01b6001600160e01b0319831614610738565b6001600160a01b0385166134065760005b83518110156134045782818151811061339d57634e487b7160e01b600052603260045260246000fd5b6020026020010151600660008684815181106133c957634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060008282546133ee9190614623565b909155506133fd90508161473b565b9050613374565b505b6001600160a01b0384166122035760005b8351811015612b1f57600084828151811061344257634e487b7160e01b600052603260045260246000fd5b60200260200101519050600084838151811061346e57634e487b7160e01b600052603260045260246000fd5b60200260200101519050600060066000848152602001908152602001600020549050818110156134f15760405162461bcd60e51b815260206004820152602860248201527f455243313135353a206275726e20616d6f756e74206578636565647320746f74604482015267616c537570706c7960c01b606482015260840161070a565b6000928352600660205260409092209103905561350d8161473b565b9050613417565b6060600061352383600261465b565b61352e906002614623565b6001600160401b0381111561355357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561357d576020820181803683370190505b509050600360fc1b816000815181106135a657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106135e357634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600061360784600261465b565b613612906001614623565b90505b60018111156136a6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061365457634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061367857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361369f816146bd565b9050613615565b508315611b995760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161070a565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561372c57506000905060036137d9565b8460ff16601b1415801561374457508460ff16601c14155b1561375557506000905060046137d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156137a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166137d2576000600192509250506137d9565b9150600090505b94509492505050565b6000806001600160ff1b038316816137ff60ff86901c601b614623565b905061380d878288856136f5565b935093505050935093915050565b828054613827906146d4565b90600052602060002090601f016020900481019282613849576000855561388f565b82601f1061386257805160ff191683800117855561388f565b8280016001018555821561388f579182015b8281111561388f578251825591602001919060010190613874565b5061389b92915061389f565b5090565b5b8082111561389b57600081556001016138a0565b60006001600160401b038311156138cd576138cd61476c565b6040516138e4601f8501601f19166020018261470f565b8091508381528484840111156138f957600080fd5b83836020830137600060208583010152509392505050565b60008083601f840112613922578182fd5b5081356001600160401b03811115613938578182fd5b6020830191508360208260051b8501011115610c1057600080fd5b600082601f830112613963578081fd5b8135602061397082614600565b60405161397d828261470f565b8381528281019150858301600585901b8701840188101561399c578586fd5b855b858110156139ba5781358452928401929084019060010161399e565b5090979650505050505050565b600082601f8301126139d7578081fd5b611b99838335602085016138b4565b803563ffffffff811681146139fa57600080fd5b919050565b600060208284031215613a10578081fd5b8135611b9981614823565b600060208284031215613a2c578081fd5b8151611b9981614823565b60008060408385031215613a49578081fd5b8235613a5481614823565b91506020830135613a6481614823565b809150509250929050565b600080600080600060a08688031215613a86578081fd5b8535613a9181614823565b94506020860135613aa181614823565b935060408601356001600160401b0380821115613abc578283fd5b613ac889838a01613953565b94506060880135915080821115613add578283fd5b613ae989838a01613953565b93506080880135915080821115613afe578283fd5b50613b0b888289016139c7565b9150509295509295909350565b600080600080600060a08688031215613b2f578081fd5b8535613b3a81614823565b94506020860135613b4a81614823565b9350604086013592506060860135915060808601356001600160401b03811115613b72578182fd5b613b0b888289016139c7565b600080600060608486031215613b92578081fd5b8335613b9d81614823565b925060208401356001600160401b0380821115613bb8578283fd5b613bc487838801613953565b93506040860135915080821115613bd9578283fd5b50613be686828701613953565b9150509250925092565b60008060408385031215613c02578182fd5b8235613c0d81614823565b915060208301358015158114613a64578182fd5b60008060408385031215613c33578182fd5b8235613c3e81614823565b946020939093013593505050565b600080600060608486031215613c60578081fd5b8335613c6b81614823565b95602085013595506040909401359392505050565b60008060008060008060608789031215613c98578384fd5b86356001600160401b0380821115613cae578586fd5b613cba8a838b01613911565b90985096506020890135915080821115613cd2578586fd5b613cde8a838b01613911565b90965094506040890135915080821115613cf6578283fd5b50613d0389828a01613911565b979a9699509497509295939492505050565b60008060408385031215613d27578182fd5b82356001600160401b0380821115613d3d578384fd5b818501915085601f830112613d50578384fd5b81356020613d5d82614600565b604051613d6a828261470f565b8381528281019150858301600585901b870184018b1015613d89578889fd5b8896505b84871015613db4578035613da081614823565b835260019690960195918301918301613d8d565b5096505086013592505080821115613dca578283fd5b50613dd785828601613953565b9150509250929050565b600060208284031215613df2578081fd5b5035919050565b60008060408385031215613e0b578182fd5b823591506020830135613a6481614823565b600060208284031215613e2e578081fd5b8135611b9981614838565b600060208284031215613e4a578081fd5b8151611b9981614838565b600080600080600080600080600060a08a8c031215613e72578687fd5b89356001600160401b0380821115613e88578889fd5b818c0191508c601f830112613e9b578889fd5b813581811115613ea957898afd5b8d6020828501011115613eba57898afd5b60209283019b509950908b0135975060408b01359080821115613edb578485fd5b613ee78d838e01613911565b909850965060608c0135915080821115613eff578485fd5b613f0b8d838e01613911565b909650945060808c0135915080821115613f23578384fd5b50613f308c828d01613911565b915080935050809150509295985092959850929598565b600060208284031215613f58578081fd5b81356001600160401b03811115613f6d578182fd5b8201601f81018413613f7d578182fd5b613f8c848235602084016138b4565b949350505050565b60008060408385031215613fa6578182fd5b50508035926020909101359150565b600080600060608486031215613fc9578081fd5b83359250613fd9602085016139e6565b9150613fe7604085016139e6565b90509250925092565b600060208284031215614001578081fd5b611b99826139e6565b60006001600160fb1b0383111561401f578081fd5b8260051b80838637939093019283525090919050565b6000815180845260208085019450808401835b8381101561406457815187529582019590820190600101614048565b509495945050505050565b60008151808452614087816020860160208601614691565b601f01601f19169290920160200192915050565b6bffffffffffffffffffffffff198960601b16815287601482015260006140da6140d36140cc603485018a8c61400a565b878961400a565b848661400a565b9a9950505050505050505050565b60008083546140f6816146d4565b6001828116801561410e576001811461411f5761414b565b60ff1984168752828701945061414b565b8786526020808720875b858110156141425781548a820152908401908201614129565b50505082870194505b50929695505050505050565b60008251614169818460208701614691565b6c31b7b73a3930b1ba173539b7b760991b920191825250600d01919050565b6000825161419a818460208701614691565b6e3a37b5b2b717bdb4b23e973539b7b760891b920191825250600f01919050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516141f3816017850160208801614691565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614224816028840160208801614691565b01602801949350505050565b6001600160a01b0386811682528516602082015260a06040820181905260009061425c90830186614035565b828103606084015261426e8186614035565b90508281036080840152614282818561406f565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906142c89083018461406f565b979650505050505050565b602081526000611b996020830184614035565b6040815260006142f96040830185614035565b828103602084015261430b8185614035565b95945050505050565b602081016004831061433657634e487b7160e01b600052602160045260246000fd5b91905290565b602081526000611b99602083018461406f565b60006020808352818454614362816146d4565b808487015260406001808416600081146143835760018114614397576143c2565b60ff198516898401526060890195506143c2565b898852868820885b858110156143ba5781548b820186015290830190880161439f565b8a0184019650505b509398975050505050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b60208082526029908201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260408201526808185c1c1c9bdd995960ba1b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60006001600160401b038211156146195761461961476c565b5060051b60200190565b6000821982111561463657614636614756565b500190565b60008261465657634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561467557614675614756565b500290565b60008282101561468c5761468c614756565b500390565b60005b838110156146ac578181015183820152602001614694565b838111156124b55750506000910152565b6000816146cc576146cc614756565b506000190190565b600181811c908216806146e857607f821691505b6020821081141561470957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f191681016001600160401b03811182821017156147345761473461476c565b6040525050565b600060001982141561474f5761474f614756565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d111561479757600481823e5160e01c5b90565b600060443d10156147a85790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156147d757505050505090565b82850191508151818111156147ef5750505050505090565b843d87010160208285010111156148095750505050505090565b6148186020828601018761470f565b509095945050505050565b6001600160a01b03811681146109e057600080fd5b6001600160e01b0319811681146109e057600080fdfe71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834fa2646970667358221220f4a1de97cf67fcee7bd2647ccfb2ec84d756f29ae0809f32d2c995d8759c556464736f6c6343000804003368747470733a2f2f6d6173736c6573732d697066732d7075626c69632d676174657761792e6d7970696e6174612e636c6f75642f697066732f0000000000000000000000004efb67498393531bd60dcc5b0c7056b59cfa3ec4000000000000000000000000859010baad3e7f51a5ef1e43550056ea29542fb000000000000000000000000038c339fd95a910386a79dca2d0bbb9cd617169d100000000000000000000000074f1716a9f452dd36d945368d806cd491290b24000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061029f5760003560e01c80636b20c45411610167578063bd85b039116100ce578063e8a3d48511610087578063e8a3d48514610646578063e985e9c51461064e578063f0292a0314610661578063f242432a14610669578063f2fde38b1461067c578063f5298aca1461068f57600080fd5b8063bd85b039146105dd578063cd85cdb5146105fd578063d1b1934714610605578063d1e812a314610618578063d547741f14610620578063e23059d41461063357600080fd5b806395d89b411161012057806395d89b41146105455780639fbc87131461054d578063a217fddf14610560578063a22cb46514610568578063b4b5b48f1461057b578063b8886264146105ca57600080fd5b80636b20c454146104de578063715018a6146104f1578063797669c9146104f95780638da5cb5b1461050e5780638dc251e31461051f57806391d148541461053257600080fd5b80632a55205a1161020b578063404a1f37116101c4578063404a1f371461042557806342260b5d146104385780634e1273f4146104645780634f558e79146104845780635b7633d0146104a65780635c6fd90b146104cb57600080fd5b80632a55205a146103a95780632be09561146103db5780632eb2c2d6146103e35780632f2ff15d146103f6578063340754ed1461040957806336568abe1461041257600080fd5b80630e89341c1161025d5780630e89341c146103325780631351cf51146103455780631a8bd2da146103585780631cf015c614610360578063248a9ca31461037357806325bdb2a81461039657600080fd5b8062fdd58e146102a4578063017043a5146102ca57806301ffc9a7146102d457806302fe5305146102f7578063046dc1661461030a57806306fdde031461031d575b600080fd5b6102b76102b2366004613c21565b6106a2565b6040519081526020015b60405180910390f35b6102d261073e565b005b6102e76102e2366004613e1d565b6107f4565b60405190151581526020016102c1565b6102d2610305366004613f47565b61086a565b6102d26103183660046139ff565b610968565b6103256109e3565b6040516102c1919061433c565b610325610340366004613de1565b610a75565b6102d2610353366004613bf0565b610aa6565b6102d2610b0e565b6102d261036e366004613ff0565b610b72565b6102b7610381366004613de1565b60009081526020819052604090206001015490565b600a5460ff166040516102c19190614314565b6103bc6103b7366004613f94565b610bcf565b604080516001600160a01b0390931683526020830191909152016102c1565b6102d2610c17565b6102d26103f1366004613a6f565b610ccb565b6102d2610404366004613df9565b610d62565b6102b7600f5481565b6102d2610420366004613df9565b610d8c565b6102d26104333660046139ff565b610e06565b60075461044f90600160a01b900463ffffffff1681565b60405163ffffffff90911681526020016102c1565b610477610472366004613d15565b610e75565b6040516102c191906142d3565b6102e7610492366004613de1565b600090815260066020526040902054151590565b6008546001600160a01b03165b6040516001600160a01b0390911681526020016102c1565b6102d26104d93660046139ff565b610fd6565b6102d26104ec366004613b7e565b611045565b6102d2611088565b6102b760008051602061484f83398151915281565b6001546001600160a01b03166104b3565b6102d261052d3660046139ff565b6110ec565b6102e7610540366004613df9565b611146565b61032561116f565b6007546104b3906001600160a01b031681565b6102b7600081565b6102d2610576366004613bf0565b61117e565b6105ad610589366004613de1565b600e6020526000908152604090205463ffffffff8082169164010000000090041682565b6040805163ffffffff9384168152929091166020830152016102c1565b6102d26105d8366004613e55565b611189565b6102b76105eb366004613de1565b60009081526006602052604090205490565b6102d2611586565b6102d2610613366004613c80565b6115e8565b61032561198e565b6102d261062e366004613df9565b6119a0565b6102d2610641366004613fb5565b6119c5565b610325611b16565b6102e761065c366004613a37565b611b46565b61044f600281565b6102d2610677366004613b18565b611ba0565b6102d261068a3660046139ff565b611be5565b6102d261069d366004613c4c565b611cd4565b60006001600160a01b0383166107135760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b5060008181526003602090815260408083206001600160a01b03861684529091529020545b92915050565b6001546001600160a01b031633148061075d575061075d600033611146565b61077a57604051637bb62a2160e01b815260040160405180910390fd5b6001600a5460ff1660038111156107a157634e487b7160e01b600052602160045260246000fd5b146107bf57604051638ca755f560e01b815260040160405180910390fd5b6107c96003611d17565b6040517faf24d3bccd7e329975f60c4d13b81252ff061649fb46d1c416c9b6a13100bff190600090a1565b60006001600160e01b03198216637965db0b60e01b148061082557506001600160e01b0319821663152a902d60e11b145b8061084057506001600160e01b0319821663e8a3d48560e01b145b8061085b57506001600160e01b03198216636cdb3d1360e11b145b80610738575061073882611e58565b6001546001600160a01b03163314806108895750610889600033611146565b806108a757506108a760008051602061484f83398151915233611146565b6108c45760405163c5cca88d60e01b815260040160405180910390fd5b8051602f60f81b9082906108da9060019061467a565b815181106108f857634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916146109255760405163a467f6f560e01b815260040160405180910390fd5b61092e81611e7d565b7fe3afa94108b5f5e82e5f6e539d161ff4b5402a85f696c67b9768ec3ae54ce3668160405161095d919061433c565b60405180910390a150565b6001546001600160a01b03163314806109875750610987600033611146565b806109a557506109a560008051602061484f83398151915233611146565b6109c25760405163c5cca88d60e01b815260040160405180910390fd5b600880546001600160a01b0319166001600160a01b03831617905550565b50565b6060600c80546109f2906146d4565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1e906146d4565b8015610a6b5780601f10610a4057610100808354040283529160200191610a6b565b820191906000526020600020905b815481529060010190602001808311610a4e57829003601f168201915b5050505050905090565b6060610a8082611e90565b604051602001610a909190614188565b6040516020818303038152906040529050919050565b6001546001600160a01b0316331480610ac55750610ac5600033611146565b610ae257604051637bb62a2160e01b815260040160405180910390fd5b6001600160a01b0382166000908152600260205260409020805460ff19168215151790555050565b5050565b6001546001600160a01b0316331480610b2d5750610b2d600033611146565b80610b4b5750610b4b60008051602061484f83398151915233611146565b610b685760405163c5cca88d60e01b815260040160405180910390fd5b610b70611f24565b565b6001546001600160a01b0316331480610b915750610b91600033611146565b610bae57604051637bb62a2160e01b815260040160405180910390fd5b6007805463ffffffff60a01b1916600160a01b63ffffffff84160217905550565b6007546000908190819061271090610bf490600160a01b900463ffffffff168661465b565b610bfe919061463b565b6007546001600160a01b031693509150505b9250929050565b6001546001600160a01b0316331480610c365750610c36600033611146565b80610c545750610c5460008051602061484f83398151915233611146565b610c715760405163c5cca88d60e01b815260040160405180910390fd5b610c9660405180604001604052806004815260200163135a5b9d60e21b815250611fad565b610ca06001611d17565b6040517f96266d6a53ec58aa3297367be80d53849d07d09d8560baf4c5c8fe89e2aada7590600090a1565b6001600160a01b038516331480610ce75750610ce78533611b46565b610d4e5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b606482015260840161070a565b610d5b8585858585612042565b5050505050565b600082815260208190526040902060010154610d7d8161220b565b610d878383612215565b505050565b6001600160a01b0381163314610dfc5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161070a565b610b0a8282612299565b6001546001600160a01b0316331480610e255750610e25600033611146565b610e4257604051637bb62a2160e01b815260040160405180910390fd5b806001600160a01b038116610e6a57604051633ef39b8160e01b815260040160405180910390fd5b610b0a600083612299565b60608151835114610eda5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b606482015260840161070a565b600083516001600160401b03811115610f0357634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610f2c578160200160208202803683370190505b50905060005b8451811015610fce57610f93858281518110610f5e57634e487b7160e01b600052603260045260246000fd5b6020026020010151858381518110610f8657634e487b7160e01b600052603260045260246000fd5b60200260200101516106a2565b828281518110610fb357634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610fc78161473b565b9050610f32565b509392505050565b6001546001600160a01b0316331480610ff55750610ff5600033611146565b61101257604051637bb62a2160e01b815260040160405180910390fd5b806001600160a01b03811661103a57604051633ef39b8160e01b815260040160405180910390fd5b610b0a600083612215565b6001600160a01b03831633148061106157506110618333611b46565b61107d5760405162461bcd60e51b815260040161070a9061445c565b610d878383836122fe565b6001546001600160a01b031633146110e25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161070a565b610b7060006124bb565b6001546001600160a01b031633148061110b575061110b600033611146565b61112857604051637bb62a2160e01b815260040160405180910390fd5b600780546001600160a01b0319166001600160a01b03831617905550565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600d80546109f2906146d4565b610b0a33838361250d565b604080518082019091526004815263135a5b9d60e21b60208201526001600a5460ff1660038111156111cb57634e487b7160e01b600052602160045260246000fd5b146111e957604051638ca755f560e01b815260040160405180910390fd5b805160208201206040516111ff90600b906140e8565b60405180910390201461122557604051630a761c7560e31b815260040160405180910390fd5b338888888888888860405160200161124498979695949392919061409b565b60408051601f198184030181529181528151602092830120600081815260099093529120548b908b9060ff161561128e5760405163180567a360e31b815260040160405180910390fd5b60006112db83838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506112d592508891506125ee9050565b90612641565b6008549091506001600160a01b03808316911614611323576008546040516372ee54c960e01b81526001600160a01b038084166004830152909116602482015260440161070a565b6000848152600960205260409020805460ff191660011790556113498b8b8b8b8a61265d565b60005b868110156114e85760105433906001600160a01b0316636352211e8a8a8581811061138757634e487b7160e01b600052603260045260246000fd5b905060200201356040518263ffffffff1660e01b81526004016113ac91815260200190565b60206040518083038186803b1580156113c457600080fd5b505afa1580156113d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fc9190613a1b565b6001600160a01b03161461144d5787878281811061142a57634e487b7160e01b600052603260045260246000fd5b90506020020135604051633b94a19960e01b815260040161070a91815260200190565b6010546001600160a01b03166342966c6889898481811061147e57634e487b7160e01b600052603260045260246000fd5b905060200201356040518263ffffffff1660e01b81526004016114a391815260200190565b600060405180830381600087803b1580156114bd57600080fd5b505af11580156114d1573d6000803e3d6000fd5b5050505080806114e09061473b565b91505061134c565b50611576338c8c80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508b8b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525060408051602081019091529081529250612843915050565b5050505050505050505050505050565b6001546001600160a01b03163314806115a557506115a5600033611146565b806115c357506115c360008051602061484f83398151915233611146565b6115e05760405163c5cca88d60e01b815260040160405180910390fd5b610b706129ba565b6001546001600160a01b03163314806116075750611607600033611146565b61162457604051637bb62a2160e01b815260040160405180910390fd5b83838383828181146116495760405163512509d360e11b815260040160405180910390fd5b8061166757604051633296c17360e01b815260040160405180910390fd5b6000600f546001600160401b0381111561169157634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156116ba578160200160208202803683370190505b50905060005b828110156118885760008787838181106116ea57634e487b7160e01b600052603260045260246000fd5b602090810292909201356000818152600e845260409081902081518083019092525463ffffffff808216808452640100000000909204169482019490945290935091159050611857576000828152600660205260408120548251611754919063ffffffff1661467a565b9050600088888681811061177857634e487b7160e01b600052603260045260246000fd5b90506020020135905080600014156117a6576040516358288f5960e01b81526004810185905260240161070a565b808685815181106117c757634e487b7160e01b600052603260045260246000fd5b60200260200101516117d99190614623565b8685815181106117f957634e487b7160e01b600052603260045260246000fd5b6020026020010181815250508186858151811061182657634e487b7160e01b600052603260045260246000fd5b6020026020010151111561185057604051637e1f5a7760e01b81526004810185905260240161070a565b5050611873565b60405163b19df59760e01b81526004810183905260240161070a565b505080806118809061473b565b9150506116c0565b508a89146118a95760405163512509d360e11b815260040160405180910390fd5b8a6118c757604051633296c17360e01b815260040160405180910390fd5b60005b8b81101561197f5761196d8d8d838181106118f557634e487b7160e01b600052603260045260246000fd5b905060200201602081019061190a91906139ff565b8c8c8481811061192a57634e487b7160e01b600052603260045260246000fd5b905060200201358b8b8581811061195157634e487b7160e01b600052603260045260246000fd5b9050602002013560405180602001604052806000815250612a3d565b806119778161473b565b9150506118ca565b50505050505050505050505050565b6060600a60010180546109f2906146d4565b6000828152602081905260409020600101546119bb8161220b565b610d878383612299565b6001546001600160a01b03163314806119e457506119e4600033611146565b611a0157604051637bb62a2160e01b815260040160405180910390fd5b818163ffffffff8216611a265760405162f5b33f60e41b815260040160405180910390fd5b63ffffffff8116611a4957604051625e4ced60e21b815260040160405180910390fd5b6000858152600e602052604090205463ffffffff16611aa257600f54851415611a8657600f8054906000611a7c8361473b565b9190505550611aa2565b60405163ed15e6cf60e01b81526004810186905260240161070a565b6000858152600e602052604090819020805463ffffffff8681166401000000000267ffffffffffffffff1990921690881617179055517fc36abfa7304bfc9937cc9ac7763f3f6141eb88c5b0741bc8197ad41bf553417890611b079087815260200190565b60405180910390a15050505050565b6060611b226000611e90565b604051602001611b329190614157565b604051602081830303815290604052905090565b6001600160a01b03811660009081526002602052604081205460ff1615611b6f57506001610738565b6001600160a01b0380841660009081526004602090815260408083209386168352929052205460ff165b9392505050565b6001600160a01b038516331480611bbc5750611bbc8533611b46565b611bd85760405162461bcd60e51b815260040161070a9061445c565b610d5b8585858585612b28565b6001546001600160a01b03163314611c3f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161070a565b6001600160a01b038116611ca45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161070a565b611caf600082612215565b611ccb6000611cc66001546001600160a01b031690565b612299565b6109e0816124bb565b6001600160a01b038316331480611cf05750611cf08333611b46565b611d0c5760405162461bcd60e51b815260040161070a9061445c565b610d87838383612c64565b6003600a5460ff166003811115611d3e57634e487b7160e01b600052602160045260246000fd5b1415611d5d57604051630ddc900960e11b815260040160405180910390fd5b600a805482919060ff19166001836003811115611d8a57634e487b7160e01b600052602160045260246000fd5b02179055506003816003811115611db157634e487b7160e01b600052602160045260246000fd5b1415611e215760408051808201909152600880825267119a5b9a5cda195960c21b6020909201918252611de691600b9161381b565b506040517f73c24a7893680131e7c50fcccddb220f15bfc9f6968bef4235b6cc599404912490611e1890600b9061434f565b60405180910390a15b600a546040517f115b0a20885b9271082b68a739b15a23986a94c5e2807b824f9ad7dd918f8aeb9161095d9160ff90911690614314565b60006001600160e01b0319821663152a902d60e11b1480610738575061073882612d80565b8051610b0a90600590602084019061381b565b606060058054611e9f906146d4565b80601f0160208091040260200160405190810160405280929190818152602001828054611ecb906146d4565b8015611f185780601f10611eed57610100808354040283529160200191611f18565b820191906000526020600020905b815481529060010190602001808311611efb57829003601f168201915b50505050509050919050565b6002600a5460ff166003811115611f4b57634e487b7160e01b600052602160045260246000fd5b14611f6957604051635402932b60e01b815260040160405180910390fd5b600a805460ff19166001179055604051600081527fff4a5dbbab6b1963d10f5edd139f33a7987ecb3c4f65969be77ddba28d946594906020015b60405180910390a1565b6003600a5460ff166003811115611fd457634e487b7160e01b600052602160045260246000fd5b1415611ff357604051630ddc900960e11b815260040160405180910390fd5b805161200690600b90602084019061381b565b50600a805460ff191690556040517f73c24a7893680131e7c50fcccddb220f15bfc9f6968bef4235b6cc59940491249061095d90600b9061434f565b81518351146120635760405162461bcd60e51b815260040161070a90614577565b6001600160a01b0384166120895760405162461bcd60e51b815260040161070a906144a5565b33612098818787878787612dc0565b60005b845181101561219d5760008582815181106120c657634e487b7160e01b600052603260045260246000fd5b6020026020010151905060008583815181106120f257634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526003835260408082206001600160a01b038e1683529093529190912054909150818110156121435760405162461bcd60e51b815260040161070a9061452d565b60008381526003602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612182908490614623565b92505081905550505050806121969061473b565b905061209b565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516121ed9291906142e6565b60405180910390a4612203818787878787612dce565b505050505050565b6109e08133612f39565b61221f8282611146565b610b0a576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556122553390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6122a38282611146565b15610b0a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b0383166123245760405162461bcd60e51b815260040161070a906144ea565b80518251146123455760405162461bcd60e51b815260040161070a90614577565b600033905061236881856000868660405180602001604052806000815250612dc0565b60005b835181101561244c57600084828151811061239657634e487b7160e01b600052603260045260246000fd5b6020026020010151905060008483815181106123c257634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526003835260408082206001600160a01b038c1683529093529190912054909150818110156124135760405162461bcd60e51b815260040161070a90614418565b60009283526003602090815260408085206001600160a01b038b16865290915290922091039055806124448161473b565b91505061236b565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161249d9291906142e6565b60405180910390a46040805160208101909152600090525b50505050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156125815760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b606482015260840161070a565b6001600160a01b03838116600081815260046020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b60008060006126508585612f9d565b91509150610fce8161300a565b83821461267d5760405163512509d360e11b815260040160405180910390fd5b8361269b57604051633296c17360e01b815260040160405180910390fd5b6000805b858110156128225760008787838181106126c957634e487b7160e01b600052603260045260246000fd5b602090810292909201356000818152600e845260409081902081518083019092525463ffffffff808216808452640100000000909204169482019490945290935091159050611857576000828152600660205260408120548251612733919063ffffffff1661467a565b9050600088888681811061275757634e487b7160e01b600052603260045260246000fd5b9050602002013590508060001415612785576040516358288f5960e01b81526004810185905260240161070a565b818111156127a957604051637e1f5a7760e01b81526004810185905260240161070a565b6002816127b633876106a2565b6127c09190614623565b11156127e957604051632198e2fb60e11b8152600481018590526002602482015260440161070a565b80836020015163ffffffff166127ff919061465b565b6128099087614623565b955050505050808061281a9061473b565b91505061269f565b508181146122035760405163bb2c33c760e01b815260040160405180910390fd5b6001600160a01b0384166128695760405162461bcd60e51b815260040161070a906145bf565b815183511461288a5760405162461bcd60e51b815260040161070a90614577565b3361289a81600087878787612dc0565b60005b8451811015612952578381815181106128c657634e487b7160e01b600052603260045260246000fd5b6020026020010151600360008784815181106128f257634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b03168152602001908152602001600020600082825461293a9190614623565b9091555081905061294a8161473b565b91505061289d565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516129a39291906142e6565b60405180910390a4610d5b81600087878787612dce565b6001600a5460ff1660038111156129e157634e487b7160e01b600052602160045260246000fd5b146129ff57604051638ca755f560e01b815260040160405180910390fd5b600a805460ff19166002179055604051600181527fff4a5dbbab6b1963d10f5edd139f33a7987ecb3c4f65969be77ddba28d94659490602001611fa3565b6001600160a01b038416612a635760405162461bcd60e51b815260040161070a906145bf565b336000612a6f8561320b565b90506000612a7c8561320b565b9050612a8d83600089858589612dc0565b60008681526003602090815260408083206001600160a01b038b16845290915281208054879290612abf908490614623565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612b1f83600089898989613264565b50505050505050565b6001600160a01b038416612b4e5760405162461bcd60e51b815260040161070a906144a5565b336000612b5a8561320b565b90506000612b678561320b565b9050612b77838989858589612dc0565b60008681526003602090815260408083206001600160a01b038c16845290915290205485811015612bba5760405162461bcd60e51b815260040161070a9061452d565b60008781526003602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612bf9908490614623565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612c59848a8a8a8a8a613264565b505050505050505050565b6001600160a01b038316612c8a5760405162461bcd60e51b815260040161070a906144ea565b336000612c968461320b565b90506000612ca38461320b565b9050612cc383876000858560405180602001604052806000815250612dc0565b60008581526003602090815260408083206001600160a01b038a16845290915290205484811015612d065760405162461bcd60e51b815260040161070a90614418565b60008681526003602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052612b1f565b60006001600160e01b03198216636cdb3d1360e11b1480612db157506001600160e01b031982166303a24d0760e21b145b8061073857506107388261332e565b612203868686868686613363565b6001600160a01b0384163b156122035760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612e129089908990889088908890600401614230565b602060405180830381600087803b158015612e2c57600080fd5b505af1925050508015612e5c575060408051601f3d908101601f19168201909252612e5991810190613e39565b60015b612f0957612e68614782565b806308c379a01415612ea25750612e7d61479a565b80612e885750612ea4565b8060405162461bcd60e51b815260040161070a919061433c565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b606482015260840161070a565b6001600160e01b0319811663bc197c8160e01b14612b1f5760405162461bcd60e51b815260040161070a906143d0565b612f438282611146565b610b0a57612f5b816001600160a01b03166014613514565b612f66836020613514565b604051602001612f779291906141bb565b60408051601f198184030181529082905262461bcd60e51b825261070a9160040161433c565b600080825160411415612fd45760208301516040840151606085015160001a612fc8878285856136f5565b94509450505050610c10565b825160401415612ffe5760208301516040840151612ff38683836137e2565b935093505050610c10565b50600090506002610c10565b600081600481111561302c57634e487b7160e01b600052602160045260246000fd5b14156130355750565b600181600481111561305757634e487b7160e01b600052602160045260246000fd5b14156130a55760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161070a565b60028160048111156130c757634e487b7160e01b600052602160045260246000fd5b14156131155760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161070a565b600381600481111561313757634e487b7160e01b600052602160045260246000fd5b14156131905760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161070a565b60048160048111156131b257634e487b7160e01b600052602160045260246000fd5b14156109e05760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161070a565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061325357634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b6001600160a01b0384163b156122035760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906132a8908990899088908890889060040161428e565b602060405180830381600087803b1580156132c257600080fd5b505af19250505080156132f2575060408051601f3d908101601f191682019092526132ef91810190613e39565b60015b6132fe57612e68614782565b6001600160e01b0319811663f23a6e6160e01b14612b1f5760405162461bcd60e51b815260040161070a906143d0565b60006001600160e01b03198216637965db0b60e01b148061073857506301ffc9a760e01b6001600160e01b0319831614610738565b6001600160a01b0385166134065760005b83518110156134045782818151811061339d57634e487b7160e01b600052603260045260246000fd5b6020026020010151600660008684815181106133c957634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060008282546133ee9190614623565b909155506133fd90508161473b565b9050613374565b505b6001600160a01b0384166122035760005b8351811015612b1f57600084828151811061344257634e487b7160e01b600052603260045260246000fd5b60200260200101519050600084838151811061346e57634e487b7160e01b600052603260045260246000fd5b60200260200101519050600060066000848152602001908152602001600020549050818110156134f15760405162461bcd60e51b815260206004820152602860248201527f455243313135353a206275726e20616d6f756e74206578636565647320746f74604482015267616c537570706c7960c01b606482015260840161070a565b6000928352600660205260409092209103905561350d8161473b565b9050613417565b6060600061352383600261465b565b61352e906002614623565b6001600160401b0381111561355357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561357d576020820181803683370190505b509050600360fc1b816000815181106135a657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106135e357634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600061360784600261465b565b613612906001614623565b90505b60018111156136a6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061365457634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061367857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361369f816146bd565b9050613615565b508315611b995760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161070a565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561372c57506000905060036137d9565b8460ff16601b1415801561374457508460ff16601c14155b1561375557506000905060046137d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156137a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166137d2576000600192509250506137d9565b9150600090505b94509492505050565b6000806001600160ff1b038316816137ff60ff86901c601b614623565b905061380d878288856136f5565b935093505050935093915050565b828054613827906146d4565b90600052602060002090601f016020900481019282613849576000855561388f565b82601f1061386257805160ff191683800117855561388f565b8280016001018555821561388f579182015b8281111561388f578251825591602001919060010190613874565b5061389b92915061389f565b5090565b5b8082111561389b57600081556001016138a0565b60006001600160401b038311156138cd576138cd61476c565b6040516138e4601f8501601f19166020018261470f565b8091508381528484840111156138f957600080fd5b83836020830137600060208583010152509392505050565b60008083601f840112613922578182fd5b5081356001600160401b03811115613938578182fd5b6020830191508360208260051b8501011115610c1057600080fd5b600082601f830112613963578081fd5b8135602061397082614600565b60405161397d828261470f565b8381528281019150858301600585901b8701840188101561399c578586fd5b855b858110156139ba5781358452928401929084019060010161399e565b5090979650505050505050565b600082601f8301126139d7578081fd5b611b99838335602085016138b4565b803563ffffffff811681146139fa57600080fd5b919050565b600060208284031215613a10578081fd5b8135611b9981614823565b600060208284031215613a2c578081fd5b8151611b9981614823565b60008060408385031215613a49578081fd5b8235613a5481614823565b91506020830135613a6481614823565b809150509250929050565b600080600080600060a08688031215613a86578081fd5b8535613a9181614823565b94506020860135613aa181614823565b935060408601356001600160401b0380821115613abc578283fd5b613ac889838a01613953565b94506060880135915080821115613add578283fd5b613ae989838a01613953565b93506080880135915080821115613afe578283fd5b50613b0b888289016139c7565b9150509295509295909350565b600080600080600060a08688031215613b2f578081fd5b8535613b3a81614823565b94506020860135613b4a81614823565b9350604086013592506060860135915060808601356001600160401b03811115613b72578182fd5b613b0b888289016139c7565b600080600060608486031215613b92578081fd5b8335613b9d81614823565b925060208401356001600160401b0380821115613bb8578283fd5b613bc487838801613953565b93506040860135915080821115613bd9578283fd5b50613be686828701613953565b9150509250925092565b60008060408385031215613c02578182fd5b8235613c0d81614823565b915060208301358015158114613a64578182fd5b60008060408385031215613c33578182fd5b8235613c3e81614823565b946020939093013593505050565b600080600060608486031215613c60578081fd5b8335613c6b81614823565b95602085013595506040909401359392505050565b60008060008060008060608789031215613c98578384fd5b86356001600160401b0380821115613cae578586fd5b613cba8a838b01613911565b90985096506020890135915080821115613cd2578586fd5b613cde8a838b01613911565b90965094506040890135915080821115613cf6578283fd5b50613d0389828a01613911565b979a9699509497509295939492505050565b60008060408385031215613d27578182fd5b82356001600160401b0380821115613d3d578384fd5b818501915085601f830112613d50578384fd5b81356020613d5d82614600565b604051613d6a828261470f565b8381528281019150858301600585901b870184018b1015613d89578889fd5b8896505b84871015613db4578035613da081614823565b835260019690960195918301918301613d8d565b5096505086013592505080821115613dca578283fd5b50613dd785828601613953565b9150509250929050565b600060208284031215613df2578081fd5b5035919050565b60008060408385031215613e0b578182fd5b823591506020830135613a6481614823565b600060208284031215613e2e578081fd5b8135611b9981614838565b600060208284031215613e4a578081fd5b8151611b9981614838565b600080600080600080600080600060a08a8c031215613e72578687fd5b89356001600160401b0380821115613e88578889fd5b818c0191508c601f830112613e9b578889fd5b813581811115613ea957898afd5b8d6020828501011115613eba57898afd5b60209283019b509950908b0135975060408b01359080821115613edb578485fd5b613ee78d838e01613911565b909850965060608c0135915080821115613eff578485fd5b613f0b8d838e01613911565b909650945060808c0135915080821115613f23578384fd5b50613f308c828d01613911565b915080935050809150509295985092959850929598565b600060208284031215613f58578081fd5b81356001600160401b03811115613f6d578182fd5b8201601f81018413613f7d578182fd5b613f8c848235602084016138b4565b949350505050565b60008060408385031215613fa6578182fd5b50508035926020909101359150565b600080600060608486031215613fc9578081fd5b83359250613fd9602085016139e6565b9150613fe7604085016139e6565b90509250925092565b600060208284031215614001578081fd5b611b99826139e6565b60006001600160fb1b0383111561401f578081fd5b8260051b80838637939093019283525090919050565b6000815180845260208085019450808401835b8381101561406457815187529582019590820190600101614048565b509495945050505050565b60008151808452614087816020860160208601614691565b601f01601f19169290920160200192915050565b6bffffffffffffffffffffffff198960601b16815287601482015260006140da6140d36140cc603485018a8c61400a565b878961400a565b848661400a565b9a9950505050505050505050565b60008083546140f6816146d4565b6001828116801561410e576001811461411f5761414b565b60ff1984168752828701945061414b565b8786526020808720875b858110156141425781548a820152908401908201614129565b50505082870194505b50929695505050505050565b60008251614169818460208701614691565b6c31b7b73a3930b1ba173539b7b760991b920191825250600d01919050565b6000825161419a818460208701614691565b6e3a37b5b2b717bdb4b23e973539b7b760891b920191825250600f01919050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516141f3816017850160208801614691565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614224816028840160208801614691565b01602801949350505050565b6001600160a01b0386811682528516602082015260a06040820181905260009061425c90830186614035565b828103606084015261426e8186614035565b90508281036080840152614282818561406f565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906142c89083018461406f565b979650505050505050565b602081526000611b996020830184614035565b6040815260006142f96040830185614035565b828103602084015261430b8185614035565b95945050505050565b602081016004831061433657634e487b7160e01b600052602160045260246000fd5b91905290565b602081526000611b99602083018461406f565b60006020808352818454614362816146d4565b808487015260406001808416600081146143835760018114614397576143c2565b60ff198516898401526060890195506143c2565b898852868820885b858110156143ba5781548b820186015290830190880161439f565b8a0184019650505b509398975050505050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b60208082526029908201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260408201526808185c1c1c9bdd995960ba1b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60006001600160401b038211156146195761461961476c565b5060051b60200190565b6000821982111561463657614636614756565b500190565b60008261465657634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561467557614675614756565b500290565b60008282101561468c5761468c614756565b500390565b60005b838110156146ac578181015183820152602001614694565b838111156124b55750506000910152565b6000816146cc576146cc614756565b506000190190565b600181811c908216806146e857607f821691505b6020821081141561470957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f191681016001600160401b03811182821017156147345761473461476c565b6040525050565b600060001982141561474f5761474f614756565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d111561479757600481823e5160e01c5b90565b600060443d10156147a85790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156147d757505050505090565b82850191508151818111156147ef5750505050505090565b843d87010160208285010111156148095750505050505090565b6148186020828601018761470f565b509095945050505050565b6001600160a01b03811681146109e057600080fd5b6001600160e01b0319811681146109e057600080fdfe71f3d55856e4058ed06ee057d79ada615f65cdf5f9ee88181b914225088f834fa2646970667358221220f4a1de97cf67fcee7bd2647ccfb2ec84d756f29ae0809f32d2c995d8759c556464736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004efb67498393531bd60dcc5b0c7056b59cfa3ec4000000000000000000000000859010baad3e7f51a5ef1e43550056ea29542fb000000000000000000000000038c339fd95a910386a79dca2d0bbb9cd617169d100000000000000000000000074f1716a9f452dd36d945368d806cd491290b24000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : signer_ (address): 0x4EfB67498393531bD60Dcc5b0c7056B59CfA3Ec4
Arg [1] : admin_ (address): 0x859010BaAD3E7f51A5EF1e43550056ea29542Fb0
Arg [2] : royaltyReceiver_ (address): 0x38c339fd95a910386A79DCa2D0BbB9Cd617169D1
Arg [3] : evoContract_ (address): 0x74F1716A9F452dD36d945368d806cD491290B240
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000004efb67498393531bd60dcc5b0c7056b59cfa3ec4
Arg [1] : 000000000000000000000000859010baad3e7f51a5ef1e43550056ea29542fb0
Arg [2] : 00000000000000000000000038c339fd95a910386a79dca2d0bbb9cd617169d1
Arg [3] : 00000000000000000000000074f1716a9f452dd36d945368d806cd491290b240
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
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.