ERC-1155
Overview
Max Total Supply
0 Pink
Holders
0
Total Transfers
-
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
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
MintpadERC1155Evolve
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@thirdweb-dev/contracts/base/ERC1155Base.sol"; // ========== External imports ========== // ========== Internal imports ========== import "@thirdweb-dev/contracts/lib/CurrencyTransferLib.sol"; import "@thirdweb-dev/contracts/lib/Strings.sol"; // ========== Features ========== import "@thirdweb-dev/contracts/extension/PrimarySale.sol"; import "@thirdweb-dev/contracts/extension/LazyMint.sol"; import "@thirdweb-dev/contracts/extension/PermissionsEnumerable.sol"; import "@thirdweb-dev/contracts/extension/Drop1155.sol"; import "../extension/TransactionFee.sol"; error TrxFeeError(); error AuthError(); error SupplyError(); error AmountError(); error PriceError(); contract MintpadERC1155Evolve is ERC1155Base, PrimarySale, LazyMint, PermissionsEnumerable, TransactionFee, Drop1155 { using Strings for uint256; /*/////////////////////////////////////////////////////////////// State variables //////////////////////////////////////////////////////////////*/ /// @dev Only transfers to or from TRANSFER_ROLE holders are valid, when transfers are restricted. bytes32 private transferRole; /// @dev Only MINTER_ROLE holders can sign off on `MintRequest`s and lazy mint tokens. bytes32 private minterRole; /// @dev Max bps in the thirdweb system. uint256 private constant MAX_BPS = 10_000; /// @dev The number to burn to get a evolved NFT uint256 public numberToBurn = 2; /// @dev The number to receive after burning `numberToBurn` NFTs uint256 public numberToReceive = 1; /*/////////////////////////////////////////////////////////////// Mappings //////////////////////////////////////////////////////////////*/ /// @dev Mapping from token ID => maximum possible total circulating supply of tokens with that ID. mapping(uint256 => uint256) public maxTotalSupply; /// @dev Mapping from token ID => the address of the recipient of primary sales. mapping(uint256 => address) public saleRecipient; constructor( address _defaultAdmin, string memory _name, string memory _symbol, address _saleRecipient, uint256 _transactionFee, address _royaltyRecipient, uint128 _royaltyBps ) ERC1155Base( _defaultAdmin, _name, _symbol, _royaltyRecipient, _royaltyBps ) { if (_transactionFee <= 0) { revert TrxFeeError(); } bytes32 _transferRole = keccak256("TRANSFER_ROLE"); bytes32 _minterRole = keccak256("MINTER_ROLE"); _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin); _setupRole(_minterRole, _defaultAdmin); _setupRole(_transferRole, _defaultAdmin); _setupRole(_transferRole, address(0)); _setupPrimarySaleRecipient(_saleRecipient); transferRole = _transferRole; minterRole = _minterRole; transactionFee = _transactionFee; } /*/////////////////////////////////////////////////////////////// Contract identifiers //////////////////////////////////////////////////////////////*/ function contractType() external pure returns (bytes32) { return bytes32("ERC1155Evolve"); } function contractVersion() external pure returns (uint8) { return uint8(1); } /// @dev Evolve x number of NFTs to an evolved NFT function evolve(address _owner, address _currency) external payable { require(_msgSender() == _owner || isApprovedForAll[_owner][_msgSender()], "!Auth"); require(balanceOf[_owner][0] >= numberToBurn, "!Tokens"); require(maxTotalSupply[1] == 0 || totalSupply[1] + numberToReceive <= maxTotalSupply[1], "!Supply"); if (_currency == CurrencyTransferLib.NATIVE_TOKEN) { if (msg.value != transactionFee) { revert PriceError(); } } _burn(_msgSender(), 0, numberToBurn); _mint(_msgSender(), 1, numberToReceive, ""); CurrencyTransferLib.transferCurrency(_currency, msg.sender, platformAddress, transactionFee); } /*////////////////////////////////////////////////////////////// Overriden ERC1155 logic //////////////////////////////////////////////////////////////*/ /// @dev Returns the uri for a given tokenId. function uri(uint256 _tokenId) public view override returns (string memory) { string memory batchUri = _getBaseURI(_tokenId); return string(abi.encodePacked(batchUri, _tokenId.toString())); } /*/////////////////////////////////////////////////////////////// Setter functions //////////////////////////////////////////////////////////////*/ /// @dev Lets a module admin set a max total supply for token. function setMaxTotalSupply(uint256 _tokenId, uint256 _maxTotalSupply) external onlyRole(DEFAULT_ADMIN_ROLE) { maxTotalSupply[_tokenId] = _maxTotalSupply; } /// @dev Lets a contract admin set the recipient for all primary sales. function setSaleRecipientForToken(uint256 _tokenId, address _saleRecipient) external onlyRole(DEFAULT_ADMIN_ROLE) { saleRecipient[_tokenId] = _saleRecipient; } /// @dev Set the number to burn to get a evolved NFT function setNumberToBurn(uint256 _amount) external onlyRole(DEFAULT_ADMIN_ROLE) { numberToBurn = _amount; } /// @dev Set the number to receive after burning `numberToBurn` NFTs function setNumberToReceive(uint256 _amount) external onlyRole(DEFAULT_ADMIN_ROLE) { numberToReceive = _amount; } /*////////////////////////////////////////////////////////////// Internal (overrideable) functions //////////////////////////////////////////////////////////////*/ /** * @notice Lets an authorized address lazy mint a given amount of NFTs. * * @param _amount The number of NFTs to lazy mint. * @param _baseURIForTokens The base URI for the 'n' number of NFTs being lazy minted, where the metadata for each * of those NFTs is `${baseURIForTokens}/${tokenId}`. * @param _data Additional bytes data to be used at the discretion of the consumer of the contract. * @return batchId A unique integer identifier for the batch of NFTs lazy minted together. */ function lazyMint( uint256 _amount, string calldata _baseURIForTokens, bytes calldata _data ) public virtual override returns (uint256 batchId) { if (!_canLazyMint()) { revert AuthError(); } if (_amount != 2) { revert AmountError(); } if (nextTokenIdToLazyMint != 0) { revert SupplyError(); } uint256 startId = nextTokenIdToLazyMint; (nextTokenIdToLazyMint, batchId) = _batchMintMetadata(startId, _amount, _baseURIForTokens); emit TokensLazyMinted(startId, startId + _amount - 1, _baseURIForTokens, _data); return batchId; } /// @dev Collects and distributes the primary sale value of NFTs being claimed. function collectPriceOnClaim( uint256 _tokenId, address _primarySaleRecipient, uint256 _quantityToClaim, address _currency, uint256 _pricePerToken ) internal virtual override { uint256 totalPrice = _pricePerToken > 0 ? _quantityToClaim * _pricePerToken : 0; if (_currency == CurrencyTransferLib.NATIVE_TOKEN) { if (msg.value != (totalPrice + transactionFee)) { revert PriceError(); } } if (_pricePerToken > 0) { CurrencyTransferLib.transferCurrency(_currency, msg.sender, _primarySaleRecipient, totalPrice); } CurrencyTransferLib.transferCurrency(_currency, msg.sender, platformAddress, transactionFee); } /// @dev Runs before every `claim` function call. function _beforeClaim( uint256 _tokenId, address, uint256 _quantity, address, uint256, AllowlistProof calldata, bytes memory ) internal view override { require(_tokenId == 0, "!Claimable"); require(maxTotalSupply[_tokenId] == 0 || totalSupply[_tokenId] + _quantity <= maxTotalSupply[_tokenId], "!Supply"); } /// @dev Transfers the NFTs being claimed. function transferTokensOnClaim( address _to, uint256 _tokenId, uint256 _quantityBeingClaimed ) internal override { _mint(_to, _tokenId, _quantityBeingClaimed, ""); } /// @dev Checks whether primary sale recipient can be set in the given execution context. function _canSetPrimarySaleRecipient() internal view override returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); } /// @dev Checks whether owner can be set in the given execution context. function _canSetOwner() internal view override returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); } /// @dev Checks whether royalty info can be set in the given execution context. function _canSetRoyaltyInfo() internal view override returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); } /// @dev Checks whether contract metadata can be set in the given execution context. function _canSetContractURI() internal view override returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); } /// @dev Checks whether platform fee info can be set in the given execution context. function _canSetClaimConditions() internal view override returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); } /// @dev Returns whether lazy minting can be done in the given execution context. function _canLazyMint() internal view virtual override returns (bool) { return hasRole(minterRole, _msgSender()); } /*/////////////////////////////////////////////////////////////// Miscellaneous //////////////////////////////////////////////////////////////*/ /// @dev The tokenId of the next NFT that will be minted / lazy minted. function nextTokenIdToMint() public view virtual override returns (uint256) { return nextTokenIdToLazyMint; } function _dropMsgSender() internal view virtual override returns (address) { return _msgSender(); } function _msgSender() internal view virtual override returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: Apache 2.0 pragma solidity ^0.8.0; error TrxErrorAuth(); error TrxErrorFee1(); error TrxErrorFee2(); /// @author Mintpad abstract contract TransactionFee { /// @dev Platform wallet address address public platformAddress = 0x4ec431790805909b0D3Dcf5C8dA25FCBF46E93F8; /// @dev Transaction cost uint256 public transactionFee; /// @dev At any given moment, returns the transaction fee. function getTransactionFee() public view returns (uint256) { return transactionFee; } /** * @notice Sets a new transaction fee in case of need. * @dev This function is only used in rare situations where * the transaction fee is not set correctly. This value can * only be lower than the current transaction fee to prevent * fraud. Only Mintpad can set this transaction fee. * * @param _transactionFee The transaction fee to be set. */ function setTransactionFee(uint256 _transactionFee) external { if (msg.sender != platformAddress) { revert TrxErrorAuth(); } if (_transactionFee > transactionFee) { revert TrxErrorFee1(); } if (_transactionFee <= 0) { revert TrxErrorFee2(); } transactionFee = _transactionFee; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import { ERC1155 } from "../eip/ERC1155.sol"; import "../extension/ContractMetadata.sol"; import "../extension/Multicall.sol"; import "../extension/Ownable.sol"; import "../extension/Royalty.sol"; import "../extension/BatchMintMetadata.sol"; import "../lib/Strings.sol"; /** * The `ERC1155Base` smart contract implements the ERC1155 NFT standard. * It includes the following additions to standard ERC1155 logic: * * - Ability to mint NFTs via the provided `mintTo` and `batchMintTo` functions. * * - Contract metadata for royalty support on platforms such as OpenSea that use * off-chain information to distribute roaylties. * * - Ownership of the contract, with the ability to restrict certain functions to * only be called by the contract's owner. * * - Multicall capability to perform multiple actions atomically * * - EIP 2981 compliance for royalty support on NFT marketplaces. */ contract ERC1155Base is ERC1155, ContractMetadata, Ownable, Royalty, Multicall, BatchMintMetadata { using Strings for uint256; /*////////////////////////////////////////////////////////////// State variables //////////////////////////////////////////////////////////////*/ /// @dev The tokenId of the next NFT to mint. uint256 internal nextTokenIdToMint_; /*////////////////////////////////////////////////////////////// Mappings //////////////////////////////////////////////////////////////*/ /** * @notice Returns the total supply of NFTs of a given tokenId * @dev Mapping from tokenId => total circulating supply of NFTs of that tokenId. */ mapping(uint256 => uint256) public totalSupply; /*////////////////////////////////////////////////////////////// Constructor //////////////////////////////////////////////////////////////*/ constructor( address _defaultAdmin, string memory _name, string memory _symbol, address _royaltyRecipient, uint128 _royaltyBps ) ERC1155(_name, _symbol) { _setupOwner(_defaultAdmin); _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps); } /*////////////////////////////////////////////////////////////// Overriden metadata logic //////////////////////////////////////////////////////////////*/ /// @notice Returns the metadata URI for the given tokenId. /// @param _tokenId The tokenId of the token for which a URI should be returned. /// @return The metadata URI for the given tokenId. function uri(uint256 _tokenId) public view virtual override returns (string memory) { string memory uriForToken = _uri[_tokenId]; if (bytes(uriForToken).length > 0) { return uriForToken; } string memory batchUri = _getBaseURI(_tokenId); return string(abi.encodePacked(batchUri, _tokenId.toString())); } /*////////////////////////////////////////////////////////////// Mint / burn logic //////////////////////////////////////////////////////////////*/ /** * @notice Lets an authorized address mint NFTs to a recipient. * @dev - The logic in the `_canMint` function determines whether the caller is authorized to mint NFTs. * - If `_tokenId == type(uint256).max` a new NFT at tokenId `nextTokenIdToMint` is minted. If the given * `tokenId < nextTokenIdToMint`, then additional supply of an existing NFT is being minted. * * @param _to The recipient of the NFTs to mint. * @param _tokenId The tokenId of the NFT to mint. * @param _tokenURI The full metadata URI for the NFTs minted (if a new NFT is being minted). * @param _amount The amount of the same NFT to mint. */ function mintTo(address _to, uint256 _tokenId, string memory _tokenURI, uint256 _amount) public virtual { require(_canMint(), "Not authorized to mint."); uint256 tokenIdToMint; uint256 nextIdToMint = nextTokenIdToMint(); if (_tokenId == type(uint256).max) { tokenIdToMint = nextIdToMint; nextTokenIdToMint_ += 1; _setTokenURI(nextIdToMint, _tokenURI); } else { require(_tokenId < nextIdToMint, "invalid id"); tokenIdToMint = _tokenId; } _mint(_to, tokenIdToMint, _amount, ""); } /** * @notice Lets an authorized address mint multiple NEW NFTs at once to a recipient. * @dev The logic in the `_canMint` function determines whether the caller is authorized to mint NFTs. * If `_tokenIds[i] == type(uint256).max` a new NFT at tokenId `nextTokenIdToMint` is minted. If the given * `tokenIds[i] < nextTokenIdToMint`, then additional supply of an existing NFT is minted. * The metadata for each new NFT is stored at `baseURI/{tokenID of NFT}` * * @param _to The recipient of the NFT to mint. * @param _tokenIds The tokenIds of the NFTs to mint. * @param _amounts The amounts of each NFT to mint. * @param _baseURI The baseURI for the `n` number of NFTs minted. The metadata for each NFT is `baseURI/tokenId` */ function batchMintTo( address _to, uint256[] memory _tokenIds, uint256[] memory _amounts, string memory _baseURI ) public virtual { require(_canMint(), "Not authorized to mint."); require(_amounts.length > 0, "Minting zero tokens."); require(_tokenIds.length == _amounts.length, "Length mismatch."); uint256 nextIdToMint = nextTokenIdToMint(); uint256 startNextIdToMint = nextIdToMint; uint256 numOfNewNFTs; for (uint256 i = 0; i < _tokenIds.length; i += 1) { if (_tokenIds[i] == type(uint256).max) { _tokenIds[i] = nextIdToMint; nextIdToMint += 1; numOfNewNFTs += 1; } else { require(_tokenIds[i] < nextIdToMint, "invalid id"); } } if (numOfNewNFTs > 0) { _batchMintMetadata(startNextIdToMint, numOfNewNFTs, _baseURI); } nextTokenIdToMint_ = nextIdToMint; _mintBatch(_to, _tokenIds, _amounts, ""); } /** * @notice Lets an owner or approved operator burn NFTs of the given tokenId. * * @param _owner The owner of the NFT to burn. * @param _tokenId The tokenId of the NFT to burn. * @param _amount The amount of the NFT to burn. */ function burn(address _owner, uint256 _tokenId, uint256 _amount) external virtual { address caller = msg.sender; require(caller == _owner || isApprovedForAll[_owner][caller], "Unapproved caller"); require(balanceOf[_owner][_tokenId] >= _amount, "Not enough tokens owned"); _burn(_owner, _tokenId, _amount); } /** * @notice Lets an owner or approved operator burn NFTs of the given tokenIds. * * @param _owner The owner of the NFTs to burn. * @param _tokenIds The tokenIds of the NFTs to burn. * @param _amounts The amounts of the NFTs to burn. */ function burnBatch(address _owner, uint256[] memory _tokenIds, uint256[] memory _amounts) external virtual { address caller = msg.sender; require(caller == _owner || isApprovedForAll[_owner][caller], "Unapproved caller"); require(_tokenIds.length == _amounts.length, "Length mismatch"); for (uint256 i = 0; i < _tokenIds.length; i += 1) { require(balanceOf[_owner][_tokenIds[i]] >= _amounts[i], "Not enough tokens owned"); } _burnBatch(_owner, _tokenIds, _amounts); } /*////////////////////////////////////////////////////////////// ERC165 Logic //////////////////////////////////////////////////////////////*/ /** * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165 * @inheritdoc IERC165 */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, IERC165) returns (bool) { return interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165 interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155 interfaceId == 0x0e89341c || // ERC165 Interface ID for ERC1155MetadataURI interfaceId == type(IERC2981).interfaceId; // ERC165 ID for ERC2981 } /*////////////////////////////////////////////////////////////// View functions //////////////////////////////////////////////////////////////*/ /// @notice The tokenId assigned to the next new NFT to be minted. function nextTokenIdToMint() public view virtual returns (uint256) { return nextTokenIdToMint_; } /*////////////////////////////////////////////////////////////// Internal (overrideable) functions //////////////////////////////////////////////////////////////*/ /// @dev Returns whether contract metadata can be set in the given execution context. /// @return Whether contract metadata can be set in the given execution context. function _canSetContractURI() internal view virtual override returns (bool) { return msg.sender == owner(); } /// @dev Returns whether a token can be minted in the given execution context. /// @return Whether a token can be minted in the given execution context. function _canMint() internal view virtual returns (bool) { return msg.sender == owner(); } /// @dev Returns whether owner can be set in the given execution context. /// @return Whether owner can be set in the given execution context. function _canSetOwner() internal view virtual override returns (bool) { return msg.sender == owner(); } /// @dev Returns whether royalty info can be set in the given execution context. /// @return Whether royalty info can be set in the given execution context. function _canSetRoyaltyInfo() internal view virtual override returns (bool) { return msg.sender == owner(); } /// @dev Runs before every token transfer / mint / burn. /// @param operator The address of the caller. /// @param from The address of the sender. /// @param to The address of the recipient. /// @param ids The tokenIds of the tokens being transferred. /// @param amounts The amounts of the tokens being transferred. /// @param data Additional data with no specified format. 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) { totalSupply[ids[i]] -= amounts[i]; } } } }
// SPDX-License-Identifier: Apache 2.0 pragma solidity ^0.8.0; import "./interface/IERC1155.sol"; import "./interface/IERC1155Metadata.sol"; import "./interface/IERC1155Receiver.sol"; contract ERC1155 is IERC1155, IERC1155Metadata { /*////////////////////////////////////////////////////////////// State variables //////////////////////////////////////////////////////////////*/ string public name; string public symbol; /*////////////////////////////////////////////////////////////// Mappings //////////////////////////////////////////////////////////////*/ mapping(address => mapping(uint256 => uint256)) public balanceOf; mapping(address => mapping(address => bool)) public isApprovedForAll; mapping(uint256 => string) internal _uri; /*////////////////////////////////////////////////////////////// Constructor //////////////////////////////////////////////////////////////*/ constructor(string memory _name, string memory _symbol) { name = _name; symbol = _symbol; } /*////////////////////////////////////////////////////////////// View functions //////////////////////////////////////////////////////////////*/ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165 interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155 interfaceId == 0x0e89341c; // ERC165 Interface ID for ERC1155MetadataURI } function uri(uint256 tokenId) public view virtual override returns (string memory) { return _uri[tokenId]; } function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "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; } /*////////////////////////////////////////////////////////////// ERC1155 logic //////////////////////////////////////////////////////////////*/ function setApprovalForAll(address operator, bool approved) public virtual override { address owner = msg.sender; require(owner != operator, "APPROVING_SELF"); isApprovedForAll[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require(from == msg.sender || isApprovedForAll[from][msg.sender], "!OWNER_OR_APPROVED"); _safeTransferFrom(from, to, id, amount, data); } function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require(from == msg.sender || isApprovedForAll[from][msg.sender], "!OWNER_OR_APPROVED"); _safeBatchTransferFrom(from, to, ids, amounts, data); } /*////////////////////////////////////////////////////////////// Internal logic //////////////////////////////////////////////////////////////*/ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "TO_ZERO_ADDR"); address operator = msg.sender; _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data); uint256 fromBalance = balanceOf[from][id]; require(fromBalance >= amount, "INSUFFICIENT_BAL"); unchecked { balanceOf[from][id] = fromBalance - amount; } balanceOf[to][id] += amount; emit TransferSingle(operator, from, to, id, amount); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "LENGTH_MISMATCH"); require(to != address(0), "TO_ZERO_ADDR"); address operator = msg.sender; _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 = balanceOf[from][id]; require(fromBalance >= amount, "INSUFFICIENT_BAL"); unchecked { balanceOf[from][id] = fromBalance - amount; } balanceOf[to][id] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } function _setTokenURI(uint256 tokenId, string memory newuri) internal virtual { _uri[tokenId] = newuri; } function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual { require(to != address(0), "TO_ZERO_ADDR"); address operator = msg.sender; _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data); balanceOf[to][id] += amount; emit TransferSingle(operator, address(0), to, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "TO_ZERO_ADDR"); require(ids.length == amounts.length, "LENGTH_MISMATCH"); address operator = msg.sender; _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { balanceOf[to][ids[i]] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } function _burn(address from, uint256 id, uint256 amount) internal virtual { require(from != address(0), "FROM_ZERO_ADDR"); address operator = msg.sender; _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); uint256 fromBalance = balanceOf[from][id]; require(fromBalance >= amount, "INSUFFICIENT_BAL"); unchecked { balanceOf[from][id] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); } function _burnBatch(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual { require(from != address(0), "FROM_ZERO_ADDR"); require(ids.length == amounts.length, "LENGTH_MISMATCH"); address operator = msg.sender; _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 = balanceOf[from][id]; require(fromBalance >= amount, "INSUFFICIENT_BAL"); unchecked { balanceOf[from][id] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); } function _beforeTokenTransfer( 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.code.length > 0) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("TOKENS_REJECTED"); } } catch Error(string memory reason) { revert(reason); } catch { revert("!ERC1155RECEIVER"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.code.length > 0) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("TOKENS_REJECTED"); } } catch Error(string memory reason) { revert(reason); } catch { revert("!ERC1155RECEIVER"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /** @title ERC-1155 Multi Token Standard @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md Note: The ERC-165 identifier for this interface is 0xd9b67a26. */ interface IERC1155 { /** @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be msg.sender. The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_id` argument MUST be the token type being transferred. The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). */ event TransferSingle( address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value ); /** @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be msg.sender. The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_ids` argument MUST be the list of tokens being transferred. The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). */ event TransferBatch( address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values ); /** @dev MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absense of an event assumes disabled). */ event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); /** @dev MUST emit when the URI is updated for a token ID. URIs are defined in RFC 3986. The URI MUST point a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema". */ event URI(string _value, uint256 indexed _id); /** @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if balance of holder for token `_id` is lower than the `_value` sent. MUST revert on any other error. MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard). After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _id ID of the token type @param _value Transfer amount @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to` */ function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external; /** @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if length of `_ids` is not the same as length of `_values`. MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient. MUST revert on any other error. MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard). Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc). After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _ids IDs of each token type (order and length must match _values array) @param _values Transfer amounts per token type (order and length must match _ids array) @param _data Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to` */ function safeBatchTransferFrom( address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data ) external; /** @notice Get the balance of an account's Tokens. @param _owner The address of the token holder @param _id ID of the Token @return The _owner's balance of the Token type requested */ function balanceOf(address _owner, uint256 _id) external view returns (uint256); /** @notice Get the balance of multiple account/token pairs @param _owners The addresses of the token holders @param _ids ID of the Tokens @return The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair) */ function balanceOfBatch( address[] calldata _owners, uint256[] calldata _ids ) external view returns (uint256[] memory); /** @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens. @dev MUST emit the ApprovalForAll event on success. @param _operator Address to add to the set of authorized operators @param _approved True if the operator is approved, false to revoke approval */ function setApprovalForAll(address _operator, bool _approved) external; /** @notice Queries the approval status of an operator for a given owner. @param _owner The owner of the Tokens @param _operator Address of authorized operator @return True if the operator is approved, false if not */ function isApprovedForAll(address _owner, address _operator) external view returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /** Note: The ERC-165 identifier for this interface is 0x0e89341c. */ interface IERC1155Metadata { /** @notice A distinct Uniform Resource Identifier (URI) for a given token. @dev URIs are defined in RFC 3986. The URI may point to a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema". @return URI string */ function uri(uint256 _id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "./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 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * [EIP](https://eips.ethereum.org/EIPS/eip-165). * * 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 * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: Apache 2.0 pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be payed in that same unit of exchange. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * @title Batch-mint Metadata * @notice The `BatchMintMetadata` is a contract extension for any base NFT contract. It lets the smart contract * using this extension set metadata for `n` number of NFTs all at once. This is enabled by storing a single * base URI for a batch of `n` NFTs, where the metadata for each NFT in a relevant batch is `baseURI/tokenId`. */ contract BatchMintMetadata { /// @dev Largest tokenId of each batch of tokens with the same baseURI + 1 {ex: batchId 100 at position 0 includes tokens 0-99} uint256[] private batchIds; /// @dev Mapping from id of a batch of tokens => to base URI for the respective batch of tokens. mapping(uint256 => string) private baseURI; /// @dev Mapping from id of a batch of tokens => to whether the base URI for the respective batch of tokens is frozen. mapping(uint256 => bool) public batchFrozen; /// @dev This event emits when the metadata of all tokens are frozen. /// While not currently supported by marketplaces, this event allows /// future indexing if desired. event MetadataFrozen(); // @dev This event emits when the metadata of a range of tokens is updated. /// So that the third-party platforms such as NFT market could /// timely update the images and related attributes of the NFTs. event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); /** * @notice Returns the count of batches of NFTs. * @dev Each batch of tokens has an in ID and an associated `baseURI`. * See {batchIds}. */ function getBaseURICount() public view returns (uint256) { return batchIds.length; } /** * @notice Returns the ID for the batch of tokens at the given index. * @dev See {getBaseURICount}. * @param _index Index of the desired batch in batchIds array. */ function getBatchIdAtIndex(uint256 _index) public view returns (uint256) { if (_index >= getBaseURICount()) { revert("Invalid index"); } return batchIds[_index]; } /// @dev Returns the id for the batch of tokens the given tokenId belongs to. function _getBatchId(uint256 _tokenId) internal view returns (uint256 batchId, uint256 index) { uint256 numOfTokenBatches = getBaseURICount(); uint256[] memory indices = batchIds; for (uint256 i = 0; i < numOfTokenBatches; i += 1) { if (_tokenId < indices[i]) { index = i; batchId = indices[i]; return (batchId, index); } } revert("Invalid tokenId"); } /// @dev Returns the baseURI for a token. The intended metadata URI for the token is baseURI + tokenId. function _getBaseURI(uint256 _tokenId) internal view returns (string memory) { uint256 numOfTokenBatches = getBaseURICount(); uint256[] memory indices = batchIds; for (uint256 i = 0; i < numOfTokenBatches; i += 1) { if (_tokenId < indices[i]) { return baseURI[indices[i]]; } } revert("Invalid tokenId"); } /// @dev returns the starting tokenId of a given batchId. function _getBatchStartId(uint256 _batchID) internal view returns (uint256) { uint256 numOfTokenBatches = getBaseURICount(); uint256[] memory indices = batchIds; for (uint256 i = 0; i < numOfTokenBatches; i++) { if (_batchID == indices[i]) { if (i > 0) { return indices[i - 1]; } return 0; } } revert("Invalid batchId"); } /// @dev Sets the base URI for the batch of tokens with the given batchId. function _setBaseURI(uint256 _batchId, string memory _baseURI) internal { require(!batchFrozen[_batchId], "Batch frozen"); baseURI[_batchId] = _baseURI; emit BatchMetadataUpdate(_getBatchStartId(_batchId), _batchId); } /// @dev Freezes the base URI for the batch of tokens with the given batchId. function _freezeBaseURI(uint256 _batchId) internal { string memory baseURIForBatch = baseURI[_batchId]; require(bytes(baseURIForBatch).length > 0, "Invalid batch"); batchFrozen[_batchId] = true; emit MetadataFrozen(); } /// @dev Mints a batch of tokenIds and associates a common baseURI to all those Ids. function _batchMintMetadata( uint256 _startId, uint256 _amountToMint, string memory _baseURIForTokens ) internal returns (uint256 nextTokenIdToMint, uint256 batchId) { batchId = _startId + _amountToMint; nextTokenIdToMint = batchId; batchIds.push(batchId); baseURI[batchId] = _baseURIForTokens; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./interface/IContractMetadata.sol"; /** * @title Contract Metadata * @notice Thirdweb's `ContractMetadata` is a contract extension for any base contracts. It lets you set a metadata URI * for you contract. * Additionally, `ContractMetadata` is necessary for NFT contracts that want royalties to get distributed on OpenSea. */ abstract contract ContractMetadata is IContractMetadata { /// @notice Returns the contract metadata URI. string public override contractURI; /** * @notice Lets a contract admin set the URI for contract-level metadata. * @dev Caller should be authorized to setup contractURI, e.g. contract admin. * See {_canSetContractURI}. * Emits {ContractURIUpdated Event}. * * @param _uri keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") */ function setContractURI(string memory _uri) external override { if (!_canSetContractURI()) { revert("Not authorized"); } _setupContractURI(_uri); } /// @dev Lets a contract admin set the URI for contract-level metadata. function _setupContractURI(string memory _uri) internal { string memory prevURI = contractURI; contractURI = _uri; emit ContractURIUpdated(prevURI, _uri); } /// @dev Returns whether contract metadata can be set in the given execution context. function _canSetContractURI() internal view virtual returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./interface/IDrop1155.sol"; import "../lib/MerkleProof.sol"; abstract contract Drop1155 is IDrop1155 { /*/////////////////////////////////////////////////////////////// State variables //////////////////////////////////////////////////////////////*/ /// @dev Mapping from token ID => the set of all claim conditions, at any given moment, for tokens of the token ID. mapping(uint256 => ClaimConditionList) public claimCondition; /*/////////////////////////////////////////////////////////////// Drop logic //////////////////////////////////////////////////////////////*/ /// @dev Lets an account claim tokens. function claim( address _receiver, uint256 _tokenId, uint256 _quantity, address _currency, uint256 _pricePerToken, AllowlistProof calldata _allowlistProof, bytes memory _data ) public payable virtual override { _beforeClaim(_tokenId, _receiver, _quantity, _currency, _pricePerToken, _allowlistProof, _data); uint256 activeConditionId = getActiveClaimConditionId(_tokenId); verifyClaim( activeConditionId, _dropMsgSender(), _tokenId, _quantity, _currency, _pricePerToken, _allowlistProof ); // Update contract state. claimCondition[_tokenId].conditions[activeConditionId].supplyClaimed += _quantity; claimCondition[_tokenId].supplyClaimedByWallet[activeConditionId][_dropMsgSender()] += _quantity; // If there's a price, collect price. collectPriceOnClaim(_tokenId, address(0), _quantity, _currency, _pricePerToken); // Mint the relevant NFTs to claimer. transferTokensOnClaim(_receiver, _tokenId, _quantity); emit TokensClaimed(activeConditionId, _dropMsgSender(), _receiver, _tokenId, _quantity); _afterClaim(_tokenId, _receiver, _quantity, _currency, _pricePerToken, _allowlistProof, _data); } /// @dev Lets a contract admin set claim conditions. function setClaimConditions( uint256 _tokenId, ClaimCondition[] calldata _conditions, bool _resetClaimEligibility ) external virtual override { if (!_canSetClaimConditions()) { revert("Not authorized"); } ClaimConditionList storage conditionList = claimCondition[_tokenId]; uint256 existingStartIndex = conditionList.currentStartId; uint256 existingPhaseCount = conditionList.count; /** * The mapping `supplyClaimedByWallet` uses a claim condition's UID as a key. * * If `_resetClaimEligibility == true`, we assign completely new UIDs to the claim * conditions in `_conditions`, effectively resetting the restrictions on claims expressed * by `supplyClaimedByWallet`. */ uint256 newStartIndex = existingStartIndex; if (_resetClaimEligibility) { newStartIndex = existingStartIndex + existingPhaseCount; } conditionList.count = _conditions.length; conditionList.currentStartId = newStartIndex; uint256 lastConditionStartTimestamp; for (uint256 i = 0; i < _conditions.length; i++) { require(i == 0 || lastConditionStartTimestamp < _conditions[i].startTimestamp, "ST"); uint256 supplyClaimedAlready = conditionList.conditions[newStartIndex + i].supplyClaimed; if (supplyClaimedAlready > _conditions[i].maxClaimableSupply) { revert("max supply claimed"); } conditionList.conditions[newStartIndex + i] = _conditions[i]; conditionList.conditions[newStartIndex + i].supplyClaimed = supplyClaimedAlready; lastConditionStartTimestamp = _conditions[i].startTimestamp; } /** * Gas refunds (as much as possible) * * If `_resetClaimEligibility == true`, we assign completely new UIDs to the claim * conditions in `_conditions`. So, we delete claim conditions with UID < `newStartIndex`. * * If `_resetClaimEligibility == false`, and there are more existing claim conditions * than in `_conditions`, we delete the existing claim conditions that don't get replaced * by the conditions in `_conditions`. */ if (_resetClaimEligibility) { for (uint256 i = existingStartIndex; i < newStartIndex; i++) { delete conditionList.conditions[i]; } } else { if (existingPhaseCount > _conditions.length) { for (uint256 i = _conditions.length; i < existingPhaseCount; i++) { delete conditionList.conditions[newStartIndex + i]; } } } emit ClaimConditionsUpdated(_tokenId, _conditions, _resetClaimEligibility); } /// @dev Checks a request to claim NFTs against the active claim condition's criteria. function verifyClaim( uint256 _conditionId, address _claimer, uint256 _tokenId, uint256 _quantity, address _currency, uint256 _pricePerToken, AllowlistProof calldata _allowlistProof ) public view virtual returns (bool isOverride) { ClaimCondition memory currentClaimPhase = claimCondition[_tokenId].conditions[_conditionId]; uint256 claimLimit = currentClaimPhase.quantityLimitPerWallet; uint256 claimPrice = currentClaimPhase.pricePerToken; address claimCurrency = currentClaimPhase.currency; /* * Here `isOverride` implies that if the merkle proof verification fails, * the claimer would claim through open claim limit instead of allowlisted limit. */ if (currentClaimPhase.merkleRoot != bytes32(0)) { (isOverride, ) = MerkleProof.verify( _allowlistProof.proof, currentClaimPhase.merkleRoot, keccak256( abi.encodePacked( _claimer, _allowlistProof.quantityLimitPerWallet, _allowlistProof.pricePerToken, _allowlistProof.currency ) ) ); } if (isOverride) { claimLimit = _allowlistProof.quantityLimitPerWallet != 0 ? _allowlistProof.quantityLimitPerWallet : claimLimit; claimPrice = _allowlistProof.pricePerToken != type(uint256).max ? _allowlistProof.pricePerToken : claimPrice; claimCurrency = _allowlistProof.pricePerToken != type(uint256).max && _allowlistProof.currency != address(0) ? _allowlistProof.currency : claimCurrency; } uint256 supplyClaimedByWallet = claimCondition[_tokenId].supplyClaimedByWallet[_conditionId][_claimer]; if (_currency != claimCurrency || _pricePerToken != claimPrice) { revert("!PriceOrCurrency"); } if (_quantity == 0 || (_quantity + supplyClaimedByWallet > claimLimit)) { revert("!Qty"); } if (currentClaimPhase.supplyClaimed + _quantity > currentClaimPhase.maxClaimableSupply) { revert("!MaxSupply"); } if (currentClaimPhase.startTimestamp > block.timestamp) { revert("cant claim yet"); } } /// @dev At any given moment, returns the uid for the active claim condition. function getActiveClaimConditionId(uint256 _tokenId) public view returns (uint256) { ClaimConditionList storage conditionList = claimCondition[_tokenId]; for (uint256 i = conditionList.currentStartId + conditionList.count; i > conditionList.currentStartId; i--) { if (block.timestamp >= conditionList.conditions[i - 1].startTimestamp) { return i - 1; } } revert("!CONDITION."); } /// @dev Returns the claim condition at the given uid. function getClaimConditionById( uint256 _tokenId, uint256 _conditionId ) external view returns (ClaimCondition memory condition) { condition = claimCondition[_tokenId].conditions[_conditionId]; } /// @dev Returns the supply claimed by claimer for a given conditionId. function getSupplyClaimedByWallet( uint256 _tokenId, uint256 _conditionId, address _claimer ) public view returns (uint256 supplyClaimedByWallet) { supplyClaimedByWallet = claimCondition[_tokenId].supplyClaimedByWallet[_conditionId][_claimer]; } /*//////////////////////////////////////////////////////////////////// Optional hooks that can be implemented in the derived contract ///////////////////////////////////////////////////////////////////*/ /// @dev Exposes the ability to override the msg sender. function _dropMsgSender() internal virtual returns (address) { return msg.sender; } /// @dev Runs before every `claim` function call. function _beforeClaim( uint256 _tokenId, address _receiver, uint256 _quantity, address _currency, uint256 _pricePerToken, AllowlistProof calldata _allowlistProof, bytes memory _data ) internal virtual {} /// @dev Runs after every `claim` function call. function _afterClaim( uint256 _tokenId, address _receiver, uint256 _quantity, address _currency, uint256 _pricePerToken, AllowlistProof calldata _allowlistProof, bytes memory _data ) internal virtual {} /*/////////////////////////////////////////////////////////////// Virtual functions: to be implemented in derived contract //////////////////////////////////////////////////////////////*/ /// @dev Collects and distributes the primary sale value of NFTs being claimed. function collectPriceOnClaim( uint256 _tokenId, address _primarySaleRecipient, uint256 _quantityToClaim, address _currency, uint256 _pricePerToken ) internal virtual; /// @dev Transfers the NFTs being claimed. function transferTokensOnClaim(address _to, uint256 _tokenId, uint256 _quantityBeingClaimed) internal virtual; /// @dev Determine what wallet can update claim conditions function _canSetClaimConditions() internal view virtual returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./interface/ILazyMint.sol"; import "./BatchMintMetadata.sol"; /** * The `LazyMint` is a contract extension for any base NFT contract. It lets you 'lazy mint' any number of NFTs * at once. Here, 'lazy mint' means defining the metadata for particular tokenIds of your NFT contract, without actually * minting a non-zero balance of NFTs of those tokenIds. */ abstract contract LazyMint is ILazyMint, BatchMintMetadata { /// @notice The tokenId assigned to the next new NFT to be lazy minted. uint256 internal nextTokenIdToLazyMint; /** * @notice Lets an authorized address lazy mint a given amount of NFTs. * * @param _amount The number of NFTs to lazy mint. * @param _baseURIForTokens The base URI for the 'n' number of NFTs being lazy minted, where the metadata for each * of those NFTs is `${baseURIForTokens}/${tokenId}`. * @param _data Additional bytes data to be used at the discretion of the consumer of the contract. * @return batchId A unique integer identifier for the batch of NFTs lazy minted together. */ function lazyMint( uint256 _amount, string calldata _baseURIForTokens, bytes calldata _data ) public virtual override returns (uint256 batchId) { if (!_canLazyMint()) { revert("Not authorized"); } if (_amount == 0) { revert("0 amt"); } uint256 startId = nextTokenIdToLazyMint; (nextTokenIdToLazyMint, batchId) = _batchMintMetadata(startId, _amount, _baseURIForTokens); emit TokensLazyMinted(startId, startId + _amount - 1, _baseURIForTokens, _data); return batchId; } /// @dev Returns whether lazy minting can be performed in the given execution context. function _canLazyMint() internal view virtual returns (bool); }
// SPDX-License-Identifier: Apache 2.0 pragma solidity ^0.8.0; /// @author thirdweb import "../lib/Address.sol"; import "./interface/IMulticall.sol"; /** * @dev Provides a function to batch together multiple calls in a single external call. * * _Available since v4.1._ */ contract Multicall is IMulticall { /** * @notice Receives and executes a batch of function calls on this contract. * @dev Receives and executes a batch of function calls on this contract. * * @param data The bytes data that makes up the batch of function calls to execute. * @return results The bytes data that makes up the result of the batch of function calls executed. */ function multicall(bytes[] calldata data) external returns (bytes[] memory results) { results = new bytes[](data.length); address sender = _msgSender(); bool isForwarder = msg.sender != sender; for (uint256 i = 0; i < data.length; i++) { if (isForwarder) { results[i] = Address.functionDelegateCall(address(this), abi.encodePacked(data[i], sender)); } else { results[i] = Address.functionDelegateCall(address(this), data[i]); } } return results; } /// @notice Returns the sender in the given execution context. function _msgSender() internal view virtual returns (address) { return msg.sender; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./interface/IOwnable.sol"; /** * @title Ownable * @notice Thirdweb's `Ownable` is a contract extension to be used with any base contract. It exposes functions for setting and reading * who the 'owner' of the inheriting smart contract is, and lets the inheriting contract perform conditional logic that uses * information about who the contract's owner is. */ abstract contract Ownable is IOwnable { /// @dev Owner of the contract (purpose: OpenSea compatibility) address private _owner; /// @dev Reverts if caller is not the owner. modifier onlyOwner() { if (msg.sender != _owner) { revert("Not authorized"); } _; } /** * @notice Returns the owner of the contract. */ function owner() public view override returns (address) { return _owner; } /** * @notice Lets an authorized wallet set a new owner for the contract. * @param _newOwner The address to set as the new owner of the contract. */ function setOwner(address _newOwner) external override { if (!_canSetOwner()) { revert("Not authorized"); } _setupOwner(_newOwner); } /// @dev Lets a contract admin set a new owner for the contract. The new owner must be a contract admin. function _setupOwner(address _newOwner) internal { address _prevOwner = _owner; _owner = _newOwner; emit OwnerUpdated(_prevOwner, _newOwner); } /// @dev Returns whether owner can be set in the given execution context. function _canSetOwner() internal view virtual returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./interface/IPermissions.sol"; import "../lib/Strings.sol"; /** * @title Permissions * @dev This contracts provides extending-contracts with role-based access control mechanisms */ contract Permissions is IPermissions { /// @dev Map from keccak256 hash of a role => a map from address => whether address has role. mapping(bytes32 => mapping(address => bool)) private _hasRole; /// @dev Map from keccak256 hash of a role to role admin. See {getRoleAdmin}. mapping(bytes32 => bytes32) private _getRoleAdmin; /// @dev Default admin role for all roles. Only accounts with this role can grant/revoke other roles. bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /// @dev Modifier that checks if an account has the specified role; reverts otherwise. modifier onlyRole(bytes32 role) { _checkRole(role, msg.sender); _; } /** * @notice Checks whether an account has a particular role. * @dev Returns `true` if `account` has been granted `role`. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account for which the role is being checked. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _hasRole[role][account]; } /** * @notice Checks whether an account has a particular role; * role restrictions can be swtiched on and off. * * @dev Returns `true` if `account` has been granted `role`. * Role restrictions can be swtiched on and off: * - If address(0) has ROLE, then the ROLE restrictions * don't apply. * - If address(0) does not have ROLE, then the ROLE * restrictions will apply. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account for which the role is being checked. */ function hasRoleWithSwitch(bytes32 role, address account) public view returns (bool) { if (!_hasRole[role][address(0)]) { return _hasRole[role][account]; } return true; } /** * @notice Returns the admin role that controls the specified role. * @dev See {grantRole} and {revokeRole}. * To change a role's admin, use {_setRoleAdmin}. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") */ function getRoleAdmin(bytes32 role) external view override returns (bytes32) { return _getRoleAdmin[role]; } /** * @notice Grants a role to an account, if not previously granted. * @dev Caller must have admin role for the `role`. * Emits {RoleGranted Event}. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account to which the role is being granted. */ function grantRole(bytes32 role, address account) public virtual override { _checkRole(_getRoleAdmin[role], msg.sender); if (_hasRole[role][account]) { revert("Can only grant to non holders"); } _setupRole(role, account); } /** * @notice Revokes role from an account. * @dev Caller must have admin role for the `role`. * Emits {RoleRevoked Event}. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account from which the role is being revoked. */ function revokeRole(bytes32 role, address account) public virtual override { _checkRole(_getRoleAdmin[role], msg.sender); _revokeRole(role, account); } /** * @notice Revokes role from the account. * @dev Caller must have the `role`, with caller being the same as `account`. * Emits {RoleRevoked Event}. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account from which the role is being revoked. */ function renounceRole(bytes32 role, address account) public virtual override { if (msg.sender != account) { revert("Can only renounce for self"); } _revokeRole(role, account); } /// @dev Sets `adminRole` as `role`'s admin role. function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = _getRoleAdmin[role]; _getRoleAdmin[role] = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /// @dev Sets up `role` for `account` function _setupRole(bytes32 role, address account) internal virtual { _hasRole[role][account] = true; emit RoleGranted(role, account, msg.sender); } /// @dev Revokes `role` from `account` function _revokeRole(bytes32 role, address account) internal virtual { _checkRole(role, account); delete _hasRole[role][account]; emit RoleRevoked(role, account, msg.sender); } /// @dev Checks `role` for `account`. Reverts with a message including the required role. function _checkRole(bytes32 role, address account) internal view virtual { if (!_hasRole[role][account]) { revert( string( abi.encodePacked( "Permissions: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /// @dev Checks `role` for `account`. Reverts with a message including the required role. function _checkRoleWithSwitch(bytes32 role, address account) internal view virtual { if (!hasRoleWithSwitch(role, account)) { revert( string( abi.encodePacked( "Permissions: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./interface/IPermissionsEnumerable.sol"; import "./Permissions.sol"; /** * @title PermissionsEnumerable * @dev This contracts provides extending-contracts with role-based access control mechanisms. * Also provides interfaces to view all members with a given role, and total count of members. */ contract PermissionsEnumerable is IPermissionsEnumerable, Permissions { /** * @notice A data structure to store data of members for a given role. * * @param index Current index in the list of accounts that have a role. * @param members map from index => address of account that has a role * @param indexOf map from address => index which the account has. */ struct RoleMembers { uint256 index; mapping(uint256 => address) members; mapping(address => uint256) indexOf; } /// @dev map from keccak256 hash of a role to its members' data. See {RoleMembers}. mapping(bytes32 => RoleMembers) private roleMembers; /** * @notice Returns the role-member from a list of members for a role, * at a given index. * @dev Returns `member` who has `role`, at `index` of role-members list. * See struct {RoleMembers}, and mapping {roleMembers} * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param index Index in list of current members for the role. * * @return member Address of account that has `role` */ function getRoleMember(bytes32 role, uint256 index) external view override returns (address member) { uint256 currentIndex = roleMembers[role].index; uint256 check; for (uint256 i = 0; i < currentIndex; i += 1) { if (roleMembers[role].members[i] != address(0)) { if (check == index) { member = roleMembers[role].members[i]; return member; } check += 1; } else if (hasRole(role, address(0)) && i == roleMembers[role].indexOf[address(0)]) { check += 1; } } } /** * @notice Returns total number of accounts that have a role. * @dev Returns `count` of accounts that have `role`. * See struct {RoleMembers}, and mapping {roleMembers} * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * * @return count Total number of accounts that have `role` */ function getRoleMemberCount(bytes32 role) external view override returns (uint256 count) { uint256 currentIndex = roleMembers[role].index; for (uint256 i = 0; i < currentIndex; i += 1) { if (roleMembers[role].members[i] != address(0)) { count += 1; } } if (hasRole(role, address(0))) { count += 1; } } /// @dev Revokes `role` from `account`, and removes `account` from {roleMembers} /// See {_removeMember} function _revokeRole(bytes32 role, address account) internal override { super._revokeRole(role, account); _removeMember(role, account); } /// @dev Grants `role` to `account`, and adds `account` to {roleMembers} /// See {_addMember} function _setupRole(bytes32 role, address account) internal override { super._setupRole(role, account); _addMember(role, account); } /// @dev adds `account` to {roleMembers}, for `role` function _addMember(bytes32 role, address account) internal { uint256 idx = roleMembers[role].index; roleMembers[role].index += 1; roleMembers[role].members[idx] = account; roleMembers[role].indexOf[account] = idx; } /// @dev removes `account` from {roleMembers}, for `role` function _removeMember(bytes32 role, address account) internal { uint256 idx = roleMembers[role].indexOf[account]; delete roleMembers[role].members[idx]; delete roleMembers[role].indexOf[account]; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./interface/IPrimarySale.sol"; /** * @title Primary Sale * @notice Thirdweb's `PrimarySale` is a contract extension to be used with any base contract. It exposes functions for setting and reading * the recipient of primary sales, and lets the inheriting contract perform conditional logic that uses information about * primary sales, if desired. */ abstract contract PrimarySale is IPrimarySale { /// @dev The address that receives all primary sales value. address private recipient; /// @dev Returns primary sale recipient address. function primarySaleRecipient() public view override returns (address) { return recipient; } /** * @notice Updates primary sale recipient. * @dev Caller should be authorized to set primary sales info. * See {_canSetPrimarySaleRecipient}. * Emits {PrimarySaleRecipientUpdated Event}; See {_setupPrimarySaleRecipient}. * * @param _saleRecipient Address to be set as new recipient of primary sales. */ function setPrimarySaleRecipient(address _saleRecipient) external override { if (!_canSetPrimarySaleRecipient()) { revert("Not authorized"); } _setupPrimarySaleRecipient(_saleRecipient); } /// @dev Lets a contract admin set the recipient for all primary sales. function _setupPrimarySaleRecipient(address _saleRecipient) internal { if (_saleRecipient == address(0)) { revert("Invalid recipient"); } recipient = _saleRecipient; emit PrimarySaleRecipientUpdated(_saleRecipient); } /// @dev Returns whether primary sale recipient can be set in the given execution context. function _canSetPrimarySaleRecipient() internal view virtual returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./interface/IRoyalty.sol"; /** * @title Royalty * @notice Thirdweb's `Royalty` is a contract extension to be used with any base contract. It exposes functions for setting and reading * the recipient of royalty fee and the royalty fee basis points, and lets the inheriting contract perform conditional logic * that uses information about royalty fees, if desired. * * @dev The `Royalty` contract is ERC2981 compliant. */ abstract contract Royalty is IRoyalty { /// @dev The (default) address that receives all royalty value. address private royaltyRecipient; /// @dev The (default) % of a sale to take as royalty (in basis points). uint16 private royaltyBps; /// @dev Token ID => royalty recipient and bps for token mapping(uint256 => RoyaltyInfo) private royaltyInfoForToken; /** * @notice View royalty info for a given token and sale price. * @dev Returns royalty amount and recipient for `tokenId` and `salePrice`. * @param tokenId The tokenID of the NFT for which to query royalty info. * @param salePrice Sale price of the token. * * @return receiver Address of royalty recipient account. * @return royaltyAmount Royalty amount calculated at current royaltyBps value. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view virtual override returns (address receiver, uint256 royaltyAmount) { (address recipient, uint256 bps) = getRoyaltyInfoForToken(tokenId); receiver = recipient; royaltyAmount = (salePrice * bps) / 10_000; } /** * @notice View royalty info for a given token. * @dev Returns royalty recipient and bps for `_tokenId`. * @param _tokenId The tokenID of the NFT for which to query royalty info. */ function getRoyaltyInfoForToken(uint256 _tokenId) public view override returns (address, uint16) { RoyaltyInfo memory royaltyForToken = royaltyInfoForToken[_tokenId]; return royaltyForToken.recipient == address(0) ? (royaltyRecipient, uint16(royaltyBps)) : (royaltyForToken.recipient, uint16(royaltyForToken.bps)); } /** * @notice Returns the defualt royalty recipient and BPS for this contract's NFTs. */ function getDefaultRoyaltyInfo() external view override returns (address, uint16) { return (royaltyRecipient, uint16(royaltyBps)); } /** * @notice Updates default royalty recipient and bps. * @dev Caller should be authorized to set royalty info. * See {_canSetRoyaltyInfo}. * Emits {DefaultRoyalty Event}; See {_setupDefaultRoyaltyInfo}. * * @param _royaltyRecipient Address to be set as default royalty recipient. * @param _royaltyBps Updated royalty bps. */ function setDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) external override { if (!_canSetRoyaltyInfo()) { revert("Not authorized"); } _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps); } /// @dev Lets a contract admin update the default royalty recipient and bps. function _setupDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) internal { if (_royaltyBps > 10_000) { revert("Exceeds max bps"); } royaltyRecipient = _royaltyRecipient; royaltyBps = uint16(_royaltyBps); emit DefaultRoyalty(_royaltyRecipient, _royaltyBps); } /** * @notice Updates default royalty recipient and bps for a particular token. * @dev Sets royalty info for `_tokenId`. Caller should be authorized to set royalty info. * See {_canSetRoyaltyInfo}. * Emits {RoyaltyForToken Event}; See {_setupRoyaltyInfoForToken}. * * @param _recipient Address to be set as royalty recipient for given token Id. * @param _bps Updated royalty bps for the token Id. */ function setRoyaltyInfoForToken(uint256 _tokenId, address _recipient, uint256 _bps) external override { if (!_canSetRoyaltyInfo()) { revert("Not authorized"); } _setupRoyaltyInfoForToken(_tokenId, _recipient, _bps); } /// @dev Lets a contract admin set the royalty recipient and bps for a particular token Id. function _setupRoyaltyInfoForToken(uint256 _tokenId, address _recipient, uint256 _bps) internal { if (_bps > 10_000) { revert("Exceeds max bps"); } royaltyInfoForToken[_tokenId] = RoyaltyInfo({ recipient: _recipient, bps: _bps }); emit RoyaltyForToken(_tokenId, _recipient, _bps); } /// @dev Returns whether royalty info can be set in the given execution context. function _canSetRoyaltyInfo() internal view virtual returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * The interface `IClaimCondition` is written for thirdweb's 'Drop' contracts, which are distribution mechanisms for tokens. * * A claim condition defines criteria under which accounts can mint tokens. Claim conditions can be overwritten * or added to by the contract admin. At any moment, there is only one active claim condition. */ interface IClaimCondition { /** * @notice The criteria that make up a claim condition. * * @param startTimestamp The unix timestamp after which the claim condition applies. * The same claim condition applies until the `startTimestamp` * of the next claim condition. * * @param maxClaimableSupply The maximum total number of tokens that can be claimed under * the claim condition. * * @param supplyClaimed At any given point, the number of tokens that have been claimed * under the claim condition. * * @param quantityLimitPerWallet The maximum number of tokens that can be claimed by a wallet. * * @param merkleRoot The allowlist of addresses that can claim tokens under the claim * condition. * * @param pricePerToken The price required to pay per token claimed. * * @param currency The currency in which the `pricePerToken` must be paid. * * @param metadata Claim condition metadata. */ struct ClaimCondition { uint256 startTimestamp; uint256 maxClaimableSupply; uint256 supplyClaimed; uint256 quantityLimitPerWallet; bytes32 merkleRoot; uint256 pricePerToken; address currency; string metadata; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./IClaimCondition.sol"; /** * The interface `IClaimConditionMultiPhase` is written for thirdweb's 'Drop' contracts, which are distribution mechanisms for tokens. * * An authorized wallet can set a series of claim conditions, ordered by their respective `startTimestamp`. * A claim condition defines criteria under which accounts can mint tokens. Claim conditions can be overwritten * or added to by the contract admin. At any moment, there is only one active claim condition. */ interface IClaimConditionMultiPhase is IClaimCondition { /** * @notice The set of all claim conditions, at any given moment. * Claim Phase ID = [currentStartId, currentStartId + length - 1]; * * @param currentStartId The uid for the first claim condition amongst the current set of * claim conditions. The uid for each next claim condition is one * more than the previous claim condition's uid. * * @param count The total number of phases / claim conditions in the list * of claim conditions. * * @param conditions The claim conditions at a given uid. Claim conditions * are ordered in an ascending order by their `startTimestamp`. * * @param supplyClaimedByWallet Map from a claim condition uid and account to supply claimed by account. */ struct ClaimConditionList { uint256 currentStartId; uint256 count; mapping(uint256 => ClaimCondition) conditions; mapping(uint256 => mapping(address => uint256)) supplyClaimedByWallet; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * Thirdweb's `ContractMetadata` is a contract extension for any base contracts. It lets you set a metadata URI * for you contract. * * Additionally, `ContractMetadata` is necessary for NFT contracts that want royalties to get distributed on OpenSea. */ interface IContractMetadata { /// @dev Returns the metadata URI of the contract. function contractURI() external view returns (string memory); /** * @dev Sets contract URI for the storefront-level metadata of the contract. * Only module admin can call this function. */ function setContractURI(string calldata _uri) external; /// @dev Emitted when the contract URI is updated. event ContractURIUpdated(string prevURI, string newURI); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./IClaimConditionMultiPhase.sol"; /** * The interface `IDrop1155` is written for thirdweb's 'Drop' contracts, which are distribution mechanisms for tokens. * * An authorized wallet can set a series of claim conditions, ordered by their respective `startTimestamp`. * A claim condition defines criteria under which accounts can mint tokens. Claim conditions can be overwritten * or added to by the contract admin. At any moment, there is only one active claim condition. */ interface IDrop1155 is IClaimConditionMultiPhase { /** * @param proof Proof of concerned wallet's inclusion in an allowlist. * @param quantityLimitPerWallet The total quantity of tokens the allowlisted wallet is eligible to claim over time. * @param pricePerToken The price per token the allowlisted wallet must pay to claim tokens. * @param currency The currency in which the allowlisted wallet must pay the price for claiming tokens. */ struct AllowlistProof { bytes32[] proof; uint256 quantityLimitPerWallet; uint256 pricePerToken; address currency; } /// @notice Emitted when tokens are claimed. event TokensClaimed( uint256 indexed claimConditionIndex, address indexed claimer, address indexed receiver, uint256 tokenId, uint256 quantityClaimed ); /// @notice Emitted when the contract's claim conditions are updated. event ClaimConditionsUpdated(uint256 indexed tokenId, ClaimCondition[] claimConditions, bool resetEligibility); /** * @notice Lets an account claim a given quantity of NFTs. * * @param receiver The receiver of the NFTs to claim. * @param tokenId The tokenId of the NFT to claim. * @param quantity The quantity of NFTs to claim. * @param currency The currency in which to pay for the claim. * @param pricePerToken The price per token to pay for the claim. * @param allowlistProof The proof of the claimer's inclusion in the merkle root allowlist * of the claim conditions that apply. * @param data Arbitrary bytes data that can be leveraged in the implementation of this interface. */ function claim( address receiver, uint256 tokenId, uint256 quantity, address currency, uint256 pricePerToken, AllowlistProof calldata allowlistProof, bytes memory data ) external payable; /** * @notice Lets a contract admin (account with `DEFAULT_ADMIN_ROLE`) set claim conditions. * * @param tokenId The token ID for which to set mint conditions. * @param phases Claim conditions in ascending order by `startTimestamp`. * * @param resetClaimEligibility Whether to honor the restrictions applied to wallets who have claimed tokens in the current conditions, * in the new claim conditions being set. * */ function setClaimConditions(uint256 tokenId, ClaimCondition[] calldata phases, bool resetClaimEligibility) external; }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * Thirdweb's `LazyMint` is a contract extension for any base NFT contract. It lets you 'lazy mint' any number of NFTs * at once. Here, 'lazy mint' means defining the metadata for particular tokenIds of your NFT contract, without actually * minting a non-zero balance of NFTs of those tokenIds. */ interface ILazyMint { /// @dev Emitted when tokens are lazy minted. event TokensLazyMinted(uint256 indexed startTokenId, uint256 endTokenId, string baseURI, bytes encryptedBaseURI); /** * @notice Lazy mints a given amount of NFTs. * * @param amount The number of NFTs to lazy mint. * * @param baseURIForTokens The base URI for the 'n' number of NFTs being lazy minted, where the metadata for each * of those NFTs is `${baseURIForTokens}/${tokenId}`. * * @param extraData Additional bytes data to be used at the discretion of the consumer of the contract. * * @return batchId A unique integer identifier for the batch of NFTs lazy minted together. */ function lazyMint( uint256 amount, string calldata baseURIForTokens, bytes calldata extraData ) external returns (uint256 batchId); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author thirdweb /** * @dev Provides a function to batch together multiple calls in a single external call. * * _Available since v4.1._ */ interface IMulticall { /** * @dev Receives and executes a batch of function calls on this contract. */ function multicall(bytes[] calldata data) external returns (bytes[] memory results); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * Thirdweb's `Ownable` is a contract extension to be used with any base contract. It exposes functions for setting and reading * who the 'owner' of the inheriting smart contract is, and lets the inheriting contract perform conditional logic that uses * information about who the contract's owner is. */ interface IOwnable { /// @dev Returns the owner of the contract. function owner() external view returns (address); /// @dev Lets a module admin set a new owner for the contract. The new owner must be a module admin. function setOwner(address _newOwner) external; /// @dev Emitted when a new Owner is set. event OwnerUpdated(address indexed prevOwner, address indexed newOwner); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IPermissions { /** * @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; }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./IPermissions.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IPermissionsEnumerable is IPermissions { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * [forum post](https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296) * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * Thirdweb's `Primary` is a contract extension to be used with any base contract. It exposes functions for setting and reading * the recipient of primary sales, and lets the inheriting contract perform conditional logic that uses information about * primary sales, if desired. */ interface IPrimarySale { /// @dev The adress that receives all primary sales value. function primarySaleRecipient() external view returns (address); /// @dev Lets a module admin set the default recipient of all primary sales. function setPrimarySaleRecipient(address _saleRecipient) external; /// @dev Emitted when a new sale recipient is set. event PrimarySaleRecipientUpdated(address indexed recipient); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "../../eip/interface/IERC2981.sol"; /** * Thirdweb's `Royalty` is a contract extension to be used with any base contract. It exposes functions for setting and reading * the recipient of royalty fee and the royalty fee basis points, and lets the inheriting contract perform conditional logic * that uses information about royalty fees, if desired. * * The `Royalty` contract is ERC2981 compliant. */ interface IRoyalty is IERC2981 { struct RoyaltyInfo { address recipient; uint256 bps; } /// @dev Returns the royalty recipient and fee bps. function getDefaultRoyaltyInfo() external view returns (address, uint16); /// @dev Lets a module admin update the royalty bps and recipient. function setDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) external; /// @dev Lets a module admin set the royalty recipient for a particular token Id. function setRoyaltyInfoForToken(uint256 tokenId, address recipient, uint256 bps) external; /// @dev Returns the royalty recipient for a particular token Id. function getRoyaltyInfoForToken(uint256 tokenId) external view returns (address, uint16); /// @dev Emitted when royalty info is updated. event DefaultRoyalty(address indexed newRoyaltyRecipient, uint256 newRoyaltyBps); /// @dev Emitted when royalty recipient for tokenId is set event RoyaltyForToken(uint256 indexed tokenId, address indexed royaltyRecipient, uint256 royaltyBps); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../../../../../eip/interface/IERC20.sol"; import { Address } from "@openzeppelin/contracts/utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; interface IWETH { function deposit() external payable; function withdraw(uint256 amount) external; function transfer(address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.1; /// @author thirdweb, OpenZeppelin Contracts (v4.9.0) /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{ value: value }(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb // Helper interfaces import { IWETH } from "../infra/interface/IWETH.sol"; import { SafeERC20, IERC20 } from "../external-deps/openzeppelin/token/ERC20/utils/SafeERC20.sol"; library CurrencyTransferLib { using SafeERC20 for IERC20; /// @dev The address interpreted as native token of the chain. address public constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /// @dev Transfers a given amount of currency. function transferCurrency(address _currency, address _from, address _to, uint256 _amount) internal { if (_amount == 0) { return; } if (_currency == NATIVE_TOKEN) { safeTransferNativeToken(_to, _amount); } else { safeTransferERC20(_currency, _from, _to, _amount); } } /// @dev Transfers a given amount of currency. (With native token wrapping) function transferCurrencyWithWrapper( address _currency, address _from, address _to, uint256 _amount, address _nativeTokenWrapper ) internal { if (_amount == 0) { return; } if (_currency == NATIVE_TOKEN) { if (_from == address(this)) { // withdraw from weth then transfer withdrawn native token to recipient IWETH(_nativeTokenWrapper).withdraw(_amount); safeTransferNativeTokenWithWrapper(_to, _amount, _nativeTokenWrapper); } else if (_to == address(this)) { // store native currency in weth require(_amount == msg.value, "msg.value != amount"); IWETH(_nativeTokenWrapper).deposit{ value: _amount }(); } else { safeTransferNativeTokenWithWrapper(_to, _amount, _nativeTokenWrapper); } } else { safeTransferERC20(_currency, _from, _to, _amount); } } /// @dev Transfer `amount` of ERC20 token from `from` to `to`. function safeTransferERC20(address _currency, address _from, address _to, uint256 _amount) internal { if (_from == _to) { return; } if (_from == address(this)) { IERC20(_currency).safeTransfer(_to, _amount); } else { IERC20(_currency).safeTransferFrom(_from, _to, _amount); } } /// @dev Transfers `amount` of native token to `to`. function safeTransferNativeToken(address to, uint256 value) internal { // solhint-disable avoid-low-level-calls // slither-disable-next-line low-level-calls (bool success, ) = to.call{ value: value }(""); require(success, "native token transfer failed"); } /// @dev Transfers `amount` of native token to `to`. (With native token wrapping) function safeTransferNativeTokenWithWrapper(address to, uint256 value, address _nativeTokenWrapper) internal { // solhint-disable avoid-low-level-calls // slither-disable-next-line low-level-calls (bool success, ) = to.call{ value: value }(""); if (!success) { IWETH(_nativeTokenWrapper).deposit{ value: value }(); IERC20(_nativeTokenWrapper).safeTransfer(to, value); } } }
// SPDX-License-Identifier: Apache 2.0 pragma solidity ^0.8.0; /// @author thirdweb library MerkleProof { function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool, uint256) { bytes32 computedHash = leaf; uint256 index = 0; for (uint256 i = 0; i < proof.length; i++) { index *= 2; bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); index += 1; } } // Check if the computed hash (root) is equal to the provided root return (computedHash == root, index); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * @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); } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte, /// and the alphabets are capitalized conditionally according to /// https://eips.ethereum.org/EIPS/eip-55 function toHexStringChecksummed(address value) internal pure returns (string memory str) { str = toHexString(value); /// @solidity memory-safe-assembly assembly { let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...` let o := add(str, 0x22) let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... ` let t := shl(240, 136) // `0b10001000 << 240` for { let i := 0 } 1 { } { mstore(add(i, i), mul(t, byte(i, hashed))) i := add(i, 1) if eq(i, 20) { break } } mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask))))) o := add(o, 0x20) mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask))))) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. function toHexString(address value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(address value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { str := mload(0x40) // Allocate the memory. // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x28 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80. mstore(0x40, add(str, 0x80)) // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) str := add(str, 2) mstore(str, 40) let o := add(str, 0x20) mstore(add(o, 40), 0) value := shl(96, value) // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let i := 0 } 1 { } { let p := add(o, add(i, i)) let temp := byte(i, value) mstore8(add(p, 1), mload(and(temp, 15))) mstore8(p, mload(shr(4, temp))) i := add(i, 1) if eq(i, 20) { break } } } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexString(bytes memory raw) internal pure returns (string memory str) { str = toHexStringNoPrefix(raw); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { let length := mload(raw) str := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix. mstore(str, add(length, length)) // Store the length of the output. // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let o := add(str, 0x20) let end := add(raw, length) for { } iszero(eq(raw, end)) { } { raw := add(raw, 1) mstore8(add(o, 1), mload(and(mload(raw), 15))) mstore8(o, mload(and(shr(4, mload(raw)), 15))) o := add(o, 2) } mstore(o, 0) // Zeroize the slot after the string. mstore(0x40, add(o, 0x20)) // Allocate the memory. } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "remappings": [ ":@openzeppelin/=node_modules/@openzeppelin/", ":@thirdweb-dev/=node_modules/@thirdweb-dev/", ":ds-test/=lib/forge-std/lib/ds-test/src/", ":forge-std/=lib/forge-std/src/" ], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_defaultAdmin","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_saleRecipient","type":"address"},{"internalType":"uint256","name":"_transactionFee","type":"uint256"},{"internalType":"address","name":"_royaltyRecipient","type":"address"},{"internalType":"uint128","name":"_royaltyBps","type":"uint128"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AmountError","type":"error"},{"inputs":[],"name":"AuthError","type":"error"},{"inputs":[],"name":"PriceError","type":"error"},{"inputs":[],"name":"SupplyError","type":"error"},{"inputs":[],"name":"TrxErrorAuth","type":"error"},{"inputs":[],"name":"TrxErrorFee1","type":"error"},{"inputs":[],"name":"TrxErrorFee2","type":"error"},{"inputs":[],"name":"TrxFeeError","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxClaimableSupply","type":"uint256"},{"internalType":"uint256","name":"supplyClaimed","type":"uint256"},{"internalType":"uint256","name":"quantityLimitPerWallet","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"string","name":"metadata","type":"string"}],"indexed":false,"internalType":"struct IClaimCondition.ClaimCondition[]","name":"claimConditions","type":"tuple[]"},{"indexed":false,"internalType":"bool","name":"resetEligibility","type":"bool"}],"name":"ClaimConditionsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"prevURI","type":"string"},{"indexed":false,"internalType":"string","name":"newURI","type":"string"}],"name":"ContractURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newRoyaltyRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"newRoyaltyBps","type":"uint256"}],"name":"DefaultRoyalty","type":"event"},{"anonymous":false,"inputs":[],"name":"MetadataFrozen","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prevOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"}],"name":"PrimarySaleRecipientUpdated","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":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"royaltyRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"royaltyBps","type":"uint256"}],"name":"RoyaltyForToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"claimConditionIndex","type":"uint256"},{"indexed":true,"internalType":"address","name":"claimer","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantityClaimed","type":"uint256"}],"name":"TokensClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"startTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"baseURI","type":"string"},{"indexed":false,"internalType":"bytes","name":"encryptedBaseURI","type":"bytes"}],"name":"TokensLazyMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"_values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","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":"uint256","name":"","type":"uint256"}],"name":"batchFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"string","name":"_baseURI","type":"string"}],"name":"batchMintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"address","name":"_currency","type":"address"},{"internalType":"uint256","name":"_pricePerToken","type":"uint256"},{"components":[{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"uint256","name":"quantityLimitPerWallet","type":"uint256"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"}],"internalType":"struct IDrop1155.AllowlistProof","name":"_allowlistProof","type":"tuple"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"claim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"claimCondition","outputs":[{"internalType":"uint256","name":"currentStartId","type":"uint256"},{"internalType":"uint256","name":"count","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractType","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractVersion","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_currency","type":"address"}],"name":"evolve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getActiveClaimConditionId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBaseURICount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getBatchIdAtIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_conditionId","type":"uint256"}],"name":"getClaimConditionById","outputs":[{"components":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxClaimableSupply","type":"uint256"},{"internalType":"uint256","name":"supplyClaimed","type":"uint256"},{"internalType":"uint256","name":"quantityLimitPerWallet","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"string","name":"metadata","type":"string"}],"internalType":"struct IClaimCondition.ClaimCondition","name":"condition","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDefaultRoyaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"member","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getRoyaltyInfoForToken","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_conditionId","type":"uint256"},{"internalType":"address","name":"_claimer","type":"address"}],"name":"getSupplyClaimedByWallet","outputs":[{"internalType":"uint256","name":"supplyClaimedByWallet","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransactionFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRoleWithSwitch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"string","name":"_baseURIForTokens","type":"string"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"lazyMint","outputs":[{"internalType":"uint256","name":"batchId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"maxTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTokenIdToMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberToBurn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberToReceive","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":"platformAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primarySaleRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"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":"uint256","name":"","type":"uint256"}],"name":"saleRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"components":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxClaimableSupply","type":"uint256"},{"internalType":"uint256","name":"supplyClaimed","type":"uint256"},{"internalType":"uint256","name":"quantityLimitPerWallet","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"string","name":"metadata","type":"string"}],"internalType":"struct IClaimCondition.ClaimCondition[]","name":"_conditions","type":"tuple[]"},{"internalType":"bool","name":"_resetClaimEligibility","type":"bool"}],"name":"setClaimConditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_royaltyRecipient","type":"address"},{"internalType":"uint256","name":"_royaltyBps","type":"uint256"}],"name":"setDefaultRoyaltyInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_maxTotalSupply","type":"uint256"}],"name":"setMaxTotalSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setNumberToBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setNumberToReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_saleRecipient","type":"address"}],"name":"setPrimarySaleRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_bps","type":"uint256"}],"name":"setRoyaltyInfoForToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_saleRecipient","type":"address"}],"name":"setSaleRecipientForToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_transactionFee","type":"uint256"}],"name":"setTransactionFee","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":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transactionFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_conditionId","type":"uint256"},{"internalType":"address","name":"_claimer","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"address","name":"_currency","type":"address"},{"internalType":"uint256","name":"_pricePerToken","type":"uint256"},{"components":[{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"uint256","name":"quantityLimitPerWallet","type":"uint256"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"}],"internalType":"struct IDrop1155.AllowlistProof","name":"_allowlistProof","type":"tuple"}],"name":"verifyClaim","outputs":[{"internalType":"bool","name":"isOverride","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6080604052601380546001600160a01b031916734ec431790805909b0d3dcf5c8da25fcbf46e93f8179055600260185560016019553480156200004157600080fd5b50604051620063c8380380620063c88339810160408190526200006491620004cf565b8686868484838360006200007983826200062f565b5060016200008882826200062f565b5050506200009c856200017060201b60201c565b620000b1826001600160801b038316620001c2565b505050505060008311620000d857604051630bae660560e01b815260040160405180910390fd5b7f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66200012760008a6200026e565b62000133818a6200026e565b6200013f828a6200026e565b6200014c8260006200026e565b62000157866200028a565b6016919091556017555050601455506200072392505050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d7690600090a35050565b6127108111156200020c5760405162461bcd60e51b815260206004820152600f60248201526e45786365656473206d61782062707360881b60448201526064015b60405180910390fd5b600780546001600160a01b0384166001600160b01b03199091168117600160a01b61ffff851602179091556040518281527f90d7ec04bcb8978719414f82e52e4cb651db41d0e6f8cea6118c2191e6183adb9060200160405180910390a25050565b6200027a828262000320565b6200028682826200037b565b5050565b6001600160a01b038116620002d65760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081c9958da5c1a595b9d607a1b604482015260640162000203565b600e80546001600160a01b0319166001600160a01b0383169081179091556040517f299d17e95023f496e0ffc4909cff1a61f74bb5eb18de6f900f4155bfa1b3b33390600090a250565b60008281526010602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000828152601260205260408120805491600191906200039c8385620006fb565b9091555050600092835260126020908152604080852083865260018101835281862080546001600160a01b039096166001600160a01b03199096168617905593855260029093019052912055565b80516001600160a01b03811681146200040257600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200042f57600080fd5b81516001600160401b03808211156200044c576200044c62000407565b604051601f8301601f19908116603f0116810190828211818310171562000477576200047762000407565b81604052838152602092508660208588010111156200049557600080fd5b600091505b83821015620004b957858201830151818301840152908201906200049a565b6000602085830101528094505050505092915050565b600080600080600080600060e0888a031215620004eb57600080fd5b620004f688620003ea565b60208901519097506001600160401b03808211156200051457600080fd5b620005228b838c016200041d565b975060408a01519150808211156200053957600080fd5b50620005488a828b016200041d565b9550506200055960608901620003ea565b9350608088015192506200057060a08901620003ea565b60c08901519092506001600160801b03811681146200058e57600080fd5b8091505092959891949750929550565b600181811c90821680620005b357607f821691505b602082108103620005d457634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200062a576000816000526020600020601f850160051c81016020861015620006055750805b601f850160051c820191505b81811015620006265782815560010162000611565b5050505b505050565b81516001600160401b038111156200064b576200064b62000407565b62000663816200065c84546200059e565b84620005da565b602080601f8311600181146200069b5760008415620006825750858301515b600019600386901b1c1916600185901b17855562000626565b600085815260208120601f198616915b82811015620006cc57888601518255948401946001909101908401620006ab565b5085821015620006eb5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b808201808211156200071d57634e487b7160e01b600052601160045260246000fd5b92915050565b615c9580620007336000396000f3fe6080604052600436106103b75760003560e01c80639010d07c116101f2578063bd85b0391161010d578063dbe55e56116100a0578063ea1def9c1161006f578063ea1def9c14610c21578063f242432a14610c41578063f43c0b8214610c61578063f5298aca14610c8157600080fd5b8063dbe55e5614610b68578063e8a3d48514610b88578063e9703d2514610b9d578063e985e9c514610be657600080fd5b8063cb2ef6f7116100dc578063cb2ef6f714610ad8578063d37c353b14610afb578063d45b28d714610b1b578063d547741f14610b4857600080fd5b8063bd85b03914610a42578063c1faece414610a6f578063c7337d6b14610a82578063ca15c87314610ab857600080fd5b8063a0a8e46011610185578063a38873f611610154578063a38873f6146109b4578063ac9650d8146109ca578063b03f4528146109f7578063b24f2d3914610a1757600080fd5b8063a0a8e46014610943578063a217fddf1461095f578063a22cb46514610974578063a32fa5b31461099457600080fd5b8063949c09f7116101c1578063949c09f7146108d857806395d89b41146108f85780639bcf7a151461090d5780639ed3edf01461092d57600080fd5b80639010d07c146108625780639087fd661461088257806391d1485414610898578063938e3d7b146108b857600080fd5b80632f2ff15d116102e2578063600dd5ea11610275578063830405321161024457806383040532146107df57806385d791021461080f57806387198cf2146108245780638da5cb5b1461084457600080fd5b8063600dd5ea1461076a57806363b45e2d1461078a5780636b20c4541461079f5780636f4f2837146107bf57600080fd5b80634e1273f4116102b15780634e1273f4146106bd57806357bc3d78146106ea5780635811ddab146106fd5780635ab063e81461074a57600080fd5b80632f2ff15d1461062657806336568abe146106465780633b1475a7146106665780634cc157df1461067b57600080fd5b806313af40351161035a57806324aaffaa1161032957806324aaffaa1461057a57806329c49b9b146105a75780632a55205a146105c75780632eb2c2d61461060657600080fd5b806313af4035146104ed578063183718d11461050d5780632419f51b1461052d578063248a9ca31461054d57600080fd5b806306fdde031161039657806306fdde0314610459578063079fe40e1461047b578063096a8ab7146104ad5780630e89341c146104cd57600080fd5b8062fdd58e146103bc57806301ffc9a71461040757806302f0f19a14610437575b600080fd5b3480156103c857600080fd5b506103f46103d7366004614858565b600260209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561041357600080fd5b5061042761042236600461489a565b610ca1565b60405190151581526020016103fe565b34801561044357600080fd5b506104576104523660046148b7565b610d0e565b005b34801561046557600080fd5b5061046e610d20565b6040516103fe9190614920565b34801561048757600080fd5b50600e546001600160a01b03165b6040516001600160a01b0390911681526020016103fe565b3480156104b957600080fd5b506104576104c83660046148b7565b610dae565b3480156104d957600080fd5b5061046e6104e83660046148b7565b610e22565b3480156104f957600080fd5b50610457610508366004614933565b610e63565b34801561051957600080fd5b506104576105283660046149a9565b610e9c565b34801561053957600080fd5b506103f46105483660046148b7565b6111db565b34801561055957600080fd5b506103f46105683660046148b7565b60009081526011602052604090205490565b34801561058657600080fd5b506103f46105953660046148b7565b601a6020526000908152604090205481565b3480156105b357600080fd5b506104576105c2366004614a07565b611249565b3480156105d357600080fd5b506105e76105e2366004614a37565b611284565b604080516001600160a01b0390931683526020830191909152016103fe565b34801561061257600080fd5b50610457610621366004614ba7565b6112c1565b34801561063257600080fd5b50610457610641366004614a07565b611350565b34801561065257600080fd5b50610457610661366004614a07565b6113ea565b34801561067257600080fd5b50600f546103f4565b34801561068757600080fd5b5061069b6106963660046148b7565b61144c565b604080516001600160a01b03909316835261ffff9091166020830152016103fe565b3480156106c957600080fd5b506106dd6106d8366004614c54565b6114b7565b6040516103fe9190614d5c565b6104576106f8366004614d81565b6115c3565b34801561070957600080fd5b506103f4610718366004614e26565b6000928352601560209081526040808520938552600390930181528284206001600160a01b0390921684525290205490565b34801561075657600080fd5b506103f46107653660046148b7565b6116c8565b34801561077657600080fd5b50610457610785366004614858565b611779565b34801561079657600080fd5b506009546103f4565b3480156107ab57600080fd5b506104576107ba366004614e5f565b6117a7565b3480156107cb57600080fd5b506104576107da366004614933565b611949565b3480156107eb57600080fd5b506104276107fa3660046148b7565b600b6020526000908152604090205460ff1681565b34801561081b57600080fd5b506014546103f4565b34801561083057600080fd5b5061045761083f366004614a37565b611976565b34801561085057600080fd5b506006546001600160a01b0316610495565b34801561086e57600080fd5b5061049561087d366004614a37565b611995565b34801561088e57600080fd5b506103f460185481565b3480156108a457600080fd5b506104276108b3366004614a07565b611a83565b3480156108c457600080fd5b506104576108d3366004614ed4565b611aae565b3480156108e457600080fd5b506104576108f3366004614f08565b611adb565b34801561090457600080fd5b5061046e611cd6565b34801561091957600080fd5b50610457610928366004614fa2565b611ce3565b34801561093957600080fd5b506103f460145481565b34801561094f57600080fd5b50604051600181526020016103fe565b34801561096b57600080fd5b506103f4600081565b34801561098057600080fd5b5061045761098f366004614fda565b611d17565b3480156109a057600080fd5b506104276109af366004614a07565b611dcf565b3480156109c057600080fd5b506103f460195481565b3480156109d657600080fd5b506109ea6109e5366004615008565b611e25565b6040516103fe9190615049565b348015610a0357600080fd5b50610457610a123660046150ad565b611f81565b348015610a2357600080fd5b506007546001600160a01b03811690600160a01b900461ffff1661069b565b348015610a4e57600080fd5b506103f4610a5d3660046148b7565b600d6020526000908152604090205481565b610457610a7d36600461510d565b612074565b348015610a8e57600080fd5b50610495610a9d3660046148b7565b601b602052600090815260409020546001600160a01b031681565b348015610ac457600080fd5b506103f4610ad33660046148b7565b612298565b348015610ae457600080fd5b506c4552433131353545766f6c766560981b6103f4565b348015610b0757600080fd5b506103f4610b1636600461517c565b612321565b348015610b2757600080fd5b50610b3b610b36366004614a37565b612439565b6040516103fe91906151f5565b348015610b5457600080fd5b50610457610b63366004614a07565b6125a0565b348015610b7457600080fd5b50601354610495906001600160a01b031681565b348015610b9457600080fd5b5061046e6125b9565b348015610ba957600080fd5b50610bd1610bb83660046148b7565b6015602052600090815260409020805460019091015482565b604080519283526020830191909152016103fe565b348015610bf257600080fd5b50610427610c0136600461510d565b600360209081526000928352604080842090915290825290205460ff1681565b348015610c2d57600080fd5b50610427610c3c366004615262565b6125c6565b348015610c4d57600080fd5b50610457610c5c3660046152db565b6129d3565b348015610c6d57600080fd5b50610457610c7c3660046148b7565b612a5b565b348015610c8d57600080fd5b50610457610c9c366004615343565b612a6d565b60006301ffc9a760e01b6001600160e01b031983161480610cd25750636cdb3d1360e11b6001600160e01b03198316145b80610ced57506303a24d0760e21b6001600160e01b03198316145b80610d0857506001600160e01b0319821663152a902d60e11b145b92915050565b6000610d1a8133612b62565b50601955565b60008054610d2d90615378565b80601f0160208091040260200160405190810160405280929190818152602001828054610d5990615378565b8015610da65780601f10610d7b57610100808354040283529160200191610da6565b820191906000526020600020905b815481529060010190602001808311610d8957829003601f168201915b505050505081565b6013546001600160a01b03163314610dd95760405163231a964b60e11b815260040160405180910390fd5b601454811115610dfc5760405163a223083f60e01b815260040160405180910390fd5b60008111610e1d5760405163b4b79d4f60e01b815260040160405180910390fd5b601455565b60606000610e2f83612be2565b905080610e3b84612d7e565b604051602001610e4c9291906153ac565b604051602081830303815290604052915050919050565b610e6b612e7e565b610e905760405162461bcd60e51b8152600401610e87906153db565b60405180910390fd5b610e9981612e8f565b50565b610ea4612e7e565b610ec05760405162461bcd60e51b8152600401610e87906153db565b600084815260156020526040902080546001820154818415610ee957610ee68284615419565b90505b600184018690558084556000805b8781101561109757801580610f2f5750888882818110610f1957610f1961542c565b9050602002810190610f2b9190615442565b3582105b610f605760405162461bcd60e51b815260206004820152600260248201526114d560f21b6044820152606401610e87565b60006002870181610f718487615419565b8152602001908152602001600020600201549050898983818110610f9757610f9761542c565b9050602002810190610fa99190615442565b60200135811115610ff15760405162461bcd60e51b81526020600482015260126024820152711b585e081cdd5c1c1b1e4818db185a5b595960721b6044820152606401610e87565b8989838181106110035761100361542c565b90506020028101906110159190615442565b6002880160006110258588615419565b8152602001908152602001600020818161103f91906155af565b508190506002880160006110538588615419565b81526020810191909152604001600020600201558989838181106110795761107961542c565b905060200281019061108b9190615442565b35925050600101610ef7565b50851561110e57835b82811015611108576000818152600280880160205260408220828155600181018390559081018290556003810182905560048101829055600581018290556006810180546001600160a01b0319169055906110fe60078301826147f5565b50506001016110a0565b50611194565b8683111561119457865b83811015611192576002860160006111308386615419565b81526020810191909152604001600090812081815560018101829055600281018290556003810182905560048101829055600581018290556006810180546001600160a01b03191690559061118860078301826147f5565b5050600101611118565b505b887f066f72a648b18490c0bc4ab07d508cdb5d6589fa188c63cfba1e0547f3a6556a8989896040516111c89392919061569b565b60405180910390a2505050505050505050565b60006111e660095490565b82106112245760405162461bcd60e51b815260206004820152600d60248201526c092dcecc2d8d2c840d2dcc8caf609b1b6044820152606401610e87565b600982815481106112375761123761542c565b90600052602060002001549050919050565b60006112558133612b62565b506000918252601b602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b6000806000806112938661144c565b90945084925061ffff1690506127106112ac8287615783565b6112b691906157b0565b925050509250929050565b6001600160a01b0385163314806112fb57506001600160a01b038516600090815260036020908152604080832033845290915290205460ff165b61133c5760405162461bcd60e51b81526020600482015260126024820152710853d5d3915497d3d497d054141493d5915160721b6044820152606401610e87565b6113498585858585612ee1565b5050505050565b6000828152601160205260409020546113699033612b62565b60008281526010602090815260408083206001600160a01b038516845290915290205460ff16156113dc5760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c79206772616e7420746f206e6f6e20686f6c646572730000006044820152606401610e87565b6113e6828261308d565b5050565b336001600160a01b038216146114425760405162461bcd60e51b815260206004820152601a60248201527f43616e206f6e6c792072656e6f756e636520666f722073656c660000000000006044820152606401610e87565b6113e682826130a1565b6000818152600860209081526040808320815180830190925280546001600160a01b03168083526001909101549282019290925282911561149357805160208201516114ad565b6007546001600160a01b03811690600160a01b900461ffff165b9250925050915091565b606081518351146114da5760405162461bcd60e51b8152600401610e87906157c4565b600083516001600160401b038111156114f5576114f5614a59565b60405190808252806020026020018201604052801561151e578160200160208202803683370190505b50905060005b84518110156115bb57600260008683815181106115435761154361542c565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600085838151811061157f5761157f61542c565b60200260200101518152602001908152602001600020548282815181106115a8576115a861542c565b6020908102919091010152600101611524565b509392505050565b6115d2868887878787876130f8565b60006115dd876116c8565b90506115ee813389898989896125c6565b5060008781526015602090815260408083208484526002908101909252822001805488929061161e908490615419565b90915550506000878152601560209081526040808320848452600301825280832033845290915281208054889290611657908490615419565b9091555061166b90508760008888886131a8565b611676888888613244565b60408051888152602081018890526001600160a01b038a1691339184917ffa76a4010d9533e3e964f2930a65fb6042a12fa6ff5b08281837a10b0be7321e910160405180910390a45050505050505050565b60008181526015602052604081206001810154815483916116e891615419565b90505b8154811115611742576002820160006117056001846157ed565b8152602001908152602001600020600001544210611730576117286001826157ed565b949350505050565b8061173a81615800565b9150506116eb565b5060405162461bcd60e51b815260206004820152600b60248201526a10a1a7a72224aa24a7a71760a91b6044820152606401610e87565b611781612e7e565b61179d5760405162461bcd60e51b8152600401610e87906153db565b6113e6828261325f565b336001600160a01b0384168114806117e457506001600160a01b0380851660009081526003602090815260408083209385168352929052205460ff165b6118245760405162461bcd60e51b81526020600482015260116024820152702ab730b8383937bb32b21031b0b63632b960791b6044820152606401610e87565b81518351146118675760405162461bcd60e51b815260206004820152600f60248201526e098cadccee8d040dad2e6dac2e8c6d608b1b6044820152606401610e87565b60005b8351811015611937578281815181106118855761188561542c565b602002602001015160026000876001600160a01b03166001600160a01b0316815260200190815260200160002060008684815181106118c6576118c661542c565b602002602001015181526020019081526020016000205410156119255760405162461bcd60e51b8152602060048201526017602482015276139bdd08195b9bdd59da081d1bdad95b9cc81bdddb9959604a1b6044820152606401610e87565b611930600182615419565b905061186a565b50611943848484613305565b50505050565b611951612e7e565b61196d5760405162461bcd60e51b8152600401610e87906153db565b610e99816134b0565b60006119828133612b62565b506000918252601a602052604090912055565b60008281526012602052604081205481805b82811015611a7a5760008681526012602090815260408083208484526001019091529020546001600160a01b031615611a2357848203611a115760008681526012602090815260408083209383526001909301905220546001600160a01b03169250610d08915050565b611a1c600183615419565b9150611a68565b611a2e866000611a83565b8015611a555750600086815260126020908152604080832083805260020190915290205481145b15611a6857611a65600183615419565b91505b611a73600182615419565b90506119a7565b50505092915050565b60009182526010602090815260408084206001600160a01b0393909316845291905290205460ff1690565b611ab6612e7e565b611ad25760405162461bcd60e51b8152600401610e87906153db565b610e9981613544565b611ae3613620565b611b295760405162461bcd60e51b81526020600482015260176024820152762737ba1030baba3437b934bd32b2103a379036b4b73a1760491b6044820152606401610e87565b6000825111611b715760405162461bcd60e51b815260206004820152601460248201527326b4b73a34b733903d32b937903a37b5b2b7399760611b6044820152606401610e87565b8151835114611bb55760405162461bcd60e51b815260206004820152601060248201526f2632b733ba341036b4b9b6b0ba31b41760811b6044820152606401610e87565b6000611bc0600f5490565b9050806000805b8651811015611c9657600019878281518110611be557611be561542c565b602002602001015103611c2f5783878281518110611c0557611c0561542c565b6020908102919091010152611c1b600185615419565b9350611c28600183615419565b9150611c84565b83878281518110611c4257611c4261542c565b602002602001015110611c845760405162461bcd60e51b815260206004820152600a6024820152691a5b9d985b1a59081a5960b21b6044820152606401610e87565b611c8f600182615419565b9050611bc7565b508015611cab57611ca882828661364d565b50505b82600c81905550611ccd878787604051806020016040528060008152506136b1565b50505050505050565b60018054610d2d90615378565b611ceb612e7e565b611d075760405162461bcd60e51b8152600401610e87906153db565b611d12838383613801565b505050565b336001600160a01b0383168103611d615760405162461bcd60e51b815260206004820152600e60248201526d20a8282927ab24a723afa9a2a62360911b6044820152606401610e87565b6001600160a01b03818116600081815260036020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191015b60405180910390a3505050565b600082815260106020908152604080832083805290915281205460ff16611e1c575060008281526010602090815260408083206001600160a01b038516845290915290205460ff16610d08565b50600192915050565b6060816001600160401b03811115611e3f57611e3f614a59565b604051908082528060200260200182016040528015611e7257816020015b6060815260200190600190039081611e5d5790505b509050336000805b84811015611a7a578115611ef957611ed730878784818110611e9e57611e9e61542c565b9050602002810190611eb09190615462565b86604051602001611ec393929190615817565b6040516020818303038152906040526138c2565b848281518110611ee957611ee961542c565b6020026020010181905250611f79565b611f5b30878784818110611f0f57611f0f61542c565b9050602002810190611f219190615462565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506138c292505050565b848281518110611f6d57611f6d61542c565b60200260200101819052505b600101611e7a565b611f89613620565b611fcf5760405162461bcd60e51b81526020600482015260176024820152762737ba1030baba3437b934bd32b2103a379036b4b73a1760491b6044820152606401610e87565b600080611fdb600f5490565b90506000198503612011578091506001600c6000828254611ffc9190615419565b9091555061200c905081856138ee565b612051565b80851061204d5760405162461bcd60e51b815260206004820152600a6024820152691a5b9d985b1a59081a5960b21b6044820152606401610e87565b8491505b61206c86838560405180602001604052806000815250613906565b505050505050565b336001600160a01b03831614806120ae57506001600160a01b038216600090815260036020908152604080832033845290915290205460ff165b6120e25760405162461bcd60e51b815260206004820152600560248201526404282eae8d60db1b6044820152606401610e87565b6018546001600160a01b038316600090815260026020908152604080832083805290915290205410156121415760405162461bcd60e51b815260206004820152600760248201526621546f6b656e7360c81b6044820152606401610e87565b6001600052601a6020527ff88cd8d612926ebb404e40725c01084b6e9b3ce0344cde068570342cbd448c615415806121d2575060016000527ff88cd8d612926ebb404e40725c01084b6e9b3ce0344cde068570342cbd448c6154601954600d6020527ffd54ff1ed53f34a900b24c5ba64f85761163b5d82d98a47b9bd80e45466993c5546121cf9190615419565b11155b6122085760405162461bcd60e51b815260206004820152600760248201526621537570706c7960c81b6044820152606401610e87565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0382160161224f57601454341461224f576040516348fa9b2b60e11b815260040160405180910390fd5b61225d3360006018546139df565b61227b33600160195460405180602001604052806000815250613906565b6013546014546113e691839133916001600160a01b031690613b04565b600081815260126020526040812054815b818110156122fc5760008481526012602090815260408083208484526001019091529020546001600160a01b0316156122ea576122e7600184615419565b92505b6122f5600182615419565b90506122a9565b50612308836000611a83565b1561231b57612318600183615419565b91505b50919050565b600061232b613b4a565b6123485760405163779def6f60e11b815260040160405180910390fd5b8560021461236957604051634ff64a9f60e01b815260040160405180910390fd5b600f541561238a5760405163389e3b7760e21b815260040160405180910390fd5b6000600f5490506123d2818888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061364d92505050565b600f919091559150807f2a0365091ef1a40953c670dce28177e37520648a6fdc91506bffac0ab045570d60016124088a84615419565b61241291906157ed565b8888888860405161242795949392919061583d565b60405180910390a25095945050505050565b61248d60405180610100016040528060008152602001600081526020016000815260200160008152602001600080191681526020016000815260200160006001600160a01b03168152602001606081525090565b600083815260156020908152604080832085845260029081018352928190208151610100810183528154815260018201549381019390935292830154908201526003820154606082015260048201546080820152600582015460a082015260068201546001600160a01b031660c082015260078201805491929160e08401919061251690615378565b80601f016020809104026020016040519081016040528092919081815260200182805461254290615378565b801561258f5780601f106125645761010080835404028352916020019161258f565b820191906000526020600020905b81548152906001019060200180831161257257829003601f168201915b505050505081525050905092915050565b6000828152601160205260409020546114429033612b62565b60058054610d2d90615378565b60008581526015602090815260408083208a8452600290810183528184208251610100810184528154815260018201549481019490945290810154918301919091526003810154606083015260048101546080830152600581015460a083015260068101546001600160a01b031660c08301526007810180548493929160e084019161265190615378565b80601f016020809104026020016040519081016040528092919081815260200182805461267d90615378565b80156126ca5780601f1061269f576101008083540402835291602001916126ca565b820191906000526020600020905b8154815290600101906020018083116126ad57829003601f168201915b50505091909252505050606081015160a082015160c083015160808401519394509192909190156127af576127ab6127028780615876565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505060808088015191508e9060208b01359060408c013590612757908d0160608e01614933565b6040516bffffffffffffffffffffffff19606095861b811660208301526034820194909452605481019290925290921b16607482015260880160405160208183030381529060405280519060200120613b59565b5094505b84156128365785602001356000036127c757826127cd565b85602001355b92506000198660400135036127e257816127e8565b85604001355b91506000198660400135141580156128195750600061280d6080880160608901614933565b6001600160a01b031614155b6128235780612833565b6128336080870160608801614933565b90505b6000601560008c815260200190815260200160002060030160008e815260200190815260200160002060008d6001600160a01b03166001600160a01b03168152602001908152602001600020549050816001600160a01b0316896001600160a01b03161415806128a65750828814155b156128e65760405162461bcd60e51b815260206004820152601060248201526f2150726963654f7243757272656e637960801b6044820152606401610e87565b8915806128fb5750836128f9828c615419565b115b156129315760405162461bcd60e51b8152600401610e87906020808252600490820152632151747960e01b604082015260600190565b84602001518a86604001516129469190615419565b11156129815760405162461bcd60e51b815260206004820152600a602482015269214d6178537570706c7960b01b6044820152606401610e87565b84514210156129c35760405162461bcd60e51b815260206004820152600e60248201526d18d85b9d0818db185a5b481e595d60921b6044820152606401610e87565b5050505050979650505050505050565b6001600160a01b038516331480612a0d57506001600160a01b038516600090815260036020908152604080832033845290915290205460ff165b612a4e5760405162461bcd60e51b81526020600482015260126024820152710853d5d3915497d3d497d054141493d5915160721b6044820152606401610e87565b6113498585858585613c1d565b6000612a678133612b62565b50601855565b336001600160a01b038416811480612aaa57506001600160a01b0380851660009081526003602090815260408083209385168352929052205460ff165b612aea5760405162461bcd60e51b81526020600482015260116024820152702ab730b8383937bb32b21031b0b63632b960791b6044820152606401610e87565b6001600160a01b0384166000908152600260209081526040808320868452909152902054821115612b575760405162461bcd60e51b8152602060048201526017602482015276139bdd08195b9bdd59da081d1bdad95b9cc81bdddb9959604a1b6044820152606401610e87565b6119438484846139df565b60008281526010602090815260408083206001600160a01b038516845290915290205460ff166113e657612ba0816001600160a01b03166014613d43565b612bab836020613d43565b604051602001612bbc9291906158bf565b60408051601f198184030181529082905262461bcd60e51b8252610e8791600401614920565b60606000612bef60095490565b905060006009805480602002602001604051908101604052809291908181526020018280548015612c3f57602002820191906000526020600020905b815481526020019060010190808311612c2b575b5050505050905060005b82811015612d4357818181518110612c6357612c6361542c565b6020026020010151851015612d3157600a6000838381518110612c8857612c8861542c565b602002602001015181526020019081526020016000208054612ca990615378565b80601f0160208091040260200160405190810160405280929190818152602001828054612cd590615378565b8015612d225780601f10612cf757610100808354040283529160200191612d22565b820191906000526020600020905b815481529060010190602001808311612d0557829003601f168201915b50505050509350505050919050565b612d3c600182615419565b9050612c49565b5060405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d1bdad95b9259608a1b6044820152606401610e87565b606081600003612da55750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612dcf5780612db98161592c565b9150612dc89050600a836157b0565b9150612da9565b6000816001600160401b03811115612de957612de9614a59565b6040519080825280601f01601f191660200182016040528015612e13576020820181803683370190505b5090505b841561172857612e286001836157ed565b9150612e35600a86615945565b612e40906030615419565b60f81b818381518110612e5557612e5561542c565b60200101906001600160f81b031916908160001a905350612e77600a866157b0565b9450612e17565b6000612e8a8133611a83565b905090565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d7690600090a35050565b8151835114612f025760405162461bcd60e51b8152600401610e87906157c4565b6001600160a01b038416612f285760405162461bcd60e51b8152600401610e8790615959565b33612f37818787878787613ede565b60005b8451811015613027576000858281518110612f5757612f5761542c565b602002602001015190506000858381518110612f7557612f7561542c565b6020908102919091018101516001600160a01b038b166000908152600283526040808220868352909352919091205490915081811015612fc75760405162461bcd60e51b8152600401610e879061597f565b6001600160a01b03808b16600090815260026020818152604080842088855282528084208787039055938d16835290815282822086835290529081208054849290613013908490615419565b909155505060019093019250612f3a915050565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516130779291906159a9565b60405180910390a461206c818787878787613fd8565b613097828261412b565b6113e68282614186565b6130ab82826141f3565b60008281526012602090815260408083206001600160a01b03851680855260028201808552838620805487526001909301855292852080546001600160a01b031916905584529152555050565b86156131335760405162461bcd60e51b815260206004820152600a60248201526921436c61696d61626c6560b01b6044820152606401610e87565b6000878152601a6020526040902054158061317257506000878152601a6020908152604080832054600d9092529091205461316f908790615419565b11155b611ccd5760405162461bcd60e51b815260206004820152600760248201526621537570706c7960c81b6044820152606401610e87565b60008082116131b85760006131c2565b6131c28285615783565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03841601613215576014546131f69082615419565b3414613215576040516348fa9b2b60e11b815260040160405180910390fd5b81156132275761322783338784613b04565b60135460145461206c91859133916001600160a01b031690613b04565b611d1283838360405180602001604052806000815250613906565b6127108111156132a35760405162461bcd60e51b815260206004820152600f60248201526e45786365656473206d61782062707360881b6044820152606401610e87565b600780546001600160a01b0384166001600160b01b03199091168117600160a01b61ffff851602179091556040518281527f90d7ec04bcb8978719414f82e52e4cb651db41d0e6f8cea6118c2191e6183adb9060200160405180910390a25050565b6001600160a01b03831661334c5760405162461bcd60e51b815260206004820152600e60248201526d232927a6afad22a927afa0a2222960911b6044820152606401610e87565b805182511461336d5760405162461bcd60e51b8152600401610e87906157c4565b600033905061339081856000868660405180602001604052806000815250613ede565b60005b83518110156134515760008482815181106133b0576133b061542c565b6020026020010151905060008483815181106133ce576133ce61542c565b6020908102919091018101516001600160a01b03891660009081526002835260408082208683529093529190912054909150818110156134205760405162461bcd60e51b8152600401610e879061597f565b6001600160a01b03881660009081526002602090815260408083209583529490529290922091039055600101613393565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516134a29291906159a9565b60405180910390a450505050565b6001600160a01b0381166134fa5760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081c9958da5c1a595b9d607a1b6044820152606401610e87565b600e80546001600160a01b0319166001600160a01b0383169081179091556040517f299d17e95023f496e0ffc4909cff1a61f74bb5eb18de6f900f4155bfa1b3b33390600090a250565b60006005805461355390615378565b80601f016020809104026020016040519081016040528092919081815260200182805461357f90615378565b80156135cc5780601f106135a1576101008083540402835291602001916135cc565b820191906000526020600020905b8154815290600101906020018083116135af57829003601f168201915b5050505050905081600590816135e291906159d7565b507fc9c7c3fe08b88b4df9d4d47ef47d2c43d55c025a0ba88ca442580ed9e7348a168183604051613614929190615a96565b60405180910390a15050565b60006136346006546001600160a01b031690565b6001600160a01b0316336001600160a01b031614905090565b60008061365a8486615419565b60098054600181019091557f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af018190556000818152600a602052604090209092508291506136a884826159d7565b50935093915050565b6001600160a01b0384166136d75760405162461bcd60e51b8152600401610e8790615959565b81518351146136f85760405162461bcd60e51b8152600401610e87906157c4565b3361370881600087878787613ede565b60005b8451811015613799578381815181106137265761372661542c565b602002602001015160026000886001600160a01b03166001600160a01b0316815260200190815260200160002060008784815181106137675761376761542c565b60200260200101518152602001908152602001600020600082825461378c9190615419565b909155505060010161370b565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516137ea9291906159a9565b60405180910390a461134981600087878787613fd8565b6127108111156138455760405162461bcd60e51b815260206004820152600f60248201526e45786365656473206d61782062707360881b6044820152606401610e87565b6040805180820182526001600160a01b038481168083526020808401868152600089815260088352869020945185546001600160a01b031916941693909317845591516001909301929092559151838152909185917f7365cf4122f072a3365c20d54eff9b38d73c096c28e1892ec8f5b0e403a0f12d9101611dc2565b60606138e78383604051806060016040528060278152602001615c3960279139614255565b9392505050565b6000828152600460205260409020611d1282826159d7565b6001600160a01b03841661392c5760405162461bcd60e51b8152600401610e8790615959565b3361394c8160008761393d886142cd565b613946886142cd565b87613ede565b6001600160a01b03851660009081526002602090815260408083208784529091528120805485929061397f908490615419565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461134981600087878787614318565b6001600160a01b038316613a265760405162461bcd60e51b815260206004820152600e60248201526d232927a6afad22a927afa0a2222960911b6044820152606401610e87565b33613a5581856000613a37876142cd565b613a40876142cd565b60405180602001604052806000815250613ede565b6001600160a01b038416600090815260026020908152604080832086845290915290205482811015613a995760405162461bcd60e51b8152600401610e879061597f565b6001600160a01b03858116600081815260026020908152604080832089845282528083208887039055805189815291820188905291938616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b80156119435773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03851601613b3e57613b3982826143f5565b611943565b61194384848484614498565b6000612e8a6017546108b33390565b6000808281805b8751811015613c1157613b74600283615783565b91506000888281518110613b8a57613b8a61542c565b60200260200101519050808411613bcc576040805160208101869052908101829052606001604051602081830303815290604052805190602001209350613c08565b6040805160208101839052908101859052606001604051602081830303815290604052805190602001209350600183613c059190615419565b92505b50600101613b60565b50941495939450505050565b6001600160a01b038416613c435760405162461bcd60e51b8152600401610e8790615959565b33613c5381878761393d886142cd565b6001600160a01b038616600090815260026020908152604080832087845290915290205483811015613c975760405162461bcd60e51b8152600401610e879061597f565b6001600160a01b0380881660009081526002602081815260408084208a855282528084208987039055938a16835290815282822088835290529081208054869290613ce3908490615419565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611ccd828888888888614318565b60606000613d52836002615783565b613d5d906002615419565b6001600160401b03811115613d7457613d74614a59565b6040519080825280601f01601f191660200182016040528015613d9e576020820181803683370190505b509050600360fc1b81600081518110613db957613db961542c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613de857613de861542c565b60200101906001600160f81b031916908160001a9053506000613e0c846002615783565b613e17906001615419565b90505b6001811115613e8f576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613e4b57613e4b61542c565b1a60f81b828281518110613e6157613e6161542c565b60200101906001600160f81b031916908160001a90535060049490941c93613e8881615800565b9050613e1a565b5083156138e75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e87565b6001600160a01b038516613f5c5760005b8351811015613f5a57828181518110613f0a57613f0a61542c565b6020026020010151600d6000868481518110613f2857613f2861542c565b602002602001015181526020019081526020016000206000828254613f4d9190615419565b9091555050600101613eef565b505b6001600160a01b03841661206c5760005b8351811015611ccd57828181518110613f8857613f8861542c565b6020026020010151600d6000868481518110613fa657613fa661542c565b602002602001015181526020019081526020016000206000828254613fcb91906157ed565b9091555050600101613f6d565b6001600160a01b0384163b1561206c5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061401c9089908990889088908890600401615abb565b6020604051808303816000875af1925050508015614057575060408051601f3d908101601f1916820190925261405491810190615b0d565b60015b6140d957614063615b2a565b806308c379a00361409c5750614077615b46565b80614082575061409e565b8060405162461bcd60e51b8152600401610e879190614920565b505b60405162461bcd60e51b815260206004820152601060248201526f10a2a92198989a9aa922a1a2a4ab22a960811b6044820152606401610e87565b6001600160e01b0319811663bc197c8160e01b14611ccd5760405162461bcd60e51b815260206004820152600f60248201526e1513d2d15394d7d491529150d51151608a1b6044820152606401610e87565b60008281526010602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000828152601260205260408120805491600191906141a58385615419565b9091555050600092835260126020908152604080852083865260018101835281862080546001600160a01b039096166001600160a01b03199096168617905593855260029093019052912055565b6141fd8282612b62565b60008281526010602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6060600080856001600160a01b0316856040516142729190615bcf565b600060405180830381855af49150503d80600081146142ad576040519150601f19603f3d011682016040523d82523d6000602084013e6142b2565b606091505b50915091506142c3868383876144eb565b9695505050505050565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106143075761430761542c565b602090810291909101015292915050565b6001600160a01b0384163b1561206c5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061435c9089908990889088908890600401615be1565b6020604051808303816000875af1925050508015614397575060408051601f3d908101601f1916820190925261439491810190615b0d565b60015b6143a357614063615b2a565b6001600160e01b0319811663f23a6e6160e01b14611ccd5760405162461bcd60e51b815260206004820152600f60248201526e1513d2d15394d7d491529150d51151608a1b6044820152606401610e87565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114614442576040519150601f19603f3d011682016040523d82523d6000602084013e614447565b606091505b5050905080611d125760405162461bcd60e51b815260206004820152601c60248201527f6e617469766520746f6b656e207472616e73666572206661696c6564000000006044820152606401610e87565b816001600160a01b0316836001600160a01b0316031561194357306001600160a01b038416036144d657613b396001600160a01b0385168383614564565b6119436001600160a01b0385168484846145c7565b6060831561455a578251600003614553576001600160a01b0385163b6145535760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610e87565b5081611728565b61172883836145ff565b6040516001600160a01b038316602482015260448101829052611d1290849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261460f565b6040516001600160a01b03808516602483015283166044820152606481018290526119439085906323b872dd60e01b90608401614590565b8151156140825781518083602001fd5b6000614664826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166146e19092919063ffffffff16565b805190915015611d1257808060200190518101906146829190615c1b565b611d125760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610e87565b60606117288484600085856001600160a01b0385163b6147435760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610e87565b600080866001600160a01b0316858760405161475f9190615bcf565b60006040518083038185875af1925050503d806000811461479c576040519150601f19603f3d011682016040523d82523d6000602084013e6147a1565b606091505b50915091506147b18282866147bc565b979650505050505050565b606083156147cb5750816138e7565b8251156147db5782518084602001fd5b8160405162461bcd60e51b8152600401610e879190614920565b50805461480190615378565b6000825580601f10614811575050565b601f016020900490600052602060002090810190610e9991905b8082111561483f576000815560010161482b565b5090565b6001600160a01b0381168114610e9957600080fd5b6000806040838503121561486b57600080fd5b823561487681614843565b946020939093013593505050565b6001600160e01b031981168114610e9957600080fd5b6000602082840312156148ac57600080fd5b81356138e781614884565b6000602082840312156148c957600080fd5b5035919050565b60005b838110156148eb5781810151838201526020016148d3565b50506000910152565b6000815180845261490c8160208601602086016148d0565b601f01601f19169290920160200192915050565b6020815260006138e760208301846148f4565b60006020828403121561494557600080fd5b81356138e781614843565b60008083601f84011261496257600080fd5b5081356001600160401b0381111561497957600080fd5b6020830191508360208260051b850101111561499457600080fd5b9250929050565b8015158114610e9957600080fd5b600080600080606085870312156149bf57600080fd5b8435935060208501356001600160401b038111156149dc57600080fd5b6149e887828801614950565b90945092505060408501356149fc8161499b565b939692955090935050565b60008060408385031215614a1a57600080fd5b823591506020830135614a2c81614843565b809150509250929050565b60008060408385031215614a4a57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715614a9457614a94614a59565b6040525050565b60006001600160401b03821115614ab457614ab4614a59565b5060051b60200190565b600082601f830112614acf57600080fd5b81356020614adc82614a9b565b604051614ae98282614a6f565b80915083815260208101915060208460051b870101935086841115614b0d57600080fd5b602086015b84811015614b295780358352918301918301614b12565b509695505050505050565b600082601f830112614b4557600080fd5b81356001600160401b03811115614b5e57614b5e614a59565b604051614b75601f8301601f191660200182614a6f565b818152846020838601011115614b8a57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215614bbf57600080fd5b8535614bca81614843565b94506020860135614bda81614843565b935060408601356001600160401b0380821115614bf657600080fd5b614c0289838a01614abe565b94506060880135915080821115614c1857600080fd5b614c2489838a01614abe565b93506080880135915080821115614c3a57600080fd5b50614c4788828901614b34565b9150509295509295909350565b60008060408385031215614c6757600080fd5b82356001600160401b0380821115614c7e57600080fd5b818501915085601f830112614c9257600080fd5b81356020614c9f82614a9b565b604051614cac8282614a6f565b83815260059390931b8501820192828101915089841115614ccc57600080fd5b948201945b83861015614cf3578535614ce481614843565b82529482019490820190614cd1565b96505086013592505080821115614d0957600080fd5b50614d1685828601614abe565b9150509250929050565b60008151808452602080850194506020840160005b83811015614d5157815187529582019590820190600101614d35565b509495945050505050565b6020815260006138e76020830184614d20565b60006080828403121561231b57600080fd5b600080600080600080600060e0888a031215614d9c57600080fd5b8735614da781614843565b965060208801359550604088013594506060880135614dc581614843565b93506080880135925060a08801356001600160401b0380821115614de857600080fd5b614df48b838c01614d6f565b935060c08a0135915080821115614e0a57600080fd5b50614e178a828b01614b34565b91505092959891949750929550565b600080600060608486031215614e3b57600080fd5b83359250602084013591506040840135614e5481614843565b809150509250925092565b600080600060608486031215614e7457600080fd5b8335614e7f81614843565b925060208401356001600160401b0380821115614e9b57600080fd5b614ea787838801614abe565b93506040860135915080821115614ebd57600080fd5b50614eca86828701614abe565b9150509250925092565b600060208284031215614ee657600080fd5b81356001600160401b03811115614efc57600080fd5b61172884828501614b34565b60008060008060808587031215614f1e57600080fd5b8435614f2981614843565b935060208501356001600160401b0380821115614f4557600080fd5b614f5188838901614abe565b94506040870135915080821115614f6757600080fd5b614f7388838901614abe565b93506060870135915080821115614f8957600080fd5b50614f9687828801614b34565b91505092959194509250565b600080600060608486031215614fb757600080fd5b833592506020840135614fc981614843565b929592945050506040919091013590565b60008060408385031215614fed57600080fd5b8235614ff881614843565b91506020830135614a2c8161499b565b6000806020838503121561501b57600080fd5b82356001600160401b0381111561503157600080fd5b61503d85828601614950565b90969095509350505050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156150a057603f1988860301845261508e8583516148f4565b94509285019290850190600101615072565b5092979650505050505050565b600080600080608085870312156150c357600080fd5b84356150ce81614843565b93506020850135925060408501356001600160401b038111156150f057600080fd5b6150fc87828801614b34565b949793965093946060013593505050565b6000806040838503121561512057600080fd5b823561512b81614843565b91506020830135614a2c81614843565b60008083601f84011261514d57600080fd5b5081356001600160401b0381111561516457600080fd5b60208301915083602082850101111561499457600080fd5b60008060008060006060868803121561519457600080fd5b8535945060208601356001600160401b03808211156151b257600080fd5b6151be89838a0161513b565b909650945060408801359150808211156151d757600080fd5b506151e48882890161513b565b969995985093965092949392505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a082015260a082015160c082015260018060a01b0360c08301511660e0820152600060e08301516101008081850152506117286101208401826148f4565b600080600080600080600060e0888a03121561527d57600080fd5b87359650602088013561528f81614843565b9550604088013594506060880135935060808801356152ad81614843565b925060a0880135915060c08801356001600160401b038111156152cf57600080fd5b614e178a828b01614d6f565b600080600080600060a086880312156152f357600080fd5b85356152fe81614843565b9450602086013561530e81614843565b9350604086013592506060860135915060808601356001600160401b0381111561533757600080fd5b614c4788828901614b34565b60008060006060848603121561535857600080fd5b833561536381614843565b95602085013595506040909401359392505050565b600181811c9082168061538c57607f821691505b60208210810361231b57634e487b7160e01b600052602260045260246000fd5b600083516153be8184602088016148d0565b8351908301906153d28183602088016148d0565b01949350505050565b6020808252600e908201526d139bdd08185d5d1a1bdc9a5e995960921b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610d0857610d08615403565b634e487b7160e01b600052603260045260246000fd5b6000823560fe1983360301811261545857600080fd5b9190910192915050565b6000808335601e1984360301811261547957600080fd5b8301803591506001600160401b0382111561549357600080fd5b60200191503681900382131561499457600080fd5b601f821115611d12576000816000526020600020601f850160051c810160208610156154d15750805b601f850160051c820191505b8181101561206c578281556001016154dd565b6001600160401b0383111561550757615507614a59565b61551b836155158354615378565b836154a8565b6000601f84116001811461554f57600085156155375750838201355b600019600387901b1c1916600186901b178355611349565b600083815260209020601f19861690835b828110156155805786850135825560209485019460019092019101615560565b508682101561559d5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b813581556020820135600182015560408201356002820155606082013560038201556080820135600482015560a082013560058201556006810160c08301356155f781614843565b81546001600160a01b0319166001600160a01b039190911617905561561f60e0830183615462565b6119438183600786016154f0565b6000808335601e1984360301811261564457600080fd5b83016020810192503590506001600160401b0381111561566357600080fd5b80360382131561499457600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60408082528181018490526000906060808401600587901b850182018885805b8a81101561576d57888403605f190185528235368d900360fe190181126156e0578283fd5b8c018035855260208082013581870152888201358987015287820135888701526080808301359087015260a080830135908701526101009060c08084013561572781614843565b6001600160a01b03169088015260e06157428482018561562d565b945083828a0152615756848a018683615672565b9983019998505050949094019350506001016156bb565b5050508615156020870152935061172892505050565b8082028115828204841417610d0857610d08615403565b634e487b7160e01b600052601260045260246000fd5b6000826157bf576157bf61579a565b500490565b6020808252600f908201526e0988a9c8ea890be9a92a69a82a8869608b1b604082015260600190565b81810381811115610d0857610d08615403565b60008161580f5761580f615403565b506000190190565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b858152606060208201526000615857606083018688615672565b828103604084015261586a818587615672565b98975050505050505050565b6000808335601e1984360301811261588d57600080fd5b8301803591506001600160401b038211156158a757600080fd5b6020019150600581901b360382131561499457600080fd5b7402832b936b4b9b9b4b7b7399d1030b1b1b7bab73a1605d1b8152600083516158ef8160158501602088016148d0565b7001034b99036b4b9b9b4b733903937b6329607d1b60159184019182015283516159208160268401602088016148d0565b01602601949350505050565b60006001820161593e5761593e615403565b5060010190565b6000826159545761595461579a565b500690565b6020808252600c908201526b2a27afad22a927afa0a2222960a11b604082015260600190565b60208082526010908201526f125394d551919250d251539517d0905360821b604082015260600190565b6040815260006159bc6040830185614d20565b82810360208401526159ce8185614d20565b95945050505050565b81516001600160401b038111156159f0576159f0614a59565b615a04816159fe8454615378565b846154a8565b602080601f831160018114615a395760008415615a215750858301515b600019600386901b1c1916600185901b17855561206c565b600085815260208120601f198616915b82811015615a6857888601518255948401946001909101908401615a49565b5085821015615a865787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604081526000615aa960408301856148f4565b82810360208401526159ce81856148f4565b6001600160a01b0386811682528516602082015260a060408201819052600090615ae790830186614d20565b8281036060840152615af98186614d20565b9050828103608084015261586a81856148f4565b600060208284031215615b1f57600080fd5b81516138e781614884565b600060033d1115615b435760046000803e5060005160e01c5b90565b600060443d1015615b545790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715615b8357505050505090565b8285019150815181811115615b9b5750505050505090565b843d8701016020828501011115615bb55750505050505090565b615bc460208286010187614a6f565b509095945050505050565b600082516154588184602087016148d0565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906147b1908301846148f4565b600060208284031215615c2d57600080fd5b81516138e78161499b56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212206572335dad1a1e8a22e127bbcccde610b3cdf523b3ff6dc878e358f467780e9364736f6c63430008170033000000000000000000000000f563fac20fe0f85e573fefee0013d5a2062a41d300000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000f563fac20fe0f85e573fefee0013d5a2062a41d300000000000000000000000000000000000000000000000009214fc70912a1d4000000000000000000000000f563fac20fe0f85e573fefee0013d5a2062a41d30000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000000b50696e6b42616c6c6f6f6e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000450696e6b00000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106103b75760003560e01c80639010d07c116101f2578063bd85b0391161010d578063dbe55e56116100a0578063ea1def9c1161006f578063ea1def9c14610c21578063f242432a14610c41578063f43c0b8214610c61578063f5298aca14610c8157600080fd5b8063dbe55e5614610b68578063e8a3d48514610b88578063e9703d2514610b9d578063e985e9c514610be657600080fd5b8063cb2ef6f7116100dc578063cb2ef6f714610ad8578063d37c353b14610afb578063d45b28d714610b1b578063d547741f14610b4857600080fd5b8063bd85b03914610a42578063c1faece414610a6f578063c7337d6b14610a82578063ca15c87314610ab857600080fd5b8063a0a8e46011610185578063a38873f611610154578063a38873f6146109b4578063ac9650d8146109ca578063b03f4528146109f7578063b24f2d3914610a1757600080fd5b8063a0a8e46014610943578063a217fddf1461095f578063a22cb46514610974578063a32fa5b31461099457600080fd5b8063949c09f7116101c1578063949c09f7146108d857806395d89b41146108f85780639bcf7a151461090d5780639ed3edf01461092d57600080fd5b80639010d07c146108625780639087fd661461088257806391d1485414610898578063938e3d7b146108b857600080fd5b80632f2ff15d116102e2578063600dd5ea11610275578063830405321161024457806383040532146107df57806385d791021461080f57806387198cf2146108245780638da5cb5b1461084457600080fd5b8063600dd5ea1461076a57806363b45e2d1461078a5780636b20c4541461079f5780636f4f2837146107bf57600080fd5b80634e1273f4116102b15780634e1273f4146106bd57806357bc3d78146106ea5780635811ddab146106fd5780635ab063e81461074a57600080fd5b80632f2ff15d1461062657806336568abe146106465780633b1475a7146106665780634cc157df1461067b57600080fd5b806313af40351161035a57806324aaffaa1161032957806324aaffaa1461057a57806329c49b9b146105a75780632a55205a146105c75780632eb2c2d61461060657600080fd5b806313af4035146104ed578063183718d11461050d5780632419f51b1461052d578063248a9ca31461054d57600080fd5b806306fdde031161039657806306fdde0314610459578063079fe40e1461047b578063096a8ab7146104ad5780630e89341c146104cd57600080fd5b8062fdd58e146103bc57806301ffc9a71461040757806302f0f19a14610437575b600080fd5b3480156103c857600080fd5b506103f46103d7366004614858565b600260209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561041357600080fd5b5061042761042236600461489a565b610ca1565b60405190151581526020016103fe565b34801561044357600080fd5b506104576104523660046148b7565b610d0e565b005b34801561046557600080fd5b5061046e610d20565b6040516103fe9190614920565b34801561048757600080fd5b50600e546001600160a01b03165b6040516001600160a01b0390911681526020016103fe565b3480156104b957600080fd5b506104576104c83660046148b7565b610dae565b3480156104d957600080fd5b5061046e6104e83660046148b7565b610e22565b3480156104f957600080fd5b50610457610508366004614933565b610e63565b34801561051957600080fd5b506104576105283660046149a9565b610e9c565b34801561053957600080fd5b506103f46105483660046148b7565b6111db565b34801561055957600080fd5b506103f46105683660046148b7565b60009081526011602052604090205490565b34801561058657600080fd5b506103f46105953660046148b7565b601a6020526000908152604090205481565b3480156105b357600080fd5b506104576105c2366004614a07565b611249565b3480156105d357600080fd5b506105e76105e2366004614a37565b611284565b604080516001600160a01b0390931683526020830191909152016103fe565b34801561061257600080fd5b50610457610621366004614ba7565b6112c1565b34801561063257600080fd5b50610457610641366004614a07565b611350565b34801561065257600080fd5b50610457610661366004614a07565b6113ea565b34801561067257600080fd5b50600f546103f4565b34801561068757600080fd5b5061069b6106963660046148b7565b61144c565b604080516001600160a01b03909316835261ffff9091166020830152016103fe565b3480156106c957600080fd5b506106dd6106d8366004614c54565b6114b7565b6040516103fe9190614d5c565b6104576106f8366004614d81565b6115c3565b34801561070957600080fd5b506103f4610718366004614e26565b6000928352601560209081526040808520938552600390930181528284206001600160a01b0390921684525290205490565b34801561075657600080fd5b506103f46107653660046148b7565b6116c8565b34801561077657600080fd5b50610457610785366004614858565b611779565b34801561079657600080fd5b506009546103f4565b3480156107ab57600080fd5b506104576107ba366004614e5f565b6117a7565b3480156107cb57600080fd5b506104576107da366004614933565b611949565b3480156107eb57600080fd5b506104276107fa3660046148b7565b600b6020526000908152604090205460ff1681565b34801561081b57600080fd5b506014546103f4565b34801561083057600080fd5b5061045761083f366004614a37565b611976565b34801561085057600080fd5b506006546001600160a01b0316610495565b34801561086e57600080fd5b5061049561087d366004614a37565b611995565b34801561088e57600080fd5b506103f460185481565b3480156108a457600080fd5b506104276108b3366004614a07565b611a83565b3480156108c457600080fd5b506104576108d3366004614ed4565b611aae565b3480156108e457600080fd5b506104576108f3366004614f08565b611adb565b34801561090457600080fd5b5061046e611cd6565b34801561091957600080fd5b50610457610928366004614fa2565b611ce3565b34801561093957600080fd5b506103f460145481565b34801561094f57600080fd5b50604051600181526020016103fe565b34801561096b57600080fd5b506103f4600081565b34801561098057600080fd5b5061045761098f366004614fda565b611d17565b3480156109a057600080fd5b506104276109af366004614a07565b611dcf565b3480156109c057600080fd5b506103f460195481565b3480156109d657600080fd5b506109ea6109e5366004615008565b611e25565b6040516103fe9190615049565b348015610a0357600080fd5b50610457610a123660046150ad565b611f81565b348015610a2357600080fd5b506007546001600160a01b03811690600160a01b900461ffff1661069b565b348015610a4e57600080fd5b506103f4610a5d3660046148b7565b600d6020526000908152604090205481565b610457610a7d36600461510d565b612074565b348015610a8e57600080fd5b50610495610a9d3660046148b7565b601b602052600090815260409020546001600160a01b031681565b348015610ac457600080fd5b506103f4610ad33660046148b7565b612298565b348015610ae457600080fd5b506c4552433131353545766f6c766560981b6103f4565b348015610b0757600080fd5b506103f4610b1636600461517c565b612321565b348015610b2757600080fd5b50610b3b610b36366004614a37565b612439565b6040516103fe91906151f5565b348015610b5457600080fd5b50610457610b63366004614a07565b6125a0565b348015610b7457600080fd5b50601354610495906001600160a01b031681565b348015610b9457600080fd5b5061046e6125b9565b348015610ba957600080fd5b50610bd1610bb83660046148b7565b6015602052600090815260409020805460019091015482565b604080519283526020830191909152016103fe565b348015610bf257600080fd5b50610427610c0136600461510d565b600360209081526000928352604080842090915290825290205460ff1681565b348015610c2d57600080fd5b50610427610c3c366004615262565b6125c6565b348015610c4d57600080fd5b50610457610c5c3660046152db565b6129d3565b348015610c6d57600080fd5b50610457610c7c3660046148b7565b612a5b565b348015610c8d57600080fd5b50610457610c9c366004615343565b612a6d565b60006301ffc9a760e01b6001600160e01b031983161480610cd25750636cdb3d1360e11b6001600160e01b03198316145b80610ced57506303a24d0760e21b6001600160e01b03198316145b80610d0857506001600160e01b0319821663152a902d60e11b145b92915050565b6000610d1a8133612b62565b50601955565b60008054610d2d90615378565b80601f0160208091040260200160405190810160405280929190818152602001828054610d5990615378565b8015610da65780601f10610d7b57610100808354040283529160200191610da6565b820191906000526020600020905b815481529060010190602001808311610d8957829003601f168201915b505050505081565b6013546001600160a01b03163314610dd95760405163231a964b60e11b815260040160405180910390fd5b601454811115610dfc5760405163a223083f60e01b815260040160405180910390fd5b60008111610e1d5760405163b4b79d4f60e01b815260040160405180910390fd5b601455565b60606000610e2f83612be2565b905080610e3b84612d7e565b604051602001610e4c9291906153ac565b604051602081830303815290604052915050919050565b610e6b612e7e565b610e905760405162461bcd60e51b8152600401610e87906153db565b60405180910390fd5b610e9981612e8f565b50565b610ea4612e7e565b610ec05760405162461bcd60e51b8152600401610e87906153db565b600084815260156020526040902080546001820154818415610ee957610ee68284615419565b90505b600184018690558084556000805b8781101561109757801580610f2f5750888882818110610f1957610f1961542c565b9050602002810190610f2b9190615442565b3582105b610f605760405162461bcd60e51b815260206004820152600260248201526114d560f21b6044820152606401610e87565b60006002870181610f718487615419565b8152602001908152602001600020600201549050898983818110610f9757610f9761542c565b9050602002810190610fa99190615442565b60200135811115610ff15760405162461bcd60e51b81526020600482015260126024820152711b585e081cdd5c1c1b1e4818db185a5b595960721b6044820152606401610e87565b8989838181106110035761100361542c565b90506020028101906110159190615442565b6002880160006110258588615419565b8152602001908152602001600020818161103f91906155af565b508190506002880160006110538588615419565b81526020810191909152604001600020600201558989838181106110795761107961542c565b905060200281019061108b9190615442565b35925050600101610ef7565b50851561110e57835b82811015611108576000818152600280880160205260408220828155600181018390559081018290556003810182905560048101829055600581018290556006810180546001600160a01b0319169055906110fe60078301826147f5565b50506001016110a0565b50611194565b8683111561119457865b83811015611192576002860160006111308386615419565b81526020810191909152604001600090812081815560018101829055600281018290556003810182905560048101829055600581018290556006810180546001600160a01b03191690559061118860078301826147f5565b5050600101611118565b505b887f066f72a648b18490c0bc4ab07d508cdb5d6589fa188c63cfba1e0547f3a6556a8989896040516111c89392919061569b565b60405180910390a2505050505050505050565b60006111e660095490565b82106112245760405162461bcd60e51b815260206004820152600d60248201526c092dcecc2d8d2c840d2dcc8caf609b1b6044820152606401610e87565b600982815481106112375761123761542c565b90600052602060002001549050919050565b60006112558133612b62565b506000918252601b602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b6000806000806112938661144c565b90945084925061ffff1690506127106112ac8287615783565b6112b691906157b0565b925050509250929050565b6001600160a01b0385163314806112fb57506001600160a01b038516600090815260036020908152604080832033845290915290205460ff165b61133c5760405162461bcd60e51b81526020600482015260126024820152710853d5d3915497d3d497d054141493d5915160721b6044820152606401610e87565b6113498585858585612ee1565b5050505050565b6000828152601160205260409020546113699033612b62565b60008281526010602090815260408083206001600160a01b038516845290915290205460ff16156113dc5760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c79206772616e7420746f206e6f6e20686f6c646572730000006044820152606401610e87565b6113e6828261308d565b5050565b336001600160a01b038216146114425760405162461bcd60e51b815260206004820152601a60248201527f43616e206f6e6c792072656e6f756e636520666f722073656c660000000000006044820152606401610e87565b6113e682826130a1565b6000818152600860209081526040808320815180830190925280546001600160a01b03168083526001909101549282019290925282911561149357805160208201516114ad565b6007546001600160a01b03811690600160a01b900461ffff165b9250925050915091565b606081518351146114da5760405162461bcd60e51b8152600401610e87906157c4565b600083516001600160401b038111156114f5576114f5614a59565b60405190808252806020026020018201604052801561151e578160200160208202803683370190505b50905060005b84518110156115bb57600260008683815181106115435761154361542c565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600085838151811061157f5761157f61542c565b60200260200101518152602001908152602001600020548282815181106115a8576115a861542c565b6020908102919091010152600101611524565b509392505050565b6115d2868887878787876130f8565b60006115dd876116c8565b90506115ee813389898989896125c6565b5060008781526015602090815260408083208484526002908101909252822001805488929061161e908490615419565b90915550506000878152601560209081526040808320848452600301825280832033845290915281208054889290611657908490615419565b9091555061166b90508760008888886131a8565b611676888888613244565b60408051888152602081018890526001600160a01b038a1691339184917ffa76a4010d9533e3e964f2930a65fb6042a12fa6ff5b08281837a10b0be7321e910160405180910390a45050505050505050565b60008181526015602052604081206001810154815483916116e891615419565b90505b8154811115611742576002820160006117056001846157ed565b8152602001908152602001600020600001544210611730576117286001826157ed565b949350505050565b8061173a81615800565b9150506116eb565b5060405162461bcd60e51b815260206004820152600b60248201526a10a1a7a72224aa24a7a71760a91b6044820152606401610e87565b611781612e7e565b61179d5760405162461bcd60e51b8152600401610e87906153db565b6113e6828261325f565b336001600160a01b0384168114806117e457506001600160a01b0380851660009081526003602090815260408083209385168352929052205460ff165b6118245760405162461bcd60e51b81526020600482015260116024820152702ab730b8383937bb32b21031b0b63632b960791b6044820152606401610e87565b81518351146118675760405162461bcd60e51b815260206004820152600f60248201526e098cadccee8d040dad2e6dac2e8c6d608b1b6044820152606401610e87565b60005b8351811015611937578281815181106118855761188561542c565b602002602001015160026000876001600160a01b03166001600160a01b0316815260200190815260200160002060008684815181106118c6576118c661542c565b602002602001015181526020019081526020016000205410156119255760405162461bcd60e51b8152602060048201526017602482015276139bdd08195b9bdd59da081d1bdad95b9cc81bdddb9959604a1b6044820152606401610e87565b611930600182615419565b905061186a565b50611943848484613305565b50505050565b611951612e7e565b61196d5760405162461bcd60e51b8152600401610e87906153db565b610e99816134b0565b60006119828133612b62565b506000918252601a602052604090912055565b60008281526012602052604081205481805b82811015611a7a5760008681526012602090815260408083208484526001019091529020546001600160a01b031615611a2357848203611a115760008681526012602090815260408083209383526001909301905220546001600160a01b03169250610d08915050565b611a1c600183615419565b9150611a68565b611a2e866000611a83565b8015611a555750600086815260126020908152604080832083805260020190915290205481145b15611a6857611a65600183615419565b91505b611a73600182615419565b90506119a7565b50505092915050565b60009182526010602090815260408084206001600160a01b0393909316845291905290205460ff1690565b611ab6612e7e565b611ad25760405162461bcd60e51b8152600401610e87906153db565b610e9981613544565b611ae3613620565b611b295760405162461bcd60e51b81526020600482015260176024820152762737ba1030baba3437b934bd32b2103a379036b4b73a1760491b6044820152606401610e87565b6000825111611b715760405162461bcd60e51b815260206004820152601460248201527326b4b73a34b733903d32b937903a37b5b2b7399760611b6044820152606401610e87565b8151835114611bb55760405162461bcd60e51b815260206004820152601060248201526f2632b733ba341036b4b9b6b0ba31b41760811b6044820152606401610e87565b6000611bc0600f5490565b9050806000805b8651811015611c9657600019878281518110611be557611be561542c565b602002602001015103611c2f5783878281518110611c0557611c0561542c565b6020908102919091010152611c1b600185615419565b9350611c28600183615419565b9150611c84565b83878281518110611c4257611c4261542c565b602002602001015110611c845760405162461bcd60e51b815260206004820152600a6024820152691a5b9d985b1a59081a5960b21b6044820152606401610e87565b611c8f600182615419565b9050611bc7565b508015611cab57611ca882828661364d565b50505b82600c81905550611ccd878787604051806020016040528060008152506136b1565b50505050505050565b60018054610d2d90615378565b611ceb612e7e565b611d075760405162461bcd60e51b8152600401610e87906153db565b611d12838383613801565b505050565b336001600160a01b0383168103611d615760405162461bcd60e51b815260206004820152600e60248201526d20a8282927ab24a723afa9a2a62360911b6044820152606401610e87565b6001600160a01b03818116600081815260036020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191015b60405180910390a3505050565b600082815260106020908152604080832083805290915281205460ff16611e1c575060008281526010602090815260408083206001600160a01b038516845290915290205460ff16610d08565b50600192915050565b6060816001600160401b03811115611e3f57611e3f614a59565b604051908082528060200260200182016040528015611e7257816020015b6060815260200190600190039081611e5d5790505b509050336000805b84811015611a7a578115611ef957611ed730878784818110611e9e57611e9e61542c565b9050602002810190611eb09190615462565b86604051602001611ec393929190615817565b6040516020818303038152906040526138c2565b848281518110611ee957611ee961542c565b6020026020010181905250611f79565b611f5b30878784818110611f0f57611f0f61542c565b9050602002810190611f219190615462565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506138c292505050565b848281518110611f6d57611f6d61542c565b60200260200101819052505b600101611e7a565b611f89613620565b611fcf5760405162461bcd60e51b81526020600482015260176024820152762737ba1030baba3437b934bd32b2103a379036b4b73a1760491b6044820152606401610e87565b600080611fdb600f5490565b90506000198503612011578091506001600c6000828254611ffc9190615419565b9091555061200c905081856138ee565b612051565b80851061204d5760405162461bcd60e51b815260206004820152600a6024820152691a5b9d985b1a59081a5960b21b6044820152606401610e87565b8491505b61206c86838560405180602001604052806000815250613906565b505050505050565b336001600160a01b03831614806120ae57506001600160a01b038216600090815260036020908152604080832033845290915290205460ff165b6120e25760405162461bcd60e51b815260206004820152600560248201526404282eae8d60db1b6044820152606401610e87565b6018546001600160a01b038316600090815260026020908152604080832083805290915290205410156121415760405162461bcd60e51b815260206004820152600760248201526621546f6b656e7360c81b6044820152606401610e87565b6001600052601a6020527ff88cd8d612926ebb404e40725c01084b6e9b3ce0344cde068570342cbd448c615415806121d2575060016000527ff88cd8d612926ebb404e40725c01084b6e9b3ce0344cde068570342cbd448c6154601954600d6020527ffd54ff1ed53f34a900b24c5ba64f85761163b5d82d98a47b9bd80e45466993c5546121cf9190615419565b11155b6122085760405162461bcd60e51b815260206004820152600760248201526621537570706c7960c81b6044820152606401610e87565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0382160161224f57601454341461224f576040516348fa9b2b60e11b815260040160405180910390fd5b61225d3360006018546139df565b61227b33600160195460405180602001604052806000815250613906565b6013546014546113e691839133916001600160a01b031690613b04565b600081815260126020526040812054815b818110156122fc5760008481526012602090815260408083208484526001019091529020546001600160a01b0316156122ea576122e7600184615419565b92505b6122f5600182615419565b90506122a9565b50612308836000611a83565b1561231b57612318600183615419565b91505b50919050565b600061232b613b4a565b6123485760405163779def6f60e11b815260040160405180910390fd5b8560021461236957604051634ff64a9f60e01b815260040160405180910390fd5b600f541561238a5760405163389e3b7760e21b815260040160405180910390fd5b6000600f5490506123d2818888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061364d92505050565b600f919091559150807f2a0365091ef1a40953c670dce28177e37520648a6fdc91506bffac0ab045570d60016124088a84615419565b61241291906157ed565b8888888860405161242795949392919061583d565b60405180910390a25095945050505050565b61248d60405180610100016040528060008152602001600081526020016000815260200160008152602001600080191681526020016000815260200160006001600160a01b03168152602001606081525090565b600083815260156020908152604080832085845260029081018352928190208151610100810183528154815260018201549381019390935292830154908201526003820154606082015260048201546080820152600582015460a082015260068201546001600160a01b031660c082015260078201805491929160e08401919061251690615378565b80601f016020809104026020016040519081016040528092919081815260200182805461254290615378565b801561258f5780601f106125645761010080835404028352916020019161258f565b820191906000526020600020905b81548152906001019060200180831161257257829003601f168201915b505050505081525050905092915050565b6000828152601160205260409020546114429033612b62565b60058054610d2d90615378565b60008581526015602090815260408083208a8452600290810183528184208251610100810184528154815260018201549481019490945290810154918301919091526003810154606083015260048101546080830152600581015460a083015260068101546001600160a01b031660c08301526007810180548493929160e084019161265190615378565b80601f016020809104026020016040519081016040528092919081815260200182805461267d90615378565b80156126ca5780601f1061269f576101008083540402835291602001916126ca565b820191906000526020600020905b8154815290600101906020018083116126ad57829003601f168201915b50505091909252505050606081015160a082015160c083015160808401519394509192909190156127af576127ab6127028780615876565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505060808088015191508e9060208b01359060408c013590612757908d0160608e01614933565b6040516bffffffffffffffffffffffff19606095861b811660208301526034820194909452605481019290925290921b16607482015260880160405160208183030381529060405280519060200120613b59565b5094505b84156128365785602001356000036127c757826127cd565b85602001355b92506000198660400135036127e257816127e8565b85604001355b91506000198660400135141580156128195750600061280d6080880160608901614933565b6001600160a01b031614155b6128235780612833565b6128336080870160608801614933565b90505b6000601560008c815260200190815260200160002060030160008e815260200190815260200160002060008d6001600160a01b03166001600160a01b03168152602001908152602001600020549050816001600160a01b0316896001600160a01b03161415806128a65750828814155b156128e65760405162461bcd60e51b815260206004820152601060248201526f2150726963654f7243757272656e637960801b6044820152606401610e87565b8915806128fb5750836128f9828c615419565b115b156129315760405162461bcd60e51b8152600401610e87906020808252600490820152632151747960e01b604082015260600190565b84602001518a86604001516129469190615419565b11156129815760405162461bcd60e51b815260206004820152600a602482015269214d6178537570706c7960b01b6044820152606401610e87565b84514210156129c35760405162461bcd60e51b815260206004820152600e60248201526d18d85b9d0818db185a5b481e595d60921b6044820152606401610e87565b5050505050979650505050505050565b6001600160a01b038516331480612a0d57506001600160a01b038516600090815260036020908152604080832033845290915290205460ff165b612a4e5760405162461bcd60e51b81526020600482015260126024820152710853d5d3915497d3d497d054141493d5915160721b6044820152606401610e87565b6113498585858585613c1d565b6000612a678133612b62565b50601855565b336001600160a01b038416811480612aaa57506001600160a01b0380851660009081526003602090815260408083209385168352929052205460ff165b612aea5760405162461bcd60e51b81526020600482015260116024820152702ab730b8383937bb32b21031b0b63632b960791b6044820152606401610e87565b6001600160a01b0384166000908152600260209081526040808320868452909152902054821115612b575760405162461bcd60e51b8152602060048201526017602482015276139bdd08195b9bdd59da081d1bdad95b9cc81bdddb9959604a1b6044820152606401610e87565b6119438484846139df565b60008281526010602090815260408083206001600160a01b038516845290915290205460ff166113e657612ba0816001600160a01b03166014613d43565b612bab836020613d43565b604051602001612bbc9291906158bf565b60408051601f198184030181529082905262461bcd60e51b8252610e8791600401614920565b60606000612bef60095490565b905060006009805480602002602001604051908101604052809291908181526020018280548015612c3f57602002820191906000526020600020905b815481526020019060010190808311612c2b575b5050505050905060005b82811015612d4357818181518110612c6357612c6361542c565b6020026020010151851015612d3157600a6000838381518110612c8857612c8861542c565b602002602001015181526020019081526020016000208054612ca990615378565b80601f0160208091040260200160405190810160405280929190818152602001828054612cd590615378565b8015612d225780601f10612cf757610100808354040283529160200191612d22565b820191906000526020600020905b815481529060010190602001808311612d0557829003601f168201915b50505050509350505050919050565b612d3c600182615419565b9050612c49565b5060405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d1bdad95b9259608a1b6044820152606401610e87565b606081600003612da55750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612dcf5780612db98161592c565b9150612dc89050600a836157b0565b9150612da9565b6000816001600160401b03811115612de957612de9614a59565b6040519080825280601f01601f191660200182016040528015612e13576020820181803683370190505b5090505b841561172857612e286001836157ed565b9150612e35600a86615945565b612e40906030615419565b60f81b818381518110612e5557612e5561542c565b60200101906001600160f81b031916908160001a905350612e77600a866157b0565b9450612e17565b6000612e8a8133611a83565b905090565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d7690600090a35050565b8151835114612f025760405162461bcd60e51b8152600401610e87906157c4565b6001600160a01b038416612f285760405162461bcd60e51b8152600401610e8790615959565b33612f37818787878787613ede565b60005b8451811015613027576000858281518110612f5757612f5761542c565b602002602001015190506000858381518110612f7557612f7561542c565b6020908102919091018101516001600160a01b038b166000908152600283526040808220868352909352919091205490915081811015612fc75760405162461bcd60e51b8152600401610e879061597f565b6001600160a01b03808b16600090815260026020818152604080842088855282528084208787039055938d16835290815282822086835290529081208054849290613013908490615419565b909155505060019093019250612f3a915050565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516130779291906159a9565b60405180910390a461206c818787878787613fd8565b613097828261412b565b6113e68282614186565b6130ab82826141f3565b60008281526012602090815260408083206001600160a01b03851680855260028201808552838620805487526001909301855292852080546001600160a01b031916905584529152555050565b86156131335760405162461bcd60e51b815260206004820152600a60248201526921436c61696d61626c6560b01b6044820152606401610e87565b6000878152601a6020526040902054158061317257506000878152601a6020908152604080832054600d9092529091205461316f908790615419565b11155b611ccd5760405162461bcd60e51b815260206004820152600760248201526621537570706c7960c81b6044820152606401610e87565b60008082116131b85760006131c2565b6131c28285615783565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03841601613215576014546131f69082615419565b3414613215576040516348fa9b2b60e11b815260040160405180910390fd5b81156132275761322783338784613b04565b60135460145461206c91859133916001600160a01b031690613b04565b611d1283838360405180602001604052806000815250613906565b6127108111156132a35760405162461bcd60e51b815260206004820152600f60248201526e45786365656473206d61782062707360881b6044820152606401610e87565b600780546001600160a01b0384166001600160b01b03199091168117600160a01b61ffff851602179091556040518281527f90d7ec04bcb8978719414f82e52e4cb651db41d0e6f8cea6118c2191e6183adb9060200160405180910390a25050565b6001600160a01b03831661334c5760405162461bcd60e51b815260206004820152600e60248201526d232927a6afad22a927afa0a2222960911b6044820152606401610e87565b805182511461336d5760405162461bcd60e51b8152600401610e87906157c4565b600033905061339081856000868660405180602001604052806000815250613ede565b60005b83518110156134515760008482815181106133b0576133b061542c565b6020026020010151905060008483815181106133ce576133ce61542c565b6020908102919091018101516001600160a01b03891660009081526002835260408082208683529093529190912054909150818110156134205760405162461bcd60e51b8152600401610e879061597f565b6001600160a01b03881660009081526002602090815260408083209583529490529290922091039055600101613393565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516134a29291906159a9565b60405180910390a450505050565b6001600160a01b0381166134fa5760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081c9958da5c1a595b9d607a1b6044820152606401610e87565b600e80546001600160a01b0319166001600160a01b0383169081179091556040517f299d17e95023f496e0ffc4909cff1a61f74bb5eb18de6f900f4155bfa1b3b33390600090a250565b60006005805461355390615378565b80601f016020809104026020016040519081016040528092919081815260200182805461357f90615378565b80156135cc5780601f106135a1576101008083540402835291602001916135cc565b820191906000526020600020905b8154815290600101906020018083116135af57829003601f168201915b5050505050905081600590816135e291906159d7565b507fc9c7c3fe08b88b4df9d4d47ef47d2c43d55c025a0ba88ca442580ed9e7348a168183604051613614929190615a96565b60405180910390a15050565b60006136346006546001600160a01b031690565b6001600160a01b0316336001600160a01b031614905090565b60008061365a8486615419565b60098054600181019091557f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af018190556000818152600a602052604090209092508291506136a884826159d7565b50935093915050565b6001600160a01b0384166136d75760405162461bcd60e51b8152600401610e8790615959565b81518351146136f85760405162461bcd60e51b8152600401610e87906157c4565b3361370881600087878787613ede565b60005b8451811015613799578381815181106137265761372661542c565b602002602001015160026000886001600160a01b03166001600160a01b0316815260200190815260200160002060008784815181106137675761376761542c565b60200260200101518152602001908152602001600020600082825461378c9190615419565b909155505060010161370b565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516137ea9291906159a9565b60405180910390a461134981600087878787613fd8565b6127108111156138455760405162461bcd60e51b815260206004820152600f60248201526e45786365656473206d61782062707360881b6044820152606401610e87565b6040805180820182526001600160a01b038481168083526020808401868152600089815260088352869020945185546001600160a01b031916941693909317845591516001909301929092559151838152909185917f7365cf4122f072a3365c20d54eff9b38d73c096c28e1892ec8f5b0e403a0f12d9101611dc2565b60606138e78383604051806060016040528060278152602001615c3960279139614255565b9392505050565b6000828152600460205260409020611d1282826159d7565b6001600160a01b03841661392c5760405162461bcd60e51b8152600401610e8790615959565b3361394c8160008761393d886142cd565b613946886142cd565b87613ede565b6001600160a01b03851660009081526002602090815260408083208784529091528120805485929061397f908490615419565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461134981600087878787614318565b6001600160a01b038316613a265760405162461bcd60e51b815260206004820152600e60248201526d232927a6afad22a927afa0a2222960911b6044820152606401610e87565b33613a5581856000613a37876142cd565b613a40876142cd565b60405180602001604052806000815250613ede565b6001600160a01b038416600090815260026020908152604080832086845290915290205482811015613a995760405162461bcd60e51b8152600401610e879061597f565b6001600160a01b03858116600081815260026020908152604080832089845282528083208887039055805189815291820188905291938616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b80156119435773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03851601613b3e57613b3982826143f5565b611943565b61194384848484614498565b6000612e8a6017546108b33390565b6000808281805b8751811015613c1157613b74600283615783565b91506000888281518110613b8a57613b8a61542c565b60200260200101519050808411613bcc576040805160208101869052908101829052606001604051602081830303815290604052805190602001209350613c08565b6040805160208101839052908101859052606001604051602081830303815290604052805190602001209350600183613c059190615419565b92505b50600101613b60565b50941495939450505050565b6001600160a01b038416613c435760405162461bcd60e51b8152600401610e8790615959565b33613c5381878761393d886142cd565b6001600160a01b038616600090815260026020908152604080832087845290915290205483811015613c975760405162461bcd60e51b8152600401610e879061597f565b6001600160a01b0380881660009081526002602081815260408084208a855282528084208987039055938a16835290815282822088835290529081208054869290613ce3908490615419565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611ccd828888888888614318565b60606000613d52836002615783565b613d5d906002615419565b6001600160401b03811115613d7457613d74614a59565b6040519080825280601f01601f191660200182016040528015613d9e576020820181803683370190505b509050600360fc1b81600081518110613db957613db961542c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613de857613de861542c565b60200101906001600160f81b031916908160001a9053506000613e0c846002615783565b613e17906001615419565b90505b6001811115613e8f576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613e4b57613e4b61542c565b1a60f81b828281518110613e6157613e6161542c565b60200101906001600160f81b031916908160001a90535060049490941c93613e8881615800565b9050613e1a565b5083156138e75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e87565b6001600160a01b038516613f5c5760005b8351811015613f5a57828181518110613f0a57613f0a61542c565b6020026020010151600d6000868481518110613f2857613f2861542c565b602002602001015181526020019081526020016000206000828254613f4d9190615419565b9091555050600101613eef565b505b6001600160a01b03841661206c5760005b8351811015611ccd57828181518110613f8857613f8861542c565b6020026020010151600d6000868481518110613fa657613fa661542c565b602002602001015181526020019081526020016000206000828254613fcb91906157ed565b9091555050600101613f6d565b6001600160a01b0384163b1561206c5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061401c9089908990889088908890600401615abb565b6020604051808303816000875af1925050508015614057575060408051601f3d908101601f1916820190925261405491810190615b0d565b60015b6140d957614063615b2a565b806308c379a00361409c5750614077615b46565b80614082575061409e565b8060405162461bcd60e51b8152600401610e879190614920565b505b60405162461bcd60e51b815260206004820152601060248201526f10a2a92198989a9aa922a1a2a4ab22a960811b6044820152606401610e87565b6001600160e01b0319811663bc197c8160e01b14611ccd5760405162461bcd60e51b815260206004820152600f60248201526e1513d2d15394d7d491529150d51151608a1b6044820152606401610e87565b60008281526010602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000828152601260205260408120805491600191906141a58385615419565b9091555050600092835260126020908152604080852083865260018101835281862080546001600160a01b039096166001600160a01b03199096168617905593855260029093019052912055565b6141fd8282612b62565b60008281526010602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6060600080856001600160a01b0316856040516142729190615bcf565b600060405180830381855af49150503d80600081146142ad576040519150601f19603f3d011682016040523d82523d6000602084013e6142b2565b606091505b50915091506142c3868383876144eb565b9695505050505050565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106143075761430761542c565b602090810291909101015292915050565b6001600160a01b0384163b1561206c5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061435c9089908990889088908890600401615be1565b6020604051808303816000875af1925050508015614397575060408051601f3d908101601f1916820190925261439491810190615b0d565b60015b6143a357614063615b2a565b6001600160e01b0319811663f23a6e6160e01b14611ccd5760405162461bcd60e51b815260206004820152600f60248201526e1513d2d15394d7d491529150d51151608a1b6044820152606401610e87565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114614442576040519150601f19603f3d011682016040523d82523d6000602084013e614447565b606091505b5050905080611d125760405162461bcd60e51b815260206004820152601c60248201527f6e617469766520746f6b656e207472616e73666572206661696c6564000000006044820152606401610e87565b816001600160a01b0316836001600160a01b0316031561194357306001600160a01b038416036144d657613b396001600160a01b0385168383614564565b6119436001600160a01b0385168484846145c7565b6060831561455a578251600003614553576001600160a01b0385163b6145535760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610e87565b5081611728565b61172883836145ff565b6040516001600160a01b038316602482015260448101829052611d1290849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261460f565b6040516001600160a01b03808516602483015283166044820152606481018290526119439085906323b872dd60e01b90608401614590565b8151156140825781518083602001fd5b6000614664826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166146e19092919063ffffffff16565b805190915015611d1257808060200190518101906146829190615c1b565b611d125760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610e87565b60606117288484600085856001600160a01b0385163b6147435760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610e87565b600080866001600160a01b0316858760405161475f9190615bcf565b60006040518083038185875af1925050503d806000811461479c576040519150601f19603f3d011682016040523d82523d6000602084013e6147a1565b606091505b50915091506147b18282866147bc565b979650505050505050565b606083156147cb5750816138e7565b8251156147db5782518084602001fd5b8160405162461bcd60e51b8152600401610e879190614920565b50805461480190615378565b6000825580601f10614811575050565b601f016020900490600052602060002090810190610e9991905b8082111561483f576000815560010161482b565b5090565b6001600160a01b0381168114610e9957600080fd5b6000806040838503121561486b57600080fd5b823561487681614843565b946020939093013593505050565b6001600160e01b031981168114610e9957600080fd5b6000602082840312156148ac57600080fd5b81356138e781614884565b6000602082840312156148c957600080fd5b5035919050565b60005b838110156148eb5781810151838201526020016148d3565b50506000910152565b6000815180845261490c8160208601602086016148d0565b601f01601f19169290920160200192915050565b6020815260006138e760208301846148f4565b60006020828403121561494557600080fd5b81356138e781614843565b60008083601f84011261496257600080fd5b5081356001600160401b0381111561497957600080fd5b6020830191508360208260051b850101111561499457600080fd5b9250929050565b8015158114610e9957600080fd5b600080600080606085870312156149bf57600080fd5b8435935060208501356001600160401b038111156149dc57600080fd5b6149e887828801614950565b90945092505060408501356149fc8161499b565b939692955090935050565b60008060408385031215614a1a57600080fd5b823591506020830135614a2c81614843565b809150509250929050565b60008060408385031215614a4a57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715614a9457614a94614a59565b6040525050565b60006001600160401b03821115614ab457614ab4614a59565b5060051b60200190565b600082601f830112614acf57600080fd5b81356020614adc82614a9b565b604051614ae98282614a6f565b80915083815260208101915060208460051b870101935086841115614b0d57600080fd5b602086015b84811015614b295780358352918301918301614b12565b509695505050505050565b600082601f830112614b4557600080fd5b81356001600160401b03811115614b5e57614b5e614a59565b604051614b75601f8301601f191660200182614a6f565b818152846020838601011115614b8a57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215614bbf57600080fd5b8535614bca81614843565b94506020860135614bda81614843565b935060408601356001600160401b0380821115614bf657600080fd5b614c0289838a01614abe565b94506060880135915080821115614c1857600080fd5b614c2489838a01614abe565b93506080880135915080821115614c3a57600080fd5b50614c4788828901614b34565b9150509295509295909350565b60008060408385031215614c6757600080fd5b82356001600160401b0380821115614c7e57600080fd5b818501915085601f830112614c9257600080fd5b81356020614c9f82614a9b565b604051614cac8282614a6f565b83815260059390931b8501820192828101915089841115614ccc57600080fd5b948201945b83861015614cf3578535614ce481614843565b82529482019490820190614cd1565b96505086013592505080821115614d0957600080fd5b50614d1685828601614abe565b9150509250929050565b60008151808452602080850194506020840160005b83811015614d5157815187529582019590820190600101614d35565b509495945050505050565b6020815260006138e76020830184614d20565b60006080828403121561231b57600080fd5b600080600080600080600060e0888a031215614d9c57600080fd5b8735614da781614843565b965060208801359550604088013594506060880135614dc581614843565b93506080880135925060a08801356001600160401b0380821115614de857600080fd5b614df48b838c01614d6f565b935060c08a0135915080821115614e0a57600080fd5b50614e178a828b01614b34565b91505092959891949750929550565b600080600060608486031215614e3b57600080fd5b83359250602084013591506040840135614e5481614843565b809150509250925092565b600080600060608486031215614e7457600080fd5b8335614e7f81614843565b925060208401356001600160401b0380821115614e9b57600080fd5b614ea787838801614abe565b93506040860135915080821115614ebd57600080fd5b50614eca86828701614abe565b9150509250925092565b600060208284031215614ee657600080fd5b81356001600160401b03811115614efc57600080fd5b61172884828501614b34565b60008060008060808587031215614f1e57600080fd5b8435614f2981614843565b935060208501356001600160401b0380821115614f4557600080fd5b614f5188838901614abe565b94506040870135915080821115614f6757600080fd5b614f7388838901614abe565b93506060870135915080821115614f8957600080fd5b50614f9687828801614b34565b91505092959194509250565b600080600060608486031215614fb757600080fd5b833592506020840135614fc981614843565b929592945050506040919091013590565b60008060408385031215614fed57600080fd5b8235614ff881614843565b91506020830135614a2c8161499b565b6000806020838503121561501b57600080fd5b82356001600160401b0381111561503157600080fd5b61503d85828601614950565b90969095509350505050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156150a057603f1988860301845261508e8583516148f4565b94509285019290850190600101615072565b5092979650505050505050565b600080600080608085870312156150c357600080fd5b84356150ce81614843565b93506020850135925060408501356001600160401b038111156150f057600080fd5b6150fc87828801614b34565b949793965093946060013593505050565b6000806040838503121561512057600080fd5b823561512b81614843565b91506020830135614a2c81614843565b60008083601f84011261514d57600080fd5b5081356001600160401b0381111561516457600080fd5b60208301915083602082850101111561499457600080fd5b60008060008060006060868803121561519457600080fd5b8535945060208601356001600160401b03808211156151b257600080fd5b6151be89838a0161513b565b909650945060408801359150808211156151d757600080fd5b506151e48882890161513b565b969995985093965092949392505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a082015260a082015160c082015260018060a01b0360c08301511660e0820152600060e08301516101008081850152506117286101208401826148f4565b600080600080600080600060e0888a03121561527d57600080fd5b87359650602088013561528f81614843565b9550604088013594506060880135935060808801356152ad81614843565b925060a0880135915060c08801356001600160401b038111156152cf57600080fd5b614e178a828b01614d6f565b600080600080600060a086880312156152f357600080fd5b85356152fe81614843565b9450602086013561530e81614843565b9350604086013592506060860135915060808601356001600160401b0381111561533757600080fd5b614c4788828901614b34565b60008060006060848603121561535857600080fd5b833561536381614843565b95602085013595506040909401359392505050565b600181811c9082168061538c57607f821691505b60208210810361231b57634e487b7160e01b600052602260045260246000fd5b600083516153be8184602088016148d0565b8351908301906153d28183602088016148d0565b01949350505050565b6020808252600e908201526d139bdd08185d5d1a1bdc9a5e995960921b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610d0857610d08615403565b634e487b7160e01b600052603260045260246000fd5b6000823560fe1983360301811261545857600080fd5b9190910192915050565b6000808335601e1984360301811261547957600080fd5b8301803591506001600160401b0382111561549357600080fd5b60200191503681900382131561499457600080fd5b601f821115611d12576000816000526020600020601f850160051c810160208610156154d15750805b601f850160051c820191505b8181101561206c578281556001016154dd565b6001600160401b0383111561550757615507614a59565b61551b836155158354615378565b836154a8565b6000601f84116001811461554f57600085156155375750838201355b600019600387901b1c1916600186901b178355611349565b600083815260209020601f19861690835b828110156155805786850135825560209485019460019092019101615560565b508682101561559d5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b813581556020820135600182015560408201356002820155606082013560038201556080820135600482015560a082013560058201556006810160c08301356155f781614843565b81546001600160a01b0319166001600160a01b039190911617905561561f60e0830183615462565b6119438183600786016154f0565b6000808335601e1984360301811261564457600080fd5b83016020810192503590506001600160401b0381111561566357600080fd5b80360382131561499457600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60408082528181018490526000906060808401600587901b850182018885805b8a81101561576d57888403605f190185528235368d900360fe190181126156e0578283fd5b8c018035855260208082013581870152888201358987015287820135888701526080808301359087015260a080830135908701526101009060c08084013561572781614843565b6001600160a01b03169088015260e06157428482018561562d565b945083828a0152615756848a018683615672565b9983019998505050949094019350506001016156bb565b5050508615156020870152935061172892505050565b8082028115828204841417610d0857610d08615403565b634e487b7160e01b600052601260045260246000fd5b6000826157bf576157bf61579a565b500490565b6020808252600f908201526e0988a9c8ea890be9a92a69a82a8869608b1b604082015260600190565b81810381811115610d0857610d08615403565b60008161580f5761580f615403565b506000190190565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b858152606060208201526000615857606083018688615672565b828103604084015261586a818587615672565b98975050505050505050565b6000808335601e1984360301811261588d57600080fd5b8301803591506001600160401b038211156158a757600080fd5b6020019150600581901b360382131561499457600080fd5b7402832b936b4b9b9b4b7b7399d1030b1b1b7bab73a1605d1b8152600083516158ef8160158501602088016148d0565b7001034b99036b4b9b9b4b733903937b6329607d1b60159184019182015283516159208160268401602088016148d0565b01602601949350505050565b60006001820161593e5761593e615403565b5060010190565b6000826159545761595461579a565b500690565b6020808252600c908201526b2a27afad22a927afa0a2222960a11b604082015260600190565b60208082526010908201526f125394d551919250d251539517d0905360821b604082015260600190565b6040815260006159bc6040830185614d20565b82810360208401526159ce8185614d20565b95945050505050565b81516001600160401b038111156159f0576159f0614a59565b615a04816159fe8454615378565b846154a8565b602080601f831160018114615a395760008415615a215750858301515b600019600386901b1c1916600185901b17855561206c565b600085815260208120601f198616915b82811015615a6857888601518255948401946001909101908401615a49565b5085821015615a865787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604081526000615aa960408301856148f4565b82810360208401526159ce81856148f4565b6001600160a01b0386811682528516602082015260a060408201819052600090615ae790830186614d20565b8281036060840152615af98186614d20565b9050828103608084015261586a81856148f4565b600060208284031215615b1f57600080fd5b81516138e781614884565b600060033d1115615b435760046000803e5060005160e01c5b90565b600060443d1015615b545790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715615b8357505050505090565b8285019150815181811115615b9b5750505050505090565b843d8701016020828501011115615bb55750505050505090565b615bc460208286010187614a6f565b509095945050505050565b600082516154588184602087016148d0565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906147b1908301846148f4565b600060208284031215615c2d57600080fd5b81516138e78161499b56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212206572335dad1a1e8a22e127bbcccde610b3cdf523b3ff6dc878e358f467780e9364736f6c63430008170033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000f563fac20fe0f85e573fefee0013d5a2062a41d300000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000f563fac20fe0f85e573fefee0013d5a2062a41d300000000000000000000000000000000000000000000000009214fc70912a1d4000000000000000000000000f563fac20fe0f85e573fefee0013d5a2062a41d30000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000000b50696e6b42616c6c6f6f6e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000450696e6b00000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _defaultAdmin (address): 0xf563fac20FE0f85E573fEFEe0013d5a2062A41d3
Arg [1] : _name (string): PinkBalloon
Arg [2] : _symbol (string): Pink
Arg [3] : _saleRecipient (address): 0xf563fac20FE0f85E573fEFEe0013d5a2062A41d3
Arg [4] : _transactionFee (uint256): 657894736842105300
Arg [5] : _royaltyRecipient (address): 0xf563fac20FE0f85E573fEFEe0013d5a2062A41d3
Arg [6] : _royaltyBps (uint128): 50
-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 000000000000000000000000f563fac20fe0f85e573fefee0013d5a2062a41d3
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [3] : 000000000000000000000000f563fac20fe0f85e573fefee0013d5a2062a41d3
Arg [4] : 00000000000000000000000000000000000000000000000009214fc70912a1d4
Arg [5] : 000000000000000000000000f563fac20fe0f85e573fefee0013d5a2062a41d3
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000032
Arg [7] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [8] : 50696e6b42616c6c6f6f6e000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [10] : 50696e6b00000000000000000000000000000000000000000000000000000000
[ 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.