Overview
APE Balance
APE Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
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/token/common/ERC2981.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "./utils/Constants.sol"; import "../magicdrop-types/contracts/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 * - authorized minting */ 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; // Specify how long a signature from cosigner is valid for, recommend 300 seconds. uint64 private _timestampExpirySeconds; // The address of the cosigner server. address private _cosigner; // 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 cosigner, uint64 timestampExpirySeconds, 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; _cosigner = cosigner; _timestampExpirySeconds = timestampExpirySeconds; _transferable = true; MINT_CURRENCY = mintCurrency; 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 Returns cosign nonce. */ function getCosignNonce( address minter, uint256 tokenId ) public view override returns (uint256) { return totalMintedByAddress(minter)[tokenId]; } /** * @dev Sets cosigner. */ function setCosigner(address cosigner) external onlyOwner { _cosigner = cosigner; emit SetCosigner(cosigner); } /** * @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; } function totalSupply() public view override(ERC1155Supply, IERC1155M) returns (uint256) { return ERC1155Supply.totalSupply(); } function totalSupply( uint256 tokenId ) public view override(ERC1155Supply, IERC1155M) returns (uint256) { return ERC1155Supply.totalSupply(tokenId); } /** * @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 * limit - limit for the given minter * proof - the merkle proof generated on client side. This applies if using whitelist * timestamp - the current timestamp * signature - the signature from cosigner if using cosigner */ function mint( uint256 tokenId, uint32 qty, uint32 limit, bytes32[] calldata proof, uint64 timestamp, bytes calldata signature ) external payable virtual nonReentrant { _mintInternal( msg.sender, tokenId, qty, limit, proof, timestamp, signature ); } /** * @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, 0, bytes("0")); } /** * @dev Implementation of minting. */ function _mintInternal( address to, uint256 tokenId, uint32 qty, uint32 limit, bytes32[] calldata proof, uint64 timestamp, bytes memory signature ) internal hasSupply(tokenId, qty) { uint64 stageTimestamp = uint64(block.timestamp); bool waiveMintFee = false; if (_cosigner != address(0)) { waiveMintFee = assertValidCosign( msg.sender, tokenId, qty, timestamp, signature ); _assertValidTimestamp(timestamp); stageTimestamp = timestamp; } uint256 activeStage = getActiveStageFromTimestamp(stageTimestamp); MintStageInfo memory stage = _mintStages[activeStage]; uint80 adjustedMintFee = waiveMintFee ? 0 : stage.mintFee[tokenId]; // Check value if minting with ETH if ( MINT_CURRENCY == address(0) && msg.value < (stage.price[tokenId] + adjustedMintFee) * 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] + adjustedMintFee) * qty ); } _totalMintFee += adjustedMintFee * 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 Returns data hash for the given minter, qty, waiveMintFee and timestamp. */ function getCosignDigest( address minter, uint256 tokenId, uint32 qty, bool waiveMintFee, uint64 timestamp ) public view returns (bytes32) { if (_cosigner == address(0)) revert CosignerNotSet(); return MessageHashUtils.toEthSignedMessageHash( keccak256( abi.encodePacked( address(this), minter, qty, waiveMintFee, _cosigner, timestamp, block.chainid, getCosignNonce(minter, tokenId) ) ) ); } /** * @dev Validates the the given signature. Returns whether mint fee is waived. */ function assertValidCosign( address minter, uint256 tokenId, uint32 qty, uint64 timestamp, bytes memory signature ) public view returns (bool) { if ( SignatureChecker.isValidSignatureNow( _cosigner, getCosignDigest( minter, tokenId, qty, /* waiveMintFee= */ true, timestamp ), signature ) ) { return true; } if ( SignatureChecker.isValidSignatureNow( _cosigner, getCosignDigest( minter, tokenId, qty, /* waiveMintFee= */ false, timestamp ), signature ) ) { return false; } revert InvalidCosignSignature(); } /** * @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(); } /** * @dev Validates the timestamp is not expired. */ function _assertValidTimestamp(uint64 timestamp) internal view { if (timestamp < block.timestamp - _timestampExpirySeconds) revert TimestampExpired(); } 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/IERC1271.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC1271 standard signature validation method for * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. */ interface IERC1271 { /** * @dev Should return whether the signature provided is valid for the provided data * @param hash Hash of the data to be signed * @param signature Signature byte array associated with _data */ function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); }
// 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/cryptography/MessageHashUtils.sol) pragma solidity ^0.8.20; import {Strings} from "../Strings.sol"; /** * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing. * * The library provides methods for generating a hash of a message that conforms to the * https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712] * specifications. */ library MessageHashUtils { /** * @dev Returns the keccak256 digest of an EIP-191 signed data with version * `0x45` (`personal_sign` messages). * * The digest is calculated by prefixing a bytes32 `messageHash` with * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method. * * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with * keccak256, although any bytes32 value can be safely used because the final digest will * be re-hashed. * * See {ECDSA-recover}. */ function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) { /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20) } } /** * @dev Returns the keccak256 digest of an EIP-191 signed data with version * `0x45` (`personal_sign` messages). * * The digest is calculated by prefixing an arbitrary `message` with * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method. * * See {ECDSA-recover}. */ function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) { return keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message)); } /** * @dev Returns the keccak256 digest of an EIP-191 signed data with version * `0x00` (data with intended validator). * * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended * `validator` address. Then hashing the result. * * See {ECDSA-recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked(hex"19_00", validator, data)); } /** * @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`). * * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with * `\x19\x01` and hashing the result. It corresponds to the hash signed by the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712. * * See {ECDSA-recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, hex"19_01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) digest := keccak256(ptr, 0x42) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/SignatureChecker.sol) pragma solidity ^0.8.20; import {ECDSA} from "./ECDSA.sol"; import {IERC1271} from "../../interfaces/IERC1271.sol"; /** * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like * Argent and Safe Wallet (previously Gnosis Safe). */ library SignatureChecker { /** * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) { (address recovered, ECDSA.RecoverError error, ) = ECDSA.tryRecover(hash, signature); return (error == ECDSA.RecoverError.NoError && recovered == signer) || isValidERC1271SignatureNow(signer, hash, signature); } /** * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated * against the signer smart contract using ERC1271. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ function isValidERC1271SignatureNow( address signer, bytes32 hash, bytes memory signature ) internal view returns (bool) { (bool success, bytes memory result) = signer.staticcall( abi.encodeCall(IERC1271.isValidSignature, (hash, signature)) ); return (success && result.length >= 32 && abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector)); } }
// 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/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated 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 // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } }
// 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;
//SPDX-License-Identifier: MIT pragma solidity ^0.8.20; interface IERC1155M { error CannotIncreaseMaxMintableSupply(); error CosignerNotSet(); error NewSupplyLessThanTotalSupply(); error GlobalWalletLimitOverflow(); error InsufficientStageTimeGap(); error InvalidCosignSignature(); 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 SetCosigner(address cosigner); 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 totalSupply() external view returns (uint256); function totalSupply(uint256 tokenId) 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 getCosignNonce( address minter, uint256 tokenId ) external view returns (uint256); function getStageInfo( uint256 stage ) external view returns (MintStageInfo memory, uint256[] memory, uint256[] memory); function mint( uint256 tokenId, uint32 qty, uint32 limit, bytes32[] calldata proof, uint64 timestamp, bytes calldata signature ) external payable; function authorizedMint( address to, uint256 tokenId, uint32 qty, uint32 limit, bytes32[] calldata proof ) external payable; }
{ "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":"cosigner","type":"address"},{"internalType":"uint64","name":"timestampExpirySeconds","type":"uint64"},{"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":[],"name":"CosignerNotSet","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":"InvalidCosignSignature","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":false,"internalType":"address","name":"cosigner","type":"address"}],"name":"SetCosigner","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":"minter","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"qty","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"assertValidCosign","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"qty","type":"uint32"},{"internalType":"bool","name":"waiveMintFee","type":"bool"},{"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"getCosignDigest","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getCosignNonce","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":"uint32","name":"limit","type":"uint32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mint","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":"cosigner","type":"address"}],"name":"setCosigner","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":"tokenId","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
60e0604052346200008e576200002b62000018620003b2565b9998909897919796929695939562000818565b604051615b1c908162000d7b8239608051818181610acf0152818161402c0152614988015260a05181818161309d015281816131c3015281816132b101528181613c110152615a0f015260c051818181610eb0015281816148ca0152614a840152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b03821117620000cb57604052565b62000093565b90620000e8620000e060405190565b9283620000a9565b565b6001600160401b038111620000cb57602090601f01601f19160190565b60005b8381106200011b5750506000910152565b81810151838201526020016200010a565b90929192620001456200013f82620000ea565b620000d1565b918294828452828201116200008e576020620000e893019062000107565b9080601f830112156200008e57815162000180926020016200012c565b90565b6001600160401b038111620000cb5760051b60200190565b805b036200008e57565b90505190620000e8826200019b565b90929192620001c76200013f8262000183565b93602085838152019160051b8301928184116200008e57915b838310620001ee5750505050565b60208091620001fe8486620001a5565b815201920191620001e0565b9080601f830112156200008e5781516200018092602001620001b4565b6001600160a01b031690565b6001600160a01b0381166200019d565b90505190620000e88262000233565b6001600160401b0381166200019d565b90505190620000e88262000252565b6001600160601b0381166200019d565b90505190620000e88262000271565b9190610160838203126200008e5782516001600160401b0381116200008e5781620002bd91850162000163565b60208401519093906001600160401b0381116200008e5782620002e291830162000163565b60408201519093906001600160401b0381116200008e57836200030791840162000163565b60608301519093906001600160401b0381116200008e57816200032c9185016200020a565b60808401519093906001600160401b0381116200008e5782620003519183016200020a565b92620003618360a0840162000243565b92620003718160c0850162000262565b92620003818260e0830162000243565b92620001806200039684610100850162000243565b93610140620003aa82610120870162000243565b940162000281565b620003d56200689780380380620003c981620000d1565b92833981019062000290565b91939597999a909294969899989796959493929190565b6200018062000180620001809290565b634e487b7160e01b600052601160045260246000fd5b6000198114620004225760010190565b620003fc565b634e487b7160e01b600052603260045260246000fd5b8051821015620004535760209160051b010190565b62000428565b634e487b7160e01b600052602260045260246000fd5b600181811c92911682811562000493575b5060208310146200048d57565b62000459565b607f1692503862000480565b9060031b620004b4600019821b5b9384921b90565b169119161790565b9190620004d162000180620004da93620003ec565b9083546200049f565b9055565b620000e891600091620004bc565b818110620004f8575050565b80620005086000600193620004de565b01620004ec565b9190601f81116200051f57505050565b62000533620000e893600052602060002090565b906020601f840160051c8301931062000555575b601f0160051c0190620004ec565b909150819062000547565b81519192916001600160401b038111620000cb576200058c816200058584546200046f565b846200050f565b6020601f8211600114620005cd578190620004da939495600092620005c1575b5050600019600383901b1c19169060011b1790565b015190503880620005ac565b601f19821694620005e384600052602060002090565b9160005b8781106200062257508360019596971062000607575b505050811b019055565b015160001960f8600385901b161c19169055388080620005fd565b90926020600181928686015181550194019101620005e7565b90620000e89162000560565b81811062000653575050565b80620006636000600193620004de565b0162000647565b9190918282106200067a57505050565b6200069e620006926200068e620000e89590565b9390565b91600052602060002090565b918201910162000647565b90680100000000000000008111620000cb5781620006c9620000e8935490565b908281556200066a565b8151916001600160401b038311620000cb57620006926200070091620006fa8585620006a9565b60200190565b60005b838110620007115750505050565b60019060206200072362000180865190565b940193818401550162000703565b90620000e891620006d3565b620001809062000227906001600160a01b031682565b62000180906200073d565b620001809062000753565b906200077d62000180620004da926200075e565b825490600160401b600160e01b039060401b600160401b600160e01b031990921691161790565b6200018090620007ba906001600160401b031682565b6001600160401b031690565b90620007da62000180620004da92620007a4565b82546001600160401b0319166001600160401b03919091161790565b906200080962000180620004da92151590565b825460ff191660ff9091161790565b979399959162000830909b97939995919b33620009aa565b88516200084762000843620001808d5190565b9190565b036200097857899a6200085b6000620003ec565b986200086a620001808b9d5190565b8c1015620008fe578c8b8d8c6200088e620001806200088a84866200043e565b5190565b119283620008c9575b505050620008b357620008ab8d9c62000412565b9b516200086a565b604051630590c51360e01b8152600490fd5b0390fd5b620008f49293506200088a82620008ed6200088a620008439562000180956200043e565b956200043e565b118b8d8f62000897565b620000e89b506200095e9699506200095694979a620009396200094e9495979a9e93620009316200094694600a6200063b565b600b6200063b565b825160a052600c62000731565b600d62000731565b601362000769565b6013620007c6565b6200096c6001600f620007f6565b60805260c05262000c76565b6040516302c3f8e160e21b8152600490fd5b620001806001620003ec565b906200018062000180620004da92620003ec565b90620009b691620009cc565b620000e8620009c46200098a565b600962000996565b90620000e891620009f7565b6200022762000180620001809290565b6200018090620009d8565b9052565b9062000a039062000a68565b62000a0f6000620009e8565b6001600160a01b0381166001600160a01b0383161462000a355750620000e89062000ac1565b620008c59062000a4460405190565b631e4fbdf760e01b8152918291600483016001600160a01b03909116815260200190565b620000e890620000e890620000e89062000b81565b9060031b620004b46001600160a01b03821b620004ad565b919062000aaa62000180620004da936200075e565b90835462000a7d565b620000e89160009162000a95565b620000e89062000ad46000600862000ab3565b62000b21565b620001809062000227565b62000180905462000ada565b9062000b0562000180620004da926200075e565b82546001600160a01b0319166001600160a01b03919091161790565b62000b4f62000b4862000b35600762000ae5565b62000b4284600762000af1565b6200075e565b916200075e565b907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e062000b7b60405190565b600090a3565b620000e89060026200063b565b620001809081906001600160601b031681565b620009f39062000b8e565b916020620000e892949362000bc681604081019762000ba1565b0152565b620001806040620000d1565b620001809062000bec906001600160601b031682565b6001600160601b031690565b9062000c0c62000180620004da9262000bd6565b8254906001600160a01b03199060a01b6001600160a01b0390921691161790565b62000c636020620000e89362000c5562000c4e82516001600160a01b031690565b8562000af1565b01516001600160601b031690565b9062000bf8565b90620000e89162000c2d565b9062000c8b62000c8562000d6d565b62000b8e565b8062000c978362000b8e565b1162000d37575062000caa6000620009e8565b6001600160a01b0381166001600160a01b0384161462000d0457509062000cfc620000e89262000cec62000cdd62000bca565b6001600160a01b039094168452565b6001600160601b03166020830152565b600562000c6a565b620008c59062000d1360405190565b635b6cc80560e11b8152918291600483016001600160a01b03909116815260200190565b90620008c562000d4660405190565b636f483d0960e01b81529283926004840162000bac565b62000bec62000180620001809290565b6200018061271062000d5d56fe6080604052600436101561001257600080fd5b60003560e01c8062fdd58e146102e157806301ffc9a7146102dc57806302045138146102d757806302fe5305146102d257806304634d8d146102cd57806306fdde03146102c85780630e89341c146102c357806318160ddd146102be57806322fe44c3146102b9578063274a204b146102b45780632a55205a146102af5780632d759d0f146102aa5780632eb2c2d6146102a55780632ed6d5e8146102a05780633115bba71461029b5780633ccfd60b14610296578063424aa8841461029157806345b9206e1461028c578063475ae039146102875780634e1273f4146102825780634f558e791461027d57806354c4a632146102785780635944c753146102735780635e9dbe0c1461026e5780635f710f5c1461026957806367808a3414610264578063700d19f21461025f57806370da24ee1461025a578063715018a61461025557806379ba5097146102505780638d3a3e381461024b5780638da5cb5b1461024657806395d89b411461024157806397cf84fc1461023c5780639823560c146102375780639cd2370714610232578063a22cb4651461022d578063a3759f6014610228578063bd85b03914610223578063e2bc7c121461021e578063e30c397814610219578063e8e61bb814610214578063e985e9c51461020f578063f242432a1461020a5763f2fde38b0361030557611345565b611329565b6112cc565b611290565b611275565b61125c565b61121c565b6111f2565b611003565b610fc8565b610f99565b610f7e565b610f63565b610f3c565b610f20565b610f08565b610ef0565b610ed4565b610e9b565b610e80565b610e54565b610e35565b610dbb565b610d75565b610cda565b610cb2565b610b83565b610b64565b610aba565b610a92565b610a79565b610a31565b610a15565b610870565b610841565b610804565b6107ce565b610708565b6106ed565b6106b2565b6104c3565b61046b565b6103f7565b6103b5565b610353565b6001600160a01b031690565b90565b6102fe816102e6565b0361030557565b600080fd5b90503590610317826102f5565b565b806102fe565b9050359061031782610319565b9190604083820312610305578060206103486102f2938661030a565b940161031f565b9052565b346103055761038061036f61036936600461032c565b906115e0565b6040515b9182918290815260200190565b0390f35b6001600160e01b031981166102fe565b9050359061031782610384565b90602082820312610305576102f291610394565b34610305576103806103d06103cb3660046103a1565b6154d3565b6040515b91829182901515815260200190565b90602082820312610305576102f29161030a565b346103055761040f61040a3660046103e3565b611fe7565b604051005b9181601f8401121561030557823591826001600160401b038111610305576020908186019501011161030557565b906020828203126103055781356001600160401b038111610305576104679201610414565b9091565b346103055761040f61047e366004610442565b90614b4d565b6001600160601b0381166102fe565b9050359061031782610484565b9190604083820312610305578060206104bc6102f2938661030a565b9401610493565b346103055761040f6104d63660046104a0565b90615232565b600091031261030557565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052602260045260246000fd5b600181811c929116828115610534575b50602083101461052f57565b6104fd565b607f16925038610523565b8054600093929161055c61055283610513565b8085529360200190565b91600181169081156105ae575060011461057557505050565b6105889192939450600052602060002090565b916000925b81841061059a5750500190565b80548484015260209093019260010161058d565b60ff19168352505090151560051b019150565b906102f29161053f565b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b0382111761060257604052565b6105cb565b9061031761061460405190565b806106208180966105c1565b03906105e1565b90610635576102f290610607565b6104e7565b6102f26000600a610627565b60005b8381106106595750506000910152565b8181015183820152602001610649565b61068a61069360209361069d9361067e815190565b80835293849260200190565b95869101610646565b601f01601f191690565b0190565b9060206102f2928181520190610669565b34610305576106c23660046104dc565b6103806106cd61063a565b604051918291826106a1565b90602082820312610305576102f29161031f565b34610305576103806106cd6107033660046106d9565b611595565b34610305576107183660046104dc565b61038061036f613381565b63ffffffff81166102fe565b9050359061031782610723565b909182601f830112156103055781359283926001600160401b038511610305578060208092019560051b01011161030557565b91909160a08184031261030557610786838261030a565b92610794816020840161031f565b926107a2826040850161072f565b926107b0836060830161072f565b9260808201356001600160401b03811161030557610467920161073c565b61040f6107dc36600461076f565b94939093929192613dd2565b9190604083820312610305578060206103486102f2938661031f565b346103055761040f6108173660046107e8565b90613271565b61034f906102e6565b91602061031792949361083d81604081019761081d565b0152565b346103055761085a6108543660046107e8565b90611e57565b9061038061086760405190565b92839283610826565b346103055761038061036f6108863660046106d9565b61307a565b9061031761089860405190565b92836105e1565b6001600160401b0381116106025760051b60200190565b909291926108cb6108c68261089f565b61088b565b93602085838152019160051b83019281841161030557915b8383106108f05750505050565b602080916108fe848661031f565b8152019201916108e3565b9080601f83011215610305578160206102f2933591016108b6565b6001600160401b03811161060257602090601f01601f19160190565b90826000939282370152565b9092919261095c6108c682610924565b91829482845282820111610305576020610317930190610940565b9080601f83011215610305578160206102f29335910161094c565b91909160a081840312610305576109a9838261030a565b926109b7816020840161030a565b9260408301356001600160401b03811161030557826109d7918501610909565b9260608101356001600160401b03811161030557836109f7918301610909565b9260808201356001600160401b038111610305576102f29201610977565b346103055761040f610a28366004610992565b93929092611815565b3461030557610a413660046104dc565b61040f614af4565b9091606082840312610305576102f2610a62848461030a565b936040610a72826020870161031f565b940161072f565b346103055761040f610a8c366004610a49565b9161484d565b3461030557610aa23660046104dc565b61040f61494d565b602081019291610317919061081d565b3461030557610aca3660046104dc565b6103807f00000000000000000000000000000000000000000000000000000000000000005b60405191829182610aaa565b6001600160401b031690565b6001600160401b0381166102fe565b9050359061031782610b07565b91909160a08184031261030557610b3a838261030a565b92610b48816020840161031f565b92610b56826040850161072f565b926109f78360608301610b16565b34610305576103806103d0610b7a366004610b23565b93929092614eb2565b346103055761040f610b963660046103e3565b611f48565b90929192610bab6108c68261089f565b93602085838152019160051b83019281841161030557915b838310610bd05750505050565b60208091610bde848661030a565b815201920191610bc3565b9080601f83011215610305578160206102f293359101610b9b565b9190916040818403126103055780356001600160401b0381116103055783610c2d918301610be9565b9260208201356001600160401b038111610305576102f29201610909565b90610c6b610c64610c5a845190565b8084529260200190565b9260200190565b9060005b818110610c7c5750505090565b909192610c99610c926001928651815260200190565b9460200190565b929101610c6f565b9060206102f2928181520190610c4b565b3461030557610380610cce610cc8366004610c04565b906116a4565b60405191829182610ca1565b34610305576103806103d0610cf03660046106d9565b611d6f565b9060c08282031261030557610d0a818361031f565b92610d18826020850161072f565b92610d26836040830161072f565b9260608201356001600160401b0381116103055781610d4691840161073c565b93909392610d578360808301610b16565b9260a08201356001600160401b038111610305576104679201610414565b61040f610d83366004610cf5565b96959095949194939293613cdd565b9091606082840312610305576102f2610dab848461031f565b9360406104bc826020870161030a565b346103055761040f610dce366004610d92565b916153d5565b8015156102fe565b9050359061031782610dd4565b919060a08382031261030557610dff818461030a565b92610e0d826020830161031f565b926102f2610e1e846040850161072f565b936080610e2e8260608701610ddc565b9401610b16565b346103055761038061036f610e4b366004610de9565b93929092614e01565b346103055761040f610e673660046103e3565b611f23565b90602082820312610305576102f291610b16565b346103055761038061036f610e96366004610e6c565b614cfc565b3461030557610eab3660046104dc565b6103807f0000000000000000000000000000000000000000000000000000000000000000610aef565b3461030557610ee43660046104dc565b61038061036f600e5490565b3461030557610f003660046104dc565b61040f6113a9565b3461030557610f183660046104dc565b61040f611569565b346103055761038061036f610f3636600461032c565b90611f51565b3461030557610f4c3660046104dc565b610380610aef611367565b6102f26000600b610627565b3461030557610f733660046104dc565b6103806106cd610f57565b3461030557610380610cce610f943660046103e3565b6132ae565b346103055761038061036f610faf3660046106d9565b6131a6565b90602082820312610305576102f291610ddc565b346103055761040f610fdb366004610fb4565b614cf3565b919060408382031261030557806020610ffc6102f2938661030a565b9401610ddc565b346103055761040f611016366004610fe0565b90611769565b9061102b610c64610c5a845190565b9060005b81811061103c5750505090565b90919261105b610c9260019286516001600160501b0316815260200190565b92910161102f565b90611072610c64610c5a845190565b9060005b8181106110835750505090565b90919261109f610c92600192865163ffffffff16815260200190565b929101611076565b906110b6610c64610c5a845190565b9060005b8181106110c75750505090565b9091926110dd610c926001928651815260200190565b9291016110ba565b906110f4610c64610c5a845190565b9060005b8181106111055750505090565b909192611120610c92600192865162ffffff16815260200190565b9291016110f8565b906102f29060c08061119761118561117361116161114f895160e0895260e089019061101c565b60208a015188820360208a015261101c565b60408901518782036040890152611063565b606088015186820360608801526110a7565b608087015185820360808701526110e5565b60a0808701516001600160401b0316908501529401516001600160401b0316910152565b916111e4906111d66102f29593606086526060860190611128565b908482036020860152610c4b565b916040818403910152610c4b565b346103055761038061120d6112083660046106d9565b613bb2565b604051919391938493846111bb565b346103055761038061036f6112323660046106d9565b61338e565b906020828203126103055781356001600160401b03811161030557610467920161073c565b346103055761040f61126f366004611237565b9061303b565b34610305576112853660046104dc565b610380610aef6113fc565b346103055761040f6112a33660046107e8565b9061319c565b9190604083820312610305578060206112c56102f2938661030a565b940161030a565b34610305576103806103d06112e23660046112a9565b90611774565b91909160a081840312610305576112ff838261030a565b9261130d816020840161030a565b9261131b826040850161031f565b926109f7836060830161031f565b346103055761040f61133c3660046112e8565b939290926117ab565b346103055761040f6113583660046103e3565b6114c4565b6102f290546102e6565b6102f2600761135d565b6113796113b1565b610317611397565b6102e66102f26102f29290565b6102f290611381565b6103176113a4600061138e565b611513565b610317611371565b6113b9611367565b33906113cd6113c7836102e6565b916102e6565b036113d55750565b6113f8906113e260405190565b63118cdaa760e01b815291829160048301610aaa565b0390fd5b6102f2600861135d565b610317906114126113b1565b61146d565b6102f2906102e6906001600160a01b031682565b6102f290611417565b6102f29061142b565b9061144d6102f261146992611434565b82546001600160a01b0319166001600160a01b03919091161790565b9055565b61147881600861143d565b61149161148b611486611367565b611434565b91611434565b907f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227006114bc60405190565b80805b0390a3565b61031790611406565b9060031b6114e66001600160a01b03821b5b9384921b90565b169119161790565b91906114ff6102f261146993611434565b9083546114cd565b610317916000916114ee565b6103179061152360006008611507565b61153e61148b611533600761135d565b61148684600761143d565b907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e06114bc60405190565b336115726113fc565b61157e6113c7836102e6565b036113d55761031790611513565b6102f290610607565b506102f2600261158c565b6102f26102f26102f29290565b906115b7906115a0565b600052602052604060002090565b906115b790611434565b6102f29081565b6102f290546115cf565b6115f7906115f26102f29360006115ad565b6115c5565b6115d6565b9081526040810192916103179160200152565b9061161c6108c68361089f565b918252565b369037565b906103176116338361160f565b60208194611643601f199161089f565b019101611621565b634e487b7160e01b600052601160045260246000fd5b60001981146116705760010190565b61164b565b634e487b7160e01b600052603260045260246000fd5b805182101561169f5760209160051b010190565b611675565b906116ad825190565b6116bf6116bb6102f2845190565b9190565b03611739576116d46116cf835190565b611626565b916116df60006115a0565b6116ea6102f2835190565b811015611733578061172961171c61170c61172e948660209160051b01015190565b600584901b870160200151610369565b611726838861168b565b52565b611661565b6116df565b50505090565b519051611746565b915190565b906113f861175360405190565b635b05999160e01b8152928392600484016115fc565b610317919033611a06565b6102f2916115f26117869260016115c5565b5460ff1690565b9160206103179294936117a481604081019761081d565b019061081d565b9493929190336117ba816102e6565b6117c3886102e6565b1415806117fe575b6117da57506103179495611857565b86906113f86117e860405190565b63711bec9160e11b81529283926004840161178d565b5061181061180c8289611774565b1590565b6117cb565b949392919033611824816102e6565b61182d886102e6565b141580611844575b6117da5750610317949561198c565b5061185261180c8289611774565b611835565b909194939294611867600061138e565b611870816102e6565b8061187a866102e6565b146118c657611888846102e6565b146118a45750610317949561189c91611d4a565b9290916118e9565b6113f8906118b160405190565b626a0d4560e21b815291829160048301610aaa565b6113f8826118d360405190565b632bfa23e760e11b815291829160048301610aaa565b919392906118f98286838661556e565b61190b611906600061138e565b6102e6565b611914826102e6565b03611921575b5050505050565b339261192b865190565b6119386116bb60016115a0565b0361197c5761196c6119729661195f61195160006115a0565b809260209160051b01015190565b9460209160051b01015190565b93611b38565b388080808061191a565b611987959293611ca4565b611972565b949392919061199b600061138e565b956119a5876102e6565b806119af846102e6565b146119da576119bd826102e6565b146119cd576103179596506118e9565b6113f8876118b160405190565b6113f8886118d360405190565b906119f76102f261146992151590565b825460ff191660ff9091161790565b611a10600061138e565b611a19816102e6565b611a22846102e6565b14611a7b57506114bf611a71611a6b8361148687611a66886115f27f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319960016115c5565b6119e7565b93611434565b936103d460405190565b6113f890611a8860405190565b62ced3e160e81b815291829160048301610aaa565b9050519061031782610384565b90602082820312610305576102f291611a9d565b9193611aec60a094611ae56102f29897611adb87611af39761081d565b602087019061081d565b6040850152565b6060830152565b8160808201520190610669565b6040513d6000823e3d90fd5b9061161c6108c683610924565b3d15611b3357611b283d611b0c565b903d6000602084013e565b606090565b9193929094611b5395853b611b4d60006115a0565b97889190565b11611b62575b50505050505050565b6000602094611b9a611b766114868a611434565b94611b8060405190565b9889978896879563f23a6e6160e01b875260048701611abe565b03925af160009181611c22575b50611bed5750611bbe565b38808080808080611b59565b611bc6611b19565b91611bd26102f2845190565b03611be4576113f8906118d360405190565b50805190602001fd5b909150611c0a63f23a6e6160e01b5b916001600160e01b03191690565b03611c155750611bb2565b6113f8906118d360405190565b611c4491925060203d8111611c4b575b611c3c81836105e1565b810190611aaa565b9038611ba7565b503d611c32565b93906102f29593611c77611c9694611c6d88611c889561081d565b602088019061081d565b60a0604087015260a0860190610c4b565b908482036060860152610c4b565b916080818403910152610669565b9193929094611cb995853b611b4d60006115a0565b11611cc75750505050505050565b6000602094611cff611cdb6114868a611434565b94611ce560405190565b9889978896879563bc197c8160e01b875260048701611c52565b03925af160009181611d2a575b50611d175750611bbe565b909150611c0a63bc197c8160e01b611bfc565b611d4391925060203d8111611c4b57611c3c81836105e1565b9038611d0c565b9160806040518094600182526020820152604081019360018552606082015201604052565b611d789061338e565b611d856116bb60006115a0565b1190565b9061034f906102e6565b6102f29060a01c5b6001600160601b031690565b6102f29054611d93565b906001600160601b03169052565b6102f2604061088b565b90610317611dd5611dbf565b6020611df38295611dee611de88261135d565b85611d89565b611da7565b9101611db1565b6102f290611dc9565b6102f290516102e6565b6102f29081906001600160601b031681565b8181029291811591840414171561167057565b634e487b7160e01b600052601260045260246000fd5b8115611e52570490565b611e32565b611e68611e6d9193929360066115ad565b611dfa565b91611e7783611e03565b611e876113c7611906600061138e565b14611ed0575b611eca611eb96116bb92611eb3611eae60208801516001600160601b031690565b611e0d565b90611e1f565b611ec4611eae611efc565b90611e48565b92611e03565b91506116bb611eca611eb9611ee56005611dfa565b9492505050611e8d565b611d9b6102f26102f29290565b6102f2612710611eef565b61031790611f136113b1565b6001611a666103179260146115c5565b61031790611f07565b61031790611f386113b1565b6000611a666103179260146115c5565b61031790611f2c565b6102f291611f61611f66926132ae565b61168b565b5190565b61031790611f766113b1565b611fb2565b90611f8b6102f261146992611434565b825490600160401b600160e01b039060401b600160401b600160e01b031990921691161790565b611fe27faea1573caf7b4fdd079b947d86c1be6c725642c47582f8f9bd2c7d2a30bf0bd991610aef816013611f7b565b0390a1565b61031790611f6a565b9061031791611ffd6113b1565b612d30565b6102f2906006611e1f565b9060031b6114e6600019821b6114df565b919061202f6102f2611469936115a0565b90835461200d565b6103179160009161201e565b81811061204e575050565b8061205c6000600193612037565b01612043565b9060001960209190910360031b1c8154169055565b91909182821061208657505050565b612097610317936002600391010490565b90600a60036120b3600286018290045b93600052602060002090565b928301940602806120c7575b500190612043565b6120d5906000198501612062565b386120bf565b90600160401b811161060257816120f3610317935490565b90828155612077565b6000610317916120db565b9061063557610317906120fc565b818110612120575050565b8061212e6000600193612037565b01612115565b91909182821061214357505050565b6103179260070160031c90601c6121676007850160031c5b92600052602060002090565b9182019360021b168061217d575b500190612115565b61218b906000198501612062565b38612175565b90600160401b811161060257816121a9610317935490565b90828155612134565b600061031791612191565b9061063557610317906121b2565b919061202f6102f26114699390565b610317916000916121cb565b8181106121f1575050565b806121ff60006001936121da565b016121e6565b91909182821061221457505050565b6122346122286122246103179590565b9390565b91600052602060002090565b91820191016121e6565b90600160401b81116106025781612256610317935490565b90828155612205565b60006103179161223e565b90610635576103179061225f565b818110612283575050565b806122916000600193612037565b01612278565b9190918282106122a657505050565b6122b7610317936009600a91010490565b906003600a6122cb600986018290046120a7565b928301940602806122df575b500190612278565b6122ed906000198501612062565b386122d7565b90600160401b8111610602578161230b610317935490565b90828155612297565b6000610317916122f3565b906106355761031790612314565b600560009161233c8382612107565b6123498360018301612107565b61235683600283016121bd565b612363836003830161226a565b612370836004830161231f565b0155565b90610635576103179061232d565b81811061238d575050565b8061239b6000600693612374565b01612382565b9190918282106123b057505050565b6123c86122286123c261031795612002565b93612002565b9182019101612382565b90600160401b811161060257816123ea610317935490565b908281556123a1565b6000610317916123d2565b9061063557610317906123f3565b90359060de1981360301821215610305570190565b9082101561169f576102f29160051b81019061240c565b356102f281610b07565b9190820391821161167057565b610afb6102f26102f29290565b6102f261012c61244f565b612482906001600160401b03165b916001600160401b031690565b01906001600160401b03821161167057565b903590601e1981360301821215610305570180359182916001600160401b03841161030557602001809360051b36031261030557565b6102f260e061088b565b6001600160501b0381166102fe565b90503590610317826124d4565b909291926125006108c68261089f565b93602085838152019160051b83019281841161030557915b8383106125255750505050565b6020809161253384866124e3565b815201920191612518565b6102f29136916124f0565b909291926125596108c68261089f565b93602085838152019160051b83019281841161030557915b83831061257e5750505050565b6020809161258c848661072f565b815201920191612571565b6102f2913691612549565b909291926125b26108c68261089f565b93602085838152019160051b83019281841161030557915b8383106125d75750505050565b602080916125e5848661031f565b8152019201916125ca565b6102f29136916125a2565b62ffffff81166102fe565b90503590610317826125fb565b909291926126236108c68261089f565b93602085838152019160051b83019281841161030557915b8383106126485750505050565b602080916126568486612606565b81520192019161263b565b6102f2913691612613565b805482101561169f57612686600691600052602060002090565b91020190600090565b9060031b6114e66001600160501b03821b6114df565b906126ae815190565b906001600160401b0382116106025761215b6126d4916126ce84866120db565b60200190565b600382049160005b8381106127455750600383029003806126f6575b50505050565b92600093845b818110612711575050500155388080806126f0565b909194602061273b6001926127306102f28a516001600160501b031690565b9085600a029061268f565b96019291016126fc565b6000805b6003811061275e5750838201556001016126dc565b9590602061278760019261277c6102f286516001600160501b031690565b908a600a029061268f565b92019601612749565b90610317916126a5565b9060031b6114e663ffffffff821b6114df565b6127c06102f26102f29263ffffffff1690565b63ffffffff1690565b906127d2815190565b906001600160401b0382116106025761215b6127f2916126ce8486612191565b8160031c9160005b838110612860575060071981169003806128145750505050565b92600093845b81811061282f575050500155388080806126f0565b909194602061285660019261284b6102f28a5163ffffffff1690565b908560021b9061279a565b960192910161281a565b6000805b600881106128795750838201556001016127fa565b9590602061289f6001926128946102f2865163ffffffff1690565b908a60021b9061279a565b92019601612864565b90610317916127c9565b8151916001600160401b038311610602576122286128d4916126ce858561223e565b60005b8381106128e45750505050565b60019060206128f46102f2865190565b94019381840155016128d7565b90610317916128b2565b9060031b6114e662ffffff821b6114df565b90612926815190565b906001600160401b0382116106025761215b612946916126ce84866122f3565b600a82049160005b8381106129b25750600a83029003806129675750505050565b92600093845b818110612982575050500155388080806126f0565b90919460206129a860019261299d6102f28a5162ffffff1690565b90856003029061290b565b960192910161296d565b6000805b600a81106129cb57508382015560010161294e565b959060206129f06001926129e56102f2865162ffffff1690565b908a6003029061290b565b920196016129b6565b906103179161291d565b610afb6102f26102f2926001600160401b031690565b90612a296102f261146992612a03565b825467ffffffffffffffff19166001600160401b039091161790565b90612a556102f261146992612a03565b82549067ffffffffffffffff60401b9060401b67ffffffffffffffff60401b1990921691161790565b90612b2460c0600561031794612a9b612a95865190565b82612790565b612ab2612aa9602087015190565b60018301612790565b612ac9612ac0604087015190565b600283016128a8565b612ae0612ad7606087015190565b60038301612901565b612af7612aee608087015190565b600483016129f9565b0192612b16612b1060a08301516001600160401b031690565b85612a19565b01516001600160401b031690565b90612a45565b91906106355761031791612a7e565b80549190600160401b8310156106025782612b5c9160016103179501815561266c565b90612b2a565b506102f29060208101906124e3565b818352602090920191906000825b828210612b8d575050505090565b90919293612bbc612bb5600192612ba48886612b62565b6001600160501b0316815260200190565b9560200190565b93920190612b7f565b506102f290602081019061072f565b818352602090920191906000825b828210612bf0575050505090565b90919293612c15612bb5600192612c078886612bc5565b63ffffffff16815260200190565b93920190612be2565b9037565b8183529091602001916001600160fb1b03811161030557829161069d9160051b938491612c1e565b506102f2906020810190612606565b818352602090920191906000825b828210612c75575050505090565b90919293612c99612bb5600192612c8c8886612c4a565b62ffffff16815260200190565b93920190612c67565b979060c09995612d0f976103179d9f9e9c968b612ce591612d0198612cd7612cf397612d219f9a60e0865260e0860191612b71565b926020818503910152612b71565b918b830360408d0152612bd4565b9188830360608a0152612c22565b918583036080870152612c59565b6001600160401b0390971660a0830152565b01906001600160401b03169052565b90612d3d6000600e6123fe565b612d4760006115a0565b612d5160016115a0565b600e915b808481101561303357821115612fd5575b612d71818587612421565b60a001612d7d90612438565b612d88828688612421565b60c001612d9490612438565b612d9d91615975565b612da8818587612421565b612db1906159f8565b612dbc818587612421565b80612dc691612494565b908587612dd4858383612421565b60208101612de191612494565b90612ded878585612421565b60408101612dfa91612494565b90612e06898787612421565b60608101612e1391612494565b929093612e218b8989612421565b60808101612e2e91612494565b9690978c612e3d818c84612421565b60a001612e4990612438565b9a612e5392612421565b60c001612e5f90612438565b99612e686124ca565b9b612e729161253e565b8b52612e7d9161253e565b60208a0152612e8b91612597565b6040880152612e99916125f0565b6060860152612ea791612661565b60808401526001600160401b031660a08301526001600160401b031660c0820152612ed29084612b39565b612edd818587612421565b80612ee791612494565b90612ef3838789612421565b60208101612f0091612494565b92909187612f0f86828c612421565b60408101612f1c91612494565b8b612f2b898583969596612421565b60608101612f3891612494565b90612f448b8685612421565b60808101612f5191612494565b9490938c612f60818984612421565b60a001612f6c90612438565b97612f7692612421565b60c001612f8290612438565b96612f8c8d6115a0565b9b612f9660405190565b9b8c9b612fa39b8d612ca2565b037f7fec20ffa7d178b5b4d9eb21ec7ff2a1376af8e08ab6cb4c691750db41fc40d191a2612fd090611661565b612d55565b612feb60a0612fe5838789612421565b01612438565b61301b612475610afb61300d60c0612fe56130068989612442565b8b8d612421565b61301561245c565b90612467565b1015612d6657604051636bc1af9360e01b8152600490fd5b505050505050565b9061031791611ff0565b805482101561169f5761305d90600052602060002090565b0190600090565b6102f29160031b1c81565b906102f29154613064565b6130886102f291600c613045565b9061306f565b906103179161309b6113b1565b7f000000000000000000000000000000000000000000000000000000000000000081101561318a576130d161308882600c613045565b6130de6116bb60006115a0565b141580613171575b61315f576130f66102f28261338e565b821061314d5761314861313e82613139856131337fc95161027a9b2f0376fa8fa5f504100ccc4748c73f4e479bac3778d02ee5621c96600c613045565b9061201e565b6115a0565b9261037360405190565b0390a2565b60405163fb7af64960e01b8152600490fd5b60405163430b83b160e11b8152600490fd5b506131836102f261308883600c613045565b82116130e6565b6040516307ed98ed60e31b8152600490fd5b906103179161308e565b6130886102f291600d613045565b90610317916131c16113b1565b7f000000000000000000000000000000000000000000000000000000000000000081101561318a576131f761308882600c613045565b6132046116bb60006115a0565b1180613258575b6132465761314861313e82613139856131337f0c899f003b7b88b925c6cdfe9b56bc4df2b91107f0f6d1cec1c3538d156bbe4896600d613045565b604051630590c51360e01b8152600490fd5b5061326a6102f261308883600c613045565b821161320b565b90610317916131b4565b6102f2906127c0565b6102f2905461327b565b6102f26102f26102f29263ffffffff1690565b9190820180921161167057565b907f0000000000000000000000000000000000000000000000000000000000000000916132da83611626565b906132e4600e5490565b926132ef60006115a0565b936132fb6116bb869790565b945b8187101561337757805b86811015613362578061172961335361334161333c6133378a6115f28f61333261335d9a60106115ad565b6115ad565b613284565b61328e565b61334e611f668d8c61168b565b6132a1565b6117268b8a61168b565b613307565b5091909561336f90611661565b9590916132fd565b5050935050905090565b6102f26102f260046115d6565b6102f2906115f76102f29160036115ad565b6133a86124ca565b908160608082526020820152606060408201526060808201526133c9606090565b608082015260c06000918260a08201520152565b6102f26133a0565b6102f2905b6001600160501b031690565b6102f29060501c6133ea565b6102f29060a01c6133ea565b906001906134206120a7610c5a855490565b6000926134aa575b549080831061348d575b808310613470575b8210613447575b80611733565b826134676001939461345a602094613402565b6001600160501b03169052565b01910138613441565b919260208161348460019361345a866133f6565b0193019161343a565b91926020816134a160019361345a866133e5565b01930191613432565b816002840110156134285792600160606003926134ec87546134cf8361345a836133e5565b6134df6020840161345a836133f6565b61345a6040840191613402565b0194019201916134aa565b906102f29161340e565b9061031761350e60405190565b806106208180966134f7565b6102f29060201c6127c0565b6102f29060401c6127c0565b6102f29060601c6127c0565b6102f29060801c6127c0565b6102f29060a01c6127c0565b6102f29060c01c6127c0565b6102f29060e01c6127c0565b906001906135806120a7610c5a855490565b6000926136b6575b5490808310613699575b80831061367c575b80831061365f575b808310613642575b808310613625575b808310613608575b8083106135eb575b82106135ce5780611733565b82613467600193946135e1602094613562565b63ffffffff169052565b91926020816135ff6001936135e186613556565b019301916135c2565b919260208161361c6001936135e18661354a565b019301916135ba565b91926020816136396001936135e18661353e565b019301916135b2565b91926020816136566001936135e186613532565b019301916135aa565b91926020816136736001936135e186613526565b019301916135a2565b91926020816136906001936135e18661351a565b0193019161359a565b91926020816136ad6001936135e18661327b565b01930191613592565b816007840110156135885792600161010060089261374987546136dc836135e18361327b565b6136ec602084016135e18361351a565b6136fc604084016135e183613526565b61370c606084016135e183613532565b61371c608084016135e18361353e565b61372c60a084016135e18361354a565b61373c60c084016135e183613556565b6135e160e0840191613562565b0194019201916136b6565b906102f29161356e565b9061031761376b60405190565b80610620818096613754565b9061378661215b610c5a845490565b9060005b8181106137975750505090565b9091926137bb6137b46001926137ac876115d6565b815260200190565b9460010190565b92910161378a565b906102f291613777565b906103176137da60405190565b806106208180966137c3565b6102f2905b62ffffff1690565b6102f29060181c6137eb565b6102f29060301c6137eb565b6102f29060481c6137eb565b6102f29060601c6137eb565b6102f29060781c6137eb565b6102f29060901c6137eb565b6102f29060a81c6137eb565b6102f29060c01c6137eb565b6102f29060d81c6137eb565b906001906138716120a7610c5a855490565b6000926139f0575b54908083106139d3575b8083106139b6575b808310613999575b80831061397c575b80831061395f575b808310613942575b808310613925575b808310613908575b8083106138eb575b82106138cf5780611733565b82613467600193946138e2602094613853565b62ffffff169052565b91926020816138ff6001936138e286613847565b019301916138c3565b919260208161391c6001936138e28661383b565b019301916138bb565b91926020816139396001936138e28661382f565b019301916138b3565b91926020816139566001936138e286613823565b019301916138ab565b91926020816139736001936138e286613817565b019301916138a3565b91926020816139906001936138e28661380b565b0193019161389b565b91926020816139ad6001936138e2866137ff565b01930191613893565b91926020816139ca6001936138e2866137f3565b0193019161388b565b91926020816139e76001936138e2866137e6565b01930191613883565b8160098401101561387957926001610140600a92613aa58754613a16836138e2836137e6565b613a26602084016138e2836137f3565b613a36604084016138e2836137ff565b613a46606084016138e28361380b565b613a56608084016138e283613817565b613a6660a084016138e283613823565b613a7660c084016138e28361382f565b613a8660e084016138e28361383b565b613a9761010084016138e283613847565b6138e2610120840191613853565b0194019201916139f0565b906102f29161385f565b90610317613ac760405190565b80610620818096613ab0565b6102f290610afb565b6102f29054613ad3565b6102f29060401c610afb565b6102f29054613ae6565b90610317613b086124ca565b60c0613b9b60058396613b21613b1d82613501565b8652565b613b37613b3060018301613501565b6020870152565b613b4d613b466002830161375e565b6040870152565b613b63613b5c600383016137cd565b6060870152565b613b79613b7260048301613aba565b6080870152565b01613b96613b8682613adc565b6001600160401b031660a0860152565b613af2565b6001600160401b0316910152565b6102f290613afc565b613bba6133dd565b50613bc76102f2600e5490565b811015613bfb57613bd7336132ae565b91613bf6613bf0613be83385613c0d565b93600e61266c565b50613ba9565b929190565b60405163e82a532960e01b8152600490fd5b91907f000000000000000000000000000000000000000000000000000000000000000092613c3a84611626565b92613c4c613c4860006115a0565b9590565b945b85811015613c955780611729613c86613c7961333c613337896115f2613c90986133328c60106115ad565b61334e611f66858b61168b565b611726838961168b565b613c4e565b509350505090565b90613cb597969594939291613cb0613d07565b613cc8565b610317613d47565b6102f291369161094c565b9561031797613cd691613cbd565b9533614477565b9061031797969594939291613c9d565b6102f260026115a0565b906102f26102f2611469926115a0565b613d1160096115d6565b613d19613ced565b908114613d2b57610317906009613cf7565b604051633ee5aeb560e01b8152600490fd5b6102f260016115a0565b610317613d52613d3d565b6009613cf7565b9493929190613d6c6117863360146115c5565b600190151503613d7f5761031795613db0565b60405163ea8e4eb560e01b8152600490fd5b613d9b6001611b0c565b600360fc1b602082015290565b6102f2613d91565b926103179592949194613dc1613da8565b95613dcc600061244f565b95614477565b906103179594939291613d59565b96959493929190613df08261328e565b613dfe61308883600c613045565b613e0b6116bb60006115a0565b119081613e33575b50613e215761031797613fc2565b60405163800113cb60e01b8152600490fd5b613e41915061334e8361338e565b613e556116bb6102f261308885600c613045565b1138613e13565b6102f29060401c6102e6565b6102f29054613e5c565b6133ea6102f26102f29290565b613e9a906001600160501b03165b916001600160501b031690565b01906001600160501b03821161167057565b6133ea6102f26102f29263ffffffff1690565b613ed1906001600160501b0316613e8d565b02906001600160501b03821691820361167057565b6102f29081906001600160501b031681565b6137eb6102f26102f29290565b6102f26102f26102f29262ffffff1690565b6127c06102f26102f29290565b613f399063ffffffff165b9163ffffffff1690565b019063ffffffff821161167057565b613f5461034f916102e6565b60601b90565b60e01b90565b61034f9063ffffffff1660e01b90565b90601892613f818361069d93613f48565b6014830190613f60565b90613f9b6102f2611469926127ad565b825463ffffffff191663ffffffff9091161790565b6102f26000611b0c565b6102f2613fb0565b9594613ff8919495939293613fd64261244f565b90600099613fe46013613e68565b613ff06119068d61138e565b9586916102e6565b03614452575b505061400990614cfc565b95614018613bf088600e61266c565b981561443b576140286000613e72565b935b7f000000000000000000000000000000000000000000000000000000000000000093614055856102e6565b14928386898d8361440e575b5050506143fc578a926080840189898c61408861407f84865161168b565b5162ffffff1690565b61409e6140956000613ef8565b9162ffffff1690565b116143a6575b908e93506140b661308884600d613045565b6140c36116bb60006115a0565b11614350575b60406140ff9801936140e96140df85875161168b565b5163ffffffff1690565b6140f36000613f17565b998a9163ffffffff1690565b1161431a575b505050505060608c019161411d611f668b855161168b565b61412a6116bb60006115a0565b03614239575b50505050506141b76141d294614189614182614178614173886141bf996103179f8d9a908b916133329b156141e0575b5050505061416d86613eac565b90613ebf565b613ee6565b61334e60126115d6565b6012613cf7565b61333c61419f8a6115f2876133328d60106115ad565b6141b1836141ac83613284565b613f24565b90613f8b565b9560116115ad565b6141cc8461334e836115d6565b90613cf7565b6141da613fba565b92614487565b61417361421f6142309561421a61420d6141fc61422896611434565b9761420630611434565b975161168b565b516001600160501b031690565b613e7f565b61416d8c613eac565b91339061450f565b80893880614160565b6102f2611f668b6142988f956142936116bb968a61427a61429f9a61426c61426060405190565b93849260208401613f70565b03601f1981018352826105e1565b61428c614285825190565b9160200190565b20926125f0565b6146f6565b955161168b565b036143085763ffffffff16908111908589888a856142dd575b50505050506142cb573880808080614130565b60405163b4f3729b60e01b8152600490fd5b6142fd9495506127c093926115f26141ac936133326133379460106115ad565b11388589888a6142b8565b6040516309bde33960e01b8152600490fd5b836142986127c0936141ac6133376140df956115f26143419a613332613f2f9b60106115ad565b116142cb5738898b8a8e614105565b50506143709295506143619161476d565b61436a8961328e565b906132a1565b6143846116bb6102f26130888c600d613045565b11614394578a928a898b8a6140c9565b60405163751304ed60e11b8152600490fd5b6143db93949750826142986143d69361436a6143d06115f76116bb9861333261407f9860116115ad565b9161328e565b613f05565b116143eb578a923889898c6140a4565b60405162d0844960e21b8152600490fd5b604051630717c22560e51b8152600490fd5b61443193509161421a61420d61442893614173955161168b565b61416d8a613eac565b341086898d614061565b61444c61420d8760208c015161168b565b9361402a565b81614466929b506140099350878933614eb2565b98614470816159b8565b9038613ffe565b9061031797969594939291613de0565b90939291614495600061138e565b9461449f866102e6565b6144a8846102e6565b146144bc5761031794959161189c91611d4a565b6113f8866118d360405190565b6144dc613f5a6102f29263ffffffff1690565b6001600160e01b03191690565b60409061083d610317949695939661450583606081019961081d565b602083019061081d565b909161455290614544610317956145296323b872dd6144c9565b9261453360405190565b9687946020860152602485016144e9565b03601f1981018452836105e1565b614578565b9050519061031782610dd4565b90602082820312610305576102f291614557565b61458461458b91611434565b91826145f2565b805161459a6116bb60006115a0565b141590816145ce575b506145ab5750565b6113f8906145b860405190565b635274afe760e01b815291829160048301610aaa565b6145ec9150806020806145e261180c945190565b8301019101614564565b386145a3565b6102f29161460060006115a0565b61460930611434565b818131106146335750600082819260206102f2969551920190855af161462d611b19565b91614656565b6113f89061464060405190565b63cd78605960e01b815291829160048301610aaa565b9015614662565b501590565b1561466d57506146c7565b614688614678835190565b61468260006115a0565b91829190565b1490816146bc575b50614699575090565b6113f8906146a660405190565b639996b31560e01b815291829160048301610aaa565b9050813b1438614690565b80516146d66116bb60006115a0565b11156146e457805190602001fd5b604051630a12f52160e11b8152600490fd5b61470060006115a0565b915b61470d6102f2835190565b83101561473a5761472e61473491614728611f66868661168b565b90614740565b92611661565b91614702565b91505090565b8181101561475b57906102f291600052602052604060002090565b6102f291600052602052604060002090565b61477760006115a0565b9182936147866102f2600e5490565b945b858510156147bc576147b06147b69161436a61333c613337886115f2896133328d60106115ad565b94611661565b93614788565b945092505050565b9061031792916147d26113b1565b91906147dd8261328e565b6147eb61308883600c613045565b6147f86116bb60006115a0565b11908161480e575b50613e215761031792614837565b61481c915061334e8361338e565b6148306116bb6102f261308885600c613045565b1138614800565b906148446103179361328e565b906141da613fba565b9061031792916147c4565b6148606113b1565b61031761489a600080730b98151bedee73f9ba5f2c7b72dea02d38ce49fc61488860126115d6565b60405190818003925af161465d611b19565b61493b576148ab61418260006115a0565b6148b430611434565b316148f36000806148c460405190565b600090857f00000000000000000000000000000000000000000000000000000000000000005af161465d611b19565b61492957611fe261036f7f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d9261334e60126115d6565b604051631d42c86760e21b8152600490fd5b6040516312171d8360e31b8152600490fd5b610317614858565b61495d6113b1565b610317614986565b9050519061031782610319565b90602082820312610305576102f291614965565b7f00000000000000000000000000000000000000000000000000000000000000006149b4611906600061138e565b6149bd826102e6565b14614ae257614a3c6149ce82611434565b6149f7730b98151bedee73f9ba5f2c7b72dea02d38ce49fc6149f060126115d6565b9083614afc565b614a0461418260006115a0565b6020614a0f82611434565b614a1830611434565b90614a2260405190565b948592839182916370a0823160e01b835260048301610aaa565b03915afa908115614add57611a6b6131489261313e927fbe7426aee8a34d0263892b55ce65ce81d8f4c806eb4719e59015ea49feb92d2295600092614aa9575b5081614178917f000000000000000000000000000000000000000000000000000000000000000090614afc565b614178919250614acf9060203d8111614ad6575b614ac781836105e1565b810190614972565b9190614a7c565b503d614abd565b611b00565b60405163a47ca0b760e01b8152600490fd5b610317614955565b61455261031793614544614b1363a9059cbb6144c9565b91614b1d60405190565b958693602085015260248401610826565b9061031791614b3b6113b1565b61031791614b4891613cbd565b614cac565b9061031791614b2e565b818110614b62575050565b80614b706000600193612037565b01614b57565b9190601f8111614b8557505050565b614b9761031793600052602060002090565b906020601f840160051c83019310614bb7575b601f0160051c0190614b57565b9091508190614baa565b9060001960039190911b1c191690565b81614bdb91614bc1565b9060011b1790565b81519192916001600160401b03811161060257614c0a81614c048454610513565b84614b76565b6020601f8211600114614c39578190611469939495600092614c2e575b5050614bd1565b015190503880614c27565b601f19821694614c4e84600052602060002090565b9160005b878110614c8a575083600195969710614c70575b505050811b019055565b614c80910151601f841690614bc1565b9055388080614c66565b90926020600181928686015181550194019101614c52565b9061031791614be3565b610317906002614ca2565b61031790614cc36113b1565b611fe27fbcde07732ba7563e295b3edc0bf5ec939a471d93d850a58a6f2902c0ed323728916103d081600f6119e7565b61031790614cb7565b614d0660006115a0565b90614d136102f2600e5490565b915b82811015613bfb57614d37610afb6005614d3084600e61266c565b5001613adc565b6001600160401b038316908110159081614d5f575b5061473a57614d5a90611661565b614d15565b9050614d7b610afb6005614d7485600e61266c565b5001613af2565b1138614d4c565b61034f906001600160401b031660c01b90565b969260899895614ddf614dfa96614dd3614de994614dc9614df39860148f61069d9f9a81614dc291613f48565b0190613f48565b60288d0190613f60565b151560f81b602c8b0152565b602d890190613f48565b6041870190614d82565b6049850152565b6069830152565b90919293614e0f6013613e68565b614e1f6113c7611906600061138e565b14614ea0576102f294614e669361426c92614e3930611434565b91614e4e614e476013613e68565b9187611f51565b93614e5860405190565b988997469560208a01614d95565b614e71614285825190565b207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b600052601c52603c60002090565b6040516353bd4fb360e11b8152600490fd5b91909392614ebe600090565b50614ee184614ecd6013613e68565b614edb846001878b8a614e01565b90614f52565b614f19576000614edb92614eff96614ef96013613e68565b95614e01565b614f145760405162b7fad960e11b8152600490fd5b600090565b5050505050600190565b634e487b7160e01b600052602160045260246000fd5b60041115614f4357565b614f23565b9061031782614f39565b9190614f5e8282614fb3565b50614f75614f6f6000969396614f48565b91614f48565b149384614f9c575b508315614f8a5750505090565b614f94935061511a565b388080611733565b909350614fab6113c7856102e6565b149238614f7d565b8151614fc26116bb60416115a0565b03614fec5790614fe5916020820151906060604084015193015160001a90615041565b9192909190565b50615002613139614ffd600061138e565b925190565b909160029190565b6102f2906115a0565b61083d6103179461503a60609498979561503085608081019b9052565b60ff166020850152565b6040830152565b909161504c8461500a565b61506e6116bb6fa2a8918ca85bafe22016d0b997e4df60600160ff1b036115a0565b116150e957906150906020946000949361508760405190565b94859485615013565b838052039060015afa15614add576000516150ab600061138e565b6150b4816102e6565b6150bd836102e6565b146150d557506150cd60006115a0565b909160009190565b90506150e160006115a0565b909160019190565b5050506150f6600061138e565b9160039190565b8061510d6040926102f295949052565b8160208201520190610669565b6000929161426c61514a859461512f60405190565b9283916020830195630b135d3f60e11b8752602484016150fd565b51915afa615156611b19565b81615199575b81615165575090565b61517f9150602080615175835190565b8301019101614972565b6151956116bb6102f2630b135d3f60e11b6144dc565b1490565b90506151a3815190565b6151b06116bb60206115a0565b10159061515c565b90610317916151c56113b1565b6151f0565b9160206103179294936151e181604081019761081d565b01906001600160601b03169052565b907f8a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef9161521d82826152da565b611fe261522960405190565b928392836151ca565b90610317916151b8565b61034f90611e0d565b91602061031792949361083d81604081019761523c565b6102f290611d9b906001600160601b031682565b906152806102f26114699261525c565b8254906001600160a01b03199060a01b6001600160a01b0390921691161790565b6152ca6020610317936152bc6152b682611e03565b8561143d565b01516001600160601b031690565b90615270565b90610317916152a1565b906152e6611eae611efc565b806152f083611e0d565b116153655750615300600061138e565b615309816102e6565b615312846102e6565b1461534257509061533b6103179261533261532b611dbf565b9384611d89565b60208301611db1565b60056152d0565b6113f89061534f60405190565b635b6cc80560e11b815291829160048301610aaa565b906113f861537260405190565b636f483d0960e01b815292839260048401615245565b9061031792916153966113b1565b916153c87f7f5b076c952c0ec86e5425963c1326dd0f03a3595c19f81d765e8ff559a6e33c929361313983868361541a565b9261314861522960405190565b906103179291615388565b60409061083d61031794969593966153fb8360608101999052565b602083019061523c565b908152604081019291610317916020906117a4565b9091615427611eae611efc565b8061543183611e0d565b116154af5750615441600061138e565b61544a816102e6565b615453856102e6565b1461548c5750610317929161548061548792615477615470611dbf565b9586611d89565b60208501611db1565b60066115ad565b6152d0565b826113f861549960405190565b634b4f842960e11b815292839260048401615405565b6113f883916154bd60405190565b63dfd1fc1b60e01b8152938493600485016153e0565b6154dc816154f1565b9081156154e7575090565b6102f29150615535565b6001600160e01b03198116636cdb3d1360e11b811491908215615524575b50811561551a575090565b6102f2915061555e565b6303a24d0760e21b1491503861550f565b63152a902d60e11b6001600160e01b0319821614908115615554575090565b6102f291506154f1565b6151956301ffc9a760e01b611bfc565b6155a19061558561559a93956155a79587846155eb565b615592611906600061138e565b9283916102e6565b14936102e6565b14911590565b90816155e2575b50806155cd575b6155bb57565b60405163dc8d8db760e01b8152600490fd5b506155dd61180c600f5460ff1690565b6155b5565b159050386155ae565b9061560091949392946155858487848461575d565b1461569c575b61560f906102e6565b1461561957509050565b61562360006115a0565b90815b6156316102f2865190565b83101561567e5761472e6156789161564c611f66868661168b565b9061069d615667615660611f66898c61168b565b60036115ad565b6141cc84615674836115d6565b0390565b91615626565b9050610317929350615695915061567460046115d6565b6004613cf7565b926156aa60009392936115a0565b9285845b6156b96102f2835190565b8610156156f0576156e8916147b09161334e6141bf615660611f668b6156e2611f66828e61168b565b9661168b565b9386906156ae565b61560f93969294955061570c91506156959061334e60046115d6565b9050615606565b61083d6103179461503a60609498979561573185608081019b61081d565b6020850152565b909161574f6102f293604084526040840190610c4b565b916020818403910152610c4b565b939092919261576a845190565b6157786116bb6102f2865190565b0361596957909290339161578c60006115a0565b94859361579c611906600061138e565b945b6157a96102f2855190565b81101561588f57600581901b840160200151600582901b880160200151876157d08c6102e6565b03615821575b906157f5929187896157e7826102e6565b036157fa575b505050611661565b61579e565b61580f6141cc916115f26158199560006115ad565b9161334e836115d6565b3880876157ed565b6158336115f78c6115f28560006115ad565b81811061586a57906158618c61585c615850846157f59897960390565b916115f28660006115ad565b613cf7565b909192506157d6565b8b6113f8848461587960405190565b6303dee4c560e01b815294859460048601615713565b5092949591909693506158a0815190565b6158ad6116bb60016115a0565b03615920576158ff6158ff611a6b846158f27fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6297966159059660209160051b01015190565b9960209160051b01015190565b94611434565b9461591b61591260405190565b928392836115fc565b0390a4565b9490506159536158ff6158ff7f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb94611434565b9461591b61596060405190565b92839283615738565b82611746611741865190565b90615988906001600160401b0316612475565b101561599057565b604051631750215560e11b8152600490fd5b6102f26102f26102f2926001600160401b031690565b6159df6159d96102f26159d36159ce6013613adc565b6159a2565b42612442565b916159a2565b106159e657565b6040516313634e8d60e11b8152600490fd5b615a33615a0d615a088380612494565b905090565b7f0000000000000000000000000000000000000000000000000000000000000000614682565b1491821592615ac8575b8215615aaa575b8215615a8c575b8215615a6c575b5050615a5a57565b604051634f7ee04f60e11b8152600490fd5b615a83919250615a088160806102f2930190612494565b14153880615a52565b915080615aa26102f2615a086060860186612494565b141591615a4b565b915080615ac06102f2615a086040860186612494565b141591615a44565b915080615ade6102f2615a086020860186612494565b141591615a3d56fea26469706673582212208a6a1f42ca7221fd7dbec05d6fbc00bb359e06d62ca9e25e5676155793f4f1af64736f6c63430008140033000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ef59f379b48f2e92abd94adcbf714d170967925d000000000000000000000000ef59f379b48f2e92abd94adcbf714d170967925d0000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000d4d756c74692031313535204f4500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b4d554c5449313135354f45000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005668747470733a2f2f626166796265696773346c333434337a377a61336c636565666164636c623364647176616e78636572667a336f3672666e6a7572376379747366652e697066732e7733732e6c696e6b2f7b69647d0000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c8062fdd58e146102e157806301ffc9a7146102dc57806302045138146102d757806302fe5305146102d257806304634d8d146102cd57806306fdde03146102c85780630e89341c146102c357806318160ddd146102be57806322fe44c3146102b9578063274a204b146102b45780632a55205a146102af5780632d759d0f146102aa5780632eb2c2d6146102a55780632ed6d5e8146102a05780633115bba71461029b5780633ccfd60b14610296578063424aa8841461029157806345b9206e1461028c578063475ae039146102875780634e1273f4146102825780634f558e791461027d57806354c4a632146102785780635944c753146102735780635e9dbe0c1461026e5780635f710f5c1461026957806367808a3414610264578063700d19f21461025f57806370da24ee1461025a578063715018a61461025557806379ba5097146102505780638d3a3e381461024b5780638da5cb5b1461024657806395d89b411461024157806397cf84fc1461023c5780639823560c146102375780639cd2370714610232578063a22cb4651461022d578063a3759f6014610228578063bd85b03914610223578063e2bc7c121461021e578063e30c397814610219578063e8e61bb814610214578063e985e9c51461020f578063f242432a1461020a5763f2fde38b0361030557611345565b611329565b6112cc565b611290565b611275565b61125c565b61121c565b6111f2565b611003565b610fc8565b610f99565b610f7e565b610f63565b610f3c565b610f20565b610f08565b610ef0565b610ed4565b610e9b565b610e80565b610e54565b610e35565b610dbb565b610d75565b610cda565b610cb2565b610b83565b610b64565b610aba565b610a92565b610a79565b610a31565b610a15565b610870565b610841565b610804565b6107ce565b610708565b6106ed565b6106b2565b6104c3565b61046b565b6103f7565b6103b5565b610353565b6001600160a01b031690565b90565b6102fe816102e6565b0361030557565b600080fd5b90503590610317826102f5565b565b806102fe565b9050359061031782610319565b9190604083820312610305578060206103486102f2938661030a565b940161031f565b9052565b346103055761038061036f61036936600461032c565b906115e0565b6040515b9182918290815260200190565b0390f35b6001600160e01b031981166102fe565b9050359061031782610384565b90602082820312610305576102f291610394565b34610305576103806103d06103cb3660046103a1565b6154d3565b6040515b91829182901515815260200190565b90602082820312610305576102f29161030a565b346103055761040f61040a3660046103e3565b611fe7565b604051005b9181601f8401121561030557823591826001600160401b038111610305576020908186019501011161030557565b906020828203126103055781356001600160401b038111610305576104679201610414565b9091565b346103055761040f61047e366004610442565b90614b4d565b6001600160601b0381166102fe565b9050359061031782610484565b9190604083820312610305578060206104bc6102f2938661030a565b9401610493565b346103055761040f6104d63660046104a0565b90615232565b600091031261030557565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052602260045260246000fd5b600181811c929116828115610534575b50602083101461052f57565b6104fd565b607f16925038610523565b8054600093929161055c61055283610513565b8085529360200190565b91600181169081156105ae575060011461057557505050565b6105889192939450600052602060002090565b916000925b81841061059a5750500190565b80548484015260209093019260010161058d565b60ff19168352505090151560051b019150565b906102f29161053f565b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b0382111761060257604052565b6105cb565b9061031761061460405190565b806106208180966105c1565b03906105e1565b90610635576102f290610607565b6104e7565b6102f26000600a610627565b60005b8381106106595750506000910152565b8181015183820152602001610649565b61068a61069360209361069d9361067e815190565b80835293849260200190565b95869101610646565b601f01601f191690565b0190565b9060206102f2928181520190610669565b34610305576106c23660046104dc565b6103806106cd61063a565b604051918291826106a1565b90602082820312610305576102f29161031f565b34610305576103806106cd6107033660046106d9565b611595565b34610305576107183660046104dc565b61038061036f613381565b63ffffffff81166102fe565b9050359061031782610723565b909182601f830112156103055781359283926001600160401b038511610305578060208092019560051b01011161030557565b91909160a08184031261030557610786838261030a565b92610794816020840161031f565b926107a2826040850161072f565b926107b0836060830161072f565b9260808201356001600160401b03811161030557610467920161073c565b61040f6107dc36600461076f565b94939093929192613dd2565b9190604083820312610305578060206103486102f2938661031f565b346103055761040f6108173660046107e8565b90613271565b61034f906102e6565b91602061031792949361083d81604081019761081d565b0152565b346103055761085a6108543660046107e8565b90611e57565b9061038061086760405190565b92839283610826565b346103055761038061036f6108863660046106d9565b61307a565b9061031761089860405190565b92836105e1565b6001600160401b0381116106025760051b60200190565b909291926108cb6108c68261089f565b61088b565b93602085838152019160051b83019281841161030557915b8383106108f05750505050565b602080916108fe848661031f565b8152019201916108e3565b9080601f83011215610305578160206102f2933591016108b6565b6001600160401b03811161060257602090601f01601f19160190565b90826000939282370152565b9092919261095c6108c682610924565b91829482845282820111610305576020610317930190610940565b9080601f83011215610305578160206102f29335910161094c565b91909160a081840312610305576109a9838261030a565b926109b7816020840161030a565b9260408301356001600160401b03811161030557826109d7918501610909565b9260608101356001600160401b03811161030557836109f7918301610909565b9260808201356001600160401b038111610305576102f29201610977565b346103055761040f610a28366004610992565b93929092611815565b3461030557610a413660046104dc565b61040f614af4565b9091606082840312610305576102f2610a62848461030a565b936040610a72826020870161031f565b940161072f565b346103055761040f610a8c366004610a49565b9161484d565b3461030557610aa23660046104dc565b61040f61494d565b602081019291610317919061081d565b3461030557610aca3660046104dc565b6103807f00000000000000000000000000000000000000000000000000000000000000005b60405191829182610aaa565b6001600160401b031690565b6001600160401b0381166102fe565b9050359061031782610b07565b91909160a08184031261030557610b3a838261030a565b92610b48816020840161031f565b92610b56826040850161072f565b926109f78360608301610b16565b34610305576103806103d0610b7a366004610b23565b93929092614eb2565b346103055761040f610b963660046103e3565b611f48565b90929192610bab6108c68261089f565b93602085838152019160051b83019281841161030557915b838310610bd05750505050565b60208091610bde848661030a565b815201920191610bc3565b9080601f83011215610305578160206102f293359101610b9b565b9190916040818403126103055780356001600160401b0381116103055783610c2d918301610be9565b9260208201356001600160401b038111610305576102f29201610909565b90610c6b610c64610c5a845190565b8084529260200190565b9260200190565b9060005b818110610c7c5750505090565b909192610c99610c926001928651815260200190565b9460200190565b929101610c6f565b9060206102f2928181520190610c4b565b3461030557610380610cce610cc8366004610c04565b906116a4565b60405191829182610ca1565b34610305576103806103d0610cf03660046106d9565b611d6f565b9060c08282031261030557610d0a818361031f565b92610d18826020850161072f565b92610d26836040830161072f565b9260608201356001600160401b0381116103055781610d4691840161073c565b93909392610d578360808301610b16565b9260a08201356001600160401b038111610305576104679201610414565b61040f610d83366004610cf5565b96959095949194939293613cdd565b9091606082840312610305576102f2610dab848461031f565b9360406104bc826020870161030a565b346103055761040f610dce366004610d92565b916153d5565b8015156102fe565b9050359061031782610dd4565b919060a08382031261030557610dff818461030a565b92610e0d826020830161031f565b926102f2610e1e846040850161072f565b936080610e2e8260608701610ddc565b9401610b16565b346103055761038061036f610e4b366004610de9565b93929092614e01565b346103055761040f610e673660046103e3565b611f23565b90602082820312610305576102f291610b16565b346103055761038061036f610e96366004610e6c565b614cfc565b3461030557610eab3660046104dc565b6103807f000000000000000000000000ef59f379b48f2e92abd94adcbf714d170967925d610aef565b3461030557610ee43660046104dc565b61038061036f600e5490565b3461030557610f003660046104dc565b61040f6113a9565b3461030557610f183660046104dc565b61040f611569565b346103055761038061036f610f3636600461032c565b90611f51565b3461030557610f4c3660046104dc565b610380610aef611367565b6102f26000600b610627565b3461030557610f733660046104dc565b6103806106cd610f57565b3461030557610380610cce610f943660046103e3565b6132ae565b346103055761038061036f610faf3660046106d9565b6131a6565b90602082820312610305576102f291610ddc565b346103055761040f610fdb366004610fb4565b614cf3565b919060408382031261030557806020610ffc6102f2938661030a565b9401610ddc565b346103055761040f611016366004610fe0565b90611769565b9061102b610c64610c5a845190565b9060005b81811061103c5750505090565b90919261105b610c9260019286516001600160501b0316815260200190565b92910161102f565b90611072610c64610c5a845190565b9060005b8181106110835750505090565b90919261109f610c92600192865163ffffffff16815260200190565b929101611076565b906110b6610c64610c5a845190565b9060005b8181106110c75750505090565b9091926110dd610c926001928651815260200190565b9291016110ba565b906110f4610c64610c5a845190565b9060005b8181106111055750505090565b909192611120610c92600192865162ffffff16815260200190565b9291016110f8565b906102f29060c08061119761118561117361116161114f895160e0895260e089019061101c565b60208a015188820360208a015261101c565b60408901518782036040890152611063565b606088015186820360608801526110a7565b608087015185820360808701526110e5565b60a0808701516001600160401b0316908501529401516001600160401b0316910152565b916111e4906111d66102f29593606086526060860190611128565b908482036020860152610c4b565b916040818403910152610c4b565b346103055761038061120d6112083660046106d9565b613bb2565b604051919391938493846111bb565b346103055761038061036f6112323660046106d9565b61338e565b906020828203126103055781356001600160401b03811161030557610467920161073c565b346103055761040f61126f366004611237565b9061303b565b34610305576112853660046104dc565b610380610aef6113fc565b346103055761040f6112a33660046107e8565b9061319c565b9190604083820312610305578060206112c56102f2938661030a565b940161030a565b34610305576103806103d06112e23660046112a9565b90611774565b91909160a081840312610305576112ff838261030a565b9261130d816020840161030a565b9261131b826040850161031f565b926109f7836060830161031f565b346103055761040f61133c3660046112e8565b939290926117ab565b346103055761040f6113583660046103e3565b6114c4565b6102f290546102e6565b6102f2600761135d565b6113796113b1565b610317611397565b6102e66102f26102f29290565b6102f290611381565b6103176113a4600061138e565b611513565b610317611371565b6113b9611367565b33906113cd6113c7836102e6565b916102e6565b036113d55750565b6113f8906113e260405190565b63118cdaa760e01b815291829160048301610aaa565b0390fd5b6102f2600861135d565b610317906114126113b1565b61146d565b6102f2906102e6906001600160a01b031682565b6102f290611417565b6102f29061142b565b9061144d6102f261146992611434565b82546001600160a01b0319166001600160a01b03919091161790565b9055565b61147881600861143d565b61149161148b611486611367565b611434565b91611434565b907f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227006114bc60405190565b80805b0390a3565b61031790611406565b9060031b6114e66001600160a01b03821b5b9384921b90565b169119161790565b91906114ff6102f261146993611434565b9083546114cd565b610317916000916114ee565b6103179061152360006008611507565b61153e61148b611533600761135d565b61148684600761143d565b907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e06114bc60405190565b336115726113fc565b61157e6113c7836102e6565b036113d55761031790611513565b6102f290610607565b506102f2600261158c565b6102f26102f26102f29290565b906115b7906115a0565b600052602052604060002090565b906115b790611434565b6102f29081565b6102f290546115cf565b6115f7906115f26102f29360006115ad565b6115c5565b6115d6565b9081526040810192916103179160200152565b9061161c6108c68361089f565b918252565b369037565b906103176116338361160f565b60208194611643601f199161089f565b019101611621565b634e487b7160e01b600052601160045260246000fd5b60001981146116705760010190565b61164b565b634e487b7160e01b600052603260045260246000fd5b805182101561169f5760209160051b010190565b611675565b906116ad825190565b6116bf6116bb6102f2845190565b9190565b03611739576116d46116cf835190565b611626565b916116df60006115a0565b6116ea6102f2835190565b811015611733578061172961171c61170c61172e948660209160051b01015190565b600584901b870160200151610369565b611726838861168b565b52565b611661565b6116df565b50505090565b519051611746565b915190565b906113f861175360405190565b635b05999160e01b8152928392600484016115fc565b610317919033611a06565b6102f2916115f26117869260016115c5565b5460ff1690565b9160206103179294936117a481604081019761081d565b019061081d565b9493929190336117ba816102e6565b6117c3886102e6565b1415806117fe575b6117da57506103179495611857565b86906113f86117e860405190565b63711bec9160e11b81529283926004840161178d565b5061181061180c8289611774565b1590565b6117cb565b949392919033611824816102e6565b61182d886102e6565b141580611844575b6117da5750610317949561198c565b5061185261180c8289611774565b611835565b909194939294611867600061138e565b611870816102e6565b8061187a866102e6565b146118c657611888846102e6565b146118a45750610317949561189c91611d4a565b9290916118e9565b6113f8906118b160405190565b626a0d4560e21b815291829160048301610aaa565b6113f8826118d360405190565b632bfa23e760e11b815291829160048301610aaa565b919392906118f98286838661556e565b61190b611906600061138e565b6102e6565b611914826102e6565b03611921575b5050505050565b339261192b865190565b6119386116bb60016115a0565b0361197c5761196c6119729661195f61195160006115a0565b809260209160051b01015190565b9460209160051b01015190565b93611b38565b388080808061191a565b611987959293611ca4565b611972565b949392919061199b600061138e565b956119a5876102e6565b806119af846102e6565b146119da576119bd826102e6565b146119cd576103179596506118e9565b6113f8876118b160405190565b6113f8886118d360405190565b906119f76102f261146992151590565b825460ff191660ff9091161790565b611a10600061138e565b611a19816102e6565b611a22846102e6565b14611a7b57506114bf611a71611a6b8361148687611a66886115f27f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319960016115c5565b6119e7565b93611434565b936103d460405190565b6113f890611a8860405190565b62ced3e160e81b815291829160048301610aaa565b9050519061031782610384565b90602082820312610305576102f291611a9d565b9193611aec60a094611ae56102f29897611adb87611af39761081d565b602087019061081d565b6040850152565b6060830152565b8160808201520190610669565b6040513d6000823e3d90fd5b9061161c6108c683610924565b3d15611b3357611b283d611b0c565b903d6000602084013e565b606090565b9193929094611b5395853b611b4d60006115a0565b97889190565b11611b62575b50505050505050565b6000602094611b9a611b766114868a611434565b94611b8060405190565b9889978896879563f23a6e6160e01b875260048701611abe565b03925af160009181611c22575b50611bed5750611bbe565b38808080808080611b59565b611bc6611b19565b91611bd26102f2845190565b03611be4576113f8906118d360405190565b50805190602001fd5b909150611c0a63f23a6e6160e01b5b916001600160e01b03191690565b03611c155750611bb2565b6113f8906118d360405190565b611c4491925060203d8111611c4b575b611c3c81836105e1565b810190611aaa565b9038611ba7565b503d611c32565b93906102f29593611c77611c9694611c6d88611c889561081d565b602088019061081d565b60a0604087015260a0860190610c4b565b908482036060860152610c4b565b916080818403910152610669565b9193929094611cb995853b611b4d60006115a0565b11611cc75750505050505050565b6000602094611cff611cdb6114868a611434565b94611ce560405190565b9889978896879563bc197c8160e01b875260048701611c52565b03925af160009181611d2a575b50611d175750611bbe565b909150611c0a63bc197c8160e01b611bfc565b611d4391925060203d8111611c4b57611c3c81836105e1565b9038611d0c565b9160806040518094600182526020820152604081019360018552606082015201604052565b611d789061338e565b611d856116bb60006115a0565b1190565b9061034f906102e6565b6102f29060a01c5b6001600160601b031690565b6102f29054611d93565b906001600160601b03169052565b6102f2604061088b565b90610317611dd5611dbf565b6020611df38295611dee611de88261135d565b85611d89565b611da7565b9101611db1565b6102f290611dc9565b6102f290516102e6565b6102f29081906001600160601b031681565b8181029291811591840414171561167057565b634e487b7160e01b600052601260045260246000fd5b8115611e52570490565b611e32565b611e68611e6d9193929360066115ad565b611dfa565b91611e7783611e03565b611e876113c7611906600061138e565b14611ed0575b611eca611eb96116bb92611eb3611eae60208801516001600160601b031690565b611e0d565b90611e1f565b611ec4611eae611efc565b90611e48565b92611e03565b91506116bb611eca611eb9611ee56005611dfa565b9492505050611e8d565b611d9b6102f26102f29290565b6102f2612710611eef565b61031790611f136113b1565b6001611a666103179260146115c5565b61031790611f07565b61031790611f386113b1565b6000611a666103179260146115c5565b61031790611f2c565b6102f291611f61611f66926132ae565b61168b565b5190565b61031790611f766113b1565b611fb2565b90611f8b6102f261146992611434565b825490600160401b600160e01b039060401b600160401b600160e01b031990921691161790565b611fe27faea1573caf7b4fdd079b947d86c1be6c725642c47582f8f9bd2c7d2a30bf0bd991610aef816013611f7b565b0390a1565b61031790611f6a565b9061031791611ffd6113b1565b612d30565b6102f2906006611e1f565b9060031b6114e6600019821b6114df565b919061202f6102f2611469936115a0565b90835461200d565b6103179160009161201e565b81811061204e575050565b8061205c6000600193612037565b01612043565b9060001960209190910360031b1c8154169055565b91909182821061208657505050565b612097610317936002600391010490565b90600a60036120b3600286018290045b93600052602060002090565b928301940602806120c7575b500190612043565b6120d5906000198501612062565b386120bf565b90600160401b811161060257816120f3610317935490565b90828155612077565b6000610317916120db565b9061063557610317906120fc565b818110612120575050565b8061212e6000600193612037565b01612115565b91909182821061214357505050565b6103179260070160031c90601c6121676007850160031c5b92600052602060002090565b9182019360021b168061217d575b500190612115565b61218b906000198501612062565b38612175565b90600160401b811161060257816121a9610317935490565b90828155612134565b600061031791612191565b9061063557610317906121b2565b919061202f6102f26114699390565b610317916000916121cb565b8181106121f1575050565b806121ff60006001936121da565b016121e6565b91909182821061221457505050565b6122346122286122246103179590565b9390565b91600052602060002090565b91820191016121e6565b90600160401b81116106025781612256610317935490565b90828155612205565b60006103179161223e565b90610635576103179061225f565b818110612283575050565b806122916000600193612037565b01612278565b9190918282106122a657505050565b6122b7610317936009600a91010490565b906003600a6122cb600986018290046120a7565b928301940602806122df575b500190612278565b6122ed906000198501612062565b386122d7565b90600160401b8111610602578161230b610317935490565b90828155612297565b6000610317916122f3565b906106355761031790612314565b600560009161233c8382612107565b6123498360018301612107565b61235683600283016121bd565b612363836003830161226a565b612370836004830161231f565b0155565b90610635576103179061232d565b81811061238d575050565b8061239b6000600693612374565b01612382565b9190918282106123b057505050565b6123c86122286123c261031795612002565b93612002565b9182019101612382565b90600160401b811161060257816123ea610317935490565b908281556123a1565b6000610317916123d2565b9061063557610317906123f3565b90359060de1981360301821215610305570190565b9082101561169f576102f29160051b81019061240c565b356102f281610b07565b9190820391821161167057565b610afb6102f26102f29290565b6102f261012c61244f565b612482906001600160401b03165b916001600160401b031690565b01906001600160401b03821161167057565b903590601e1981360301821215610305570180359182916001600160401b03841161030557602001809360051b36031261030557565b6102f260e061088b565b6001600160501b0381166102fe565b90503590610317826124d4565b909291926125006108c68261089f565b93602085838152019160051b83019281841161030557915b8383106125255750505050565b6020809161253384866124e3565b815201920191612518565b6102f29136916124f0565b909291926125596108c68261089f565b93602085838152019160051b83019281841161030557915b83831061257e5750505050565b6020809161258c848661072f565b815201920191612571565b6102f2913691612549565b909291926125b26108c68261089f565b93602085838152019160051b83019281841161030557915b8383106125d75750505050565b602080916125e5848661031f565b8152019201916125ca565b6102f29136916125a2565b62ffffff81166102fe565b90503590610317826125fb565b909291926126236108c68261089f565b93602085838152019160051b83019281841161030557915b8383106126485750505050565b602080916126568486612606565b81520192019161263b565b6102f2913691612613565b805482101561169f57612686600691600052602060002090565b91020190600090565b9060031b6114e66001600160501b03821b6114df565b906126ae815190565b906001600160401b0382116106025761215b6126d4916126ce84866120db565b60200190565b600382049160005b8381106127455750600383029003806126f6575b50505050565b92600093845b818110612711575050500155388080806126f0565b909194602061273b6001926127306102f28a516001600160501b031690565b9085600a029061268f565b96019291016126fc565b6000805b6003811061275e5750838201556001016126dc565b9590602061278760019261277c6102f286516001600160501b031690565b908a600a029061268f565b92019601612749565b90610317916126a5565b9060031b6114e663ffffffff821b6114df565b6127c06102f26102f29263ffffffff1690565b63ffffffff1690565b906127d2815190565b906001600160401b0382116106025761215b6127f2916126ce8486612191565b8160031c9160005b838110612860575060071981169003806128145750505050565b92600093845b81811061282f575050500155388080806126f0565b909194602061285660019261284b6102f28a5163ffffffff1690565b908560021b9061279a565b960192910161281a565b6000805b600881106128795750838201556001016127fa565b9590602061289f6001926128946102f2865163ffffffff1690565b908a60021b9061279a565b92019601612864565b90610317916127c9565b8151916001600160401b038311610602576122286128d4916126ce858561223e565b60005b8381106128e45750505050565b60019060206128f46102f2865190565b94019381840155016128d7565b90610317916128b2565b9060031b6114e662ffffff821b6114df565b90612926815190565b906001600160401b0382116106025761215b612946916126ce84866122f3565b600a82049160005b8381106129b25750600a83029003806129675750505050565b92600093845b818110612982575050500155388080806126f0565b90919460206129a860019261299d6102f28a5162ffffff1690565b90856003029061290b565b960192910161296d565b6000805b600a81106129cb57508382015560010161294e565b959060206129f06001926129e56102f2865162ffffff1690565b908a6003029061290b565b920196016129b6565b906103179161291d565b610afb6102f26102f2926001600160401b031690565b90612a296102f261146992612a03565b825467ffffffffffffffff19166001600160401b039091161790565b90612a556102f261146992612a03565b82549067ffffffffffffffff60401b9060401b67ffffffffffffffff60401b1990921691161790565b90612b2460c0600561031794612a9b612a95865190565b82612790565b612ab2612aa9602087015190565b60018301612790565b612ac9612ac0604087015190565b600283016128a8565b612ae0612ad7606087015190565b60038301612901565b612af7612aee608087015190565b600483016129f9565b0192612b16612b1060a08301516001600160401b031690565b85612a19565b01516001600160401b031690565b90612a45565b91906106355761031791612a7e565b80549190600160401b8310156106025782612b5c9160016103179501815561266c565b90612b2a565b506102f29060208101906124e3565b818352602090920191906000825b828210612b8d575050505090565b90919293612bbc612bb5600192612ba48886612b62565b6001600160501b0316815260200190565b9560200190565b93920190612b7f565b506102f290602081019061072f565b818352602090920191906000825b828210612bf0575050505090565b90919293612c15612bb5600192612c078886612bc5565b63ffffffff16815260200190565b93920190612be2565b9037565b8183529091602001916001600160fb1b03811161030557829161069d9160051b938491612c1e565b506102f2906020810190612606565b818352602090920191906000825b828210612c75575050505090565b90919293612c99612bb5600192612c8c8886612c4a565b62ffffff16815260200190565b93920190612c67565b979060c09995612d0f976103179d9f9e9c968b612ce591612d0198612cd7612cf397612d219f9a60e0865260e0860191612b71565b926020818503910152612b71565b918b830360408d0152612bd4565b9188830360608a0152612c22565b918583036080870152612c59565b6001600160401b0390971660a0830152565b01906001600160401b03169052565b90612d3d6000600e6123fe565b612d4760006115a0565b612d5160016115a0565b600e915b808481101561303357821115612fd5575b612d71818587612421565b60a001612d7d90612438565b612d88828688612421565b60c001612d9490612438565b612d9d91615975565b612da8818587612421565b612db1906159f8565b612dbc818587612421565b80612dc691612494565b908587612dd4858383612421565b60208101612de191612494565b90612ded878585612421565b60408101612dfa91612494565b90612e06898787612421565b60608101612e1391612494565b929093612e218b8989612421565b60808101612e2e91612494565b9690978c612e3d818c84612421565b60a001612e4990612438565b9a612e5392612421565b60c001612e5f90612438565b99612e686124ca565b9b612e729161253e565b8b52612e7d9161253e565b60208a0152612e8b91612597565b6040880152612e99916125f0565b6060860152612ea791612661565b60808401526001600160401b031660a08301526001600160401b031660c0820152612ed29084612b39565b612edd818587612421565b80612ee791612494565b90612ef3838789612421565b60208101612f0091612494565b92909187612f0f86828c612421565b60408101612f1c91612494565b8b612f2b898583969596612421565b60608101612f3891612494565b90612f448b8685612421565b60808101612f5191612494565b9490938c612f60818984612421565b60a001612f6c90612438565b97612f7692612421565b60c001612f8290612438565b96612f8c8d6115a0565b9b612f9660405190565b9b8c9b612fa39b8d612ca2565b037f7fec20ffa7d178b5b4d9eb21ec7ff2a1376af8e08ab6cb4c691750db41fc40d191a2612fd090611661565b612d55565b612feb60a0612fe5838789612421565b01612438565b61301b612475610afb61300d60c0612fe56130068989612442565b8b8d612421565b61301561245c565b90612467565b1015612d6657604051636bc1af9360e01b8152600490fd5b505050505050565b9061031791611ff0565b805482101561169f5761305d90600052602060002090565b0190600090565b6102f29160031b1c81565b906102f29154613064565b6130886102f291600c613045565b9061306f565b906103179161309b6113b1565b7f000000000000000000000000000000000000000000000000000000000000000381101561318a576130d161308882600c613045565b6130de6116bb60006115a0565b141580613171575b61315f576130f66102f28261338e565b821061314d5761314861313e82613139856131337fc95161027a9b2f0376fa8fa5f504100ccc4748c73f4e479bac3778d02ee5621c96600c613045565b9061201e565b6115a0565b9261037360405190565b0390a2565b60405163fb7af64960e01b8152600490fd5b60405163430b83b160e11b8152600490fd5b506131836102f261308883600c613045565b82116130e6565b6040516307ed98ed60e31b8152600490fd5b906103179161308e565b6130886102f291600d613045565b90610317916131c16113b1565b7f000000000000000000000000000000000000000000000000000000000000000381101561318a576131f761308882600c613045565b6132046116bb60006115a0565b1180613258575b6132465761314861313e82613139856131337f0c899f003b7b88b925c6cdfe9b56bc4df2b91107f0f6d1cec1c3538d156bbe4896600d613045565b604051630590c51360e01b8152600490fd5b5061326a6102f261308883600c613045565b821161320b565b90610317916131b4565b6102f2906127c0565b6102f2905461327b565b6102f26102f26102f29263ffffffff1690565b9190820180921161167057565b907f0000000000000000000000000000000000000000000000000000000000000003916132da83611626565b906132e4600e5490565b926132ef60006115a0565b936132fb6116bb869790565b945b8187101561337757805b86811015613362578061172961335361334161333c6133378a6115f28f61333261335d9a60106115ad565b6115ad565b613284565b61328e565b61334e611f668d8c61168b565b6132a1565b6117268b8a61168b565b613307565b5091909561336f90611661565b9590916132fd565b5050935050905090565b6102f26102f260046115d6565b6102f2906115f76102f29160036115ad565b6133a86124ca565b908160608082526020820152606060408201526060808201526133c9606090565b608082015260c06000918260a08201520152565b6102f26133a0565b6102f2905b6001600160501b031690565b6102f29060501c6133ea565b6102f29060a01c6133ea565b906001906134206120a7610c5a855490565b6000926134aa575b549080831061348d575b808310613470575b8210613447575b80611733565b826134676001939461345a602094613402565b6001600160501b03169052565b01910138613441565b919260208161348460019361345a866133f6565b0193019161343a565b91926020816134a160019361345a866133e5565b01930191613432565b816002840110156134285792600160606003926134ec87546134cf8361345a836133e5565b6134df6020840161345a836133f6565b61345a6040840191613402565b0194019201916134aa565b906102f29161340e565b9061031761350e60405190565b806106208180966134f7565b6102f29060201c6127c0565b6102f29060401c6127c0565b6102f29060601c6127c0565b6102f29060801c6127c0565b6102f29060a01c6127c0565b6102f29060c01c6127c0565b6102f29060e01c6127c0565b906001906135806120a7610c5a855490565b6000926136b6575b5490808310613699575b80831061367c575b80831061365f575b808310613642575b808310613625575b808310613608575b8083106135eb575b82106135ce5780611733565b82613467600193946135e1602094613562565b63ffffffff169052565b91926020816135ff6001936135e186613556565b019301916135c2565b919260208161361c6001936135e18661354a565b019301916135ba565b91926020816136396001936135e18661353e565b019301916135b2565b91926020816136566001936135e186613532565b019301916135aa565b91926020816136736001936135e186613526565b019301916135a2565b91926020816136906001936135e18661351a565b0193019161359a565b91926020816136ad6001936135e18661327b565b01930191613592565b816007840110156135885792600161010060089261374987546136dc836135e18361327b565b6136ec602084016135e18361351a565b6136fc604084016135e183613526565b61370c606084016135e183613532565b61371c608084016135e18361353e565b61372c60a084016135e18361354a565b61373c60c084016135e183613556565b6135e160e0840191613562565b0194019201916136b6565b906102f29161356e565b9061031761376b60405190565b80610620818096613754565b9061378661215b610c5a845490565b9060005b8181106137975750505090565b9091926137bb6137b46001926137ac876115d6565b815260200190565b9460010190565b92910161378a565b906102f291613777565b906103176137da60405190565b806106208180966137c3565b6102f2905b62ffffff1690565b6102f29060181c6137eb565b6102f29060301c6137eb565b6102f29060481c6137eb565b6102f29060601c6137eb565b6102f29060781c6137eb565b6102f29060901c6137eb565b6102f29060a81c6137eb565b6102f29060c01c6137eb565b6102f29060d81c6137eb565b906001906138716120a7610c5a855490565b6000926139f0575b54908083106139d3575b8083106139b6575b808310613999575b80831061397c575b80831061395f575b808310613942575b808310613925575b808310613908575b8083106138eb575b82106138cf5780611733565b82613467600193946138e2602094613853565b62ffffff169052565b91926020816138ff6001936138e286613847565b019301916138c3565b919260208161391c6001936138e28661383b565b019301916138bb565b91926020816139396001936138e28661382f565b019301916138b3565b91926020816139566001936138e286613823565b019301916138ab565b91926020816139736001936138e286613817565b019301916138a3565b91926020816139906001936138e28661380b565b0193019161389b565b91926020816139ad6001936138e2866137ff565b01930191613893565b91926020816139ca6001936138e2866137f3565b0193019161388b565b91926020816139e76001936138e2866137e6565b01930191613883565b8160098401101561387957926001610140600a92613aa58754613a16836138e2836137e6565b613a26602084016138e2836137f3565b613a36604084016138e2836137ff565b613a46606084016138e28361380b565b613a56608084016138e283613817565b613a6660a084016138e283613823565b613a7660c084016138e28361382f565b613a8660e084016138e28361383b565b613a9761010084016138e283613847565b6138e2610120840191613853565b0194019201916139f0565b906102f29161385f565b90610317613ac760405190565b80610620818096613ab0565b6102f290610afb565b6102f29054613ad3565b6102f29060401c610afb565b6102f29054613ae6565b90610317613b086124ca565b60c0613b9b60058396613b21613b1d82613501565b8652565b613b37613b3060018301613501565b6020870152565b613b4d613b466002830161375e565b6040870152565b613b63613b5c600383016137cd565b6060870152565b613b79613b7260048301613aba565b6080870152565b01613b96613b8682613adc565b6001600160401b031660a0860152565b613af2565b6001600160401b0316910152565b6102f290613afc565b613bba6133dd565b50613bc76102f2600e5490565b811015613bfb57613bd7336132ae565b91613bf6613bf0613be83385613c0d565b93600e61266c565b50613ba9565b929190565b60405163e82a532960e01b8152600490fd5b91907f000000000000000000000000000000000000000000000000000000000000000392613c3a84611626565b92613c4c613c4860006115a0565b9590565b945b85811015613c955780611729613c86613c7961333c613337896115f2613c90986133328c60106115ad565b61334e611f66858b61168b565b611726838961168b565b613c4e565b509350505090565b90613cb597969594939291613cb0613d07565b613cc8565b610317613d47565b6102f291369161094c565b9561031797613cd691613cbd565b9533614477565b9061031797969594939291613c9d565b6102f260026115a0565b906102f26102f2611469926115a0565b613d1160096115d6565b613d19613ced565b908114613d2b57610317906009613cf7565b604051633ee5aeb560e01b8152600490fd5b6102f260016115a0565b610317613d52613d3d565b6009613cf7565b9493929190613d6c6117863360146115c5565b600190151503613d7f5761031795613db0565b60405163ea8e4eb560e01b8152600490fd5b613d9b6001611b0c565b600360fc1b602082015290565b6102f2613d91565b926103179592949194613dc1613da8565b95613dcc600061244f565b95614477565b906103179594939291613d59565b96959493929190613df08261328e565b613dfe61308883600c613045565b613e0b6116bb60006115a0565b119081613e33575b50613e215761031797613fc2565b60405163800113cb60e01b8152600490fd5b613e41915061334e8361338e565b613e556116bb6102f261308885600c613045565b1138613e13565b6102f29060401c6102e6565b6102f29054613e5c565b6133ea6102f26102f29290565b613e9a906001600160501b03165b916001600160501b031690565b01906001600160501b03821161167057565b6133ea6102f26102f29263ffffffff1690565b613ed1906001600160501b0316613e8d565b02906001600160501b03821691820361167057565b6102f29081906001600160501b031681565b6137eb6102f26102f29290565b6102f26102f26102f29262ffffff1690565b6127c06102f26102f29290565b613f399063ffffffff165b9163ffffffff1690565b019063ffffffff821161167057565b613f5461034f916102e6565b60601b90565b60e01b90565b61034f9063ffffffff1660e01b90565b90601892613f818361069d93613f48565b6014830190613f60565b90613f9b6102f2611469926127ad565b825463ffffffff191663ffffffff9091161790565b6102f26000611b0c565b6102f2613fb0565b9594613ff8919495939293613fd64261244f565b90600099613fe46013613e68565b613ff06119068d61138e565b9586916102e6565b03614452575b505061400990614cfc565b95614018613bf088600e61266c565b981561443b576140286000613e72565b935b7f000000000000000000000000000000000000000000000000000000000000000093614055856102e6565b14928386898d8361440e575b5050506143fc578a926080840189898c61408861407f84865161168b565b5162ffffff1690565b61409e6140956000613ef8565b9162ffffff1690565b116143a6575b908e93506140b661308884600d613045565b6140c36116bb60006115a0565b11614350575b60406140ff9801936140e96140df85875161168b565b5163ffffffff1690565b6140f36000613f17565b998a9163ffffffff1690565b1161431a575b505050505060608c019161411d611f668b855161168b565b61412a6116bb60006115a0565b03614239575b50505050506141b76141d294614189614182614178614173886141bf996103179f8d9a908b916133329b156141e0575b5050505061416d86613eac565b90613ebf565b613ee6565b61334e60126115d6565b6012613cf7565b61333c61419f8a6115f2876133328d60106115ad565b6141b1836141ac83613284565b613f24565b90613f8b565b9560116115ad565b6141cc8461334e836115d6565b90613cf7565b6141da613fba565b92614487565b61417361421f6142309561421a61420d6141fc61422896611434565b9761420630611434565b975161168b565b516001600160501b031690565b613e7f565b61416d8c613eac565b91339061450f565b80893880614160565b6102f2611f668b6142988f956142936116bb968a61427a61429f9a61426c61426060405190565b93849260208401613f70565b03601f1981018352826105e1565b61428c614285825190565b9160200190565b20926125f0565b6146f6565b955161168b565b036143085763ffffffff16908111908589888a856142dd575b50505050506142cb573880808080614130565b60405163b4f3729b60e01b8152600490fd5b6142fd9495506127c093926115f26141ac936133326133379460106115ad565b11388589888a6142b8565b6040516309bde33960e01b8152600490fd5b836142986127c0936141ac6133376140df956115f26143419a613332613f2f9b60106115ad565b116142cb5738898b8a8e614105565b50506143709295506143619161476d565b61436a8961328e565b906132a1565b6143846116bb6102f26130888c600d613045565b11614394578a928a898b8a6140c9565b60405163751304ed60e11b8152600490fd5b6143db93949750826142986143d69361436a6143d06115f76116bb9861333261407f9860116115ad565b9161328e565b613f05565b116143eb578a923889898c6140a4565b60405162d0844960e21b8152600490fd5b604051630717c22560e51b8152600490fd5b61443193509161421a61420d61442893614173955161168b565b61416d8a613eac565b341086898d614061565b61444c61420d8760208c015161168b565b9361402a565b81614466929b506140099350878933614eb2565b98614470816159b8565b9038613ffe565b9061031797969594939291613de0565b90939291614495600061138e565b9461449f866102e6565b6144a8846102e6565b146144bc5761031794959161189c91611d4a565b6113f8866118d360405190565b6144dc613f5a6102f29263ffffffff1690565b6001600160e01b03191690565b60409061083d610317949695939661450583606081019961081d565b602083019061081d565b909161455290614544610317956145296323b872dd6144c9565b9261453360405190565b9687946020860152602485016144e9565b03601f1981018452836105e1565b614578565b9050519061031782610dd4565b90602082820312610305576102f291614557565b61458461458b91611434565b91826145f2565b805161459a6116bb60006115a0565b141590816145ce575b506145ab5750565b6113f8906145b860405190565b635274afe760e01b815291829160048301610aaa565b6145ec9150806020806145e261180c945190565b8301019101614564565b386145a3565b6102f29161460060006115a0565b61460930611434565b818131106146335750600082819260206102f2969551920190855af161462d611b19565b91614656565b6113f89061464060405190565b63cd78605960e01b815291829160048301610aaa565b9015614662565b501590565b1561466d57506146c7565b614688614678835190565b61468260006115a0565b91829190565b1490816146bc575b50614699575090565b6113f8906146a660405190565b639996b31560e01b815291829160048301610aaa565b9050813b1438614690565b80516146d66116bb60006115a0565b11156146e457805190602001fd5b604051630a12f52160e11b8152600490fd5b61470060006115a0565b915b61470d6102f2835190565b83101561473a5761472e61473491614728611f66868661168b565b90614740565b92611661565b91614702565b91505090565b8181101561475b57906102f291600052602052604060002090565b6102f291600052602052604060002090565b61477760006115a0565b9182936147866102f2600e5490565b945b858510156147bc576147b06147b69161436a61333c613337886115f2896133328d60106115ad565b94611661565b93614788565b945092505050565b9061031792916147d26113b1565b91906147dd8261328e565b6147eb61308883600c613045565b6147f86116bb60006115a0565b11908161480e575b50613e215761031792614837565b61481c915061334e8361338e565b6148306116bb6102f261308885600c613045565b1138614800565b906148446103179361328e565b906141da613fba565b9061031792916147c4565b6148606113b1565b61031761489a600080730b98151bedee73f9ba5f2c7b72dea02d38ce49fc61488860126115d6565b60405190818003925af161465d611b19565b61493b576148ab61418260006115a0565b6148b430611434565b316148f36000806148c460405190565b600090857f000000000000000000000000ef59f379b48f2e92abd94adcbf714d170967925d5af161465d611b19565b61492957611fe261036f7f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d9261334e60126115d6565b604051631d42c86760e21b8152600490fd5b6040516312171d8360e31b8152600490fd5b610317614858565b61495d6113b1565b610317614986565b9050519061031782610319565b90602082820312610305576102f291614965565b7f00000000000000000000000000000000000000000000000000000000000000006149b4611906600061138e565b6149bd826102e6565b14614ae257614a3c6149ce82611434565b6149f7730b98151bedee73f9ba5f2c7b72dea02d38ce49fc6149f060126115d6565b9083614afc565b614a0461418260006115a0565b6020614a0f82611434565b614a1830611434565b90614a2260405190565b948592839182916370a0823160e01b835260048301610aaa565b03915afa908115614add57611a6b6131489261313e927fbe7426aee8a34d0263892b55ce65ce81d8f4c806eb4719e59015ea49feb92d2295600092614aa9575b5081614178917f000000000000000000000000ef59f379b48f2e92abd94adcbf714d170967925d90614afc565b614178919250614acf9060203d8111614ad6575b614ac781836105e1565b810190614972565b9190614a7c565b503d614abd565b611b00565b60405163a47ca0b760e01b8152600490fd5b610317614955565b61455261031793614544614b1363a9059cbb6144c9565b91614b1d60405190565b958693602085015260248401610826565b9061031791614b3b6113b1565b61031791614b4891613cbd565b614cac565b9061031791614b2e565b818110614b62575050565b80614b706000600193612037565b01614b57565b9190601f8111614b8557505050565b614b9761031793600052602060002090565b906020601f840160051c83019310614bb7575b601f0160051c0190614b57565b9091508190614baa565b9060001960039190911b1c191690565b81614bdb91614bc1565b9060011b1790565b81519192916001600160401b03811161060257614c0a81614c048454610513565b84614b76565b6020601f8211600114614c39578190611469939495600092614c2e575b5050614bd1565b015190503880614c27565b601f19821694614c4e84600052602060002090565b9160005b878110614c8a575083600195969710614c70575b505050811b019055565b614c80910151601f841690614bc1565b9055388080614c66565b90926020600181928686015181550194019101614c52565b9061031791614be3565b610317906002614ca2565b61031790614cc36113b1565b611fe27fbcde07732ba7563e295b3edc0bf5ec939a471d93d850a58a6f2902c0ed323728916103d081600f6119e7565b61031790614cb7565b614d0660006115a0565b90614d136102f2600e5490565b915b82811015613bfb57614d37610afb6005614d3084600e61266c565b5001613adc565b6001600160401b038316908110159081614d5f575b5061473a57614d5a90611661565b614d15565b9050614d7b610afb6005614d7485600e61266c565b5001613af2565b1138614d4c565b61034f906001600160401b031660c01b90565b969260899895614ddf614dfa96614dd3614de994614dc9614df39860148f61069d9f9a81614dc291613f48565b0190613f48565b60288d0190613f60565b151560f81b602c8b0152565b602d890190613f48565b6041870190614d82565b6049850152565b6069830152565b90919293614e0f6013613e68565b614e1f6113c7611906600061138e565b14614ea0576102f294614e669361426c92614e3930611434565b91614e4e614e476013613e68565b9187611f51565b93614e5860405190565b988997469560208a01614d95565b614e71614285825190565b207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b600052601c52603c60002090565b6040516353bd4fb360e11b8152600490fd5b91909392614ebe600090565b50614ee184614ecd6013613e68565b614edb846001878b8a614e01565b90614f52565b614f19576000614edb92614eff96614ef96013613e68565b95614e01565b614f145760405162b7fad960e11b8152600490fd5b600090565b5050505050600190565b634e487b7160e01b600052602160045260246000fd5b60041115614f4357565b614f23565b9061031782614f39565b9190614f5e8282614fb3565b50614f75614f6f6000969396614f48565b91614f48565b149384614f9c575b508315614f8a5750505090565b614f94935061511a565b388080611733565b909350614fab6113c7856102e6565b149238614f7d565b8151614fc26116bb60416115a0565b03614fec5790614fe5916020820151906060604084015193015160001a90615041565b9192909190565b50615002613139614ffd600061138e565b925190565b909160029190565b6102f2906115a0565b61083d6103179461503a60609498979561503085608081019b9052565b60ff166020850152565b6040830152565b909161504c8461500a565b61506e6116bb6fa2a8918ca85bafe22016d0b997e4df60600160ff1b036115a0565b116150e957906150906020946000949361508760405190565b94859485615013565b838052039060015afa15614add576000516150ab600061138e565b6150b4816102e6565b6150bd836102e6565b146150d557506150cd60006115a0565b909160009190565b90506150e160006115a0565b909160019190565b5050506150f6600061138e565b9160039190565b8061510d6040926102f295949052565b8160208201520190610669565b6000929161426c61514a859461512f60405190565b9283916020830195630b135d3f60e11b8752602484016150fd565b51915afa615156611b19565b81615199575b81615165575090565b61517f9150602080615175835190565b8301019101614972565b6151956116bb6102f2630b135d3f60e11b6144dc565b1490565b90506151a3815190565b6151b06116bb60206115a0565b10159061515c565b90610317916151c56113b1565b6151f0565b9160206103179294936151e181604081019761081d565b01906001600160601b03169052565b907f8a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef9161521d82826152da565b611fe261522960405190565b928392836151ca565b90610317916151b8565b61034f90611e0d565b91602061031792949361083d81604081019761523c565b6102f290611d9b906001600160601b031682565b906152806102f26114699261525c565b8254906001600160a01b03199060a01b6001600160a01b0390921691161790565b6152ca6020610317936152bc6152b682611e03565b8561143d565b01516001600160601b031690565b90615270565b90610317916152a1565b906152e6611eae611efc565b806152f083611e0d565b116153655750615300600061138e565b615309816102e6565b615312846102e6565b1461534257509061533b6103179261533261532b611dbf565b9384611d89565b60208301611db1565b60056152d0565b6113f89061534f60405190565b635b6cc80560e11b815291829160048301610aaa565b906113f861537260405190565b636f483d0960e01b815292839260048401615245565b9061031792916153966113b1565b916153c87f7f5b076c952c0ec86e5425963c1326dd0f03a3595c19f81d765e8ff559a6e33c929361313983868361541a565b9261314861522960405190565b906103179291615388565b60409061083d61031794969593966153fb8360608101999052565b602083019061523c565b908152604081019291610317916020906117a4565b9091615427611eae611efc565b8061543183611e0d565b116154af5750615441600061138e565b61544a816102e6565b615453856102e6565b1461548c5750610317929161548061548792615477615470611dbf565b9586611d89565b60208501611db1565b60066115ad565b6152d0565b826113f861549960405190565b634b4f842960e11b815292839260048401615405565b6113f883916154bd60405190565b63dfd1fc1b60e01b8152938493600485016153e0565b6154dc816154f1565b9081156154e7575090565b6102f29150615535565b6001600160e01b03198116636cdb3d1360e11b811491908215615524575b50811561551a575090565b6102f2915061555e565b6303a24d0760e21b1491503861550f565b63152a902d60e11b6001600160e01b0319821614908115615554575090565b6102f291506154f1565b6151956301ffc9a760e01b611bfc565b6155a19061558561559a93956155a79587846155eb565b615592611906600061138e565b9283916102e6565b14936102e6565b14911590565b90816155e2575b50806155cd575b6155bb57565b60405163dc8d8db760e01b8152600490fd5b506155dd61180c600f5460ff1690565b6155b5565b159050386155ae565b9061560091949392946155858487848461575d565b1461569c575b61560f906102e6565b1461561957509050565b61562360006115a0565b90815b6156316102f2865190565b83101561567e5761472e6156789161564c611f66868661168b565b9061069d615667615660611f66898c61168b565b60036115ad565b6141cc84615674836115d6565b0390565b91615626565b9050610317929350615695915061567460046115d6565b6004613cf7565b926156aa60009392936115a0565b9285845b6156b96102f2835190565b8610156156f0576156e8916147b09161334e6141bf615660611f668b6156e2611f66828e61168b565b9661168b565b9386906156ae565b61560f93969294955061570c91506156959061334e60046115d6565b9050615606565b61083d6103179461503a60609498979561573185608081019b61081d565b6020850152565b909161574f6102f293604084526040840190610c4b565b916020818403910152610c4b565b939092919261576a845190565b6157786116bb6102f2865190565b0361596957909290339161578c60006115a0565b94859361579c611906600061138e565b945b6157a96102f2855190565b81101561588f57600581901b840160200151600582901b880160200151876157d08c6102e6565b03615821575b906157f5929187896157e7826102e6565b036157fa575b505050611661565b61579e565b61580f6141cc916115f26158199560006115ad565b9161334e836115d6565b3880876157ed565b6158336115f78c6115f28560006115ad565b81811061586a57906158618c61585c615850846157f59897960390565b916115f28660006115ad565b613cf7565b909192506157d6565b8b6113f8848461587960405190565b6303dee4c560e01b815294859460048601615713565b5092949591909693506158a0815190565b6158ad6116bb60016115a0565b03615920576158ff6158ff611a6b846158f27fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6297966159059660209160051b01015190565b9960209160051b01015190565b94611434565b9461591b61591260405190565b928392836115fc565b0390a4565b9490506159536158ff6158ff7f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb94611434565b9461591b61596060405190565b92839283615738565b82611746611741865190565b90615988906001600160401b0316612475565b101561599057565b604051631750215560e11b8152600490fd5b6102f26102f26102f2926001600160401b031690565b6159df6159d96102f26159d36159ce6013613adc565b6159a2565b42612442565b916159a2565b106159e657565b6040516313634e8d60e11b8152600490fd5b615a33615a0d615a088380612494565b905090565b7f0000000000000000000000000000000000000000000000000000000000000003614682565b1491821592615ac8575b8215615aaa575b8215615a8c575b8215615a6c575b5050615a5a57565b604051634f7ee04f60e11b8152600490fd5b615a83919250615a088160806102f2930190612494565b14153880615a52565b915080615aa26102f2615a086060860186612494565b141591615a4b565b915080615ac06102f2615a086040860186612494565b141591615a44565b915080615ade6102f2615a086020860186612494565b141591615a3d56fea26469706673582212208a6a1f42ca7221fd7dbec05d6fbc00bb359e06d62ca9e25e5676155793f4f1af64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ef59f379b48f2e92abd94adcbf714d170967925d000000000000000000000000ef59f379b48f2e92abd94adcbf714d170967925d0000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000d4d756c74692031313535204f4500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b4d554c5449313135354f45000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005668747470733a2f2f626166796265696773346c333434337a377a61336c636565666164636c623364647176616e78636572667a336f3672666e6a7572376379747366652e697066732e7733732e6c696e6b2f7b69647d0000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : collectionName (string): Multi 1155 OE
Arg [1] : collectionSymbol (string): MULTI1155OE
Arg [2] : uri (string): https://bafybeigs4l3443z7za3lceefadclb3ddqvanxcerfz3o6rfnjur7cytsfe.ipfs.w3s.link/{id}
Arg [3] : maxMintableSupply (uint256[]): 0,0,0
Arg [4] : globalWalletLimit (uint256[]): 0,0,0
Arg [5] : cosigner (address): 0x0000000000000000000000000000000000000000
Arg [6] : timestampExpirySeconds (uint64): 300
Arg [7] : mintCurrency (address): 0x0000000000000000000000000000000000000000
Arg [8] : fundReceiver (address): 0xef59F379B48f2E92aBD94ADcBf714D170967925D
Arg [9] : royaltyReceiver (address): 0xef59F379B48f2E92aBD94ADcBf714D170967925D
Arg [10] : royaltyFeeNumerator (uint96): 100
-----Encoded View---------------
27 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [1] : 00000000000000000000000000000000000000000000000000000000000001a0
Arg [2] : 00000000000000000000000000000000000000000000000000000000000001e0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000260
Arg [4] : 00000000000000000000000000000000000000000000000000000000000002e0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 000000000000000000000000000000000000000000000000000000000000012c
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [8] : 000000000000000000000000ef59f379b48f2e92abd94adcbf714d170967925d
Arg [9] : 000000000000000000000000ef59f379b48f2e92abd94adcbf714d170967925d
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [11] : 000000000000000000000000000000000000000000000000000000000000000d
Arg [12] : 4d756c74692031313535204f4500000000000000000000000000000000000000
Arg [13] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [14] : 4d554c5449313135354f45000000000000000000000000000000000000000000
Arg [15] : 0000000000000000000000000000000000000000000000000000000000000056
Arg [16] : 68747470733a2f2f626166796265696773346c333434337a377a61336c636565
Arg [17] : 666164636c623364647176616e78636572667a336f3672666e6a757237637974
Arg [18] : 7366652e697066732e7733732e6c696e6b2f7b69647d00000000000000000000
Arg [19] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [20] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [21] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [22] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [23] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [24] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [25] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [26] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.