ERC-1155
Overview
Max Total Supply
310 the_winning_strike
Holders
200
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
ERC1155M
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 20 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts/access/Ownable2Step.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "./utils/Constants.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "./IERC1155M.sol"; /** * @title ERC1155M * * @dev OpenZeppelin's ERC1155 subclass with MagicEden launchpad features including * - multi token minting * - multi minting stages with time-based auto stage switch * - global and stage wallet-level minting limit * - whitelist * - variable wallet limit */ contract ERC1155M is IERC1155M, ERC1155Supply, ERC2981, Ownable2Step, ReentrancyGuard { using ECDSA for bytes32; using SafeERC20 for IERC20; // Collection name. string public name; // Collection symbol. string public symbol; // The total mintable supply per token. uint256[] private _maxMintableSupply; // Global wallet limit, across all stages, per token. uint256[] private _globalWalletLimit; // Mint stage information. See MintStageInfo for details. MintStageInfo[] private _mintStages; // Whether the token can be transferred. bool private _transferable; // Minted count per stage per token per wallet mapping(uint256 => mapping(uint256 => mapping(address => uint32))) private _stageMintedCountsPerTokenPerWallet; // Minted count per stage per token. mapping(uint256 => mapping(uint256 => uint256)) private _stageMintedCountsPerToken; // Total mint fee uint256 private _totalMintFee; // Address of ERC-20 token used to pay for minting. If 0 address, use native currency. address private immutable MINT_CURRENCY; // Number of tokens. uint256 private immutable NUM_TOKENS; // Fund receiver address public immutable FUND_RECEIVER; // Authorized minters mapping(address => bool) private _authorizedMinters; constructor( string memory collectionName, string memory collectionSymbol, string memory uri, uint256[] memory maxMintableSupply, uint256[] memory globalWalletLimit, address mintCurrency, address fundReceiver, address royaltyReceiver, uint96 royaltyFeeNumerator ) Ownable(msg.sender) ERC1155(uri) { if (maxMintableSupply.length != globalWalletLimit.length) { revert InvalidLimitArgsLength(); } for (uint256 i = 0; i < globalWalletLimit.length; i++) { if (maxMintableSupply[i] > 0 && globalWalletLimit[i] > maxMintableSupply[i]) { revert GlobalWalletLimitOverflow(); } } name = collectionName; symbol = collectionSymbol; NUM_TOKENS = globalWalletLimit.length; _maxMintableSupply = maxMintableSupply; _globalWalletLimit = globalWalletLimit; MINT_CURRENCY = mintCurrency; _transferable = true; FUND_RECEIVER = fundReceiver; _setDefaultRoyalty(royaltyReceiver, royaltyFeeNumerator); } /** * @dev Returns whether it has enough supply for the given qty. */ modifier hasSupply(uint256 tokenId, uint256 qty) { if (_maxMintableSupply[tokenId] > 0 && totalSupply(tokenId) + qty > _maxMintableSupply[tokenId]) revert NoSupplyLeft(); _; } /** * @dev Returns whether the msg sender is authorized to mint. */ modifier onlyAuthorizedMinter() { if (_authorizedMinters[_msgSender()] != true) revert NotAuthorized(); _; } /** * @dev Add authorized minter. Can only be called by contract owner. */ function addAuthorizedMinter(address minter) external onlyOwner { _authorizedMinters[minter] = true; } /** * @dev Remove authorized minter. Can only be called by contract owner. */ function removeAuthorizedMinter(address minter) external onlyOwner { _authorizedMinters[minter] = false; } /** * @dev Sets stages in the format of an array of `MintStageInfo`. * * Following is an example of launch with two stages. The first stage is exclusive for whitelisted wallets * specified by merkle root. * [{ * price: 10000000000000000000, * maxStageSupply: 2000, * walletLimit: 1, * merkleRoot: 0x559fadeb887449800b7b320bf1e92d309f329b9641ac238bebdb74e15c0a5218, * startTimeUnixSeconds: 1667768000, * endTimeUnixSeconds: 1667771600, * }, * { * price: 20000000000000000000, * maxStageSupply: 3000, * walletLimit: 2, * merkleRoot: 0, * startTimeUnixSeconds: 1667771600, * endTimeUnixSeconds: 1667775200, * } * ] */ function setStages(MintStageInfo[] calldata newStages) external onlyOwner { delete _mintStages; for (uint256 i = 0; i < newStages.length; i++) { if (i >= 1) { if ( newStages[i].startTimeUnixSeconds < newStages[i - 1].endTimeUnixSeconds + TIMESTAMP_EXPIRY_SECONDS ) { revert InsufficientStageTimeGap(); } } _assertValidStartAndEndTimestamp( newStages[i].startTimeUnixSeconds, newStages[i].endTimeUnixSeconds ); _assertValidStageArgsLength(newStages[i]); _mintStages.push( MintStageInfo({ price: newStages[i].price, mintFee: newStages[i].mintFee, walletLimit: newStages[i].walletLimit, merkleRoot: newStages[i].merkleRoot, maxStageSupply: newStages[i].maxStageSupply, startTimeUnixSeconds: newStages[i].startTimeUnixSeconds, endTimeUnixSeconds: newStages[i].endTimeUnixSeconds }) ); emit UpdateStage( i, newStages[i].price, newStages[i].mintFee, newStages[i].walletLimit, newStages[i].merkleRoot, newStages[i].maxStageSupply, newStages[i].startTimeUnixSeconds, newStages[i].endTimeUnixSeconds ); } } /** * @dev Returns maximum mintable supply per token. */ function getMaxMintableSupply(uint256 tokenId) external view override returns (uint256) { return _maxMintableSupply[tokenId]; } /** * @dev Sets maximum mintable supply. New supply cannot be larger than the old or the supply alraedy minted. */ function setMaxMintableSupply( uint256 tokenId, uint256 maxMintableSupply ) external virtual onlyOwner { if (tokenId >= NUM_TOKENS) { revert InvalidTokenId(); } if (_maxMintableSupply[tokenId] != 0 && maxMintableSupply > _maxMintableSupply[tokenId]) { revert CannotIncreaseMaxMintableSupply(); } if (maxMintableSupply < totalSupply(tokenId)) { revert NewSupplyLessThanTotalSupply(); } _maxMintableSupply[tokenId] = maxMintableSupply; emit SetMaxMintableSupply(tokenId, maxMintableSupply); } /** * @dev Returns global wallet limit. This is the max number of tokens can be minted by one wallet. */ function getGlobalWalletLimit(uint256 tokenId) external view override returns (uint256) { return _globalWalletLimit[tokenId]; } /** * @dev Sets global wallet limit. */ function setGlobalWalletLimit( uint256 tokenId, uint256 globalWalletLimit ) external onlyOwner { if (tokenId >= NUM_TOKENS) { revert InvalidTokenId(); } if (_maxMintableSupply[tokenId] > 0 && globalWalletLimit > _maxMintableSupply[tokenId]) { revert GlobalWalletLimitOverflow(); } _globalWalletLimit[tokenId] = globalWalletLimit; emit SetGlobalWalletLimit(tokenId, globalWalletLimit); } /** * @dev Returns number of minted tokens for a given address. */ function totalMintedByAddress( address account ) public view virtual override returns (uint256[] memory) { uint256[] memory totalMinted = new uint256[](NUM_TOKENS); uint256 numStages = _mintStages.length; for (uint256 token = 0; token < NUM_TOKENS; token++ ) { for (uint256 stage = 0; stage < numStages; stage++) { totalMinted[token] += _stageMintedCountsPerTokenPerWallet[stage][token][account]; } } return totalMinted; } /** * @dev Returns number of minted token for a given token and address. */ function totalMintedByTokenByAddress( address account, uint256 tokenId ) internal view virtual returns (uint256) { uint256 totalMinted = 0; uint256 numStages = _mintStages.length; for (uint256 i = 0; i < numStages; i++) { totalMinted += _stageMintedCountsPerTokenPerWallet[i][tokenId][account]; } return totalMinted; } /** * @dev Returns number of minted tokens for a given stage and address. */ function totalMintedByStageByAddress( uint256 stage, address account ) internal view virtual returns (uint256[] memory) { uint256[] memory totalMinted = new uint256[](NUM_TOKENS); for (uint256 token = 0; token < NUM_TOKENS; token++ ) { totalMinted[token] += _stageMintedCountsPerTokenPerWallet[stage][token][account]; } return totalMinted; } /** * @dev Returns number of stages. */ function getNumberStages() external view override returns (uint256) { return _mintStages.length; } /** * @dev Returns info for one stage specified by stage index (starting from 0). */ function getStageInfo( uint256 stage ) external view override returns (MintStageInfo memory, uint256[] memory, uint256[] memory) { if (stage >= _mintStages.length) { revert InvalidStage(); } uint256[] memory walletMinted = totalMintedByAddress(msg.sender); uint256[] memory stageMinted = totalMintedByStageByAddress(stage, msg.sender); return (_mintStages[stage], walletMinted, stageMinted); } /** * @dev Returns mint currency address. */ function getMintCurrency() external view returns (address) { return MINT_CURRENCY; } /** * @dev Mints token(s). * * tokenId - token id * qty - number of tokens to mint * proof - the merkle proof generated on client side. This applies if using whitelist. */ function mint( uint256 tokenId, uint32 qty, bytes32[] calldata proof ) external payable virtual nonReentrant { _mintInternal(msg.sender, tokenId, qty, 0, proof); } /** * @dev Mints token(s) with limit. * * tokenId - token id * qty - number of tokens to mint * limit - limit for the given minter * proof - the merkle proof generated on client side. This applies if using whitelist. */ function mintWithLimit( uint256 tokenId, uint32 qty, uint32 limit, bytes32[] calldata proof ) external payable virtual nonReentrant { _mintInternal(msg.sender, tokenId, qty, limit, proof); } /** * @dev Authorized mints token(s) with limit * * to - the token recipient * tokenId - token id * qty - number of tokens to mint * limit - limit for the given minter * proof - the merkle proof generated on client side. This applies if using whitelist */ function authorizedMint( address to, uint256 tokenId, uint32 qty, uint32 limit, bytes32[] calldata proof ) external payable onlyAuthorizedMinter { _mintInternal(to, tokenId, qty, limit, proof); } /** * @dev Implementation of minting. */ function _mintInternal( address to, uint256 tokenId, uint32 qty, uint32 limit, bytes32[] calldata proof ) internal hasSupply(tokenId, qty) { uint64 stageTimestamp = uint64(block.timestamp); uint256 activeStage = getActiveStageFromTimestamp(stageTimestamp); MintStageInfo memory stage = _mintStages[activeStage]; // Check value if minting with ETH if ( MINT_CURRENCY == address(0) && msg.value < (stage.price[tokenId] + stage.mintFee[tokenId]) * qty ) revert NotEnoughValue(); // Check stage supply if applicable if (stage.maxStageSupply[tokenId] > 0) { if (_stageMintedCountsPerToken[activeStage][tokenId] + qty > stage.maxStageSupply[tokenId]) revert StageSupplyExceeded(); } // Check global wallet limit if applicable if (_globalWalletLimit[tokenId] > 0) { if (totalMintedByTokenByAddress(to, tokenId) + qty > _globalWalletLimit[tokenId]) revert WalletGlobalLimitExceeded(); } // Check wallet limit for stage if applicable, limit == 0 means no limit enforced if (stage.walletLimit[tokenId] > 0) { if ( _stageMintedCountsPerTokenPerWallet[activeStage][tokenId][to] + qty > stage.walletLimit[tokenId] ) revert WalletStageLimitExceeded(); } // Check merkle proof if applicable, merkleRoot == 0x00...00 means no proof required if (stage.merkleRoot[tokenId] != 0) { if ( MerkleProof.processProof( proof, keccak256(abi.encodePacked(to, limit)) ) != stage.merkleRoot[tokenId] ) revert InvalidProof(); // Verify merkle proof mint limit if ( limit > 0 && _stageMintedCountsPerTokenPerWallet[activeStage][tokenId][to] + qty > limit ) { revert WalletStageLimitExceeded(); } } if (MINT_CURRENCY != address(0)) { // ERC20 mint payment IERC20(MINT_CURRENCY).safeTransferFrom( msg.sender, address(this), (stage.price[tokenId] + stage.mintFee[tokenId]) * qty ); } _totalMintFee += stage.mintFee[tokenId] * qty; _stageMintedCountsPerTokenPerWallet[activeStage][tokenId][to] += qty; _stageMintedCountsPerToken[activeStage][tokenId] += qty; _mint(to, tokenId, qty, ""); } /** * @dev Mints token(s) by owner. * * NOTE: This function bypasses validations thus only available for owner. * This is typically used for owner to pre-mint or mint the remaining of the supply. */ function ownerMint( address to, uint256 tokenId, uint32 qty ) external onlyOwner hasSupply(tokenId, qty) { _mint(to, tokenId, qty, ""); } /** * @dev Withdraws funds by owner. */ function withdraw() external onlyOwner { (bool success, ) = MINT_FEE_RECEIVER.call{value: _totalMintFee}(""); if (!success) revert TransferFailed(); _totalMintFee = 0; uint256 remainingValue = address(this).balance; (success, ) = FUND_RECEIVER.call{value: remainingValue}(""); if (!success) revert WithdrawFailed(); emit Withdraw(_totalMintFee + remainingValue); } /** * @dev Withdraws ERC-20 funds by owner. */ function withdrawERC20() external onlyOwner { if (MINT_CURRENCY == address(0)) revert WrongMintCurrency(); IERC20(MINT_CURRENCY).safeTransfer(MINT_FEE_RECEIVER, _totalMintFee); _totalMintFee = 0; uint256 remaining = IERC20(MINT_CURRENCY).balanceOf(address(this)); IERC20(MINT_CURRENCY).safeTransfer(FUND_RECEIVER, remaining); emit WithdrawERC20(MINT_CURRENCY, _totalMintFee + remaining); } /** * @dev Sets a new URI for all token types. The URI relies on token type ID * substitution mechanism. */ function setURI(string calldata newURI) external onlyOwner { _setURI(newURI); } /** * @dev Sets transferable of the tokens. */ function setTransferable(bool transferable) external onlyOwner { _transferable = transferable; emit SetTransferable(transferable); } /** * @dev Returns the current active stage based on timestamp. */ function getActiveStageFromTimestamp( uint64 timestamp ) public view returns (uint256) { for (uint256 i = 0; i < _mintStages.length; i++) { if ( timestamp >= _mintStages[i].startTimeUnixSeconds && timestamp < _mintStages[i].endTimeUnixSeconds ) { return i; } } revert InvalidStage(); } /** * @dev Set default royalty for all tokens */ function setDefaultRoyalty( address receiver, uint96 feeNumerator ) public onlyOwner { super._setDefaultRoyalty(receiver, feeNumerator); emit DefaultRoyaltySet(receiver, feeNumerator); } /** * @dev Set default royalty for individual token */ function setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) public onlyOwner { super._setTokenRoyalty(tokenId, receiver, feeNumerator); emit TokenRoyaltySet(tokenId, receiver, feeNumerator); } function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC2981, ERC1155) returns (bool) { return ERC1155.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); } /** * @dev The hook of token transfer to validate the transfer. */ function _update( address from, address to, uint256[] memory ids, uint256[] memory values ) internal virtual override { super._update(from, to, ids, values); bool fromZeroAddress = from == address(0); bool toZeroAddress = to == address(0); if (!fromZeroAddress && !toZeroAddress && !_transferable) { revert NotTransferable(); } } /** * @dev Validates the start timestamp is before end timestamp. Used when updating stages. */ function _assertValidStartAndEndTimestamp( uint64 start, uint64 end ) internal pure { if (start >= end) revert InvalidStartAndEndTimestamp(); } function _assertValidStageArgsLength(MintStageInfo calldata stageInfo) internal { if (stageInfo.price.length != NUM_TOKENS || stageInfo.mintFee.length != NUM_TOKENS || stageInfo.walletLimit.length != NUM_TOKENS || stageInfo.merkleRoot.length != NUM_TOKENS || stageInfo.maxStageSupply.length != NUM_TOKENS ) { revert InvalidStageArgsLength(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol) pragma solidity ^0.8.20; import {Ownable} from "./Ownable.sol"; /** * @dev Contract module which provides access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is specified at deployment time in the constructor for `Ownable`. This * can later be changed with {transferOwnership} and {acceptOwnership}. * * This module is used through inheritance. It will make available all functions * from parent (Ownable). */ abstract contract Ownable2Step is Ownable { address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { return _pendingOwner; } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { _pendingOwner = newOwner; emit OwnershipTransferStarted(owner(), newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { delete _pendingOwner; super._transferOwnership(newOwner); } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() public virtual { address sender = _msgSender(); if (pendingOwner() != sender) { revert OwnableUnauthorizedAccount(sender); } _transferOwnership(sender); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/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. */ 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 paid in that same unit of exchange. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/common/ERC2981.sol) pragma solidity ^0.8.20; import {IERC2981} from "../../interfaces/IERC2981.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 tokenId => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev The default royalty set is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator); /** * @dev The default royalty receiver is invalid. */ error ERC2981InvalidDefaultRoyaltyReceiver(address receiver); /** * @dev The royalty set for an specific `tokenId` is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator); /** * @dev The royalty receiver for `tokenId` is invalid. */ error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver); /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidDefaultRoyalty(feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidDefaultRoyaltyReceiver(address(0)); } _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidTokenRoyalty(tokenId, feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidTokenRoyaltyReceiver(tokenId, address(0)); } _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.20; import {IERC1155} from "./IERC1155.sol"; import {IERC1155Receiver} from "./IERC1155Receiver.sol"; import {IERC1155MetadataURI} from "./extensions/IERC1155MetadataURI.sol"; import {Context} from "../../utils/Context.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; import {Arrays} from "../../utils/Arrays.sol"; import {IERC1155Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 */ abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IERC1155Errors { using Arrays for uint256[]; using Arrays for address[]; mapping(uint256 id => mapping(address account => uint256)) private _balances; mapping(address account => mapping(address operator => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256 /* id */) public view virtual returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. */ function balanceOf(address account, uint256 id) public view virtual returns (uint256) { return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view virtual returns (uint256[] memory) { if (accounts.length != ids.length) { revert ERC1155InvalidArrayLength(ids.length, accounts.length); } uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts.unsafeMemoryAccess(i), ids.unsafeMemoryAccess(i)); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) public virtual { address sender = _msgSender(); if (from != sender && !isApprovedForAll(from, sender)) { revert ERC1155MissingApprovalForAll(sender, from); } _safeTransferFrom(from, to, id, value, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) public virtual { address sender = _msgSender(); if (from != sender && !isApprovedForAll(from, sender)) { revert ERC1155MissingApprovalForAll(sender, from); } _safeBatchTransferFrom(from, to, ids, values, data); } /** * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. Will mint (or burn) if `from` * (or `to`) is the zero address. * * Emits a {TransferSingle} event if the arrays contain one element, and {TransferBatch} otherwise. * * Requirements: * * - If `to` refers to a smart contract, it must implement either {IERC1155Receiver-onERC1155Received} * or {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value. * - `ids` and `values` must have the same length. * * NOTE: The ERC-1155 acceptance check is not performed in this function. See {_updateWithAcceptanceCheck} instead. */ function _update(address from, address to, uint256[] memory ids, uint256[] memory values) internal virtual { if (ids.length != values.length) { revert ERC1155InvalidArrayLength(ids.length, values.length); } address operator = _msgSender(); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids.unsafeMemoryAccess(i); uint256 value = values.unsafeMemoryAccess(i); if (from != address(0)) { uint256 fromBalance = _balances[id][from]; if (fromBalance < value) { revert ERC1155InsufficientBalance(from, fromBalance, value, id); } unchecked { // Overflow not possible: value <= fromBalance _balances[id][from] = fromBalance - value; } } if (to != address(0)) { _balances[id][to] += value; } } if (ids.length == 1) { uint256 id = ids.unsafeMemoryAccess(0); uint256 value = values.unsafeMemoryAccess(0); emit TransferSingle(operator, from, to, id, value); } else { emit TransferBatch(operator, from, to, ids, values); } } /** * @dev Version of {_update} that performs the token acceptance check by calling * {IERC1155Receiver-onERC1155Received} or {IERC1155Receiver-onERC1155BatchReceived} on the receiver address if it * contains code (eg. is a smart contract at the moment of execution). * * IMPORTANT: Overriding this function is discouraged because it poses a reentrancy risk from the receiver. So any * update to the contract state after this function would break the check-effect-interaction pattern. Consider * overriding {_update} instead. */ function _updateWithAcceptanceCheck( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal virtual { _update(from, to, ids, values); if (to != address(0)) { address operator = _msgSender(); if (ids.length == 1) { uint256 id = ids.unsafeMemoryAccess(0); uint256 value = values.unsafeMemoryAccess(0); _doSafeTransferAcceptanceCheck(operator, from, to, id, value, data); } else { _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, values, data); } } } /** * @dev Transfers a `value` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `value` amount. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value); _updateWithAcceptanceCheck(from, to, ids, values, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. * - `ids` and `values` must have the same length. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } _updateWithAcceptanceCheck(from, to, ids, values, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the values in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates a `value` amount of tokens of type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint(address to, uint256 id, uint256 value, bytes memory data) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value); _updateWithAcceptanceCheck(address(0), to, ids, values, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `values` must have the same length. * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch(address to, uint256[] memory ids, uint256[] memory values, bytes memory data) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } _updateWithAcceptanceCheck(address(0), to, ids, values, data); } /** * @dev Destroys a `value` amount of tokens of type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `value` amount of tokens of type `id`. */ function _burn(address from, uint256 id, uint256 value) internal { if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value); _updateWithAcceptanceCheck(from, address(0), ids, values, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `value` amount of tokens of type `id`. * - `ids` and `values` must have the same length. */ function _burnBatch(address from, uint256[] memory ids, uint256[] memory values) internal { if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } _updateWithAcceptanceCheck(from, address(0), ids, values, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the zero address. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (operator == address(0)) { revert ERC1155InvalidOperator(address(0)); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Performs an acceptance check by calling {IERC1155-onERC1155Received} on the `to` address * if it contains code at the moment of execution. */ function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 value, bytes memory data ) private { if (to.code.length > 0) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, value, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { // Tokens rejected revert ERC1155InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { // non-ERC1155Receiver implementer revert ERC1155InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } /** * @dev Performs a batch acceptance check by calling {IERC1155-onERC1155BatchReceived} on the `to` address * if it contains code at the moment of execution. */ function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) private { if (to.code.length > 0) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, values, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { // Tokens rejected revert ERC1155InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { // non-ERC1155Receiver implementer revert ERC1155InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } /** * @dev Creates an array in memory with only one value for each of the elements provided. */ function _asSingletonArrays( uint256 element1, uint256 element2 ) private pure returns (uint256[] memory array1, uint256[] memory array2) { /// @solidity memory-safe-assembly assembly { // Load the free memory pointer array1 := mload(0x40) // Set array length to 1 mstore(array1, 1) // Store the single element at the next word after the length (where content starts) mstore(add(array1, 0x20), element1) // Repeat for next array locating it right after the first array array2 := add(array1, 0x40) mstore(array2, 1) mstore(add(array2, 0x20), element2) // Update the free memory pointer by pointing after the second array mstore(0x40, add(array2, 0x40)) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/ERC1155Supply.sol) pragma solidity ^0.8.20; import {ERC1155} from "../ERC1155.sol"; /** * @dev Extension of ERC1155 that adds tracking of total supply per id. * * Useful for scenarios where Fungible and Non-fungible tokens have to be * clearly identified. Note: While a totalSupply of 1 might mean the * corresponding is an NFT, there is no guarantees that no other token with the * same id are not going to be minted. * * NOTE: This contract implies a global limit of 2**256 - 1 to the number of tokens * that can be minted. * * CAUTION: This extension should not be added in an upgrade to an already deployed contract. */ abstract contract ERC1155Supply is ERC1155 { mapping(uint256 id => uint256) private _totalSupply; uint256 private _totalSupplyAll; /** * @dev Total value of tokens in with a given id. */ function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply[id]; } /** * @dev Total value of tokens. */ function totalSupply() public view virtual returns (uint256) { return _totalSupplyAll; } /** * @dev Indicates whether any token exist with a given id, or not. */ function exists(uint256 id) public view virtual returns (bool) { return totalSupply(id) > 0; } /** * @dev See {ERC1155-_update}. */ function _update( address from, address to, uint256[] memory ids, uint256[] memory values ) internal virtual override { super._update(from, to, ids, values); if (from == address(0)) { uint256 totalMintValue = 0; for (uint256 i = 0; i < ids.length; ++i) { uint256 value = values[i]; // Overflow check required: The rest of the code assumes that totalSupply never overflows _totalSupply[ids[i]] += value; totalMintValue += value; } // Overflow check required: The rest of the code assumes that totalSupplyAll never overflows _totalSupplyAll += totalMintValue; } if (to == address(0)) { uint256 totalBurnValue = 0; for (uint256 i = 0; i < ids.length; ++i) { uint256 value = values[i]; unchecked { // Overflow not possible: values[i] <= balanceOf(from, ids[i]) <= totalSupply(ids[i]) _totalSupply[ids[i]] -= value; // Overflow not possible: sum_i(values[i]) <= sum_i(totalSupply(ids[i])) <= totalSupplyAll totalBurnValue += value; } } unchecked { // Overflow not possible: totalBurnValue = sum_i(values[i]) <= sum_i(totalSupply(ids[i])) <= totalSupplyAll _totalSupplyAll -= totalBurnValue; } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.20; import {IERC1155} from "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the value of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] calldata accounts, uint256[] calldata ids ) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. * * WARNING: This function can potentially allow a reentrancy attack when transferring tokens * to an untrusted contract, when invoking {onERC1155Received} on the receiver. * Ensure to follow the checks-effects-interactions pattern and consider employing * reentrancy guards when interacting with untrusted contracts. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `value` amount. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * WARNING: This function can potentially allow a reentrancy attack when transferring tokens * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver. * Ensure to follow the checks-effects-interactions pattern and consider employing * reentrancy guards when interacting with untrusted contracts. * * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments. * * Requirements: * * - `ids` and `values` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Interface that must be implemented by smart contracts in order to receive * ERC-1155 token transfers. */ 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 (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC20Permit} from "../extensions/IERC20Permit.sol"; import {Address} from "../../../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; /** * @dev An operation with an ERC20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @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); if (returndata.length != 0 && !abi.decode(returndata, (bool))) { revert SafeERC20FailedOperation(address(token)); } } /** * @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). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // 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 cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @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 or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * 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. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @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`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) 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 FailedInnerCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Arrays.sol) pragma solidity ^0.8.20; import {StorageSlot} from "./StorageSlot.sol"; import {Math} from "./math/Math.sol"; /** * @dev Collection of functions related to array types. */ library Arrays { using StorageSlot for bytes32; /** * @dev Searches a sorted `array` and returns the first index that contains * a value greater or equal to `element`. If no such index exists (i.e. all * values in the array are strictly less than `element`), the array length is * returned. Time complexity O(log n). * * `array` is expected to be sorted in ascending order, and to contain no * repeated elements. */ function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) { uint256 low = 0; uint256 high = array.length; if (high == 0) { return 0; } while (low < high) { uint256 mid = Math.average(low, high); // Note that mid will always be strictly less than high (i.e. it will be a valid array index) // because Math.average rounds towards zero (it does integer division with truncation). if (unsafeAccess(array, mid).value > element) { high = mid; } else { low = mid + 1; } } // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound. if (low > 0 && unsafeAccess(array, low - 1).value == element) { return low - 1; } else { return low; } } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) { bytes32 slot; // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr` // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays. /// @solidity memory-safe-assembly assembly { mstore(0, arr.slot) slot := add(keccak256(0, 0x20), pos) } return slot.getAddressSlot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) { bytes32 slot; // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr` // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays. /// @solidity memory-safe-assembly assembly { mstore(0, arr.slot) slot := add(keccak256(0, 0x20), pos) } return slot.getBytes32Slot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) { bytes32 slot; // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr` // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays. /// @solidity memory-safe-assembly assembly { mstore(0, arr.slot) slot := add(keccak256(0, 0x20), pos) } return slot.getUint256Slot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) { assembly { res := mload(add(add(arr, 0x20), mul(pos, 0x20))) } } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) { assembly { res := mload(add(add(arr, 0x20), mul(pos, 0x20))) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.20; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS } /** * @dev The signature derives the `address(0)`. */ error ECDSAInvalidSignature(); /** * @dev The signature has an invalid length. */ error ECDSAInvalidSignatureLength(uint256 length); /** * @dev The signature has an S value that is in the upper half order. */ error ECDSAInvalidSignatureS(bytes32 s); /** * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not * return address(0) without also returning an error description. Errors are documented using an enum (error type) * and a bytes32 providing additional information about the error. * * If no error is returned, then the address can be used for verification purposes. * * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length)); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature); _throwError(error, errorArg); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) { unchecked { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); // We do not check for an overflow here since the shift operation results in 0 or 1. uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs); _throwError(error, errorArg); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError, bytes32) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS, s); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature, bytes32(0)); } return (signer, RecoverError.NoError, bytes32(0)); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s); _throwError(error, errorArg); return recovered; } /** * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided. */ function _throwError(RecoverError error, bytes32 errorArg) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert ECDSAInvalidSignature(); } else if (error == RecoverError.InvalidSignatureLength) { revert ECDSAInvalidSignatureLength(uint256(errorArg)); } else if (error == RecoverError.InvalidSignatureS) { revert ECDSAInvalidSignatureS(errorArg); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.20; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the Merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates Merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** *@dev The multiproof provided is not valid. */ error MerkleProofInvalidMultiproof(); /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} */ function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. if (leavesLen + proofLen != totalHashes + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { if (proofPos != proofLen) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. if (leavesLen + proofLen != totalHashes + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { if (proofPos != proofLen) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Sorts the pair (a, b) and hashes the result. */ function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } /** * @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory. */ function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.20; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(newImplementation.code.length > 0); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.20; interface IERC1155M { error CannotIncreaseMaxMintableSupply(); error NewSupplyLessThanTotalSupply(); error GlobalWalletLimitOverflow(); error InsufficientStageTimeGap(); error InvalidLimitArgsLength(); error InvalidProof(); error InvalidStage(); error InvalidStageArgsLength(); error InvalidTokenId(); error InvalidStartAndEndTimestamp(); error NoSupplyLeft(); error NotAuthorized(); error NotEnoughValue(); error NotTransferable(); error StageSupplyExceeded(); error TimestampExpired(); error TransferFailed(); error WalletGlobalLimitExceeded(); error WalletStageLimitExceeded(); error WithdrawFailed(); error WrongMintCurrency(); error NotSupported(); struct MintStageInfo { uint80[] price; uint80[] mintFee; uint32[] walletLimit; // 0 for unlimited bytes32[] merkleRoot; // 0x0 for no presale enforced uint24[] maxStageSupply; // 0 for unlimited uint64 startTimeUnixSeconds; uint64 endTimeUnixSeconds; } event UpdateStage( uint256 indexed stage, uint80[] price, uint80[] mintFee, uint32[] walletLimit, bytes32[] merkleRoot, uint24[] maxStageSupply, uint64 startTimeUnixSeconds, uint64 endTimeUnixSeconds ); event SetMaxMintableSupply(uint256 indexed tokenId, uint256 maxMintableSupply); event SetGlobalWalletLimit(uint256 indexed tokenId, uint256 globalWalletLimit); event Withdraw(uint256 value); event WithdrawERC20(address indexed mintCurrency, uint256 value); event SetTransferable(bool transferable); event DefaultRoyaltySet(address receiver, uint96 feeNumerator); event TokenRoyaltySet(uint256 indexed tokenId, address receiver, uint96 feeNumerator); function getNumberStages() external view returns (uint256); function getGlobalWalletLimit(uint256 tokenId) external view returns (uint256); function getMaxMintableSupply(uint256 tokenId) external view returns (uint256); function totalMintedByAddress(address account) external view returns (uint256[] memory); function getStageInfo(uint256 stage) external view returns (MintStageInfo memory, uint256[] memory, uint256[] memory); function mint( uint256 tokenId, uint32 qty, bytes32[] calldata proof ) external payable; function mintWithLimit( uint256 tokenId, uint32 qty, uint32 limit, bytes32[] calldata proof ) external payable; function authorizedMint( address to, uint256 tokenId, uint32 qty, uint32 limit, bytes32[] calldata proof ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E; address constant ME_SUBSCRIPTION = 0x0403c10721Ff2936EfF684Bbb57CD792Fd4b1B6c; address constant MINT_FEE_RECEIVER = 0x0B98151bEdeE73f9Ba5F2C7b72dEa02D38Ce49Fc; uint64 constant TIMESTAMP_EXPIRY_SECONDS = 300;
{ "viaIR": true, "optimizer": { "enabled": true, "runs": 20, "details": { "yulDetails": { "optimizerSteps": "dhfoD[xarrscLMcCTU]uljmul" } } }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"collectionName","type":"string"},{"internalType":"string","name":"collectionSymbol","type":"string"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256[]","name":"maxMintableSupply","type":"uint256[]"},{"internalType":"uint256[]","name":"globalWalletLimit","type":"uint256[]"},{"internalType":"address","name":"mintCurrency","type":"address"},{"internalType":"address","name":"fundReceiver","type":"address"},{"internalType":"address","name":"royaltyReceiver","type":"address"},{"internalType":"uint96","name":"royaltyFeeNumerator","type":"uint96"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"CannotIncreaseMaxMintableSupply","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC1155InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC1155InvalidApprover","type":"error"},{"inputs":[{"internalType":"uint256","name":"idsLength","type":"uint256"},{"internalType":"uint256","name":"valuesLength","type":"uint256"}],"name":"ERC1155InvalidArrayLength","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC1155InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC1155InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC1155InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC1155MissingApprovalForAll","type":"error"},{"inputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidDefaultRoyalty","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidDefaultRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidTokenRoyalty","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidTokenRoyaltyReceiver","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"GlobalWalletLimitOverflow","type":"error"},{"inputs":[],"name":"InsufficientStageTimeGap","type":"error"},{"inputs":[],"name":"InvalidLimitArgsLength","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[],"name":"InvalidStage","type":"error"},{"inputs":[],"name":"InvalidStageArgsLength","type":"error"},{"inputs":[],"name":"InvalidStartAndEndTimestamp","type":"error"},{"inputs":[],"name":"InvalidTokenId","type":"error"},{"inputs":[],"name":"NewSupplyLessThanTotalSupply","type":"error"},{"inputs":[],"name":"NoSupplyLeft","type":"error"},{"inputs":[],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"NotEnoughValue","type":"error"},{"inputs":[],"name":"NotSupported","type":"error"},{"inputs":[],"name":"NotTransferable","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"StageSupplyExceeded","type":"error"},{"inputs":[],"name":"TimestampExpired","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"WalletGlobalLimitExceeded","type":"error"},{"inputs":[],"name":"WalletStageLimitExceeded","type":"error"},{"inputs":[],"name":"WithdrawFailed","type":"error"},{"inputs":[],"name":"WrongMintCurrency","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"DefaultRoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"globalWalletLimit","type":"uint256"}],"name":"SetGlobalWalletLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"name":"SetMaxMintableSupply","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"transferable","type":"bool"}],"name":"SetTransferable","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"TokenRoyaltySet","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"stage","type":"uint256"},{"indexed":false,"internalType":"uint80[]","name":"price","type":"uint80[]"},{"indexed":false,"internalType":"uint80[]","name":"mintFee","type":"uint80[]"},{"indexed":false,"internalType":"uint32[]","name":"walletLimit","type":"uint32[]"},{"indexed":false,"internalType":"bytes32[]","name":"merkleRoot","type":"bytes32[]"},{"indexed":false,"internalType":"uint24[]","name":"maxStageSupply","type":"uint24[]"},{"indexed":false,"internalType":"uint64","name":"startTimeUnixSeconds","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"endTimeUnixSeconds","type":"uint64"}],"name":"UpdateStage","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"mintCurrency","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"WithdrawERC20","type":"event"},{"inputs":[],"name":"FUND_RECEIVER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"addAuthorizedMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"qty","type":"uint32"},{"internalType":"uint32","name":"limit","type":"uint32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"authorizedMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"getActiveStageFromTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getGlobalWalletLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getMaxMintableSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMintCurrency","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNumberStages","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stage","type":"uint256"}],"name":"getStageInfo","outputs":[{"components":[{"internalType":"uint80[]","name":"price","type":"uint80[]"},{"internalType":"uint80[]","name":"mintFee","type":"uint80[]"},{"internalType":"uint32[]","name":"walletLimit","type":"uint32[]"},{"internalType":"bytes32[]","name":"merkleRoot","type":"bytes32[]"},{"internalType":"uint24[]","name":"maxStageSupply","type":"uint24[]"},{"internalType":"uint64","name":"startTimeUnixSeconds","type":"uint64"},{"internalType":"uint64","name":"endTimeUnixSeconds","type":"uint64"}],"internalType":"struct IERC1155M.MintStageInfo","name":"","type":"tuple"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"qty","type":"uint32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"qty","type":"uint32"},{"internalType":"uint32","name":"limit","type":"uint32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mintWithLimit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"qty","type":"uint32"}],"name":"ownerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"removeAuthorizedMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","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":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"globalWalletLimit","type":"uint256"}],"name":"setGlobalWalletLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"name":"setMaxMintableSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint80[]","name":"price","type":"uint80[]"},{"internalType":"uint80[]","name":"mintFee","type":"uint80[]"},{"internalType":"uint32[]","name":"walletLimit","type":"uint32[]"},{"internalType":"bytes32[]","name":"merkleRoot","type":"bytes32[]"},{"internalType":"uint24[]","name":"maxStageSupply","type":"uint24[]"},{"internalType":"uint64","name":"startTimeUnixSeconds","type":"uint64"},{"internalType":"uint64","name":"endTimeUnixSeconds","type":"uint64"}],"internalType":"struct IERC1155M.MintStageInfo[]","name":"newStages","type":"tuple[]"}],"name":"setStages","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"transferable","type":"bool"}],"name":"setTransferable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newURI","type":"string"}],"name":"setURI","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":"address","name":"account","type":"address"}],"name":"totalMintedByAddress","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e0604052346200008b5762000028620000186200036e565b9796909695919594929462000717565b60405161545b908162000c858239608051818181610a7301528181613df70152614738015260a051818181612f080152818161302e0152818161311c01528181613a61015261534e015260c051818181610d510152818161467501526148340152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b03821117620000c857604052565b62000090565b90620000e5620000dd60405190565b9283620000a6565b565b6001600160401b038111620000c857602090601f01601f19160190565b60005b838110620001185750506000910152565b818101518382015260200162000107565b90929192620001426200013c82620000e7565b620000ce565b918294828452828201116200008b576020620000e593019062000104565b9080601f830112156200008b5781516200017d9260200162000129565b90565b6001600160401b038111620000c85760051b60200190565b805b036200008b57565b90505190620000e58262000198565b90929192620001c46200013c8262000180565b93602085838152019160051b8301928184116200008b57915b838310620001eb5750505050565b60208091620001fb8486620001a2565b815201920191620001dd565b9080601f830112156200008b5781516200017d92602001620001b1565b6001600160a01b031690565b6001600160a01b0381166200019a565b90505190620000e58262000230565b6001600160601b0381166200019a565b90505190620000e5826200024f565b9091610120828403126200008b5781516001600160401b0381116200008b57836200029b91840162000160565b60208301519093906001600160401b0381116200008b5781620002c091850162000160565b60408401519093906001600160401b0381116200008b5782620002e591830162000160565b60608201519093906001600160401b0381116200008b57836200030a91840162000207565b60808301519093906001600160401b0381116200008b57816200032f91850162000207565b926200033f8260a0830162000240565b926200017d620003538460c0850162000240565b93610100620003668260e0870162000240565b94016200025f565b62000391620060e0803803806200038581620000ce565b9283398101906200026e565b9193959798909294969796959493929190565b6200017d6200017d6200017d9290565b634e487b7160e01b600052601160045260246000fd5b6000198114620003da5760010190565b620003b4565b634e487b7160e01b600052603260045260246000fd5b80518210156200040b5760209160051b010190565b620003e0565b634e487b7160e01b600052602260045260246000fd5b600181811c9291168281156200044b575b5060208310146200044557565b62000411565b607f1692503862000438565b9060031b6200046c600019821b5b9384921b90565b169119161790565b9190620004896200017d6200049293620003a4565b90835462000457565b9055565b620000e59160009162000474565b818110620004b0575050565b80620004c0600060019362000496565b01620004a4565b9190601f8111620004d757505050565b620004eb620000e593600052602060002090565b906020601f840160051c830193106200050d575b601f0160051c0190620004a4565b9091508190620004ff565b81519192916001600160401b038111620000c85762000544816200053d845462000427565b84620004c7565b6020601f8211600114620005855781906200049293949560009262000579575b5050600019600383901b1c19169060011b1790565b01519050388062000564565b601f198216946200059b84600052602060002090565b9160005b878110620005da575083600195969710620005bf575b505050811b019055565b015160001960f8600385901b161c19169055388080620005b5565b909260206001819286860151815501940191016200059f565b90620000e59162000518565b8181106200060b575050565b806200061b600060019362000496565b01620005ff565b9190918282106200063257505050565b620006566200064a62000646620000e59590565b9390565b91600052602060002090565b9182019101620005ff565b90680100000000000000008111620000c8578162000681620000e5935490565b9082815562000622565b8151916001600160401b038311620000c8576200064a620006b891620006b2858562000661565b60200190565b60005b838110620006c95750505050565b6001906020620006db6200017d865190565b9401938184015501620006bb565b90620000e5916200068b565b90620007086200017d6200049292151590565b825460ff191660ff9091161790565b98949095916200072e909894989793973362000888565b865162000745620007416200017d8b5190565b9190565b036200085657620007576000620003a4565b95865b620007676200017d8b5190565b811015620007f75787620007886200017d62000784848d620003f6565b5190565b1189828c83620007c2575b505050620007ac57620007a690620003ca565b6200075a565b604051630590c51360e01b8152600490fd5b0390fd5b620007ed9293506200078482620007e66200078462000741956200017d95620003f6565b95620003f6565b1189828c62000793565b506200083c9396509662000827620008349295986200081f620000e59b95989c600a620005f3565b600b620005f3565b825160a052600c620006e9565b600d620006e9565b6080526200084d6001600f620006f5565b60c05262000b80565b6040516302c3f8e160e21b8152600490fd5b6200017d6001620003a4565b906200017d6200017d6200049292620003a4565b906200089491620008aa565b620000e5620008a262000868565b600962000874565b90620000e591620008d5565b620002246200017d6200017d9290565b6200017d90620008b6565b9052565b90620008e19062000946565b620008ed6000620008c6565b6001600160a01b0381166001600160a01b03831614620009135750620000e590620009cb565b620007be906200092260405190565b631e4fbdf760e01b8152918291600483016001600160a01b03909116815260200190565b620000e590620000e590620000e59062000a8b565b9060031b6200046c6001600160a01b03821b62000465565b6200017d9062000224906001600160a01b031682565b6200017d9062000973565b6200017d9062000989565b9190620009b46200017d620004929362000994565b9083546200095b565b620000e5916000916200099f565b620000e590620009de60006008620009bd565b62000a2b565b6200017d9062000224565b6200017d9054620009e4565b9062000a0f6200017d620004929262000994565b82546001600160a01b0319166001600160a01b03919091161790565b62000a5962000a5262000a3f6007620009ef565b62000a4c846007620009fb565b62000994565b9162000994565b907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e062000a8560405190565b600090a3565b620000e5906002620005f3565b6200017d9081906001600160601b031681565b620008d19062000a98565b916020620000e592949362000ad081604081019762000aab565b0152565b6200017d6040620000ce565b6200017d9062000af6906001600160601b031682565b6001600160601b031690565b9062000b166200017d620004929262000ae0565b8254906001600160a01b03199060a01b6001600160a01b0390921691161790565b62000b6d6020620000e59362000b5f62000b5882516001600160a01b031690565b85620009fb565b01516001600160601b031690565b9062000b02565b90620000e59162000b37565b9062000b9562000b8f62000c77565b62000a98565b8062000ba18362000a98565b1162000c41575062000bb46000620008c6565b6001600160a01b0381166001600160a01b0384161462000c0e57509062000c06620000e59262000bf662000be762000ad4565b6001600160a01b039094168452565b6001600160601b03166020830152565b600562000b74565b620007be9062000c1d60405190565b635b6cc80560e11b8152918291600483016001600160a01b03909116815260200190565b90620007be62000c5060405190565b636f483d0960e01b81529283926004840162000ab6565b62000af66200017d6200017d9290565b6200017d61271062000c6756fe6080604052600436101561001257600080fd5b60003560e01c8062fdd58e146102b157806301ffc9a7146102ac57806302fe5305146102a757806304634d8d146102a257806306fdde031461029d5780630e89341c1461029857806318160ddd1461029357806322fe44c31461028e578063274a204b146102895780632a55205a146102845780632d759d0f1461027f5780632eb2c2d61461027a5780632ed6d5e8146102755780633115bba7146102705780633ccfd60b1461026b578063424aa88414610266578063475ae039146102615780634e1273f41461025c5780634f558e79146102575780635944c7531461025257806359cff9491461024d5780635f710f5c1461024857806367808a3414610243578063700d19f21461023e57806370da24ee14610239578063715018a61461023457806379ba50971461022f57806379f9895d1461022a5780638da5cb5b1461022557806395d89b411461022057806397cf84fc1461021b5780639823560c146102165780639cd2370714610211578063a22cb4651461020c578063a3759f6014610207578063bd85b03914610202578063e2bc7c12146101fd578063e30c3978146101f8578063e8e61bb8146101f3578063e985e9c5146101ee578063f242432a146101e95763f2fde38b036102d557611237565b61121b565b6111be565b611182565b611167565b61114e565b61110e565b6110e4565b610ef5565b610eba565b610e76565b610e5b565b610e40565b610e19565b610e02565b610da9565b610d91565b610d75565b610d3c565b610d21565b610ccd565b610cb6565b610c4e565b610c0a565b610be2565b610ab3565b610a5e565b610a36565b610a1d565b6109d5565b6109b9565b610814565b6107e5565b6107a8565b610772565b6106ac565b610691565b610656565b610467565b61040a565b610385565b610323565b6001600160a01b031690565b90565b6102ce816102b6565b036102d557565b600080fd5b905035906102e7826102c5565b565b806102ce565b905035906102e7826102e9565b91906040838203126102d5578060206103186102c293866102da565b94016102ef565b9052565b346102d55761035061033f6103393660046102fc565b906114d2565b6040515b9182918290815260200190565b0390f35b6001600160e01b031981166102ce565b905035906102e782610354565b906020828203126102d5576102c291610364565b346102d5576103506103a061039b366004610371565b614e5d565b6040515b91829182901515815260200190565b9181601f840112156102d557823591826001600160401b0381116102d557602090818601950101116102d557565b906020828203126102d55781356001600160401b0381116102d55761040692016103b3565b9091565b346102d55761042361041d3660046103e1565b9061490d565b604051005b6001600160601b0381166102ce565b905035906102e782610428565b91906040838203126102d5578060206104606102c293866102da565b9401610437565b346102d55761042361047a366004610444565b90614bbc565b60009103126102d557565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052602260045260246000fd5b600181811c9291168281156104d8575b5060208310146104d357565b6104a1565b607f169250386104c7565b805460009392916105006104f6836104b7565b8085529360200190565b9160018116908115610552575060011461051957505050565b61052c9192939450600052602060002090565b916000925b81841061053e5750500190565b805484840152602090930192600101610531565b60ff19168352505090151560051b019150565b906102c2916104e3565b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b038211176105a657604052565b61056f565b906102e76105b860405190565b806105c4818096610565565b0390610585565b906105d9576102c2906105ab565b61048b565b6102c26000600a6105cb565b60005b8381106105fd5750506000910152565b81810151838201526020016105ed565b61062e61063760209361064193610622815190565b80835293849260200190565b958691016105ea565b601f01601f191690565b0190565b9060206102c292818152019061060d565b346102d557610666366004610480565b6103506106716105de565b60405191829182610645565b906020828203126102d5576102c2916102ef565b346102d5576103506106716106a736600461067d565b611487565b346102d5576106bc366004610480565b61035061033f611c6f565b63ffffffff81166102ce565b905035906102e7826106c7565b909182601f830112156102d55781359283926001600160401b0385116102d5578060208092019560051b0101116102d557565b91909160a0818403126102d55761072a83826102da565b9261073881602084016102ef565b9261074682604085016106d3565b9261075483606083016106d3565b9260808201356001600160401b0381116102d55761040692016106e0565b610423610780366004610713565b94939093929192613c16565b91906040838203126102d5578060206103186102c293866102ef565b346102d5576104236107bb36600461078c565b906130dc565b61031f906102b6565b9160206102e79294936107e18160408101976107c1565b0152565b346102d5576107fe6107f836600461078c565b90611d61565b9061035061080b60405190565b928392836107ca565b346102d55761035061033f61082a36600461067d565b612ee5565b906102e761083c60405190565b9283610585565b6001600160401b0381116105a65760051b60200190565b9092919261086f61086a82610843565b61082f565b93602085838152019160051b8301928184116102d557915b8383106108945750505050565b602080916108a284866102ef565b815201920191610887565b9080601f830112156102d5578160206102c29335910161085a565b6001600160401b0381116105a657602090601f01601f19160190565b90826000939282370152565b9092919261090061086a826108c8565b918294828452828201116102d55760206102e79301906108e4565b9080601f830112156102d5578160206102c2933591016108f0565b91909160a0818403126102d55761094d83826102da565b9261095b81602084016102da565b9260408301356001600160401b0381116102d5578261097b9185016108ad565b9260608101356001600160401b0381116102d5578361099b9183016108ad565b9260808201356001600160401b0381116102d5576102c2920161091b565b346102d5576104236109cc366004610936565b93929092611707565b346102d5576109e5366004610480565b6104236148a4565b90916060828403126102d5576102c2610a0684846102da565b936040610a1682602087016102ef565b94016106d3565b346102d557610423610a303660046109ed565b916145f8565b346102d557610a46366004610480565b6104236146fd565b6020810192916102e791906107c1565b346102d557610a6e366004610480565b6103507f00000000000000000000000000000000000000000000000000000000000000005b60405191829182610a4e565b906020828203126102d5576102c2916102da565b346102d557610423610ac6366004610a9f565b611e52565b90929192610adb61086a82610843565b93602085838152019160051b8301928184116102d557915b838310610b005750505050565b60208091610b0e84866102da565b815201920191610af3565b9080601f830112156102d5578160206102c293359101610acb565b9190916040818403126102d55780356001600160401b0381116102d55783610b5d918301610b19565b9260208201356001600160401b0381116102d5576102c292016108ad565b90610b9b610b94610b8a845190565b8084529260200190565b9260200190565b9060005b818110610bac5750505090565b909192610bc9610bc26001928651815260200190565b9460200190565b929101610b9f565b9060206102c2928181520190610b7b565b346102d557610350610bfe610bf8366004610b34565b90611596565b60405191829182610bd1565b346102d5576103506103a0610c2036600461067d565b611c79565b90916060828403126102d5576102c2610c3e84846102ef565b93604061046082602087016102da565b346102d557610423610c61366004610c25565b91614d5f565b906080828203126102d557610c7c81836102ef565b92610c8a82602085016106d3565b92610c9883604083016106d3565b9260608201356001600160401b0381116102d55761040692016106e0565b610423610cc4366004610c67565b93929092613bc3565b346102d557610423610ce0366004610a9f565b611e2d565b6001600160401b031690565b6001600160401b0381166102ce565b905035906102e782610cf1565b906020828203126102d5576102c291610d00565b346102d55761035061033f610d37366004610d0d565b614abc565b346102d557610d4c366004610480565b6103507f0000000000000000000000000000000000000000000000000000000000000000610a93565b346102d557610d85366004610480565b61035061033f600e5490565b346102d557610da1366004610480565b61042361129b565b346102d557610db9366004610480565b61042361145b565b916060838303126102d557610dd682846102ef565b92610de483602083016106d3565b9260408201356001600160401b0381116102d55761040692016106e0565b610423610e10366004610dc1565b92919091613b2d565b346102d557610e29366004610480565b610350610a93611259565b6102c26000600b6105cb565b346102d557610e50366004610480565b610350610671610e34565b346102d557610350610bfe610e71366004610a9f565b613119565b346102d55761035061033f610e8c36600461067d565b613011565b8015156102ce565b905035906102e782610e91565b906020828203126102d5576102c291610e99565b346102d557610423610ecd366004610ea6565b614ab3565b91906040838203126102d557806020610eee6102c293866102da565b9401610e99565b346102d557610423610f08366004610ed2565b9061165b565b90610f1d610b94610b8a845190565b9060005b818110610f2e5750505090565b909192610f4d610bc260019286516001600160501b0316815260200190565b929101610f21565b90610f64610b94610b8a845190565b9060005b818110610f755750505090565b909192610f91610bc2600192865163ffffffff16815260200190565b929101610f68565b90610fa8610b94610b8a845190565b9060005b818110610fb95750505090565b909192610fcf610bc26001928651815260200190565b929101610fac565b90610fe6610b94610b8a845190565b9060005b818110610ff75750505090565b909192611012610bc2600192865162ffffff16815260200190565b929101610fea565b906102c29060c080611089611077611065611053611041895160e0895260e0890190610f0e565b60208a015188820360208a0152610f0e565b60408901518782036040890152610f55565b60608801518682036060880152610f99565b60808701518582036080870152610fd7565b60a0808701516001600160401b0316908501529401516001600160401b0316910152565b916110d6906110c86102c2959360608652606086019061101a565b908482036020860152610b7b565b916040818403910152610b7b565b346102d5576103506110ff6110fa36600461067d565b613a02565b604051919391938493846110ad565b346102d55761035061033f61112436600461067d565b611c61565b906020828203126102d55781356001600160401b0381116102d55761040692016106e0565b346102d557610423611161366004611129565b90612ea6565b346102d557611177366004610480565b610350610a936112ee565b346102d55761042361119536600461078c565b90613007565b91906040838203126102d5578060206111b76102c293866102da565b94016102da565b346102d5576103506103a06111d436600461119b565b90611666565b91909160a0818403126102d5576111f183826102da565b926111ff81602084016102da565b9261120d82604085016102ef565b9261099b83606083016102ef565b346102d55761042361122e3660046111da565b9392909261169d565b346102d55761042361124a366004610a9f565b6113b6565b6102c290546102b6565b6102c2600761124f565b61126b6112a3565b6102e7611289565b6102b66102c26102c29290565b6102c290611273565b6102e76112966000611280565b611405565b6102e7611263565b6112ab611259565b33906112bf6112b9836102b6565b916102b6565b036112c75750565b6112ea906112d460405190565b63118cdaa760e01b815291829160048301610a4e565b0390fd5b6102c2600861124f565b6102e7906113046112a3565b61135f565b6102c2906102b6906001600160a01b031682565b6102c290611309565b6102c29061131d565b9061133f6102c261135b92611326565b82546001600160a01b0319166001600160a01b03919091161790565b9055565b61136a81600861132f565b61138361137d611378611259565b611326565b91611326565b907f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227006113ae60405190565b80805b0390a3565b6102e7906112f8565b9060031b6113d86001600160a01b03821b5b9384921b90565b169119161790565b91906113f16102c261135b93611326565b9083546113bf565b6102e7916000916113e0565b6102e790611415600060086113f9565b61143061137d611425600761124f565b61137884600761132f565b907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e06113ae60405190565b336114646112ee565b6114706112b9836102b6565b036112c7576102e790611405565b6102c2906105ab565b506102c2600261147e565b6102c26102c26102c29290565b906114a990611492565b600052602052604060002090565b906114a990611326565b6102c29081565b6102c290546114c1565b6114e9906114e46102c293600061149f565b6114b7565b6114c8565b9081526040810192916102e79160200152565b9061150e61086a83610843565b918252565b369037565b906102e761152583611501565b60208194611535601f1991610843565b019101611513565b634e487b7160e01b600052601160045260246000fd5b60001981146115625760010190565b61153d565b634e487b7160e01b600052603260045260246000fd5b80518210156115915760209160051b010190565b611567565b9061159f825190565b6115b16115ad6102c2845190565b9190565b0361162b576115c66115c1835190565b611518565b916115d16000611492565b6115dc6102c2835190565b811015611625578061161b61160e6115fe611620948660209160051b01015190565b600584901b870160200151610339565b611618838861157d565b52565b611553565b6115d1565b50505090565b519051611638565b915190565b906112ea61164560405190565b635b05999160e01b8152928392600484016114ee565b6102e79190336118f8565b6102c2916114e46116789260016114b7565b5460ff1690565b9160206102e79294936116968160408101976107c1565b01906107c1565b9493929190336116ac816102b6565b6116b5886102b6565b1415806116f0575b6116cc57506102e79495611749565b86906112ea6116da60405190565b63711bec9160e11b81529283926004840161167f565b506117026116fe8289611666565b1590565b6116bd565b949392919033611716816102b6565b61171f886102b6565b141580611736575b6116cc57506102e7949561187e565b506117446116fe8289611666565b611727565b9091949392946117596000611280565b611762816102b6565b8061176c866102b6565b146117b85761177a846102b6565b1461179657506102e7949561178e91611c3c565b9290916117db565b6112ea906117a360405190565b626a0d4560e21b815291829160048301610a4e565b6112ea826117c560405190565b632bfa23e760e11b815291829160048301610a4e565b919392906117eb82868386614efc565b6117fd6117f86000611280565b6102b6565b611806826102b6565b03611813575b5050505050565b339261181d865190565b61182a6115ad6001611492565b0361186e5761185e611864966118516118436000611492565b809260209160051b01015190565b9460209160051b01015190565b93611a2a565b388080808061180c565b611879959293611b96565b611864565b949392919061188d6000611280565b95611897876102b6565b806118a1846102b6565b146118cc576118af826102b6565b146118bf576102e79596506117db565b6112ea876117a360405190565b6112ea886117c560405190565b906118e96102c261135b92151590565b825460ff191660ff9091161790565b6119026000611280565b61190b816102b6565b611914846102b6565b1461196d57506113b161196361195d8361137887611958886114e47f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319960016114b7565b6118d9565b93611326565b936103a460405190565b6112ea9061197a60405190565b62ced3e160e81b815291829160048301610a4e565b905051906102e782610354565b906020828203126102d5576102c29161198f565b91936119de60a0946119d76102c298976119cd876119e5976107c1565b60208701906107c1565b6040850152565b6060830152565b816080820152019061060d565b6040513d6000823e3d90fd5b9061150e61086a836108c8565b3d15611a2557611a1a3d6119fe565b903d6000602084013e565b606090565b9193929094611a4595853b611a3f6000611492565b97889190565b11611a54575b50505050505050565b6000602094611a8c611a686113788a611326565b94611a7260405190565b9889978896879563f23a6e6160e01b8752600487016119b0565b03925af160009181611b14575b50611adf5750611ab0565b38808080808080611a4b565b611ab8611a0b565b91611ac46102c2845190565b03611ad6576112ea906117c560405190565b50805190602001fd5b909150611afc63f23a6e6160e01b5b916001600160e01b03191690565b03611b075750611aa4565b6112ea906117c560405190565b611b3691925060203d8111611b3d575b611b2e8183610585565b81019061199c565b9038611a99565b503d611b24565b93906102c29593611b69611b8894611b5f88611b7a956107c1565b60208801906107c1565b60a0604087015260a0860190610b7b565b908482036060860152610b7b565b91608081840391015261060d565b9193929094611bab95853b611a3f6000611492565b11611bb95750505050505050565b6000602094611bf1611bcd6113788a611326565b94611bd760405190565b9889978896879563bc197c8160e01b875260048701611b44565b03925af160009181611c1c575b50611c095750611ab0565b909150611afc63bc197c8160e01b611aee565b611c3591925060203d8111611b3d57611b2e8183610585565b9038611bfe565b9160806040518094600182526020820152604081019360018552606082015201604052565b6114e96102c291600361149f565b6102c260046114c8565b611c8290611c61565b611c8f6115ad6000611492565b1190565b9061031f906102b6565b6102c29060a01c5b6001600160601b031690565b6102c29054611c9d565b906001600160601b03169052565b6102c2604061082f565b906102e7611cdf611cc9565b6020611cfd8295611cf8611cf28261124f565b85611c93565b611cb1565b9101611cbb565b6102c290611cd3565b6102c290516102b6565b6102c29081906001600160601b031681565b8181029291811591840414171561156257565b634e487b7160e01b600052601260045260246000fd5b8115611d5c570490565b611d3c565b611d72611d7791939293600661149f565b611d04565b91611d8183611d0d565b611d916112b96117f86000611280565b14611dda575b611dd4611dc36115ad92611dbd611db860208801516001600160601b031690565b611d17565b90611d29565b611dce611db8611e06565b90611d52565b92611d0d565b91506115ad611dd4611dc3611def6005611d04565b9492505050611d97565b611ca56102c26102c29290565b6102c2612710611df9565b6102e790611e1d6112a3565b60016119586102e79260136114b7565b6102e790611e11565b6102e790611e426112a3565b60006119586102e79260136114b7565b6102e790611e36565b906102e791611e686112a3565b612b9b565b6102c2906006611d29565b9060031b6113d8600019821b6113d1565b9190611e9a6102c261135b93611492565b908354611e78565b6102e791600091611e89565b818110611eb9575050565b80611ec76000600193611ea2565b01611eae565b9060001960209190910360031b1c8154169055565b919091828210611ef157505050565b611f026102e7936002600391010490565b90600a6003611f1e600286018290045b93600052602060002090565b92830194060280611f32575b500190611eae565b611f40906000198501611ecd565b38611f2a565b90600160401b81116105a65781611f5e6102e7935490565b90828155611ee2565b60006102e791611f46565b906105d9576102e790611f67565b818110611f8b575050565b80611f996000600193611ea2565b01611f80565b919091828210611fae57505050565b6102e79260070160031c90601c611fd26007850160031c5b92600052602060002090565b9182019360021b1680611fe8575b500190611f80565b611ff6906000198501611ecd565b38611fe0565b90600160401b81116105a657816120146102e7935490565b90828155611f9f565b60006102e791611ffc565b906105d9576102e79061201d565b9190611e9a6102c261135b9390565b6102e791600091612036565b81811061205c575050565b8061206a6000600193612045565b01612051565b91909182821061207f57505050565b61209f61209361208f6102e79590565b9390565b91600052602060002090565b9182019101612051565b90600160401b81116105a657816120c16102e7935490565b90828155612070565b60006102e7916120a9565b906105d9576102e7906120ca565b8181106120ee575050565b806120fc6000600193611ea2565b016120e3565b91909182821061211157505050565b6121226102e7936009600a91010490565b906003600a61213660098601829004611f12565b9283019406028061214a575b5001906120e3565b612158906000198501611ecd565b38612142565b90600160401b81116105a657816121766102e7935490565b90828155612102565b60006102e79161215e565b906105d9576102e79061217f565b60056000916121a78382611f72565b6121b48360018301611f72565b6121c18360028301612028565b6121ce83600383016120d5565b6121db836004830161218a565b0155565b906105d9576102e790612198565b8181106121f8575050565b8061220660006006936121df565b016121ed565b91909182821061221b57505050565b61223361209361222d6102e795611e6d565b93611e6d565b91820191016121ed565b90600160401b81116105a657816122556102e7935490565b9082815561220c565b60006102e79161223d565b906105d9576102e79061225e565b90359060de19813603018212156102d5570190565b90821015611591576102c29160051b810190612277565b356102c281610cf1565b9190820391821161156257565b610ce56102c26102c29290565b6102c261012c6122ba565b6122ed906001600160401b03165b916001600160401b031690565b01906001600160401b03821161156257565b903590601e19813603018212156102d5570180359182916001600160401b0384116102d557602001809360051b3603126102d557565b6102c260e061082f565b6001600160501b0381166102ce565b905035906102e78261233f565b9092919261236b61086a82610843565b93602085838152019160051b8301928184116102d557915b8383106123905750505050565b6020809161239e848661234e565b815201920191612383565b6102c291369161235b565b909291926123c461086a82610843565b93602085838152019160051b8301928184116102d557915b8383106123e95750505050565b602080916123f784866106d3565b8152019201916123dc565b6102c29136916123b4565b9092919261241d61086a82610843565b93602085838152019160051b8301928184116102d557915b8383106124425750505050565b6020809161245084866102ef565b815201920191612435565b6102c291369161240d565b62ffffff81166102ce565b905035906102e782612466565b9092919261248e61086a82610843565b93602085838152019160051b8301928184116102d557915b8383106124b35750505050565b602080916124c18486612471565b8152019201916124a6565b6102c291369161247e565b8054821015611591576124f1600691600052602060002090565b91020190600090565b9060031b6113d86001600160501b03821b6113d1565b90612519815190565b906001600160401b0382116105a657611fc661253f916125398486611f46565b60200190565b600382049160005b8381106125b0575060038302900380612561575b50505050565b92600093845b81811061257c5750505001553880808061255b565b90919460206125a660019261259b6102c28a516001600160501b031690565b9085600a02906124fa565b9601929101612567565b6000805b600381106125c9575083820155600101612547565b959060206125f26001926125e76102c286516001600160501b031690565b908a600a02906124fa565b920196016125b4565b906102e791612510565b9060031b6113d863ffffffff821b6113d1565b61262b6102c26102c29263ffffffff1690565b63ffffffff1690565b9061263d815190565b906001600160401b0382116105a657611fc661265d916125398486611ffc565b8160031c9160005b8381106126cb5750600719811690038061267f5750505050565b92600093845b81811061269a5750505001553880808061255b565b90919460206126c16001926126b66102c28a5163ffffffff1690565b908560021b90612605565b9601929101612685565b6000805b600881106126e4575083820155600101612665565b9590602061270a6001926126ff6102c2865163ffffffff1690565b908a60021b90612605565b920196016126cf565b906102e791612634565b8151916001600160401b0383116105a65761209361273f9161253985856120a9565b60005b83811061274f5750505050565b600190602061275f6102c2865190565b9401938184015501612742565b906102e79161271d565b9060031b6113d862ffffff821b6113d1565b90612791815190565b906001600160401b0382116105a657611fc66127b191612539848661215e565b600a82049160005b83811061281d5750600a83029003806127d25750505050565b92600093845b8181106127ed5750505001553880808061255b565b90919460206128136001926128086102c28a5162ffffff1690565b908560030290612776565b96019291016127d8565b6000805b600a81106128365750838201556001016127b9565b9590602061285b6001926128506102c2865162ffffff1690565b908a60030290612776565b92019601612821565b906102e791612788565b610ce56102c26102c2926001600160401b031690565b906128946102c261135b9261286e565b825467ffffffffffffffff19166001600160401b039091161790565b906128c06102c261135b9261286e565b82549067ffffffffffffffff60401b9060401b67ffffffffffffffff60401b1990921691161790565b9061298f60c060056102e794612906612900865190565b826125fb565b61291d612914602087015190565b600183016125fb565b61293461292b604087015190565b60028301612713565b61294b612942606087015190565b6003830161276c565b612962612959608087015190565b60048301612864565b019261298161297b60a08301516001600160401b031690565b85612884565b01516001600160401b031690565b906128b0565b91906105d9576102e7916128e9565b80549190600160401b8310156105a657826129c79160016102e7950181556124d7565b90612995565b506102c290602081019061234e565b818352602090920191906000825b8282106129f8575050505090565b90919293612a27612a20600192612a0f88866129cd565b6001600160501b0316815260200190565b9560200190565b939201906129ea565b506102c29060208101906106d3565b818352602090920191906000825b828210612a5b575050505090565b90919293612a80612a20600192612a728886612a30565b63ffffffff16815260200190565b93920190612a4d565b9037565b8183529091602001916001600160fb1b0381116102d55782916106419160051b938491612a89565b506102c2906020810190612471565b818352602090920191906000825b828210612ae0575050505090565b90919293612b04612a20600192612af78886612ab5565b62ffffff16815260200190565b93920190612ad2565b979060c09995612b7a976102e79d9f9e9c968b612b5091612b6c98612b42612b5e97612b8c9f9a60e0865260e08601916129dc565b9260208185039101526129dc565b918b830360408d0152612a3f565b9188830360608a0152612a8d565b918583036080870152612ac4565b6001600160401b0390971660a0830152565b01906001600160401b03169052565b90612ba86000600e612269565b612bb26000611492565b612bbc6001611492565b600e915b8084811015612e9e57821115612e40575b612bdc81858761228c565b60a001612be8906122a3565b612bf382868861228c565b60c001612bff906122a3565b612c089161530a565b612c1381858761228c565b612c1c90615337565b612c2781858761228c565b80612c31916122ff565b908587612c3f85838361228c565b60208101612c4c916122ff565b90612c5887858561228c565b60408101612c65916122ff565b90612c7189878761228c565b60608101612c7e916122ff565b929093612c8c8b898961228c565b60808101612c99916122ff565b9690978c612ca8818c8461228c565b60a001612cb4906122a3565b9a612cbe9261228c565b60c001612cca906122a3565b99612cd3612335565b9b612cdd916123a9565b8b52612ce8916123a9565b60208a0152612cf691612402565b6040880152612d049161245b565b6060860152612d12916124cc565b60808401526001600160401b031660a08301526001600160401b031660c0820152612d3d90846129a4565b612d4881858761228c565b80612d52916122ff565b90612d5e83878961228c565b60208101612d6b916122ff565b92909187612d7a86828c61228c565b60408101612d87916122ff565b8b612d9689858396959661228c565b60608101612da3916122ff565b90612daf8b868561228c565b60808101612dbc916122ff565b9490938c612dcb81898461228c565b60a001612dd7906122a3565b97612de19261228c565b60c001612ded906122a3565b96612df78d611492565b9b612e0160405190565b9b8c9b612e0e9b8d612b0d565b037f7fec20ffa7d178b5b4d9eb21ec7ff2a1376af8e08ab6cb4c691750db41fc40d191a2612e3b90611553565b612bc0565b612e5660a0612e5083878961228c565b016122a3565b612e866122e0610ce5612e7860c0612e50612e7189896122ad565b8b8d61228c565b612e806122c7565b906122d2565b1015612bd157604051636bc1af9360e01b8152600490fd5b505050505050565b906102e791611e5b565b805482101561159157612ec890600052602060002090565b0190600090565b6102c29160031b1c81565b906102c29154612ecf565b612ef36102c291600c612eb0565b90612eda565b906102e791612f066112a3565b7f0000000000000000000000000000000000000000000000000000000000000000811015612ff557612f3c612ef382600c612eb0565b612f496115ad6000611492565b141580612fdc575b612fca57612f616102c282611c61565b8210612fb857612fb3612fa982612fa485612f9e7fc95161027a9b2f0376fa8fa5f504100ccc4748c73f4e479bac3778d02ee5621c96600c612eb0565b90611e89565b611492565b9261034360405190565b0390a2565b60405163fb7af64960e01b8152600490fd5b60405163430b83b160e11b8152600490fd5b50612fee6102c2612ef383600c612eb0565b8211612f51565b6040516307ed98ed60e31b8152600490fd5b906102e791612ef9565b612ef36102c291600d612eb0565b906102e79161302c6112a3565b7f0000000000000000000000000000000000000000000000000000000000000000811015612ff557613062612ef382600c612eb0565b61306f6115ad6000611492565b11806130c3575b6130b157612fb3612fa982612fa485612f9e7f0c899f003b7b88b925c6cdfe9b56bc4df2b91107f0f6d1cec1c3538d156bbe4896600d612eb0565b604051630590c51360e01b8152600490fd5b506130d56102c2612ef383600c612eb0565b8211613076565b906102e79161301f565b6102c29061262b565b6102c290546130e6565b6102c26102c26102c29263ffffffff1690565b9190820180921161156257565b907f00000000000000000000000000000000000000000000000000000000000000009161314583611518565b9061314f600e5490565b9261315a6000611492565b936131666115ad869790565b945b818710156131e657805b868110156131d1578061161b6131c26131ac6131a76131a28a6114e48f61319d6131cc9a601061149f565b61149f565b6130ef565b6130f9565b6131bd6131b98d8c61157d565b5190565b61310c565b6116188b8a61157d565b613172565b509190956131de90611553565b959091613168565b5050935050905090565b6131f8612335565b90816060808252602082015260606040820152606080820152613219606090565b608082015260c06000918260a08201520152565b6102c26131f0565b6102c2905b6001600160501b031690565b6102c29060501c61323a565b6102c29060a01c61323a565b90600190613270611f12610b8a855490565b6000926132fa575b54908083106132dd575b8083106132c0575b8210613297575b80611625565b826132b7600193946132aa602094613252565b6001600160501b03169052565b01910138613291565b91926020816132d46001936132aa86613246565b0193019161328a565b91926020816132f16001936132aa86613235565b01930191613282565b8160028401101561327857926001606060039261333c875461331f836132aa83613235565b61332f602084016132aa83613246565b6132aa6040840191613252565b0194019201916132fa565b906102c29161325e565b906102e761335e60405190565b806105c4818096613347565b6102c29060201c61262b565b6102c29060401c61262b565b6102c29060601c61262b565b6102c29060801c61262b565b6102c29060a01c61262b565b6102c29060c01c61262b565b6102c29060e01c61262b565b906001906133d0611f12610b8a855490565b600092613506575b54908083106134e9575b8083106134cc575b8083106134af575b808310613492575b808310613475575b808310613458575b80831061343b575b821061341e5780611625565b826132b7600193946134316020946133b2565b63ffffffff169052565b919260208161344f600193613431866133a6565b01930191613412565b919260208161346c6001936134318661339a565b0193019161340a565b91926020816134896001936134318661338e565b01930191613402565b91926020816134a660019361343186613382565b019301916133fa565b91926020816134c360019361343186613376565b019301916133f2565b91926020816134e06001936134318661336a565b019301916133ea565b91926020816134fd600193613431866130e6565b019301916133e2565b816007840110156133d857926001610100600892613599875461352c83613431836130e6565b61353c602084016134318361336a565b61354c6040840161343183613376565b61355c6060840161343183613382565b61356c608084016134318361338e565b61357c60a084016134318361339a565b61358c60c08401613431836133a6565b61343160e08401916133b2565b019401920191613506565b906102c2916133be565b906102e76135bb60405190565b806105c48180966135a4565b906135d6611fc6610b8a845490565b9060005b8181106135e75750505090565b90919261360b6136046001926135fc876114c8565b815260200190565b9460010190565b9291016135da565b906102c2916135c7565b906102e761362a60405190565b806105c4818096613613565b6102c2905b62ffffff1690565b6102c29060181c61363b565b6102c29060301c61363b565b6102c29060481c61363b565b6102c29060601c61363b565b6102c29060781c61363b565b6102c29060901c61363b565b6102c29060a81c61363b565b6102c29060c01c61363b565b6102c29060d81c61363b565b906001906136c1611f12610b8a855490565b600092613840575b5490808310613823575b808310613806575b8083106137e9575b8083106137cc575b8083106137af575b808310613792575b808310613775575b808310613758575b80831061373b575b821061371f5780611625565b826132b7600193946137326020946136a3565b62ffffff169052565b919260208161374f60019361373286613697565b01930191613713565b919260208161376c6001936137328661368b565b0193019161370b565b91926020816137896001936137328661367f565b01930191613703565b91926020816137a660019361373286613673565b019301916136fb565b91926020816137c360019361373286613667565b019301916136f3565b91926020816137e06001936137328661365b565b019301916136eb565b91926020816137fd6001936137328661364f565b019301916136e3565b919260208161381a60019361373286613643565b019301916136db565b919260208161383760019361373286613636565b019301916136d3565b816009840110156136c957926001610140600a926138f587546138668361373283613636565b6138766020840161373283613643565b613886604084016137328361364f565b613896606084016137328361365b565b6138a66080840161373283613667565b6138b660a0840161373283613673565b6138c660c084016137328361367f565b6138d660e084016137328361368b565b6138e7610100840161373283613697565b6137326101208401916136a3565b019401920191613840565b906102c2916136af565b906102e761391760405190565b806105c4818096613900565b6102c290610ce5565b6102c29054613923565b6102c29060401c610ce5565b6102c29054613936565b906102e7613958612335565b60c06139eb6005839661397161396d82613351565b8652565b61398761398060018301613351565b6020870152565b61399d613996600283016135ae565b6040870152565b6139b36139ac6003830161361d565b6060870152565b6139c96139c26004830161390a565b6080870152565b016139e66139d68261392c565b6001600160401b031660a0860152565b613942565b6001600160401b0316910152565b6102c29061394c565b613a0a61322d565b50613a176102c2600e5490565b811015613a4b57613a2733613119565b91613a46613a40613a383385613a5d565b93600e6124d7565b506139f9565b929190565b60405163e82a532960e01b8152600490fd5b91907f000000000000000000000000000000000000000000000000000000000000000092613a8a84611518565b92613a9c613a986000611492565b9590565b945b85811015613ae5578061161b613ad6613ac96131a76131a2896114e4613ae09861319d8c601061149f565b6131bd6131b9858b61157d565b611618838961157d565b613a9e565b509350505090565b90613b01939291613afc613b53565b613b16565b6102e7613b93565b61262b6102c26102c29290565b6102e7939291613b266000613b09565b9133614224565b906102e7939291613aed565b6102c26002611492565b906102c26102c261135b92611492565b613b5d60096114c8565b613b65613b39565b908114613b77576102e7906009613b43565b604051633ee5aeb560e01b8152600490fd5b6102c26001611492565b6102e7613b9e613b89565b6009613b43565b90613b0194939291613bb5613b53565b906102e79493929133614224565b906102e794939291613ba5565b9493929190613be36116783360136114b7565b600190151503613bf6576102e795613c08565b60405163ea8e4eb560e01b8152600490fd5b906102e79594939291614224565b906102e79594939291613bd0565b9493929190613c32826130f9565b613c40612ef383600c612eb0565b613c4d6115ad6000611492565b119081613c75575b50613c63576102e795613dd4565b60405163800113cb60e01b8152600490fd5b613c8391506131bd83611c61565b613c976115ad6102c2612ef385600c612eb0565b1138613c55565b613cb9906001600160501b03165b916001600160501b031690565b01906001600160501b03821161156257565b61323a6102c26102c29263ffffffff1690565b613cf0906001600160501b0316613cac565b02906001600160501b03821691820361156257565b6102c29081906001600160501b031681565b61363b6102c26102c29290565b6102c26102c26102c29262ffffff1690565b613d4b9063ffffffff165b9163ffffffff1690565b019063ffffffff821161156257565b613d6661031f916102b6565b60601b90565b60e01b90565b61031f9063ffffffff1660e01b90565b90601892613d938361064193613d5a565b6014830190613d72565b90613dad6102c261135b92612618565b825463ffffffff191663ffffffff9091161790565b6102c260006119fe565b6102c2613dc2565b9390919492613de5610d37426122ba565b93613df4613a4086600e6124d7565b927f000000000000000000000000000000000000000000000000000000000000000092613e246117f86000611280565b613e2d856102b6565b149283806141eb575b6141d957608086018a888a613e58613e4f83865161157d565b5162ffffff1690565b613e6e613e656000613d17565b9162ffffff1690565b11614189575b50613e869250612ef39150600d612eb0565b613e936115ad6000611492565b11614141575b613ed39260408701888a8d8d613ebd613eb385875161157d565b5163ffffffff1690565b613ec76000613b09565b998a9163ffffffff1690565b1161410b575b50505050506060870191613ef16131b98a855161157d565b613efe6115ad6000611492565b03614024575b505050505061319d613fa06102e798613f72613f6b613f61613f5c613f4d613f408c6020613fbb9d613fa89d839d15613fc9575b50015161157d565b516001600160501b031690565b613f5686613ccb565b90613cde565b613d05565b6131bd60126114c8565b6012613b43565b6131a7613f888a6114e48761319d8d601061149f565b613f9a83613f95836130ef565b613d36565b90613d9d565b95601161149f565b613fb5846131bd836114c8565b90613b43565b613fc3613dcc565b92614232565b613fd561401e91611326565b8b614016613f5c613fe530611326565b92613f56614010613ffa613f408c8b5161157d565b61400a613f408d8d8d015161157d565b90613c9e565b91613ccb565b9133906142ba565b38613f38565b6102c26131b98a614087989e999861408e958f6115ad968a6140696140829361405b61404f60405190565b93849260208401613d82565b03601f198101835282610585565b61407b614074825190565b9160200190565b209261245b565b6144a1565b955161157d565b036140f95763ffffffff169081119083888789856140ce575b50505050506140bc5790953880808080613f04565b60405163b4f3729b60e01b8152600490fd5b6140ee94955061262b93926114e4613f959361319d6131a294601061149f565b1138838887896140a7565b6040516309bde33960e01b8152600490fd5b8361408761262b93613f956131a2613eb3956114e46141329a61319d613d419b601061149f565b116140bc5738888a8d8d613ed9565b61415d61414e888b614518565b6141578c6130f9565b9061310c565b6141716115ad6102c2612ef38b600d612eb0565b1115613e995760405163751304ed60e11b8152600490fd5b613e4f826140876141ba956141576141af6114e96115ad9861319d6141b599601161149f565b916130f9565b613d24565b116141c857388a888a613e74565b60405162d0844960e21b8152600490fd5b604051630717c22560e51b8152600490fd5b5061421d613f5c614214614203613f408b8b5161157d565b61400a613f408c60208d015161157d565b613f568d613ccb565b3410613e36565b906102e79594939291613c24565b909392916142406000611280565b9461424a866102b6565b614253846102b6565b14614267576102e794959161178e91611c3c565b6112ea866117c560405190565b614287613d6c6102c29263ffffffff1690565b6001600160e01b03191690565b6040906107e16102e794969593966142b08360608101996107c1565b60208301906107c1565b90916142fd906142ef6102e7956142d46323b872dd614274565b926142de60405190565b968794602086015260248501614294565b03601f198101845283610585565b614323565b905051906102e782610e91565b906020828203126102d5576102c291614302565b61432f61433691611326565b918261439d565b80516143456115ad6000611492565b14159081614379575b506143565750565b6112ea9061436360405190565b635274afe760e01b815291829160048301610a4e565b61439791508060208061438d6116fe945190565b830101910161430f565b3861434e565b6102c2916143ab6000611492565b6143b430611326565b818131106143de5750600082819260206102c2969551920190855af16143d8611a0b565b91614401565b6112ea906143eb60405190565b63cd78605960e01b815291829160048301610a4e565b901561440d565b501590565b156144185750614472565b614433614423835190565b61442d6000611492565b91829190565b149081614467575b50614444575090565b6112ea9061445160405190565b639996b31560e01b815291829160048301610a4e565b9050813b143861443b565b80516144816115ad6000611492565b111561448f57805190602001fd5b604051630a12f52160e11b8152600490fd5b6144ab6000611492565b915b6144b86102c2835190565b8310156144e5576144d96144df916144d36131b9868661157d565b906144eb565b92611553565b916144ad565b91505090565b8181101561450657906102c291600052602052604060002090565b6102c291600052602052604060002090565b6145226000611492565b9182936145316102c2600e5490565b945b858510156145675761455b614561916141576131a76131a2886114e48961319d8d601061149f565b94611553565b93614533565b945092505050565b906102e7929161457d6112a3565b9190614588826130f9565b614596612ef383600c612eb0565b6145a36115ad6000611492565b1190816145b9575b50613c63576102e7926145e2565b6145c791506131bd83611c61565b6145db6115ad6102c2612ef385600c612eb0565b11386145ab565b906145ef6102e7936130f9565b90613fc3613dcc565b906102e7929161456f565b61460b6112a3565b6102e7614645600080730b98151bedee73f9ba5f2c7b72dea02d38ce49fc61463360126114c8565b60405190818003925af1614408611a0b565b6146eb57614656613f6b6000611492565b61465f30611326565b3161469e60008061466f60405190565b600090857f00000000000000000000000000000000000000000000000000000000000000005af1614408611a0b565b6146d9576146d461033f7f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d926131bd60126114c8565b0390a1565b604051631d42c86760e21b8152600490fd5b6040516312171d8360e31b8152600490fd5b6102e7614603565b61470d6112a3565b6102e7614736565b905051906102e7826102e9565b906020828203126102d5576102c291614715565b7f00000000000000000000000000000000000000000000000000000000000000006147646117f86000611280565b61476d826102b6565b14614892576147ec61477e82611326565b6147a7730b98151bedee73f9ba5f2c7b72dea02d38ce49fc6147a060126114c8565b90836148ac565b6147b4613f6b6000611492565b60206147bf82611326565b6147c830611326565b906147d260405190565b948592839182916370a0823160e01b835260048301610a4e565b03915afa90811561488d5761195d612fb392612fa9927fbe7426aee8a34d0263892b55ce65ce81d8f4c806eb4719e59015ea49feb92d2295600092614859575b5081613f61917f0000000000000000000000000000000000000000000000000000000000000000906148ac565b613f6191925061487f9060203d8111614886575b6148778183610585565b810190614722565b919061482c565b503d61486d565b6119f2565b60405163a47ca0b760e01b8152600490fd5b6102e7614705565b6142fd6102e7936142ef6148c363a9059cbb614274565b916148cd60405190565b9586936020850152602484016107ca565b906102e7916148eb6112a3565b6148fb565b6102c29136916108f0565b6102e791614908916148f0565b614a6c565b906102e7916148de565b818110614922575050565b806149306000600193611ea2565b01614917565b9190601f811161494557505050565b6149576102e793600052602060002090565b906020601f840160051c83019310614977575b601f0160051c0190614917565b909150819061496a565b9060001960039190911b1c191690565b8161499b91614981565b9060011b1790565b81519192916001600160401b0381116105a6576149ca816149c484546104b7565b84614936565b6020601f82116001146149f957819061135b9394956000926149ee575b5050614991565b0151905038806149e7565b601f19821694614a0e84600052602060002090565b9160005b878110614a4a575083600195969710614a30575b505050811b019055565b614a40910151601f841690614981565b9055388080614a26565b90926020600181928686015181550194019101614a12565b906102e7916149a3565b6102e7906002614a62565b6102e790614a836112a3565b6146d47fbcde07732ba7563e295b3edc0bf5ec939a471d93d850a58a6f2902c0ed323728916103a081600f6118d9565b6102e790614a77565b614ac66000611492565b90614ad36102c2600e5490565b915b82811015613a4b57614af7610ce56005614af084600e6124d7565b500161392c565b6001600160401b038316908110159081614b1f575b506144e557614b1a90611553565b614ad5565b9050614b3b610ce56005614b3485600e6124d7565b5001613942565b1138614b0c565b906102e791614b4f6112a3565b614b7a565b9160206102e7929493614b6b8160408101976107c1565b01906001600160601b03169052565b907f8a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef91614ba78282614c64565b6146d4614bb360405190565b92839283614b54565b906102e791614b42565b61031f90611d17565b9160206102e79294936107e1816040810197614bc6565b6102c290611ca5906001600160601b031682565b90614c0a6102c261135b92614be6565b8254906001600160a01b03199060a01b6001600160a01b0390921691161790565b614c5460206102e793614c46614c4082611d0d565b8561132f565b01516001600160601b031690565b90614bfa565b906102e791614c2b565b90614c70611db8611e06565b80614c7a83611d17565b11614cef5750614c8a6000611280565b614c93816102b6565b614c9c846102b6565b14614ccc575090614cc56102e792614cbc614cb5611cc9565b9384611c93565b60208301611cbb565b6005614c5a565b6112ea90614cd960405190565b635b6cc80560e11b815291829160048301610a4e565b906112ea614cfc60405190565b636f483d0960e01b815292839260048401614bcf565b906102e79291614d206112a3565b91614d527f7f5b076c952c0ec86e5425963c1326dd0f03a3595c19f81d765e8ff559a6e33c9293612fa4838683614da4565b92612fb3614bb360405190565b906102e79291614d12565b6040906107e16102e79496959396614d858360608101999052565b6020830190614bc6565b9081526040810192916102e791602090611696565b9091614db1611db8611e06565b80614dbb83611d17565b11614e395750614dcb6000611280565b614dd4816102b6565b614ddd856102b6565b14614e1657506102e79291614e0a614e1192614e01614dfa611cc9565b9586611c93565b60208501611cbb565b600661149f565b614c5a565b826112ea614e2360405190565b634b4f842960e11b815292839260048401614d8f565b6112ea8391614e4760405190565b63dfd1fc1b60e01b815293849360048501614d6a565b614e6681614e7b565b908115614e71575090565b6102c29150614ebf565b6001600160e01b03198116636cdb3d1360e11b811491908215614eae575b508115614ea4575090565b6102c29150614ee8565b6303a24d0760e21b14915038614e99565b63152a902d60e11b6001600160e01b0319821614908115614ede575090565b6102c29150614e7b565b614ef86301ffc9a760e01b611aee565b1490565b614f2f90614f13614f289395614f35958784614f79565b614f206117f86000611280565b9283916102b6565b14936102b6565b14911590565b9081614f70575b5080614f5b575b614f4957565b60405163dc8d8db760e01b8152600490fd5b50614f6b6116fe600f5460ff1690565b614f43565b15905038614f3c565b90614f8e9194939294614f13848784846150f2565b1461502a575b614f9d906102b6565b14614fa757509050565b614fb16000611492565b90815b614fbf6102c2865190565b83101561500c576144d961500691614fda6131b9868661157d565b90610641614ff5614fee6131b9898c61157d565b600361149f565b613fb584615002836114c8565b0390565b91614fb4565b90506102e7929350615023915061500260046114c8565b6004613b43565b926150386000939293611492565b9285845b6150476102c2835190565b86101561507e576150769161455b916131bd613fa8614fee6131b98b6150706131b9828e61157d565b9661157d565b93869061503c565b614f9d93969294955061509a9150615023906131bd60046114c8565b9050614f94565b6107e16102e7946150c66060949897956150bf85608081019b6107c1565b6020850152565b6040830152565b90916150e46102c293604084526040840190610b7b565b916020818403910152610b7b565b93909291926150ff845190565b61510d6115ad6102c2865190565b036152fe5790929033916151216000611492565b9485936151316117f86000611280565b945b61513e6102c2855190565b81101561522457600581901b840160200151600582901b880160200151876151658c6102b6565b036151b6575b9061518a9291878961517c826102b6565b0361518f575b505050611553565b615133565b6151a4613fb5916114e46151ae95600061149f565b916131bd836114c8565b388087615182565b6151c86114e98c6114e485600061149f565b8181106151ff57906151f68c6151f16151e58461518a9897960390565b916114e486600061149f565b613b43565b9091925061516b565b8b6112ea848461520e60405190565b6303dee4c560e01b8152948594600486016150a1565b509294959190969350615235815190565b6152426115ad6001611492565b036152b55761529461529461195d846152877fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62979661529a9660209160051b01015190565b9960209160051b01015190565b94611326565b946152b06152a760405190565b928392836114ee565b0390a4565b9490506152e86152946152947f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb94611326565b946152b06152f560405190565b928392836150cd565b82611638611633865190565b9061531d906001600160401b03166122e0565b101561532557565b604051631750215560e11b8152600490fd5b61537261534c61534783806122ff565b905090565b7f000000000000000000000000000000000000000000000000000000000000000061442d565b1491821592615407575b82156153e9575b82156153cb575b82156153ab575b505061539957565b604051634f7ee04f60e11b8152600490fd5b6153c29192506153478160806102c29301906122ff565b14153880615391565b9150806153e16102c261534760608601866122ff565b14159161538a565b9150806153ff6102c261534760408601866122ff565b141591615383565b91508061541d6102c261534760208601866122ff565b14159161537c56fea2646970667358221220eaf38c29dd3304052bdf7984d2de4229db528fc2695242accadf2bb57bce191e64736f6c634300081400330000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007767ce5fa5cacc198a437e42c51190287fb97f10000000000000000000000002414543db0e959124eed19fc9e87ad2c38fbcfcd00000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000000000000000000000000000000000000000003b5468652057696e6e696e6720537472696b6520666561747572696e672050756467792050656e6775696e7320262043442043617374656c6cc3b36e000000000000000000000000000000000000000000000000000000000000000000000000127468655f77696e6e696e675f737472696b650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005b68747470733a2f2f62616679626569676d7a736172773675677468616378727878676d36726b616c366d79797868703569786e6775736d6c33757272777072327032612e697066732e7733732e6c696e6b2f7b69647d2e6a736f6e00000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c8062fdd58e146102b157806301ffc9a7146102ac57806302fe5305146102a757806304634d8d146102a257806306fdde031461029d5780630e89341c1461029857806318160ddd1461029357806322fe44c31461028e578063274a204b146102895780632a55205a146102845780632d759d0f1461027f5780632eb2c2d61461027a5780632ed6d5e8146102755780633115bba7146102705780633ccfd60b1461026b578063424aa88414610266578063475ae039146102615780634e1273f41461025c5780634f558e79146102575780635944c7531461025257806359cff9491461024d5780635f710f5c1461024857806367808a3414610243578063700d19f21461023e57806370da24ee14610239578063715018a61461023457806379ba50971461022f57806379f9895d1461022a5780638da5cb5b1461022557806395d89b411461022057806397cf84fc1461021b5780639823560c146102165780639cd2370714610211578063a22cb4651461020c578063a3759f6014610207578063bd85b03914610202578063e2bc7c12146101fd578063e30c3978146101f8578063e8e61bb8146101f3578063e985e9c5146101ee578063f242432a146101e95763f2fde38b036102d557611237565b61121b565b6111be565b611182565b611167565b61114e565b61110e565b6110e4565b610ef5565b610eba565b610e76565b610e5b565b610e40565b610e19565b610e02565b610da9565b610d91565b610d75565b610d3c565b610d21565b610ccd565b610cb6565b610c4e565b610c0a565b610be2565b610ab3565b610a5e565b610a36565b610a1d565b6109d5565b6109b9565b610814565b6107e5565b6107a8565b610772565b6106ac565b610691565b610656565b610467565b61040a565b610385565b610323565b6001600160a01b031690565b90565b6102ce816102b6565b036102d557565b600080fd5b905035906102e7826102c5565b565b806102ce565b905035906102e7826102e9565b91906040838203126102d5578060206103186102c293866102da565b94016102ef565b9052565b346102d55761035061033f6103393660046102fc565b906114d2565b6040515b9182918290815260200190565b0390f35b6001600160e01b031981166102ce565b905035906102e782610354565b906020828203126102d5576102c291610364565b346102d5576103506103a061039b366004610371565b614e5d565b6040515b91829182901515815260200190565b9181601f840112156102d557823591826001600160401b0381116102d557602090818601950101116102d557565b906020828203126102d55781356001600160401b0381116102d55761040692016103b3565b9091565b346102d55761042361041d3660046103e1565b9061490d565b604051005b6001600160601b0381166102ce565b905035906102e782610428565b91906040838203126102d5578060206104606102c293866102da565b9401610437565b346102d55761042361047a366004610444565b90614bbc565b60009103126102d557565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052602260045260246000fd5b600181811c9291168281156104d8575b5060208310146104d357565b6104a1565b607f169250386104c7565b805460009392916105006104f6836104b7565b8085529360200190565b9160018116908115610552575060011461051957505050565b61052c9192939450600052602060002090565b916000925b81841061053e5750500190565b805484840152602090930192600101610531565b60ff19168352505090151560051b019150565b906102c2916104e3565b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b038211176105a657604052565b61056f565b906102e76105b860405190565b806105c4818096610565565b0390610585565b906105d9576102c2906105ab565b61048b565b6102c26000600a6105cb565b60005b8381106105fd5750506000910152565b81810151838201526020016105ed565b61062e61063760209361064193610622815190565b80835293849260200190565b958691016105ea565b601f01601f191690565b0190565b9060206102c292818152019061060d565b346102d557610666366004610480565b6103506106716105de565b60405191829182610645565b906020828203126102d5576102c2916102ef565b346102d5576103506106716106a736600461067d565b611487565b346102d5576106bc366004610480565b61035061033f611c6f565b63ffffffff81166102ce565b905035906102e7826106c7565b909182601f830112156102d55781359283926001600160401b0385116102d5578060208092019560051b0101116102d557565b91909160a0818403126102d55761072a83826102da565b9261073881602084016102ef565b9261074682604085016106d3565b9261075483606083016106d3565b9260808201356001600160401b0381116102d55761040692016106e0565b610423610780366004610713565b94939093929192613c16565b91906040838203126102d5578060206103186102c293866102ef565b346102d5576104236107bb36600461078c565b906130dc565b61031f906102b6565b9160206102e79294936107e18160408101976107c1565b0152565b346102d5576107fe6107f836600461078c565b90611d61565b9061035061080b60405190565b928392836107ca565b346102d55761035061033f61082a36600461067d565b612ee5565b906102e761083c60405190565b9283610585565b6001600160401b0381116105a65760051b60200190565b9092919261086f61086a82610843565b61082f565b93602085838152019160051b8301928184116102d557915b8383106108945750505050565b602080916108a284866102ef565b815201920191610887565b9080601f830112156102d5578160206102c29335910161085a565b6001600160401b0381116105a657602090601f01601f19160190565b90826000939282370152565b9092919261090061086a826108c8565b918294828452828201116102d55760206102e79301906108e4565b9080601f830112156102d5578160206102c2933591016108f0565b91909160a0818403126102d55761094d83826102da565b9261095b81602084016102da565b9260408301356001600160401b0381116102d5578261097b9185016108ad565b9260608101356001600160401b0381116102d5578361099b9183016108ad565b9260808201356001600160401b0381116102d5576102c2920161091b565b346102d5576104236109cc366004610936565b93929092611707565b346102d5576109e5366004610480565b6104236148a4565b90916060828403126102d5576102c2610a0684846102da565b936040610a1682602087016102ef565b94016106d3565b346102d557610423610a303660046109ed565b916145f8565b346102d557610a46366004610480565b6104236146fd565b6020810192916102e791906107c1565b346102d557610a6e366004610480565b6103507f00000000000000000000000000000000000000000000000000000000000000005b60405191829182610a4e565b906020828203126102d5576102c2916102da565b346102d557610423610ac6366004610a9f565b611e52565b90929192610adb61086a82610843565b93602085838152019160051b8301928184116102d557915b838310610b005750505050565b60208091610b0e84866102da565b815201920191610af3565b9080601f830112156102d5578160206102c293359101610acb565b9190916040818403126102d55780356001600160401b0381116102d55783610b5d918301610b19565b9260208201356001600160401b0381116102d5576102c292016108ad565b90610b9b610b94610b8a845190565b8084529260200190565b9260200190565b9060005b818110610bac5750505090565b909192610bc9610bc26001928651815260200190565b9460200190565b929101610b9f565b9060206102c2928181520190610b7b565b346102d557610350610bfe610bf8366004610b34565b90611596565b60405191829182610bd1565b346102d5576103506103a0610c2036600461067d565b611c79565b90916060828403126102d5576102c2610c3e84846102ef565b93604061046082602087016102da565b346102d557610423610c61366004610c25565b91614d5f565b906080828203126102d557610c7c81836102ef565b92610c8a82602085016106d3565b92610c9883604083016106d3565b9260608201356001600160401b0381116102d55761040692016106e0565b610423610cc4366004610c67565b93929092613bc3565b346102d557610423610ce0366004610a9f565b611e2d565b6001600160401b031690565b6001600160401b0381166102ce565b905035906102e782610cf1565b906020828203126102d5576102c291610d00565b346102d55761035061033f610d37366004610d0d565b614abc565b346102d557610d4c366004610480565b6103507f00000000000000000000000007767ce5fa5cacc198a437e42c51190287fb97f1610a93565b346102d557610d85366004610480565b61035061033f600e5490565b346102d557610da1366004610480565b61042361129b565b346102d557610db9366004610480565b61042361145b565b916060838303126102d557610dd682846102ef565b92610de483602083016106d3565b9260408201356001600160401b0381116102d55761040692016106e0565b610423610e10366004610dc1565b92919091613b2d565b346102d557610e29366004610480565b610350610a93611259565b6102c26000600b6105cb565b346102d557610e50366004610480565b610350610671610e34565b346102d557610350610bfe610e71366004610a9f565b613119565b346102d55761035061033f610e8c36600461067d565b613011565b8015156102ce565b905035906102e782610e91565b906020828203126102d5576102c291610e99565b346102d557610423610ecd366004610ea6565b614ab3565b91906040838203126102d557806020610eee6102c293866102da565b9401610e99565b346102d557610423610f08366004610ed2565b9061165b565b90610f1d610b94610b8a845190565b9060005b818110610f2e5750505090565b909192610f4d610bc260019286516001600160501b0316815260200190565b929101610f21565b90610f64610b94610b8a845190565b9060005b818110610f755750505090565b909192610f91610bc2600192865163ffffffff16815260200190565b929101610f68565b90610fa8610b94610b8a845190565b9060005b818110610fb95750505090565b909192610fcf610bc26001928651815260200190565b929101610fac565b90610fe6610b94610b8a845190565b9060005b818110610ff75750505090565b909192611012610bc2600192865162ffffff16815260200190565b929101610fea565b906102c29060c080611089611077611065611053611041895160e0895260e0890190610f0e565b60208a015188820360208a0152610f0e565b60408901518782036040890152610f55565b60608801518682036060880152610f99565b60808701518582036080870152610fd7565b60a0808701516001600160401b0316908501529401516001600160401b0316910152565b916110d6906110c86102c2959360608652606086019061101a565b908482036020860152610b7b565b916040818403910152610b7b565b346102d5576103506110ff6110fa36600461067d565b613a02565b604051919391938493846110ad565b346102d55761035061033f61112436600461067d565b611c61565b906020828203126102d55781356001600160401b0381116102d55761040692016106e0565b346102d557610423611161366004611129565b90612ea6565b346102d557611177366004610480565b610350610a936112ee565b346102d55761042361119536600461078c565b90613007565b91906040838203126102d5578060206111b76102c293866102da565b94016102da565b346102d5576103506103a06111d436600461119b565b90611666565b91909160a0818403126102d5576111f183826102da565b926111ff81602084016102da565b9261120d82604085016102ef565b9261099b83606083016102ef565b346102d55761042361122e3660046111da565b9392909261169d565b346102d55761042361124a366004610a9f565b6113b6565b6102c290546102b6565b6102c2600761124f565b61126b6112a3565b6102e7611289565b6102b66102c26102c29290565b6102c290611273565b6102e76112966000611280565b611405565b6102e7611263565b6112ab611259565b33906112bf6112b9836102b6565b916102b6565b036112c75750565b6112ea906112d460405190565b63118cdaa760e01b815291829160048301610a4e565b0390fd5b6102c2600861124f565b6102e7906113046112a3565b61135f565b6102c2906102b6906001600160a01b031682565b6102c290611309565b6102c29061131d565b9061133f6102c261135b92611326565b82546001600160a01b0319166001600160a01b03919091161790565b9055565b61136a81600861132f565b61138361137d611378611259565b611326565b91611326565b907f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227006113ae60405190565b80805b0390a3565b6102e7906112f8565b9060031b6113d86001600160a01b03821b5b9384921b90565b169119161790565b91906113f16102c261135b93611326565b9083546113bf565b6102e7916000916113e0565b6102e790611415600060086113f9565b61143061137d611425600761124f565b61137884600761132f565b907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e06113ae60405190565b336114646112ee565b6114706112b9836102b6565b036112c7576102e790611405565b6102c2906105ab565b506102c2600261147e565b6102c26102c26102c29290565b906114a990611492565b600052602052604060002090565b906114a990611326565b6102c29081565b6102c290546114c1565b6114e9906114e46102c293600061149f565b6114b7565b6114c8565b9081526040810192916102e79160200152565b9061150e61086a83610843565b918252565b369037565b906102e761152583611501565b60208194611535601f1991610843565b019101611513565b634e487b7160e01b600052601160045260246000fd5b60001981146115625760010190565b61153d565b634e487b7160e01b600052603260045260246000fd5b80518210156115915760209160051b010190565b611567565b9061159f825190565b6115b16115ad6102c2845190565b9190565b0361162b576115c66115c1835190565b611518565b916115d16000611492565b6115dc6102c2835190565b811015611625578061161b61160e6115fe611620948660209160051b01015190565b600584901b870160200151610339565b611618838861157d565b52565b611553565b6115d1565b50505090565b519051611638565b915190565b906112ea61164560405190565b635b05999160e01b8152928392600484016114ee565b6102e79190336118f8565b6102c2916114e46116789260016114b7565b5460ff1690565b9160206102e79294936116968160408101976107c1565b01906107c1565b9493929190336116ac816102b6565b6116b5886102b6565b1415806116f0575b6116cc57506102e79495611749565b86906112ea6116da60405190565b63711bec9160e11b81529283926004840161167f565b506117026116fe8289611666565b1590565b6116bd565b949392919033611716816102b6565b61171f886102b6565b141580611736575b6116cc57506102e7949561187e565b506117446116fe8289611666565b611727565b9091949392946117596000611280565b611762816102b6565b8061176c866102b6565b146117b85761177a846102b6565b1461179657506102e7949561178e91611c3c565b9290916117db565b6112ea906117a360405190565b626a0d4560e21b815291829160048301610a4e565b6112ea826117c560405190565b632bfa23e760e11b815291829160048301610a4e565b919392906117eb82868386614efc565b6117fd6117f86000611280565b6102b6565b611806826102b6565b03611813575b5050505050565b339261181d865190565b61182a6115ad6001611492565b0361186e5761185e611864966118516118436000611492565b809260209160051b01015190565b9460209160051b01015190565b93611a2a565b388080808061180c565b611879959293611b96565b611864565b949392919061188d6000611280565b95611897876102b6565b806118a1846102b6565b146118cc576118af826102b6565b146118bf576102e79596506117db565b6112ea876117a360405190565b6112ea886117c560405190565b906118e96102c261135b92151590565b825460ff191660ff9091161790565b6119026000611280565b61190b816102b6565b611914846102b6565b1461196d57506113b161196361195d8361137887611958886114e47f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319960016114b7565b6118d9565b93611326565b936103a460405190565b6112ea9061197a60405190565b62ced3e160e81b815291829160048301610a4e565b905051906102e782610354565b906020828203126102d5576102c29161198f565b91936119de60a0946119d76102c298976119cd876119e5976107c1565b60208701906107c1565b6040850152565b6060830152565b816080820152019061060d565b6040513d6000823e3d90fd5b9061150e61086a836108c8565b3d15611a2557611a1a3d6119fe565b903d6000602084013e565b606090565b9193929094611a4595853b611a3f6000611492565b97889190565b11611a54575b50505050505050565b6000602094611a8c611a686113788a611326565b94611a7260405190565b9889978896879563f23a6e6160e01b8752600487016119b0565b03925af160009181611b14575b50611adf5750611ab0565b38808080808080611a4b565b611ab8611a0b565b91611ac46102c2845190565b03611ad6576112ea906117c560405190565b50805190602001fd5b909150611afc63f23a6e6160e01b5b916001600160e01b03191690565b03611b075750611aa4565b6112ea906117c560405190565b611b3691925060203d8111611b3d575b611b2e8183610585565b81019061199c565b9038611a99565b503d611b24565b93906102c29593611b69611b8894611b5f88611b7a956107c1565b60208801906107c1565b60a0604087015260a0860190610b7b565b908482036060860152610b7b565b91608081840391015261060d565b9193929094611bab95853b611a3f6000611492565b11611bb95750505050505050565b6000602094611bf1611bcd6113788a611326565b94611bd760405190565b9889978896879563bc197c8160e01b875260048701611b44565b03925af160009181611c1c575b50611c095750611ab0565b909150611afc63bc197c8160e01b611aee565b611c3591925060203d8111611b3d57611b2e8183610585565b9038611bfe565b9160806040518094600182526020820152604081019360018552606082015201604052565b6114e96102c291600361149f565b6102c260046114c8565b611c8290611c61565b611c8f6115ad6000611492565b1190565b9061031f906102b6565b6102c29060a01c5b6001600160601b031690565b6102c29054611c9d565b906001600160601b03169052565b6102c2604061082f565b906102e7611cdf611cc9565b6020611cfd8295611cf8611cf28261124f565b85611c93565b611cb1565b9101611cbb565b6102c290611cd3565b6102c290516102b6565b6102c29081906001600160601b031681565b8181029291811591840414171561156257565b634e487b7160e01b600052601260045260246000fd5b8115611d5c570490565b611d3c565b611d72611d7791939293600661149f565b611d04565b91611d8183611d0d565b611d916112b96117f86000611280565b14611dda575b611dd4611dc36115ad92611dbd611db860208801516001600160601b031690565b611d17565b90611d29565b611dce611db8611e06565b90611d52565b92611d0d565b91506115ad611dd4611dc3611def6005611d04565b9492505050611d97565b611ca56102c26102c29290565b6102c2612710611df9565b6102e790611e1d6112a3565b60016119586102e79260136114b7565b6102e790611e11565b6102e790611e426112a3565b60006119586102e79260136114b7565b6102e790611e36565b906102e791611e686112a3565b612b9b565b6102c2906006611d29565b9060031b6113d8600019821b6113d1565b9190611e9a6102c261135b93611492565b908354611e78565b6102e791600091611e89565b818110611eb9575050565b80611ec76000600193611ea2565b01611eae565b9060001960209190910360031b1c8154169055565b919091828210611ef157505050565b611f026102e7936002600391010490565b90600a6003611f1e600286018290045b93600052602060002090565b92830194060280611f32575b500190611eae565b611f40906000198501611ecd565b38611f2a565b90600160401b81116105a65781611f5e6102e7935490565b90828155611ee2565b60006102e791611f46565b906105d9576102e790611f67565b818110611f8b575050565b80611f996000600193611ea2565b01611f80565b919091828210611fae57505050565b6102e79260070160031c90601c611fd26007850160031c5b92600052602060002090565b9182019360021b1680611fe8575b500190611f80565b611ff6906000198501611ecd565b38611fe0565b90600160401b81116105a657816120146102e7935490565b90828155611f9f565b60006102e791611ffc565b906105d9576102e79061201d565b9190611e9a6102c261135b9390565b6102e791600091612036565b81811061205c575050565b8061206a6000600193612045565b01612051565b91909182821061207f57505050565b61209f61209361208f6102e79590565b9390565b91600052602060002090565b9182019101612051565b90600160401b81116105a657816120c16102e7935490565b90828155612070565b60006102e7916120a9565b906105d9576102e7906120ca565b8181106120ee575050565b806120fc6000600193611ea2565b016120e3565b91909182821061211157505050565b6121226102e7936009600a91010490565b906003600a61213660098601829004611f12565b9283019406028061214a575b5001906120e3565b612158906000198501611ecd565b38612142565b90600160401b81116105a657816121766102e7935490565b90828155612102565b60006102e79161215e565b906105d9576102e79061217f565b60056000916121a78382611f72565b6121b48360018301611f72565b6121c18360028301612028565b6121ce83600383016120d5565b6121db836004830161218a565b0155565b906105d9576102e790612198565b8181106121f8575050565b8061220660006006936121df565b016121ed565b91909182821061221b57505050565b61223361209361222d6102e795611e6d565b93611e6d565b91820191016121ed565b90600160401b81116105a657816122556102e7935490565b9082815561220c565b60006102e79161223d565b906105d9576102e79061225e565b90359060de19813603018212156102d5570190565b90821015611591576102c29160051b810190612277565b356102c281610cf1565b9190820391821161156257565b610ce56102c26102c29290565b6102c261012c6122ba565b6122ed906001600160401b03165b916001600160401b031690565b01906001600160401b03821161156257565b903590601e19813603018212156102d5570180359182916001600160401b0384116102d557602001809360051b3603126102d557565b6102c260e061082f565b6001600160501b0381166102ce565b905035906102e78261233f565b9092919261236b61086a82610843565b93602085838152019160051b8301928184116102d557915b8383106123905750505050565b6020809161239e848661234e565b815201920191612383565b6102c291369161235b565b909291926123c461086a82610843565b93602085838152019160051b8301928184116102d557915b8383106123e95750505050565b602080916123f784866106d3565b8152019201916123dc565b6102c29136916123b4565b9092919261241d61086a82610843565b93602085838152019160051b8301928184116102d557915b8383106124425750505050565b6020809161245084866102ef565b815201920191612435565b6102c291369161240d565b62ffffff81166102ce565b905035906102e782612466565b9092919261248e61086a82610843565b93602085838152019160051b8301928184116102d557915b8383106124b35750505050565b602080916124c18486612471565b8152019201916124a6565b6102c291369161247e565b8054821015611591576124f1600691600052602060002090565b91020190600090565b9060031b6113d86001600160501b03821b6113d1565b90612519815190565b906001600160401b0382116105a657611fc661253f916125398486611f46565b60200190565b600382049160005b8381106125b0575060038302900380612561575b50505050565b92600093845b81811061257c5750505001553880808061255b565b90919460206125a660019261259b6102c28a516001600160501b031690565b9085600a02906124fa565b9601929101612567565b6000805b600381106125c9575083820155600101612547565b959060206125f26001926125e76102c286516001600160501b031690565b908a600a02906124fa565b920196016125b4565b906102e791612510565b9060031b6113d863ffffffff821b6113d1565b61262b6102c26102c29263ffffffff1690565b63ffffffff1690565b9061263d815190565b906001600160401b0382116105a657611fc661265d916125398486611ffc565b8160031c9160005b8381106126cb5750600719811690038061267f5750505050565b92600093845b81811061269a5750505001553880808061255b565b90919460206126c16001926126b66102c28a5163ffffffff1690565b908560021b90612605565b9601929101612685565b6000805b600881106126e4575083820155600101612665565b9590602061270a6001926126ff6102c2865163ffffffff1690565b908a60021b90612605565b920196016126cf565b906102e791612634565b8151916001600160401b0383116105a65761209361273f9161253985856120a9565b60005b83811061274f5750505050565b600190602061275f6102c2865190565b9401938184015501612742565b906102e79161271d565b9060031b6113d862ffffff821b6113d1565b90612791815190565b906001600160401b0382116105a657611fc66127b191612539848661215e565b600a82049160005b83811061281d5750600a83029003806127d25750505050565b92600093845b8181106127ed5750505001553880808061255b565b90919460206128136001926128086102c28a5162ffffff1690565b908560030290612776565b96019291016127d8565b6000805b600a81106128365750838201556001016127b9565b9590602061285b6001926128506102c2865162ffffff1690565b908a60030290612776565b92019601612821565b906102e791612788565b610ce56102c26102c2926001600160401b031690565b906128946102c261135b9261286e565b825467ffffffffffffffff19166001600160401b039091161790565b906128c06102c261135b9261286e565b82549067ffffffffffffffff60401b9060401b67ffffffffffffffff60401b1990921691161790565b9061298f60c060056102e794612906612900865190565b826125fb565b61291d612914602087015190565b600183016125fb565b61293461292b604087015190565b60028301612713565b61294b612942606087015190565b6003830161276c565b612962612959608087015190565b60048301612864565b019261298161297b60a08301516001600160401b031690565b85612884565b01516001600160401b031690565b906128b0565b91906105d9576102e7916128e9565b80549190600160401b8310156105a657826129c79160016102e7950181556124d7565b90612995565b506102c290602081019061234e565b818352602090920191906000825b8282106129f8575050505090565b90919293612a27612a20600192612a0f88866129cd565b6001600160501b0316815260200190565b9560200190565b939201906129ea565b506102c29060208101906106d3565b818352602090920191906000825b828210612a5b575050505090565b90919293612a80612a20600192612a728886612a30565b63ffffffff16815260200190565b93920190612a4d565b9037565b8183529091602001916001600160fb1b0381116102d55782916106419160051b938491612a89565b506102c2906020810190612471565b818352602090920191906000825b828210612ae0575050505090565b90919293612b04612a20600192612af78886612ab5565b62ffffff16815260200190565b93920190612ad2565b979060c09995612b7a976102e79d9f9e9c968b612b5091612b6c98612b42612b5e97612b8c9f9a60e0865260e08601916129dc565b9260208185039101526129dc565b918b830360408d0152612a3f565b9188830360608a0152612a8d565b918583036080870152612ac4565b6001600160401b0390971660a0830152565b01906001600160401b03169052565b90612ba86000600e612269565b612bb26000611492565b612bbc6001611492565b600e915b8084811015612e9e57821115612e40575b612bdc81858761228c565b60a001612be8906122a3565b612bf382868861228c565b60c001612bff906122a3565b612c089161530a565b612c1381858761228c565b612c1c90615337565b612c2781858761228c565b80612c31916122ff565b908587612c3f85838361228c565b60208101612c4c916122ff565b90612c5887858561228c565b60408101612c65916122ff565b90612c7189878761228c565b60608101612c7e916122ff565b929093612c8c8b898961228c565b60808101612c99916122ff565b9690978c612ca8818c8461228c565b60a001612cb4906122a3565b9a612cbe9261228c565b60c001612cca906122a3565b99612cd3612335565b9b612cdd916123a9565b8b52612ce8916123a9565b60208a0152612cf691612402565b6040880152612d049161245b565b6060860152612d12916124cc565b60808401526001600160401b031660a08301526001600160401b031660c0820152612d3d90846129a4565b612d4881858761228c565b80612d52916122ff565b90612d5e83878961228c565b60208101612d6b916122ff565b92909187612d7a86828c61228c565b60408101612d87916122ff565b8b612d9689858396959661228c565b60608101612da3916122ff565b90612daf8b868561228c565b60808101612dbc916122ff565b9490938c612dcb81898461228c565b60a001612dd7906122a3565b97612de19261228c565b60c001612ded906122a3565b96612df78d611492565b9b612e0160405190565b9b8c9b612e0e9b8d612b0d565b037f7fec20ffa7d178b5b4d9eb21ec7ff2a1376af8e08ab6cb4c691750db41fc40d191a2612e3b90611553565b612bc0565b612e5660a0612e5083878961228c565b016122a3565b612e866122e0610ce5612e7860c0612e50612e7189896122ad565b8b8d61228c565b612e806122c7565b906122d2565b1015612bd157604051636bc1af9360e01b8152600490fd5b505050505050565b906102e791611e5b565b805482101561159157612ec890600052602060002090565b0190600090565b6102c29160031b1c81565b906102c29154612ecf565b612ef36102c291600c612eb0565b90612eda565b906102e791612f066112a3565b7f0000000000000000000000000000000000000000000000000000000000000001811015612ff557612f3c612ef382600c612eb0565b612f496115ad6000611492565b141580612fdc575b612fca57612f616102c282611c61565b8210612fb857612fb3612fa982612fa485612f9e7fc95161027a9b2f0376fa8fa5f504100ccc4748c73f4e479bac3778d02ee5621c96600c612eb0565b90611e89565b611492565b9261034360405190565b0390a2565b60405163fb7af64960e01b8152600490fd5b60405163430b83b160e11b8152600490fd5b50612fee6102c2612ef383600c612eb0565b8211612f51565b6040516307ed98ed60e31b8152600490fd5b906102e791612ef9565b612ef36102c291600d612eb0565b906102e79161302c6112a3565b7f0000000000000000000000000000000000000000000000000000000000000001811015612ff557613062612ef382600c612eb0565b61306f6115ad6000611492565b11806130c3575b6130b157612fb3612fa982612fa485612f9e7f0c899f003b7b88b925c6cdfe9b56bc4df2b91107f0f6d1cec1c3538d156bbe4896600d612eb0565b604051630590c51360e01b8152600490fd5b506130d56102c2612ef383600c612eb0565b8211613076565b906102e79161301f565b6102c29061262b565b6102c290546130e6565b6102c26102c26102c29263ffffffff1690565b9190820180921161156257565b907f00000000000000000000000000000000000000000000000000000000000000019161314583611518565b9061314f600e5490565b9261315a6000611492565b936131666115ad869790565b945b818710156131e657805b868110156131d1578061161b6131c26131ac6131a76131a28a6114e48f61319d6131cc9a601061149f565b61149f565b6130ef565b6130f9565b6131bd6131b98d8c61157d565b5190565b61310c565b6116188b8a61157d565b613172565b509190956131de90611553565b959091613168565b5050935050905090565b6131f8612335565b90816060808252602082015260606040820152606080820152613219606090565b608082015260c06000918260a08201520152565b6102c26131f0565b6102c2905b6001600160501b031690565b6102c29060501c61323a565b6102c29060a01c61323a565b90600190613270611f12610b8a855490565b6000926132fa575b54908083106132dd575b8083106132c0575b8210613297575b80611625565b826132b7600193946132aa602094613252565b6001600160501b03169052565b01910138613291565b91926020816132d46001936132aa86613246565b0193019161328a565b91926020816132f16001936132aa86613235565b01930191613282565b8160028401101561327857926001606060039261333c875461331f836132aa83613235565b61332f602084016132aa83613246565b6132aa6040840191613252565b0194019201916132fa565b906102c29161325e565b906102e761335e60405190565b806105c4818096613347565b6102c29060201c61262b565b6102c29060401c61262b565b6102c29060601c61262b565b6102c29060801c61262b565b6102c29060a01c61262b565b6102c29060c01c61262b565b6102c29060e01c61262b565b906001906133d0611f12610b8a855490565b600092613506575b54908083106134e9575b8083106134cc575b8083106134af575b808310613492575b808310613475575b808310613458575b80831061343b575b821061341e5780611625565b826132b7600193946134316020946133b2565b63ffffffff169052565b919260208161344f600193613431866133a6565b01930191613412565b919260208161346c6001936134318661339a565b0193019161340a565b91926020816134896001936134318661338e565b01930191613402565b91926020816134a660019361343186613382565b019301916133fa565b91926020816134c360019361343186613376565b019301916133f2565b91926020816134e06001936134318661336a565b019301916133ea565b91926020816134fd600193613431866130e6565b019301916133e2565b816007840110156133d857926001610100600892613599875461352c83613431836130e6565b61353c602084016134318361336a565b61354c6040840161343183613376565b61355c6060840161343183613382565b61356c608084016134318361338e565b61357c60a084016134318361339a565b61358c60c08401613431836133a6565b61343160e08401916133b2565b019401920191613506565b906102c2916133be565b906102e76135bb60405190565b806105c48180966135a4565b906135d6611fc6610b8a845490565b9060005b8181106135e75750505090565b90919261360b6136046001926135fc876114c8565b815260200190565b9460010190565b9291016135da565b906102c2916135c7565b906102e761362a60405190565b806105c4818096613613565b6102c2905b62ffffff1690565b6102c29060181c61363b565b6102c29060301c61363b565b6102c29060481c61363b565b6102c29060601c61363b565b6102c29060781c61363b565b6102c29060901c61363b565b6102c29060a81c61363b565b6102c29060c01c61363b565b6102c29060d81c61363b565b906001906136c1611f12610b8a855490565b600092613840575b5490808310613823575b808310613806575b8083106137e9575b8083106137cc575b8083106137af575b808310613792575b808310613775575b808310613758575b80831061373b575b821061371f5780611625565b826132b7600193946137326020946136a3565b62ffffff169052565b919260208161374f60019361373286613697565b01930191613713565b919260208161376c6001936137328661368b565b0193019161370b565b91926020816137896001936137328661367f565b01930191613703565b91926020816137a660019361373286613673565b019301916136fb565b91926020816137c360019361373286613667565b019301916136f3565b91926020816137e06001936137328661365b565b019301916136eb565b91926020816137fd6001936137328661364f565b019301916136e3565b919260208161381a60019361373286613643565b019301916136db565b919260208161383760019361373286613636565b019301916136d3565b816009840110156136c957926001610140600a926138f587546138668361373283613636565b6138766020840161373283613643565b613886604084016137328361364f565b613896606084016137328361365b565b6138a66080840161373283613667565b6138b660a0840161373283613673565b6138c660c084016137328361367f565b6138d660e084016137328361368b565b6138e7610100840161373283613697565b6137326101208401916136a3565b019401920191613840565b906102c2916136af565b906102e761391760405190565b806105c4818096613900565b6102c290610ce5565b6102c29054613923565b6102c29060401c610ce5565b6102c29054613936565b906102e7613958612335565b60c06139eb6005839661397161396d82613351565b8652565b61398761398060018301613351565b6020870152565b61399d613996600283016135ae565b6040870152565b6139b36139ac6003830161361d565b6060870152565b6139c96139c26004830161390a565b6080870152565b016139e66139d68261392c565b6001600160401b031660a0860152565b613942565b6001600160401b0316910152565b6102c29061394c565b613a0a61322d565b50613a176102c2600e5490565b811015613a4b57613a2733613119565b91613a46613a40613a383385613a5d565b93600e6124d7565b506139f9565b929190565b60405163e82a532960e01b8152600490fd5b91907f000000000000000000000000000000000000000000000000000000000000000192613a8a84611518565b92613a9c613a986000611492565b9590565b945b85811015613ae5578061161b613ad6613ac96131a76131a2896114e4613ae09861319d8c601061149f565b6131bd6131b9858b61157d565b611618838961157d565b613a9e565b509350505090565b90613b01939291613afc613b53565b613b16565b6102e7613b93565b61262b6102c26102c29290565b6102e7939291613b266000613b09565b9133614224565b906102e7939291613aed565b6102c26002611492565b906102c26102c261135b92611492565b613b5d60096114c8565b613b65613b39565b908114613b77576102e7906009613b43565b604051633ee5aeb560e01b8152600490fd5b6102c26001611492565b6102e7613b9e613b89565b6009613b43565b90613b0194939291613bb5613b53565b906102e79493929133614224565b906102e794939291613ba5565b9493929190613be36116783360136114b7565b600190151503613bf6576102e795613c08565b60405163ea8e4eb560e01b8152600490fd5b906102e79594939291614224565b906102e79594939291613bd0565b9493929190613c32826130f9565b613c40612ef383600c612eb0565b613c4d6115ad6000611492565b119081613c75575b50613c63576102e795613dd4565b60405163800113cb60e01b8152600490fd5b613c8391506131bd83611c61565b613c976115ad6102c2612ef385600c612eb0565b1138613c55565b613cb9906001600160501b03165b916001600160501b031690565b01906001600160501b03821161156257565b61323a6102c26102c29263ffffffff1690565b613cf0906001600160501b0316613cac565b02906001600160501b03821691820361156257565b6102c29081906001600160501b031681565b61363b6102c26102c29290565b6102c26102c26102c29262ffffff1690565b613d4b9063ffffffff165b9163ffffffff1690565b019063ffffffff821161156257565b613d6661031f916102b6565b60601b90565b60e01b90565b61031f9063ffffffff1660e01b90565b90601892613d938361064193613d5a565b6014830190613d72565b90613dad6102c261135b92612618565b825463ffffffff191663ffffffff9091161790565b6102c260006119fe565b6102c2613dc2565b9390919492613de5610d37426122ba565b93613df4613a4086600e6124d7565b927f000000000000000000000000000000000000000000000000000000000000000092613e246117f86000611280565b613e2d856102b6565b149283806141eb575b6141d957608086018a888a613e58613e4f83865161157d565b5162ffffff1690565b613e6e613e656000613d17565b9162ffffff1690565b11614189575b50613e869250612ef39150600d612eb0565b613e936115ad6000611492565b11614141575b613ed39260408701888a8d8d613ebd613eb385875161157d565b5163ffffffff1690565b613ec76000613b09565b998a9163ffffffff1690565b1161410b575b50505050506060870191613ef16131b98a855161157d565b613efe6115ad6000611492565b03614024575b505050505061319d613fa06102e798613f72613f6b613f61613f5c613f4d613f408c6020613fbb9d613fa89d839d15613fc9575b50015161157d565b516001600160501b031690565b613f5686613ccb565b90613cde565b613d05565b6131bd60126114c8565b6012613b43565b6131a7613f888a6114e48761319d8d601061149f565b613f9a83613f95836130ef565b613d36565b90613d9d565b95601161149f565b613fb5846131bd836114c8565b90613b43565b613fc3613dcc565b92614232565b613fd561401e91611326565b8b614016613f5c613fe530611326565b92613f56614010613ffa613f408c8b5161157d565b61400a613f408d8d8d015161157d565b90613c9e565b91613ccb565b9133906142ba565b38613f38565b6102c26131b98a614087989e999861408e958f6115ad968a6140696140829361405b61404f60405190565b93849260208401613d82565b03601f198101835282610585565b61407b614074825190565b9160200190565b209261245b565b6144a1565b955161157d565b036140f95763ffffffff169081119083888789856140ce575b50505050506140bc5790953880808080613f04565b60405163b4f3729b60e01b8152600490fd5b6140ee94955061262b93926114e4613f959361319d6131a294601061149f565b1138838887896140a7565b6040516309bde33960e01b8152600490fd5b8361408761262b93613f956131a2613eb3956114e46141329a61319d613d419b601061149f565b116140bc5738888a8d8d613ed9565b61415d61414e888b614518565b6141578c6130f9565b9061310c565b6141716115ad6102c2612ef38b600d612eb0565b1115613e995760405163751304ed60e11b8152600490fd5b613e4f826140876141ba956141576141af6114e96115ad9861319d6141b599601161149f565b916130f9565b613d24565b116141c857388a888a613e74565b60405162d0844960e21b8152600490fd5b604051630717c22560e51b8152600490fd5b5061421d613f5c614214614203613f408b8b5161157d565b61400a613f408c60208d015161157d565b613f568d613ccb565b3410613e36565b906102e79594939291613c24565b909392916142406000611280565b9461424a866102b6565b614253846102b6565b14614267576102e794959161178e91611c3c565b6112ea866117c560405190565b614287613d6c6102c29263ffffffff1690565b6001600160e01b03191690565b6040906107e16102e794969593966142b08360608101996107c1565b60208301906107c1565b90916142fd906142ef6102e7956142d46323b872dd614274565b926142de60405190565b968794602086015260248501614294565b03601f198101845283610585565b614323565b905051906102e782610e91565b906020828203126102d5576102c291614302565b61432f61433691611326565b918261439d565b80516143456115ad6000611492565b14159081614379575b506143565750565b6112ea9061436360405190565b635274afe760e01b815291829160048301610a4e565b61439791508060208061438d6116fe945190565b830101910161430f565b3861434e565b6102c2916143ab6000611492565b6143b430611326565b818131106143de5750600082819260206102c2969551920190855af16143d8611a0b565b91614401565b6112ea906143eb60405190565b63cd78605960e01b815291829160048301610a4e565b901561440d565b501590565b156144185750614472565b614433614423835190565b61442d6000611492565b91829190565b149081614467575b50614444575090565b6112ea9061445160405190565b639996b31560e01b815291829160048301610a4e565b9050813b143861443b565b80516144816115ad6000611492565b111561448f57805190602001fd5b604051630a12f52160e11b8152600490fd5b6144ab6000611492565b915b6144b86102c2835190565b8310156144e5576144d96144df916144d36131b9868661157d565b906144eb565b92611553565b916144ad565b91505090565b8181101561450657906102c291600052602052604060002090565b6102c291600052602052604060002090565b6145226000611492565b9182936145316102c2600e5490565b945b858510156145675761455b614561916141576131a76131a2886114e48961319d8d601061149f565b94611553565b93614533565b945092505050565b906102e7929161457d6112a3565b9190614588826130f9565b614596612ef383600c612eb0565b6145a36115ad6000611492565b1190816145b9575b50613c63576102e7926145e2565b6145c791506131bd83611c61565b6145db6115ad6102c2612ef385600c612eb0565b11386145ab565b906145ef6102e7936130f9565b90613fc3613dcc565b906102e7929161456f565b61460b6112a3565b6102e7614645600080730b98151bedee73f9ba5f2c7b72dea02d38ce49fc61463360126114c8565b60405190818003925af1614408611a0b565b6146eb57614656613f6b6000611492565b61465f30611326565b3161469e60008061466f60405190565b600090857f00000000000000000000000007767ce5fa5cacc198a437e42c51190287fb97f15af1614408611a0b565b6146d9576146d461033f7f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d926131bd60126114c8565b0390a1565b604051631d42c86760e21b8152600490fd5b6040516312171d8360e31b8152600490fd5b6102e7614603565b61470d6112a3565b6102e7614736565b905051906102e7826102e9565b906020828203126102d5576102c291614715565b7f00000000000000000000000000000000000000000000000000000000000000006147646117f86000611280565b61476d826102b6565b14614892576147ec61477e82611326565b6147a7730b98151bedee73f9ba5f2c7b72dea02d38ce49fc6147a060126114c8565b90836148ac565b6147b4613f6b6000611492565b60206147bf82611326565b6147c830611326565b906147d260405190565b948592839182916370a0823160e01b835260048301610a4e565b03915afa90811561488d5761195d612fb392612fa9927fbe7426aee8a34d0263892b55ce65ce81d8f4c806eb4719e59015ea49feb92d2295600092614859575b5081613f61917f00000000000000000000000007767ce5fa5cacc198a437e42c51190287fb97f1906148ac565b613f6191925061487f9060203d8111614886575b6148778183610585565b810190614722565b919061482c565b503d61486d565b6119f2565b60405163a47ca0b760e01b8152600490fd5b6102e7614705565b6142fd6102e7936142ef6148c363a9059cbb614274565b916148cd60405190565b9586936020850152602484016107ca565b906102e7916148eb6112a3565b6148fb565b6102c29136916108f0565b6102e791614908916148f0565b614a6c565b906102e7916148de565b818110614922575050565b806149306000600193611ea2565b01614917565b9190601f811161494557505050565b6149576102e793600052602060002090565b906020601f840160051c83019310614977575b601f0160051c0190614917565b909150819061496a565b9060001960039190911b1c191690565b8161499b91614981565b9060011b1790565b81519192916001600160401b0381116105a6576149ca816149c484546104b7565b84614936565b6020601f82116001146149f957819061135b9394956000926149ee575b5050614991565b0151905038806149e7565b601f19821694614a0e84600052602060002090565b9160005b878110614a4a575083600195969710614a30575b505050811b019055565b614a40910151601f841690614981565b9055388080614a26565b90926020600181928686015181550194019101614a12565b906102e7916149a3565b6102e7906002614a62565b6102e790614a836112a3565b6146d47fbcde07732ba7563e295b3edc0bf5ec939a471d93d850a58a6f2902c0ed323728916103a081600f6118d9565b6102e790614a77565b614ac66000611492565b90614ad36102c2600e5490565b915b82811015613a4b57614af7610ce56005614af084600e6124d7565b500161392c565b6001600160401b038316908110159081614b1f575b506144e557614b1a90611553565b614ad5565b9050614b3b610ce56005614b3485600e6124d7565b5001613942565b1138614b0c565b906102e791614b4f6112a3565b614b7a565b9160206102e7929493614b6b8160408101976107c1565b01906001600160601b03169052565b907f8a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef91614ba78282614c64565b6146d4614bb360405190565b92839283614b54565b906102e791614b42565b61031f90611d17565b9160206102e79294936107e1816040810197614bc6565b6102c290611ca5906001600160601b031682565b90614c0a6102c261135b92614be6565b8254906001600160a01b03199060a01b6001600160a01b0390921691161790565b614c5460206102e793614c46614c4082611d0d565b8561132f565b01516001600160601b031690565b90614bfa565b906102e791614c2b565b90614c70611db8611e06565b80614c7a83611d17565b11614cef5750614c8a6000611280565b614c93816102b6565b614c9c846102b6565b14614ccc575090614cc56102e792614cbc614cb5611cc9565b9384611c93565b60208301611cbb565b6005614c5a565b6112ea90614cd960405190565b635b6cc80560e11b815291829160048301610a4e565b906112ea614cfc60405190565b636f483d0960e01b815292839260048401614bcf565b906102e79291614d206112a3565b91614d527f7f5b076c952c0ec86e5425963c1326dd0f03a3595c19f81d765e8ff559a6e33c9293612fa4838683614da4565b92612fb3614bb360405190565b906102e79291614d12565b6040906107e16102e79496959396614d858360608101999052565b6020830190614bc6565b9081526040810192916102e791602090611696565b9091614db1611db8611e06565b80614dbb83611d17565b11614e395750614dcb6000611280565b614dd4816102b6565b614ddd856102b6565b14614e1657506102e79291614e0a614e1192614e01614dfa611cc9565b9586611c93565b60208501611cbb565b600661149f565b614c5a565b826112ea614e2360405190565b634b4f842960e11b815292839260048401614d8f565b6112ea8391614e4760405190565b63dfd1fc1b60e01b815293849360048501614d6a565b614e6681614e7b565b908115614e71575090565b6102c29150614ebf565b6001600160e01b03198116636cdb3d1360e11b811491908215614eae575b508115614ea4575090565b6102c29150614ee8565b6303a24d0760e21b14915038614e99565b63152a902d60e11b6001600160e01b0319821614908115614ede575090565b6102c29150614e7b565b614ef86301ffc9a760e01b611aee565b1490565b614f2f90614f13614f289395614f35958784614f79565b614f206117f86000611280565b9283916102b6565b14936102b6565b14911590565b9081614f70575b5080614f5b575b614f4957565b60405163dc8d8db760e01b8152600490fd5b50614f6b6116fe600f5460ff1690565b614f43565b15905038614f3c565b90614f8e9194939294614f13848784846150f2565b1461502a575b614f9d906102b6565b14614fa757509050565b614fb16000611492565b90815b614fbf6102c2865190565b83101561500c576144d961500691614fda6131b9868661157d565b90610641614ff5614fee6131b9898c61157d565b600361149f565b613fb584615002836114c8565b0390565b91614fb4565b90506102e7929350615023915061500260046114c8565b6004613b43565b926150386000939293611492565b9285845b6150476102c2835190565b86101561507e576150769161455b916131bd613fa8614fee6131b98b6150706131b9828e61157d565b9661157d565b93869061503c565b614f9d93969294955061509a9150615023906131bd60046114c8565b9050614f94565b6107e16102e7946150c66060949897956150bf85608081019b6107c1565b6020850152565b6040830152565b90916150e46102c293604084526040840190610b7b565b916020818403910152610b7b565b93909291926150ff845190565b61510d6115ad6102c2865190565b036152fe5790929033916151216000611492565b9485936151316117f86000611280565b945b61513e6102c2855190565b81101561522457600581901b840160200151600582901b880160200151876151658c6102b6565b036151b6575b9061518a9291878961517c826102b6565b0361518f575b505050611553565b615133565b6151a4613fb5916114e46151ae95600061149f565b916131bd836114c8565b388087615182565b6151c86114e98c6114e485600061149f565b8181106151ff57906151f68c6151f16151e58461518a9897960390565b916114e486600061149f565b613b43565b9091925061516b565b8b6112ea848461520e60405190565b6303dee4c560e01b8152948594600486016150a1565b509294959190969350615235815190565b6152426115ad6001611492565b036152b55761529461529461195d846152877fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62979661529a9660209160051b01015190565b9960209160051b01015190565b94611326565b946152b06152a760405190565b928392836114ee565b0390a4565b9490506152e86152946152947f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb94611326565b946152b06152f560405190565b928392836150cd565b82611638611633865190565b9061531d906001600160401b03166122e0565b101561532557565b604051631750215560e11b8152600490fd5b61537261534c61534783806122ff565b905090565b7f000000000000000000000000000000000000000000000000000000000000000161442d565b1491821592615407575b82156153e9575b82156153cb575b82156153ab575b505061539957565b604051634f7ee04f60e11b8152600490fd5b6153c29192506153478160806102c29301906122ff565b14153880615391565b9150806153e16102c261534760608601866122ff565b14159161538a565b9150806153ff6102c261534760408601866122ff565b141591615383565b91508061541d6102c261534760208601866122ff565b14159161537c56fea2646970667358221220eaf38c29dd3304052bdf7984d2de4229db528fc2695242accadf2bb57bce191e64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007767ce5fa5cacc198a437e42c51190287fb97f10000000000000000000000002414543db0e959124eed19fc9e87ad2c38fbcfcd00000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000000000000000000000000000000000000000003b5468652057696e6e696e6720537472696b6520666561747572696e672050756467792050656e6775696e7320262043442043617374656c6cc3b36e000000000000000000000000000000000000000000000000000000000000000000000000127468655f77696e6e696e675f737472696b650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005b68747470733a2f2f62616679626569676d7a736172773675677468616378727878676d36726b616c366d79797868703569786e6775736d6c33757272777072327032612e697066732e7733732e6c696e6b2f7b69647d2e6a736f6e00000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : collectionName (string): The Winning Strike featuring Pudgy Penguins & CD Castellón
Arg [1] : collectionSymbol (string): the_winning_strike
Arg [2] : uri (string): https://bafybeigmzsarw6ugthacxrxxgm6rkal6myyxhp5ixngusml3urrwpr2p2a.ipfs.w3s.link/{id}.json
Arg [3] : maxMintableSupply (uint256[]): 0
Arg [4] : globalWalletLimit (uint256[]): 0
Arg [5] : mintCurrency (address): 0x0000000000000000000000000000000000000000
Arg [6] : fundReceiver (address): 0x07767ce5fa5Cacc198a437e42c51190287FB97F1
Arg [7] : royaltyReceiver (address): 0x2414543Db0E959124eEd19fC9e87Ad2c38FBCFcD
Arg [8] : royaltyFeeNumerator (uint96): 500
-----Encoded View---------------
22 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [2] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000240
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000280
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 00000000000000000000000007767ce5fa5cacc198a437e42c51190287fb97f1
Arg [7] : 0000000000000000000000002414543db0e959124eed19fc9e87ad2c38fbcfcd
Arg [8] : 00000000000000000000000000000000000000000000000000000000000001f4
Arg [9] : 000000000000000000000000000000000000000000000000000000000000003b
Arg [10] : 5468652057696e6e696e6720537472696b6520666561747572696e6720507564
Arg [11] : 67792050656e6775696e7320262043442043617374656c6cc3b36e0000000000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [13] : 7468655f77696e6e696e675f737472696b650000000000000000000000000000
Arg [14] : 000000000000000000000000000000000000000000000000000000000000005b
Arg [15] : 68747470733a2f2f62616679626569676d7a7361727736756774686163787278
Arg [16] : 78676d36726b616c366d79797868703569786e6775736d6c3375727277707232
Arg [17] : 7032612e697066732e7733732e6c696e6b2f7b69647d2e6a736f6e0000000000
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [19] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [20] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [21] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.