Full Code of nftlabs/nftlabs-protocols for AI

main 0da770f27209 cached
873 files
4.6 MB
1.3M tokens
9 symbols
1 requests
Download .txt
Showing preview only (5,046K chars total). Download the full file or copy to clipboard to get everything.
Repository: nftlabs/nftlabs-protocols
Branch: main
Commit: 0da770f27209
Files: 873
Total size: 4.6 MB

Directory structure:
gitextract_k8lm443i/

├── .editorconfig
├── .eslintignore
├── .eslintrc.yaml
├── .gas-snapshot
├── .gitattributes
├── .github/
│   ├── composite-actions/
│   │   └── setup/
│   │       └── action.yml
│   └── workflows/
│       ├── dispatch_docs.yml
│       ├── lint.yml
│       ├── prettier.yml
│       ├── slither.yml
│       └── tests.yml
├── .gitignore
├── .gitmodules
├── .npmignore
├── .prettierignore
├── .prettierrc
├── .solhint.json
├── .solhintignore
├── CODE_OF_CONDUCT.md
├── LICENSE.md
├── README.md
├── audit-reports/
│   └── preliminary-audits/
│       └── airdroperc20-claimable.md
├── contracts/
│   ├── base/
│   │   ├── ERC1155Base.sol
│   │   ├── ERC1155DelayedReveal.sol
│   │   ├── ERC1155Drop.sol
│   │   ├── ERC1155LazyMint.sol
│   │   ├── ERC1155SignatureMint.sol
│   │   ├── ERC20Base.sol
│   │   ├── ERC20Drop.sol
│   │   ├── ERC20DropVote.sol
│   │   ├── ERC20SignatureMint.sol
│   │   ├── ERC20SignatureMintVote.sol
│   │   ├── ERC20Vote.sol
│   │   ├── ERC721Base.sol
│   │   ├── ERC721DelayedReveal.sol
│   │   ├── ERC721Drop.sol
│   │   ├── ERC721LazyMint.sol
│   │   ├── ERC721Multiwrap.sol
│   │   ├── ERC721SignatureMint.sol
│   │   ├── Staking1155Base.sol
│   │   ├── Staking20Base.sol
│   │   └── Staking721Base.sol
│   ├── eip/
│   │   ├── ERC1155.sol
│   │   ├── ERC1271.sol
│   │   ├── ERC165.sol
│   │   ├── ERC721A.sol
│   │   ├── ERC721AUpgradeable.sol
│   │   ├── ERC721AVirtualApprove.sol
│   │   ├── ERC721AVirtualApproveUpgradeable.sol
│   │   ├── interface/
│   │   │   ├── IERC1155.sol
│   │   │   ├── IERC1155Enumerable.sol
│   │   │   ├── IERC1155Metadata.sol
│   │   │   ├── IERC1155Receiver.sol
│   │   │   ├── IERC1155Supply.sol
│   │   │   ├── IERC165.sol
│   │   │   ├── IERC20.sol
│   │   │   ├── IERC20Metadata.sol
│   │   │   ├── IERC20Permit.sol
│   │   │   ├── IERC2981.sol
│   │   │   ├── IERC4906.sol
│   │   │   ├── IERC721.sol
│   │   │   ├── IERC721A.sol
│   │   │   ├── IERC721Enumerable.sol
│   │   │   ├── IERC721Metadata.sol
│   │   │   ├── IERC721Receiver.sol
│   │   │   └── IERC721Supply.sol
│   │   └── queryable/
│   │       ├── ERC721AQueryable.sol
│   │       ├── ERC721AQueryableUpgradeable.sol
│   │       ├── ERC721AStorage.sol
│   │       ├── ERC721AUpgradeable.sol
│   │       ├── ERC721A__Initializable.sol
│   │       ├── ERC721A__InitializableStorage.sol
│   │       ├── IERC721AQueryable.sol
│   │       ├── IERC721AQueryableUpgradeable.sol
│   │       └── IERC721AUpgradeable.sol
│   ├── extension/
│   │   ├── AppURI.sol
│   │   ├── BatchMintMetadata.sol
│   │   ├── BurnToClaim.sol
│   │   ├── ContractMetadata.sol
│   │   ├── DelayedReveal.sol
│   │   ├── Drop.sol
│   │   ├── Drop1155.sol
│   │   ├── DropSinglePhase.sol
│   │   ├── DropSinglePhase1155.sol
│   │   ├── Initializable.sol
│   │   ├── LazyMint.sol
│   │   ├── LazyMintWithTier.sol
│   │   ├── Multicall.sol
│   │   ├── NFTMetadata.sol
│   │   ├── OperatorFilterToggle.sol
│   │   ├── OperatorFilterer.sol
│   │   ├── OperatorFiltererUpgradeable.sol
│   │   ├── Ownable.sol
│   │   ├── Permissions.sol
│   │   ├── PermissionsEnumerable.sol
│   │   ├── PlatformFee.sol
│   │   ├── PrimarySale.sol
│   │   ├── Proxy.sol
│   │   ├── ProxyForUpgradeable.sol
│   │   ├── Royalty.sol
│   │   ├── SeaportEIP1271.sol
│   │   ├── SeaportOrderParser.sol
│   │   ├── SharedMetadata.sol
│   │   ├── SignatureAction.sol
│   │   ├── SignatureActionUpgradeable.sol
│   │   ├── SignatureMintERC1155.sol
│   │   ├── SignatureMintERC1155Upgradeable.sol
│   │   ├── SignatureMintERC20.sol
│   │   ├── SignatureMintERC20Upgradeable.sol
│   │   ├── SignatureMintERC721.sol
│   │   ├── SignatureMintERC721Upgradeable.sol
│   │   ├── SoulboundERC721A.sol
│   │   ├── Staking1155.sol
│   │   ├── Staking1155Upgradeable.sol
│   │   ├── Staking20.sol
│   │   ├── Staking20Upgradeable.sol
│   │   ├── Staking721.sol
│   │   ├── Staking721Upgradeable.sol
│   │   ├── TokenBundle.sol
│   │   ├── TokenStore.sol
│   │   ├── Upgradeable.sol
│   │   ├── interface/
│   │   │   ├── IAccountPermissions.sol
│   │   │   ├── IAppURI.sol
│   │   │   ├── IBurnToClaim.sol
│   │   │   ├── IBurnableERC1155.sol
│   │   │   ├── IBurnableERC20.sol
│   │   │   ├── IBurnableERC721.sol
│   │   │   ├── IClaimCondition.sol
│   │   │   ├── IClaimConditionMultiPhase.sol
│   │   │   ├── IClaimConditionsSinglePhase.sol
│   │   │   ├── IClaimableERC1155.sol
│   │   │   ├── IClaimableERC721.sol
│   │   │   ├── IContractFactory.sol
│   │   │   ├── IContractMetadata.sol
│   │   │   ├── IDelayedReveal.sol
│   │   │   ├── IDelayedRevealDeprecated.sol
│   │   │   ├── IDrop.sol
│   │   │   ├── IDrop1155.sol
│   │   │   ├── IDropSinglePhase.sol
│   │   │   ├── IDropSinglePhase1155.sol
│   │   │   ├── IERC2771Context.sol
│   │   │   ├── ILazyMint.sol
│   │   │   ├── ILazyMintWithTier.sol
│   │   │   ├── IMintableERC1155.sol
│   │   │   ├── IMintableERC20.sol
│   │   │   ├── IMintableERC721.sol
│   │   │   ├── IMulticall.sol
│   │   │   ├── INFTMetadata.sol
│   │   │   ├── IOperatorFilterRegistry.sol
│   │   │   ├── IOperatorFilterToggle.sol
│   │   │   ├── IOwnable.sol
│   │   │   ├── IPermissions.sol
│   │   │   ├── IPermissionsEnumerable.sol
│   │   │   ├── IPlatformFee.sol
│   │   │   ├── IPrimarySale.sol
│   │   │   ├── IRoyalty.sol
│   │   │   ├── IRoyaltyEngineV1.sol
│   │   │   ├── IRoyaltyPayments.sol
│   │   │   ├── IRulesEngine.sol
│   │   │   ├── ISharedMetadata.sol
│   │   │   ├── ISharedMetadataBatch.sol
│   │   │   ├── ISignatureAction.sol
│   │   │   ├── ISignatureMintERC1155.sol
│   │   │   ├── ISignatureMintERC20.sol
│   │   │   ├── ISignatureMintERC721.sol
│   │   │   ├── IStaking1155.sol
│   │   │   ├── IStaking20.sol
│   │   │   ├── IStaking721.sol
│   │   │   ├── ITokenBundle.sol
│   │   │   └── plugin/
│   │   │       ├── IContext.sol
│   │   │       ├── IPluginMap.sol
│   │   │       └── IRouter.sol
│   │   ├── plugin/
│   │   │   ├── ContractMetadataLogic.sol
│   │   │   ├── ContractMetadataStorage.sol
│   │   │   ├── ERC2771ContextConsumer.sol
│   │   │   ├── ERC2771ContextLogic.sol
│   │   │   ├── ERC2771ContextStorage.sol
│   │   │   ├── ERC2771ContextUpgradeableLogic.sol
│   │   │   ├── ERC2771ContextUpgradeableStorage.sol
│   │   │   ├── PermissionsEnumerableLogic.sol
│   │   │   ├── PermissionsEnumerableStorage.sol
│   │   │   ├── PermissionsLogic.sol
│   │   │   ├── PermissionsStorage.sol
│   │   │   ├── PlatformFeeLogic.sol
│   │   │   ├── PlatformFeeStorage.sol
│   │   │   ├── PluginMap.sol
│   │   │   ├── ReentrancyGuardLogic.sol
│   │   │   ├── ReentrancyGuardStorage.sol
│   │   │   ├── Router.sol
│   │   │   ├── RouterImmutable.sol
│   │   │   └── RoyaltyPayments.sol
│   │   └── upgradeable/
│   │       ├── AccountPermissions.sol
│   │       ├── BatchMintMetadata.sol
│   │       ├── BurnToClaim.sol
│   │       ├── ContractMetadata.sol
│   │       ├── DelayedReveal.sol
│   │       ├── Drop.sol
│   │       ├── ERC2771Context.sol
│   │       ├── ERC2771ContextConsumer.sol
│   │       ├── ERC2771ContextUpgradeable.sol
│   │       ├── Initializable.sol
│   │       ├── LazyMint.sol
│   │       ├── OperatorFilterToggle.sol
│   │       ├── OperatorFiltererUpgradeable.sol
│   │       ├── Ownable.sol
│   │       ├── Permissions.sol
│   │       ├── PermissionsEnumerable.sol
│   │       ├── PlatformFee.sol
│   │       ├── PrimarySale.sol
│   │       ├── ReentrancyGuard.sol
│   │       ├── Royalty.sol
│   │       ├── RoyaltyPayments.sol
│   │       ├── RulesEngine.sol
│   │       ├── SharedMetadataBatch.sol
│   │       ├── impl/
│   │       │   ├── ContractMetadataImpl.sol
│   │       │   ├── MetaTx.sol
│   │       │   ├── PermissionsEnumerableImpl.sol
│   │       │   └── PlatformFeeImpl.sol
│   │       └── init/
│   │           ├── ContractMetadataInit.sol
│   │           ├── ERC2771ContextInit.sol
│   │           ├── ERC721AInit.sol
│   │           ├── ERC721AQueryableInit.sol
│   │           ├── OwnableInit.sol
│   │           ├── PermissionsEnumerableInit.sol
│   │           ├── PermissionsInit.sol
│   │           ├── PlatformFeeInit.sol
│   │           ├── PrimarySaleInit.sol
│   │           ├── ReentrancyGuardInit.sol
│   │           └── RoyaltyInit.sol
│   ├── external-deps/
│   │   └── openzeppelin/
│   │       ├── ERC1155PresetUpgradeable.sol
│   │       ├── cryptography/
│   │       │   └── EIP712ChainlessDomain.sol
│   │       ├── finance/
│   │       │   └── PaymentSplitterUpgradeable.sol
│   │       ├── governance/
│   │       │   └── utils/
│   │       │       └── IVotes.sol
│   │       ├── metatx/
│   │       │   ├── ERC2771Context.sol
│   │       │   └── ERC2771ContextUpgradeable.sol
│   │       ├── proxy/
│   │       │   ├── Clones.sol
│   │       │   ├── ERC1967/
│   │       │   │   ├── ERC1967Proxy.sol
│   │       │   │   └── ERC1967Upgrade.sol
│   │       │   ├── IERC1822Proxiable.sol
│   │       │   ├── Proxy.sol
│   │       │   ├── beacon/
│   │       │   │   └── IBeacon.sol
│   │       │   └── utils/
│   │       │       └── Initializable.sol
│   │       ├── security/
│   │       │   ├── ReentrancyGuard.sol
│   │       │   └── ReentrancyGuardUpgradeable.sol
│   │       ├── token/
│   │       │   ├── ERC1155/
│   │       │   │   ├── IERC1155Receiver.sol
│   │       │   │   └── utils/
│   │       │   │       ├── ERC1155Holder.sol
│   │       │   │       └── ERC1155Receiver.sol
│   │       │   ├── ERC20/
│   │       │   │   ├── ERC20.sol
│   │       │   │   ├── extensions/
│   │       │   │   │   ├── ERC20Permit.sol
│   │       │   │   │   └── ERC20Votes.sol
│   │       │   │   └── utils/
│   │       │   │       └── SafeERC20.sol
│   │       │   └── ERC721/
│   │       │       ├── IERC721Receiver.sol
│   │       │       └── utils/
│   │       │           └── ERC721Holder.sol
│   │       └── utils/
│   │           ├── Base64.sol
│   │           ├── Context.sol
│   │           ├── Counters.sol
│   │           ├── Create2.sol
│   │           ├── ERC1155/
│   │           │   ├── ERC1155Holder.sol
│   │           │   └── ERC1155Receiver.sol
│   │           ├── ERC721/
│   │           │   └── ERC721Holder.sol
│   │           ├── EnumerableSet.sol
│   │           ├── cryptography/
│   │           │   ├── ECDSA.sol
│   │           │   └── EIP712.sol
│   │           ├── math/
│   │           │   ├── Math.sol
│   │           │   ├── SafeCast.sol
│   │           │   └── SafeMath.sol
│   │           └── structs/
│   │               └── EnumerableSet.sol
│   ├── infra/
│   │   ├── ContractPublisher.sol
│   │   ├── TWFactory.sol
│   │   ├── TWFee.sol
│   │   ├── TWMinimalFactory.sol
│   │   ├── TWMultichainRegistry.sol
│   │   ├── TWProxy.sol
│   │   ├── TWRegistry.sol
│   │   ├── TWStatelessFactory.sol
│   │   ├── forwarder/
│   │   │   ├── Forwarder.sol
│   │   │   ├── ForwarderChainlessDomain.sol
│   │   │   └── ForwarderConsumer.sol
│   │   ├── interface/
│   │   │   ├── IContractDeployer.sol
│   │   │   ├── IContractPublisher.sol
│   │   │   ├── ITWFee.sol
│   │   │   ├── ITWMultichainRegistry.sol
│   │   │   ├── ITWRegistry.sol
│   │   │   ├── IThirdwebContract.sol
│   │   │   └── IWETH.sol
│   │   └── registry/
│   │       ├── entrypoint/
│   │       │   └── TWMultichainRegistryRouter.sol
│   │       └── registry-extension/
│   │           ├── TWMultichainRegistryLogic.sol
│   │           └── TWMultichainRegistryStorage.sol
│   ├── lib/
│   │   ├── Address.sol
│   │   ├── BitMaps.sol
│   │   ├── BytesLib.sol
│   │   ├── CurrencyTransferLib.sol
│   │   ├── FeeType.sol
│   │   ├── MerkleProof.sol
│   │   ├── NFTMetadataRenderer.sol
│   │   ├── StorageSlot.sol
│   │   ├── StringSet.sol
│   │   └── Strings.sol
│   ├── package.json
│   └── prebuilts/
│       ├── account/
│       │   ├── dynamic/
│       │   │   ├── DynamicAccount.sol
│       │   │   └── DynamicAccountFactory.sol
│       │   ├── interfaces/
│       │   │   ├── IAccount.sol
│       │   │   ├── IAccountCore.sol
│       │   │   ├── IAccountExecute.sol
│       │   │   ├── IAccountFactory.sol
│       │   │   ├── IAccountFactoryCore.sol
│       │   │   ├── IAggregator.sol
│       │   │   ├── IEntryPoint.sol
│       │   │   ├── INonceManager.sol
│       │   │   ├── IOracle.sol
│       │   │   ├── IPaymaster.sol
│       │   │   ├── IStakeManager.sol
│       │   │   └── PackedUserOperation.sol
│       │   ├── managed/
│       │   │   ├── ManagedAccount.sol
│       │   │   └── ManagedAccountFactory.sol
│       │   ├── non-upgradeable/
│       │   │   ├── Account.sol
│       │   │   └── AccountFactory.sol
│       │   ├── token-bound-account/
│       │   │   ├── TokenBoundAccount.sol
│       │   │   └── erc6551-utils/
│       │   │       ├── ERC6551AccountLib.sol
│       │   │       ├── ERC6551BytecodeLib.sol
│       │   │       └── IERC6551Account.sol
│       │   ├── token-paymaster/
│       │   │   ├── BasePaymaster.sol
│       │   │   └── TokenPaymaster.sol
│       │   └── utils/
│       │       ├── AccountCore.sol
│       │       ├── AccountCoreStorage.sol
│       │       ├── AccountExtension.sol
│       │       ├── AccountSeaportBulkSigSupport.sol
│       │       ├── BaseAccount.sol
│       │       ├── BaseAccountFactory.sol
│       │       ├── EntryPoint.sol
│       │       ├── Exec.sol
│       │       ├── Helpers.sol
│       │       ├── NonceManager.sol
│       │       ├── OracleHelper.sol
│       │       ├── SenderCreator.sol
│       │       ├── StakeManager.sol
│       │       ├── TokenCallbackHandler.sol
│       │       ├── UniswapHelper.sol
│       │       └── UserOperationLib.sol
│       ├── airdrop/
│       │   └── Airdrop.sol
│       ├── drop/
│       │   ├── DropERC1155.sol
│       │   ├── DropERC20.sol
│       │   ├── DropERC721.sol
│       │   ├── DropERC721C.sol
│       │   └── drop.md
│       ├── evolving-nfts/
│       │   ├── EvolvingNFT.sol
│       │   ├── EvolvingNFTLogic.sol
│       │   └── extension/
│       │       └── RulesEngineExtension.sol
│       ├── interface/
│       │   ├── ILoyaltyCard.sol
│       │   ├── ILoyaltyPoints.sol
│       │   ├── IMultiwrap.sol
│       │   ├── IPack.sol
│       │   ├── IPackVRFDirect.sol
│       │   ├── airdrop/
│       │   │   ├── IAirdropERC1155.sol
│       │   │   ├── IAirdropERC1155Claimable.sol
│       │   │   ├── IAirdropERC20.sol
│       │   │   ├── IAirdropERC20Claimable.sol
│       │   │   ├── IAirdropERC721.sol
│       │   │   └── IAirdropERC721Claimable.sol
│       │   ├── drop/
│       │   │   ├── IDropClaimCondition.sol
│       │   │   ├── IDropERC1155.sol
│       │   │   ├── IDropERC20.sol
│       │   │   └── IDropERC721.sol
│       │   ├── marketplace/
│       │   │   └── IMarketplace.sol
│       │   ├── staking/
│       │   │   ├── IEditionStake.sol
│       │   │   ├── INFTStake.sol
│       │   │   └── ITokenStake.sol
│       │   └── token/
│       │       ├── ITokenERC1155.sol
│       │       ├── ITokenERC20.sol
│       │       └── ITokenERC721.sol
│       ├── loyalty/
│       │   └── LoyaltyCard.sol
│       ├── marketplace/
│       │   ├── IMarketplace.sol
│       │   ├── direct-listings/
│       │   │   ├── DirectListingsLogic.sol
│       │   │   └── DirectListingsStorage.sol
│       │   ├── english-auctions/
│       │   │   ├── EnglishAuctionsLogic.sol
│       │   │   └── EnglishAuctionsStorage.sol
│       │   ├── entrypoint/
│       │   │   └── MarketplaceV3.sol
│       │   ├── marketplace-v3.md
│       │   └── offers/
│       │       ├── OffersLogic.sol
│       │       └── OffersStorage.sol
│       ├── marketplace-legacy/
│       │   ├── Marketplace.sol
│       │   └── marketplace.md
│       ├── multiwrap/
│       │   ├── Multiwrap.sol
│       │   └── multiwrap.md
│       ├── open-edition/
│       │   ├── OpenEditionERC721.sol
│       │   └── OpenEditionERC721FlatFee.sol
│       ├── split/
│       │   └── Split.sol
│       ├── staking/
│       │   ├── EditionStake.sol
│       │   ├── NFTStake.sol
│       │   └── TokenStake.sol
│       ├── token/
│       │   ├── TokenERC1155.sol
│       │   ├── TokenERC20.sol
│       │   ├── TokenERC721.sol
│       │   └── signatureMint.md
│       ├── unaudited/
│       │   ├── airdrop/
│       │   │   ├── AirdropERC1155.sol
│       │   │   ├── AirdropERC1155Claimable.sol
│       │   │   ├── AirdropERC20.sol
│       │   │   ├── AirdropERC20Claimable.sol
│       │   │   ├── AirdropERC721.sol
│       │   │   └── AirdropERC721Claimable.sol
│       │   ├── burn-to-claim-drop/
│       │   │   ├── BurnToClaimDropERC721.sol
│       │   │   └── extension/
│       │   │       ├── BurnToClaimDrop721Logic.sol
│       │   │       └── BurnToClaimDrop721Storage.sol
│       │   ├── contract-builder/
│       │   │   ├── CoreRouter.sol
│       │   │   └── extension/
│       │   │       └── PermissionOverride.sol
│       │   └── loyalty/
│       │       └── LoyaltyPoints.sol
│       └── vote/
│           └── VoteERC20.sol
├── foundry.toml
├── funding.json
├── gasreport.txt
├── package.json
├── release.sh
├── scripts/
│   ├── deploy-prebuilt-deterministic/
│   │   ├── bootstrap-on-a-chain.ts
│   │   ├── bootstrap-verify.ts
│   │   ├── constants.ts
│   │   ├── deploy-deterministic-std-chains.ts
│   │   └── verify.ts
│   ├── package-release.ts
│   └── release/
│       ├── add_implementations_from_release.ts
│       ├── approve_implementations_from_release.ts
│       └── constants.ts
├── slither.config.json
├── src/
│   └── test/
│       ├── ContractPublisher.t.sol
│       ├── EvolvingNFT.t.sol
│       ├── Forwarder.t.sol
│       ├── ForwarderChainlessDomain.t.sol
│       ├── LoyaltyCard.t.sol
│       ├── LoyaltyPoints.t.sol
│       ├── Multicall.t.sol
│       ├── Multiwrap.t.sol
│       ├── OpenEditionERC721.t.sol
│       ├── OpenEditionERC721FlatFee.t.sol
│       ├── TWFactory.t.sol
│       ├── TWMultichainRegistry.t.sol
│       ├── TWRegistry.t.sol
│       ├── airdrop/
│       │   ├── Airdrop.t.sol
│       │   ├── AirdropERC1155.t.sol
│       │   ├── AirdropERC1155Claimable.t.sol
│       │   ├── AirdropERC20.t.sol
│       │   ├── AirdropERC20Claimable.t.sol
│       │   ├── AirdropERC721.t.sol
│       │   └── AirdropERC721Claimable.t.sol
│       ├── benchmark/
│       │   ├── AccountBenchmark.t.sol
│       │   ├── AirdropBenchmark.t.sol
│       │   ├── AirdropERC1155Benchmark.t.sol
│       │   ├── AirdropERC20Benchmark.t.sol
│       │   ├── AirdropERC721Benchmark.t.sol
│       │   ├── DropERC1155Benchmark.t.sol
│       │   ├── DropERC20Benchmark.t.sol
│       │   ├── DropERC721Benchmark.t.sol
│       │   ├── EditionStakeBenchmark.t.sol
│       │   ├── MultiwrapBenchmark.t.sol
│       │   ├── NFTStakeBenchmark.t.sol
│       │   ├── TokenERC1155Benchmark.t.sol
│       │   ├── TokenERC20Benchmark.t.sol
│       │   ├── TokenERC721Benchmark.t.sol
│       │   └── TokenStakeBenchmark.t.sol
│       ├── burn-to-claim-drop/
│       │   └── BurnToClaimDropERC721.t.sol
│       ├── burn-to-claim-drop-BTT/
│       │   ├── BurnToClaimDropERC721.t.sol
│       │   ├── logic/
│       │   │   ├── burn-and-claim/
│       │   │   │   ├── burnAndClaim.t.sol
│       │   │   │   └── burnAndClaim.tree
│       │   │   ├── lazy-mint/
│       │   │   │   ├── lazyMint.t.sol
│       │   │   │   └── lazyMint.tree
│       │   │   ├── other-functions/
│       │   │   │   ├── other.t.sol
│       │   │   │   └── other.tree
│       │   │   └── reveal/
│       │   │       ├── reveal.t.sol
│       │   │       └── reveal.tree
│       │   └── router/
│       │       ├── initialize/
│       │       │   ├── initialize.t.sol
│       │       │   └── initialize.tree
│       │       └── other-functions/
│       │           ├── other.t.sol
│       │           └── other.tree
│       ├── drop/
│       │   ├── DropERC1155.t.sol
│       │   ├── DropERC20.t.sol
│       │   ├── DropERC721.t.sol
│       │   ├── drop-erc1155/
│       │   │   ├── _beforeClaim/
│       │   │   │   ├── _beforeClaim.t.sol
│       │   │   │   └── _beforeClaim.tree
│       │   │   ├── _beforeTokenTransfer/
│       │   │   │   ├── _beforeTokenTransfer.sol
│       │   │   │   └── _beforeTokenTransfer.tree
│       │   │   ├── _canSetFunctions/
│       │   │   │   ├── _canSetFunctions.sol
│       │   │   │   └── _canSetFunctions.tree
│       │   │   ├── burnBatch/
│       │   │   │   ├── burnBatch.t.sol
│       │   │   │   └── burnBatch.tree
│       │   │   ├── collectPriceOnClaim/
│       │   │   │   ├── collectPriceOnClaim.t.sol
│       │   │   │   └── collectPriceOnClaim.tree
│       │   │   ├── freezeBatchBaseURI/
│       │   │   │   ├── freezeBatchBaseURI.t.sol
│       │   │   │   └── freezeBatchBaseURI.tree
│       │   │   ├── initialize/
│       │   │   │   ├── initialize.t.sol
│       │   │   │   └── initialize.tree
│       │   │   ├── miscellaneous/
│       │   │   │   ├── miscellaneous.t.sol
│       │   │   │   └── miscellaneous.tree
│       │   │   ├── setMaxTotalSupply/
│       │   │   │   ├── setMaxTotalSupply.t.sol
│       │   │   │   └── setMaxTotalSupply.tree
│       │   │   ├── setSaleRecipientForToken/
│       │   │   │   ├── setSaleRecipientForToken.t.sol
│       │   │   │   └── setSaleRecipientForToken.tree
│       │   │   ├── transferTokensOnClaim/
│       │   │   │   ├── transferTokensOnClaim.t.sol
│       │   │   │   └── transferTokensOnClaim.tree
│       │   │   └── updateBatchBaseURI/
│       │   │       ├── updateBatchBaseURI.t.sol
│       │   │       └── updateBatchBaseURI.tree
│       │   ├── drop-erc20/
│       │   │   ├── _beforeClaim/
│       │   │   │   ├── _beforeClaim.t.sol
│       │   │   │   └── _beforeClaim.tree
│       │   │   ├── _canSetFunctions/
│       │   │   │   ├── _canSetFunctions.t.sol
│       │   │   │   └── _canSetFunctions.tree
│       │   │   ├── _collectPriceOnClaim/
│       │   │   │   ├── _collectPriceOnClaim.t.sol
│       │   │   │   └── _collectPriceOnClaim.tree
│       │   │   ├── initialize/
│       │   │   │   ├── initialize.t.sol
│       │   │   │   └── intialize.tree
│       │   │   ├── miscellaneous/
│       │   │   │   ├── miscellaneous.t.sol
│       │   │   │   └── miscellaneous.tree
│       │   │   └── setMaxTotalSupply/
│       │   │       ├── setMaxTotalSupply.t.sol
│       │   │       └── setMaxTotalSupply.tree
│       │   └── drop-erc721/
│       │       ├── _beforeClaim/
│       │       │   ├── _beforeClaim.t.sol
│       │       │   └── _beforeClaim.tree
│       │       ├── _canSetFunctions/
│       │       │   ├── _canSetFunctions.t.sol
│       │       │   └── _canSetFunctions.tree
│       │       ├── _collectPriceOnClaim/
│       │       │   ├── _collectPriceOnClaim.t.sol
│       │       │   └── _collectPriceOnClaim.tree
│       │       ├── _transferTokensOnClaim/
│       │       │   ├── _tranferTokensOnClaim.tree
│       │       │   └── _transferTokensOnClaim.t.sol
│       │       ├── freezeBatchBaseURI/
│       │       │   ├── freezeBatchBaseURI.t.sol
│       │       │   └── freezeBatchBaseURI.tree
│       │       ├── initalizer/
│       │       │   ├── initializer.t.sol
│       │       │   └── initializer.tree
│       │       ├── lazyMint/
│       │       │   ├── lazyMint.t.sol
│       │       │   └── lazyMint.tree
│       │       ├── miscellaneous/
│       │       │   ├── miscellaneous.t.sol
│       │       │   └── miscellaneous.tree
│       │       ├── reveal/
│       │       │   ├── reveal.t.sol
│       │       │   └── reveal.tree
│       │       ├── setMaxTotalSupply/
│       │       │   ├── setMaxTotalSupply.t.sol
│       │       │   └── setMaxTotalSupply.tree
│       │       └── updateBatchBaseURI/
│       │           ├── updateBatchBaseURI.t.sol
│       │           └── updateBatchBaseURI.tree
│       ├── marketplace/
│       │   ├── DirectListings.t.sol
│       │   ├── EnglishAuctions.t.sol
│       │   ├── Offers.t.sol
│       │   ├── direct-listings/
│       │   │   ├── _payout/
│       │   │   │   ├── _payout.t.sol
│       │   │   │   └── _payout.tree
│       │   │   ├── _transferListingTokens/
│       │   │   │   ├── _transferListingTokens.t.sol
│       │   │   │   └── _transferListingTokens.tree
│       │   │   ├── _validateERC20BalAndAllowance/
│       │   │   │   ├── _validateERC20BalAndAllowance.t.sol
│       │   │   │   └── _validateERC20BalAndAllowance.tree
│       │   │   ├── _validateNewListing/
│       │   │   │   ├── _validateNewListing.t.sol
│       │   │   │   └── _validateNewListing.tree
│       │   │   ├── _validateOwnershipAndApproval/
│       │   │   │   ├── _validateOwnershipAndApproval.t.sol
│       │   │   │   └── _validateOwnershipAndApproval.tree
│       │   │   ├── approveBuyerForListing/
│       │   │   │   ├── approveBuyerForListing.t.sol
│       │   │   │   └── approveBuyerForListing.tree
│       │   │   ├── approveCurrencyForListing/
│       │   │   │   ├── approveCurrencyForListing.t.sol
│       │   │   │   └── approveCurrencyForListing.tree
│       │   │   ├── buyFromListing/
│       │   │   │   ├── buyFromListing.t.sol
│       │   │   │   └── buyFromListing.tree
│       │   │   ├── cancelListing/
│       │   │   │   ├── cancelListing.t.sol
│       │   │   │   └── cancelListing.tree
│       │   │   ├── createListing/
│       │   │   │   ├── createListing.t.sol
│       │   │   │   └── createListing.tree
│       │   │   └── updateListing/
│       │   │       ├── updateListing.t.sol
│       │   │       └── updateListing.tree
│       │   └── english-auctions/
│       │       ├── _payout/
│       │       │   ├── _payout.t.sol
│       │       │   └── _payout.tree
│       │       ├── _transferAuctionTokens/
│       │       │   ├── _transferAuctionTokens.t.sol
│       │       │   └── _transferAuctionTokens.tree
│       │       ├── _validateNewAuction/
│       │       │   ├── _validateNewAuction.t.sol
│       │       │   └── _validateNewAuction.tree
│       │       ├── bidInAuction/
│       │       │   ├── bidInAuction.t.sol
│       │       │   └── bidInAuction.tree
│       │       ├── cancelAuction/
│       │       │   ├── cancelAuction.t.sol
│       │       │   └── cancelAuction.tree
│       │       ├── collectAuctionPayout/
│       │       │   ├── collectAuctionPayout.t.sol
│       │       │   └── collectAuctionPayout.tree
│       │       ├── collectAuctionTokens/
│       │       │   ├── collectAuctionTokens.t.sol
│       │       │   └── collectAuctionTokens.tree
│       │       └── createAuction/
│       │           ├── createAuction.t.sol
│       │           └── createAuction.tree
│       ├── minimal-factory/
│       │   └── MinimalFactory.t.sol
│       ├── mocks/
│       │   ├── Mock.sol
│       │   ├── MockContractPublisher.sol
│       │   ├── MockERC1155.sol
│       │   ├── MockERC1155NonBurnable.sol
│       │   ├── MockERC20.sol
│       │   ├── MockERC20CustomDecimals.sol
│       │   ├── MockERC20NonCompliant.sol
│       │   ├── MockERC721.sol
│       │   ├── MockERC721NonBurnable.sol
│       │   ├── MockRoyaltyEngineV1.sol
│       │   ├── MockThirdwebContract.sol
│       │   ├── TestOracle2.sol
│       │   ├── TestUniswap.sol
│       │   └── WETH9.sol
│       ├── open-edition/
│       │   ├── _beforeTokenTransfers/
│       │   │   ├── _beforeTokenTransfers.t.sol
│       │   │   └── _beforeTokenTransfers.tree
│       │   ├── _canSetFunctions/
│       │   │   ├── _canSetFunctions.t.sol
│       │   │   └── _canSetFunctions.tree
│       │   ├── _collectPriceOnClaim/
│       │   │   ├── _collectPriceOnClaim.t.sol
│       │   │   └── _collectPriceOnClaim.tree
│       │   ├── _transferTokensOnClaim/
│       │   │   ├── _transferTokensOnClaim.t.sol
│       │   │   └── _transferTokensOnClaim.tree
│       │   ├── initialize/
│       │   │   ├── initialize.t.sol
│       │   │   └── initialize.tree
│       │   └── misc/
│       │       ├── misc.t.sol
│       │       └── misc.tree
│       ├── open-edition-flat-fee/
│       │   ├── _beforeTokenTransfers/
│       │   │   ├── _beforeTokenTransfers.t.sol
│       │   │   └── _beforeTokenTransfers.tree
│       │   ├── _canSetFunctions/
│       │   │   ├── _canSetFunctions.t.sol
│       │   │   └── _canSetFunctions.tree
│       │   ├── _collectPriceOnClaim/
│       │   │   ├── _collectPriceOnClaim.t.sol
│       │   │   └── _collectPriceOnClaim.tree
│       │   ├── _transferTokensOnClaim/
│       │   │   ├── _transferTokensOnClaim.t.sol
│       │   │   └── _transferTokensOnClaim.tree
│       │   ├── initialize/
│       │   │   ├── initialize.t.sol
│       │   │   └── initialize.tree
│       │   └── misc/
│       │       ├── misc.t.sol
│       │       └── misc.tree
│       ├── plugin/
│       │   ├── Map.t.sol
│       │   ├── Router.t.sol
│       │   └── RouterImmutable.t.sol
│       ├── scripts/
│       │   ├── generateRoot.ts
│       │   ├── generateRootAirdrop.ts
│       │   ├── generateRootAirdrop1155.ts
│       │   ├── getCloneAddress.ts
│       │   ├── getProof.ts
│       │   ├── getProofAirdrop.ts
│       │   └── getProofAirdrop1155.ts
│       ├── sdk/
│       │   ├── base/
│       │   │   ├── BaseUtilTest.sol
│       │   │   ├── ERC1155Base.t.sol
│       │   │   ├── ERC1155DelayedReveal.t.sol
│       │   │   ├── ERC1155Drop.t.sol
│       │   │   ├── ERC1155LazyMint.t.sol
│       │   │   ├── ERC1155SignatureMint.t.sol
│       │   │   ├── ERC20Base.t.sol
│       │   │   ├── ERC20Drop.t.sol
│       │   │   ├── ERC20DropVote.t.sol
│       │   │   ├── ERC20SignatureMint.t.sol
│       │   │   ├── ERC20SignatureMintVote.t.sol
│       │   │   ├── ERC20Vote.t.sol
│       │   │   ├── ERC721Base.t.sol
│       │   │   ├── ERC721DelayedReveal.t.sol
│       │   │   ├── ERC721Drop.t.sol
│       │   │   ├── ERC721LazyMint.t.sol
│       │   │   ├── ERC721Multiwrap.t.sol
│       │   │   └── ERC721SignatureMint.t.sol
│       │   └── extension/
│       │       ├── BatchMintMetadata.t.sol
│       │       ├── ContractMetadata.t.sol
│       │       ├── DelayedReveal.t.sol
│       │       ├── DropSinglePhase.t.sol
│       │       ├── DropSinglePhase1155.t.sol
│       │       ├── ExtensionUtilTest.sol
│       │       ├── LazyMint.t.sol
│       │       ├── NFTMetadata.t.sol
│       │       ├── Ownable.t.sol
│       │       ├── Permissions.t.sol
│       │       ├── PermissionsEnumerable.t.sol
│       │       ├── PlatformFee.t.sol
│       │       ├── PrimarySale.t.sol
│       │       ├── Royalty.t.sol
│       │       ├── SignatureMintERC1155.t.sol
│       │       ├── SignatureMintERC20.t.sol
│       │       ├── SignatureMintERC721.t.sol
│       │       ├── StakingExtension.t.sol
│       │       ├── TokenBundle.t.sol
│       │       ├── TokenStore.t.sol
│       │       ├── batch-mint-metadata/
│       │       │   ├── batch-mint-metadata/
│       │       │   │   ├── _batchMintMetadata.t.sol
│       │       │   │   └── _batchMintMetadata.tree
│       │       │   ├── freeze-base-uri/
│       │       │   │   ├── _freezeBaseURI.t.sol
│       │       │   │   └── _freezeBaseURI.tree
│       │       │   ├── get-base-uri/
│       │       │   │   ├── _getBaseURI.t.sol
│       │       │   │   └── _getBaseURI.tree
│       │       │   ├── get-batch-id/
│       │       │   │   ├── _getBatchId.t.sol
│       │       │   │   └── _getBatchId.tree
│       │       │   ├── get-batch-start-id/
│       │       │   │   ├── _getBatchStartId.t.sol
│       │       │   │   └── _getBatchStartId.tree
│       │       │   └── set-base-uri/
│       │       │       ├── _setBaseURI.t.sol
│       │       │       └── _setBaseURI.tree
│       │       ├── burn-to-claim/
│       │       │   ├── burn-tokens-on-origin/
│       │       │   │   ├── _burnTokensOnOrigin.t.sol
│       │       │   │   └── _burnTokensOnOrigin.tree
│       │       │   ├── set-burn-to-claim-info/
│       │       │   │   ├── setBurnToClaimInfo.t.sol
│       │       │   │   └── setBurnToClaimInfo.tree
│       │       │   └── verify-burn-to-claim/
│       │       │       ├── verifyBurnToClaim.t.sol
│       │       │       └── verifyBurnToClaim.tree
│       │       ├── contract-metadata/
│       │       │   └── set-contract-uri/
│       │       │       ├── setContractURI.t.sol
│       │       │       └── setContractURI.tree
│       │       ├── delayed-reveal/
│       │       │   ├── get-reveal-uri/
│       │       │   │   ├── getRevealURI.t.sol
│       │       │   │   └── getRevealURI.tree
│       │       │   └── set-encrypted-data/
│       │       │       ├── _setEncryptedData.t.sol
│       │       │       └── _setEncryptedData.tree
│       │       ├── drop/
│       │       │   ├── claim/
│       │       │   │   ├── claim.t.sol
│       │       │   │   └── claim.tree
│       │       │   ├── get-active-claim-condition-id/
│       │       │   │   ├── getActiveClaimConditionId.t.sol
│       │       │   │   └── getActiveClaimConditionId.tree
│       │       │   ├── set-claim-conditions/
│       │       │   │   ├── setClaimConditions.t.sol
│       │       │   │   └── setClaimConditions.tree
│       │       │   └── verify-claim/
│       │       │       ├── verifyClaim.t.sol
│       │       │       └── verifyClaim.tree
│       │       ├── lazy-mint/
│       │       │   └── lazy-mint/
│       │       │       ├── lazyMint.t.sol
│       │       │       └── lazyMint.tree
│       │       ├── ownable/
│       │       │   └── set-owner/
│       │       │       ├── setOwner.t.sol
│       │       │       └── setOwner.tree
│       │       ├── royalty/
│       │       │   ├── set-default-royalty-info/
│       │       │   │   ├── setDefaultRoyaltyInfo.t.sol
│       │       │   │   └── setDefaultRoyaltyInfo.tree
│       │       │   └── set-royalty-info-for-token/
│       │       │       ├── setRoyaltyInfoForToken.t.sol
│       │       │       └── setRoyaltyInfoForToken.tree
│       │       └── upgradeable/
│       │           ├── batch-mint-metadata/
│       │           │   ├── batch-mint-metadata/
│       │           │   │   ├── _batchMintMetadata.t.sol
│       │           │   │   └── _batchMintMetadata.tree
│       │           │   ├── freeze-base-uri/
│       │           │   │   ├── _freezeBaseURI.t.sol
│       │           │   │   └── _freezeBaseURI.tree
│       │           │   ├── get-base-uri/
│       │           │   │   ├── _getBaseURI.t.sol
│       │           │   │   └── _getBaseURI.tree
│       │           │   ├── get-batch-id/
│       │           │   │   ├── _getBatchId.t.sol
│       │           │   │   └── _getBatchId.tree
│       │           │   ├── get-batch-start-id/
│       │           │   │   ├── _getBatchStartId.t.sol
│       │           │   │   └── _getBatchStartId.tree
│       │           │   └── set-base-uri/
│       │           │       ├── _setBaseURI.t.sol
│       │           │       └── _setBaseURI.tree
│       │           ├── burn-to-claim/
│       │           │   ├── burn-tokens-on-origin/
│       │           │   │   ├── _burnTokensOnOrigin.t.sol
│       │           │   │   └── _burnTokensOnOrigin.tree
│       │           │   ├── set-burn-to-claim-info/
│       │           │   │   ├── setBurnToClaimInfo.t.sol
│       │           │   │   └── setBurnToClaimInfo.tree
│       │           │   └── verify-burn-to-claim/
│       │           │       ├── verifyBurnToClaim.t.sol
│       │           │       └── verifyBurnToClaim.tree
│       │           ├── contract-metadata/
│       │           │   └── set-contract-uri/
│       │           │       ├── setContractURI.t.sol
│       │           │       └── setContractURI.tree
│       │           ├── delayed-reveal/
│       │           │   ├── get-reveal-uri/
│       │           │   │   ├── getRevealURI.t.sol
│       │           │   │   └── getRevealURI.tree
│       │           │   └── set-encrypted-data/
│       │           │       ├── _setEncryptedData.t.sol
│       │           │       └── _setEncryptedData.tree
│       │           ├── drop/
│       │           │   ├── claim/
│       │           │   │   ├── claim.t.sol
│       │           │   │   └── claim.tree
│       │           │   ├── get-active-claim-condition-id/
│       │           │   │   ├── getActiveClaimConditionId.t.sol
│       │           │   │   └── getActiveClaimConditionId.tree
│       │           │   ├── set-claim-conditions/
│       │           │   │   ├── setClaimConditions.t.sol
│       │           │   │   └── setClaimConditions.tree
│       │           │   └── verify-claim/
│       │           │       ├── verifyClaim.t.sol
│       │           │       └── verifyClaim.tree
│       │           ├── lazy-mint/
│       │           │   └── lazy-mint/
│       │           │       ├── lazyMint.t.sol
│       │           │       └── lazyMint.tree
│       │           ├── ownable/
│       │           │   └── set-owner/
│       │           │       ├── setOwner.t.sol
│       │           │       └── setOwner.tree
│       │           └── royalty/
│       │               ├── set-default-royalty-info/
│       │               │   ├── setDefaultRoyaltyInfo.t.sol
│       │               │   └── setDefaultRoyaltyInfo.tree
│       │               └── set-royalty-info-for-token/
│       │                   ├── setRoyaltyInfoForToken.t.sol
│       │                   └── setRoyaltyInfoForToken.tree
│       ├── smart-wallet/
│       │   ├── Account.t.sol
│       │   ├── AccountVulnPOC.t.sol
│       │   ├── DynamicAccount.t.sol
│       │   ├── ManagedAccount.t.sol
│       │   ├── account-core/
│       │   │   ├── isValidSigner.t.sol
│       │   │   └── isValidSigner.tree
│       │   ├── account-permissions/
│       │   │   ├── setPermissionsForSigner.t.sol
│       │   │   └── setPermissionsForSigner.tree
│       │   ├── token-paymaster/
│       │   │   └── TokenPaymaster.t.sol
│       │   └── utils/
│       │       ├── AABenchmarkArtifacts.sol
│       │       ├── AABenchmarkPrepare.sol
│       │       ├── AABenchmarkTest.t.sol
│       │       ├── AATestArtifacts.sol
│       │       ├── AATestBase.sol
│       │       ├── BasePaymaster.sol
│       │       ├── MessageHashUtils.sol
│       │       └── VerifyingPaymaster.sol
│       ├── split-BTT/
│       │   ├── distribute-erc20/
│       │   │   ├── distribute.t.sol
│       │   │   └── distribute.tree
│       │   ├── distribute-native-token/
│       │   │   ├── distribute.t.sol
│       │   │   └── distribute.tree
│       │   ├── initialize/
│       │   │   ├── initialize.t.sol
│       │   │   └── initialize.tree
│       │   ├── other-functions/
│       │   │   ├── other.t.sol
│       │   │   └── other.tree
│       │   ├── release-erc20/
│       │   │   ├── release.t.sol
│       │   │   └── release.tree
│       │   ├── release-native-token/
│       │   │   ├── release.t.sol
│       │   │   └── release.tree
│       │   └── set-contract-uri/
│       │       ├── setContractURI.t.sol
│       │       └── setContractURI.tree
│       ├── staking/
│       │   ├── EditionStake.t.sol
│       │   ├── EditionStake_EthReward.t.sol
│       │   ├── NFTStake.t.sol
│       │   ├── NFTStake_EthReward.t.sol
│       │   ├── TokenStake.t.sol
│       │   ├── TokenStake_EthReward.t.sol
│       │   └── TokenStake_EthStake.t.sol
│       ├── token/
│       │   ├── TokenERC1155.t.sol
│       │   ├── TokenERC20.t.sol
│       │   └── TokenERC721.t.sol
│       ├── tokenerc1155-BTT/
│       │   ├── burn/
│       │   │   ├── burn.t.sol
│       │   │   └── burn.tree
│       │   ├── burn-batch/
│       │   │   ├── burnBatch.t.sol
│       │   │   └── burnBatch.tree
│       │   ├── initialize/
│       │   │   ├── initialize.t.sol
│       │   │   └── initialize.tree
│       │   ├── mint-to/
│       │   │   ├── mintTo.t.sol
│       │   │   └── mintTo.tree
│       │   ├── mint-with-signature/
│       │   │   ├── mintWithSignature.t.sol
│       │   │   └── mintWithSignature.tree
│       │   ├── other-functions/
│       │   │   ├── other.t.sol
│       │   │   └── other.tree
│       │   ├── owner/
│       │   │   ├── owner.t.sol
│       │   │   └── owner.tree
│       │   ├── set-contract-uri/
│       │   │   ├── setContractURI.t.sol
│       │   │   └── setContractURI.tree
│       │   ├── set-default-royalty-info/
│       │   │   ├── setDefaultRoyaltyInfo.t.sol
│       │   │   └── setDefaultRoyaltyInfo.tree
│       │   ├── set-flat-platform-fee-info/
│       │   │   ├── setFlatPlatformFeeInfo.t.sol
│       │   │   └── setFlatPlatformFeeInfo.tree
│       │   ├── set-owner/
│       │   │   ├── setOwner.t.sol
│       │   │   └── setOwner.tree
│       │   ├── set-platform-fee-info/
│       │   │   ├── setPlatformFeeInfo.t.sol
│       │   │   └── setPlatformFeeInfo.tree
│       │   ├── set-platform-fee-type/
│       │   │   ├── setPlatformFeeType.t.sol
│       │   │   └── setPlatformFeeType.tree
│       │   ├── set-primary-sale-recipient/
│       │   │   ├── setPrimarySaleRecipient.t.sol
│       │   │   └── setPrimarySaleRecipient.tree
│       │   ├── set-royalty-info-for-token/
│       │   │   ├── setRoyaltyInfoForToken.t.sol
│       │   │   └── setRoyaltyInfoForToken.tree
│       │   ├── uri/
│       │   │   ├── tokenURI.t.sol
│       │   │   └── tokenURI.tree
│       │   └── verify/
│       │       ├── verify.t.sol
│       │       └── verify.tree
│       ├── tokenerc20-BTT/
│       │   ├── initialize/
│       │   │   ├── initialize.t.sol
│       │   │   └── initialize.tree
│       │   ├── mint-to/
│       │   │   ├── mintTo.t.sol
│       │   │   └── mintTo.tree
│       │   ├── mint-with-signature/
│       │   │   ├── mintWithSignature.t.sol
│       │   │   └── mintWithSignature.tree
│       │   ├── other-functions/
│       │   │   ├── other.t.sol
│       │   │   └── other.tree
│       │   ├── set-contract-uri/
│       │   │   ├── setContractURI.t.sol
│       │   │   └── setContractURI.tree
│       │   ├── set-platform-fee-info/
│       │   │   ├── setPlatformFeeInfo.t.sol
│       │   │   └── setPlatformFeeInfo.tree
│       │   ├── set-primary-sale-recipient/
│       │   │   ├── setPrimarySaleRecipient.t.sol
│       │   │   └── setPrimarySaleRecipient.tree
│       │   └── verify/
│       │       ├── verify.t.sol
│       │       └── verify.tree
│       ├── tokenerc721-BTT/
│       │   ├── burn/
│       │   │   ├── burn.t.sol
│       │   │   └── burn.tree
│       │   ├── initialize/
│       │   │   ├── initialize.t.sol
│       │   │   └── initialize.tree
│       │   ├── mint-to/
│       │   │   ├── mintTo.t.sol
│       │   │   └── mintTo.tree
│       │   ├── mint-with-signature/
│       │   │   ├── mintWithSignature.t.sol
│       │   │   └── mintWithSignature.tree
│       │   ├── other-functions/
│       │   │   ├── other.t.sol
│       │   │   └── other.tree
│       │   ├── owner/
│       │   │   ├── owner.t.sol
│       │   │   └── owner.tree
│       │   ├── set-contract-uri/
│       │   │   ├── setContractURI.t.sol
│       │   │   └── setContractURI.tree
│       │   ├── set-default-royalty-info/
│       │   │   ├── setDefaultRoyaltyInfo.t.sol
│       │   │   └── setDefaultRoyaltyInfo.tree
│       │   ├── set-owner/
│       │   │   ├── setOwner.t.sol
│       │   │   └── setOwner.tree
│       │   ├── set-platform-fee-info/
│       │   │   ├── setPlatformFeeInfo.t.sol
│       │   │   └── setPlatformFeeInfo.tree
│       │   ├── set-primary-sale-recipient/
│       │   │   ├── setPrimarySaleRecipient.t.sol
│       │   │   └── setPrimarySaleRecipient.tree
│       │   ├── set-royalty-info-for-token/
│       │   │   ├── setRoyaltyInfoForToken.t.sol
│       │   │   └── setRoyaltyInfoForToken.tree
│       │   ├── token-uri/
│       │   │   ├── tokenURI.t.sol
│       │   │   └── tokenURI.tree
│       │   └── verify/
│       │       ├── verify.t.sol
│       │       └── verify.tree
│       ├── utils/
│       │   ├── BaseTest.sol
│       │   ├── Console.sol
│       │   ├── SignatureMint1155Utils.sol
│       │   └── Wallet.sol
│       └── vote-BTT/
│           ├── initialize/
│           │   ├── initialize.t.sol
│           │   └── initialize.tree
│           ├── other-functions/
│           │   ├── other.t.sol
│           │   └── other.tree
│           ├── propose/
│           │   ├── propose.t.sol
│           │   └── propose.tree
│           └── set-contract-uri/
│               ├── setContractURI.t.sol
│               └── setContractURI.tree
├── tsconfig.build.json
└── tsconfig.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
# EditorConfig  http://EditorConfig.org

# top-most EditorConfig file
root = true

# All files
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.sol]
indent_size = 4


================================================
FILE: .eslintignore
================================================
# folders
artifacts/
build/
cache/
coverage/
dist/
lib/
node_modules/
typechain/

# files
.solcover.js
coverage.json


================================================
FILE: .eslintrc.yaml
================================================
extends:
  - "eslint:recommended"
  - "plugin:@typescript-eslint/eslint-recommended"
  - "plugin:@typescript-eslint/recommended"
  - "prettier"
parser: "@typescript-eslint/parser"
parserOptions:
  project: "tsconfig.json"
plugins:
  - "@typescript-eslint"
root: true
rules:
  "@typescript-eslint/no-floating-promises":
    - error
    - ignoreIIFE: true
      ignoreVoid: true
  "@typescript-eslint/no-inferrable-types": "off"
  "@typescript-eslint/no-unused-vars":
    - warn
    - argsIgnorePattern: _
      varsIgnorePattern: _


================================================
FILE: .gas-snapshot
================================================
AABenchmarkPrepare:test_prepareBenchmarkFile() (gas: 2926370)
AccountBenchmarkTest:test_state_accountReceivesNativeTokens() (gas: 11037)
AccountBenchmarkTest:test_state_addAndWithdrawDeposit() (gas: 83332)
AccountBenchmarkTest:test_state_contractMetadata() (gas: 56507)
AccountBenchmarkTest:test_state_createAccount_viaEntrypoint() (gas: 432040)
AccountBenchmarkTest:test_state_createAccount_viaFactory() (gas: 334122)
AccountBenchmarkTest:test_state_executeBatchTransaction() (gas: 39874)
AccountBenchmarkTest:test_state_executeBatchTransaction_viaAccountSigner() (gas: 392782)
AccountBenchmarkTest:test_state_executeBatchTransaction_viaEntrypoint() (gas: 82915)
AccountBenchmarkTest:test_state_executeTransaction() (gas: 35735)
AccountBenchmarkTest:test_state_executeTransaction_viaAccountSigner() (gas: 378632)
AccountBenchmarkTest:test_state_executeTransaction_viaEntrypoint() (gas: 75593)
AccountBenchmarkTest:test_state_receiveERC1155NFT() (gas: 39343)
AccountBenchmarkTest:test_state_receiveERC721NFT() (gas: 78624)
AccountBenchmarkTest:test_state_transferOutsNativeTokens() (gas: 81713)
AirdropERC1155BenchmarkTest:test_benchmark_airdropERC1155_airdrop() (gas: 38083572)
AirdropERC20BenchmarkTest:test_benchmark_airdropERC20_airdrop() (gas: 32068413)
AirdropERC721BenchmarkTest:test_benchmark_airdropERC721_airdrop() (gas: 41912536)
DropERC1155BenchmarkTest:test_benchmark_dropERC1155_claim() (gas: 185032)
DropERC1155BenchmarkTest:test_benchmark_dropERC1155_lazyMint() (gas: 123913)
DropERC1155BenchmarkTest:test_benchmark_dropERC1155_setClaimConditions_five_conditions() (gas: 492121)
DropERC20BenchmarkTest:test_benchmark_dropERC20_claim() (gas: 230505)
DropERC20BenchmarkTest:test_benchmark_dropERC20_setClaimConditions_five_conditions() (gas: 500858)
DropERC721BenchmarkTest:test_benchmark_dropERC721_claim_five_tokens() (gas: 210967)
DropERC721BenchmarkTest:test_benchmark_dropERC721_lazyMint() (gas: 124540)
DropERC721BenchmarkTest:test_benchmark_dropERC721_lazyMint_for_delayed_reveal() (gas: 226149)
DropERC721BenchmarkTest:test_benchmark_dropERC721_reveal() (gas: 13732)
DropERC721BenchmarkTest:test_benchmark_dropERC721_setClaimConditions_five_conditions() (gas: 500494)
EditionStakeBenchmarkTest:test_benchmark_editionStake_claimRewards() (gas: 65081)
EditionStakeBenchmarkTest:test_benchmark_editionStake_stake() (gas: 185144)
EditionStakeBenchmarkTest:test_benchmark_editionStake_withdraw() (gas: 46364)
MultiwrapBenchmarkTest:test_benchmark_multiwrap_unwrap() (gas: 88950)
MultiwrapBenchmarkTest:test_benchmark_multiwrap_wrap() (gas: 473462)
NFTStakeBenchmarkTest:test_benchmark_nftStake_claimRewards() (gas: 68287)
NFTStakeBenchmarkTest:test_benchmark_nftStake_stake_five_tokens() (gas: 539145)
NFTStakeBenchmarkTest:test_benchmark_nftStake_withdraw() (gas: 38076)
PackBenchmarkTest:test_benchmark_pack_addPackContents() (gas: 219188)
PackBenchmarkTest:test_benchmark_pack_createPack() (gas: 1412868)
PackBenchmarkTest:test_benchmark_pack_openPack() (gas: 141860)
PackVRFDirectBenchmarkTest:test_benchmark_packvrf_createPack() (gas: 1379604)
PackVRFDirectBenchmarkTest:test_benchmark_packvrf_openPack() (gas: 119953)
PackVRFDirectBenchmarkTest:test_benchmark_packvrf_openPackAndClaimRewards() (gas: 3621)
SignatureDropBenchmarkTest:test_benchmark_signatureDrop_claim_five_tokens() (gas: 140517)
SignatureDropBenchmarkTest:test_benchmark_signatureDrop_lazyMint() (gas: 124311)
SignatureDropBenchmarkTest:test_benchmark_signatureDrop_lazyMint_for_delayed_reveal() (gas: 225891)
SignatureDropBenchmarkTest:test_benchmark_signatureDrop_reveal() (gas: 10647)
SignatureDropBenchmarkTest:test_benchmark_signatureDrop_setClaimConditions() (gas: 73699)
TokenERC1155BenchmarkTest:test_benchmark_tokenERC1155_burn() (gas: 5728)
TokenERC1155BenchmarkTest:test_benchmark_tokenERC1155_mintTo() (gas: 122286)
TokenERC1155BenchmarkTest:test_benchmark_tokenERC1155_mintWithSignature_pay_with_ERC20() (gas: 267175)
TokenERC1155BenchmarkTest:test_benchmark_tokenERC1155_mintWithSignature_pay_with_native_token() (gas: 296172)
TokenERC20BenchmarkTest:test_benchmark_tokenERC20_mintTo() (gas: 118586)
TokenERC20BenchmarkTest:test_benchmark_tokenERC20_mintWithSignature_pay_with_ERC20() (gas: 183032)
TokenERC20BenchmarkTest:test_benchmark_tokenERC20_mintWithSignature_pay_with_native_token() (gas: 207694)
TokenERC721BenchmarkTest:test_benchmark_tokenERC721_burn() (gas: 8954)
TokenERC721BenchmarkTest:test_benchmark_tokenERC721_mintTo() (gas: 151552)
TokenERC721BenchmarkTest:test_benchmark_tokenERC721_mintWithSignature_pay_with_ERC20() (gas: 262344)
TokenERC721BenchmarkTest:test_benchmark_tokenERC721_mintWithSignature_pay_with_native_token() (gas: 286914)
TokenStakeBenchmarkTest:test_benchmark_tokenStake_claimRewards() (gas: 67554)
TokenStakeBenchmarkTest:test_benchmark_tokenStake_stake() (gas: 177180)
TokenStakeBenchmarkTest:test_benchmark_tokenStake_withdraw() (gas: 47396)

================================================
FILE: .gitattributes
================================================
*.sol linguist-language=Solidity

================================================
FILE: .github/composite-actions/setup/action.yml
================================================
name: "Install"
description: "Sets up Node.js and runs install"

runs:
  using: composite
  steps:
    - name: Setup Node.js
      uses: actions/setup-node@v3
      with:
        node-version: 18
        registry-url: "https://registry.npmjs.org"
        cache: "yarn"

    - name: Install dependencies
      shell: bash
      run: yarn

    - name: Setup lcov
      shell: bash
      run: |
        sudo apt update
        sudo apt install -y lcov


================================================
FILE: .github/workflows/dispatch_docs.yml
================================================
name: Dispatch Doc Generation

on:
  push:
    branches:
      - main

jobs:
  dispatch:
    runs-on: ubuntu-latest
    steps:
      - name: Repository Dispatch
        uses: peter-evans/repository-dispatch@v1.1.3
        with:
          token: ${{ secrets.REPO_ACCESS_TOKEN }}
          repository: thirdweb-dev/docs
          event-type: generate-docs


================================================
FILE: .github/workflows/lint.yml
================================================
# This is a basic workflow to help you get started with Actions

name: Solhint Lint

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the main branch
  push:
    branches: [main]
  pull_request:
    branches: [main]

# cancel previous runs if new commits are pushed to the branch
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  lint:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          submodules: recursive
          fetch-depth: 25

      - name: Setup Project
        uses: ./.github/composite-actions/setup

      - name: Run Lint
        run: yarn lint


================================================
FILE: .github/workflows/prettier.yml
================================================
# This is a basic workflow to help you get started with Actions

name: Prettier Formatting

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the main branch
  push:
    branches: [main]
  pull_request:
    branches: [main]

# cancel previous runs if new commits are pushed to the branch
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  # This workflow contains a single job called "build"
  lint:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          submodules: recursive
          fetch-depth: 25

      - name: Setup Project
        uses: ./.github/composite-actions/setup

      - name: Run Prettier
        run: yarn prettier:contracts


================================================
FILE: .github/workflows/slither.yml
================================================
name: Slither Analysis

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

# cancel previous runs if new commits are pushed to the branch
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  analyze:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      security-events: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          submodules: recursive
          fetch-depth: 25
          node-version: 18

      - name: Setup Project
        uses: ./.github/composite-actions/setup

      - name: Install Foundry
        uses: onbjerg/foundry-toolchain@v1
        with:
          version: nightly

      - name: Run Slither
        uses: crytic/slither-action@v0.3.0
        continue-on-error: true
        id: slither
        with:
          sarif: results.sarif
          slither-args: --foundry-out-directory artifacts_forge

      - name: Upload SARIF file
        uses: github/codeql-action/upload-sarif@v2
        with:
          sarif_file: ${{ steps.slither.outputs.sarif }}


================================================
FILE: .github/workflows/tests.yml
================================================
# This is a basic workflow to help you get started with Actions

name: Tests

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the main branch
  push:
    branches: [main]
  pull_request:
    branches: [main]

# cancel previous runs if new commits are pushed to the branch
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  test:
    # The type of runner that the job will run on
    # 16 core paid runner
    runs-on: ubuntu-latest-16

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          submodules: recursive
          fetch-depth: 25
          node-version: 18

      - name: Setup Project
        uses: ./.github/composite-actions/setup

      - name: Install Foundry
        uses: onbjerg/foundry-toolchain@v1
        with:
          version: nightly
      - name: Run coverage and tests
        run: |
          forge coverage --report lcov
          lcov --remove lcov.info -o lcov.info 'src/test/**'
          lcov --remove lcov.info -o lcov.info 'contracts/external-deps/**'
          lcov --remove lcov.info -o lcov.info 'contracts/eip/**'
          forge test
      - name: Upload coverage reports to Codecov
        uses: codecov/codecov-action@v3
        with:
          files: ./lcov.info,


================================================
FILE: .gitignore
================================================
# folders
.coverage_artifacts/
.coverage_cache/
.coverage_contracts/
artifacts/@chainlink
artifacts/@openzeppelin
artifacts/build-info
build/
scripts/reference-scripts
cache*/
coverage/
dist/
node_modules/
typechain/
typechain-types/
.parcel-cache/

abi/
contracts/abi/
contracts/README.md
artifacts/
artifacts-*/
artifacts_forge/
contract_artifacts/

# files
*.env
*.log
*.tsbuildinfo
coverage.json
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.dbg.json
deployArgs.json

# Dev
/relayerTest
./contracts/v2/Market.sol
/notes.txt
.yalc/
yalc.lock

# Forge
#/lib
/out
lcov.info

#Build
.swc/
out/

crytic-export/
venv/
mcore_*/
corpus/

# IDES
.idea

*.DS_Store


================================================
FILE: .gitmodules
================================================
[submodule "lib/forge-std"]
	path = lib/forge-std
	url = https://github.com/brockelmore/forge-std
[submodule "lib/ds-test"]
	path = lib/ds-test
	url = https://github.com/dapphub/ds-test
[submodule "lib/ERC721A-Upgradeable"]
	path = lib/ERC721A-Upgradeable
	url = https://github.com/chiru-labs/ERC721A-Upgradeable
[submodule "lib/ERC721A"]
	path = lib/ERC721A
	url = https://github.com/chiru-labs/ERC721A
[submodule "lib/dynamic-contracts"]
	path = lib/dynamic-contracts
	url = https://github.com/thirdweb-dev/dynamic-contracts
[submodule "lib/solady"]
	path = lib/solady
	url = https://github.com/vectorized/solady
[submodule "lib/seaport"]
	path = lib/seaport
	url = https://github.com/ProjectOpenSea/seaport
[submodule "lib/murky"]
	path = lib/murky
	url = https://github.com/dmfxyz/murky
[submodule "lib/solmate"]
	path = lib/solmate
	url = https://github.com/transmissions11/solmate
[submodule "lib/solarray"]
	path = lib/solarray
	url = https://github.com/emo-eth/solarray
[submodule "lib/seaport-types"]
	path = lib/seaport-types
	url = https://github.com/projectopensea/seaport-types
[submodule "lib/seaport-core"]
	path = lib/seaport-core
	url = https://github.com/projectopensea/seaport-core
[submodule "lib/seaport-sol"]
	path = lib/seaport-sol
	url = https://github.com/projectopensea/seaport-sol
[submodule "lib/openzeppelin-contracts-upgradeable"]
	path = lib/openzeppelin-contracts-upgradeable
	url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "lib/openzeppelin-contracts"]
	path = lib/openzeppelin-contracts
	url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/v3-periphery"]
	path = lib/v3-periphery
	url = https://github.com/uniswap/v3-periphery
[submodule "lib/v3-core"]
	path = lib/v3-core
	url = https://github.com/uniswap/v3-core
[submodule "lib/swap-router-contracts"]
	path = lib/swap-router-contracts
	url = https://github.com/Uniswap/swap-router-contracts
[submodule "lib/creator-token-standards"]
	path = lib/creator-token-standards
	url = https://github.com/limitbreakinc/creator-token-standards


================================================
FILE: .npmignore
================================================
node_modules/


================================================
FILE: .prettierignore
================================================
# folders
artifacts/
artifacts_forge/
build/
cache/
coverage/
dist/
node_modules/
typechain/

# files
src/test/smart-wallet/utils/AABenchmarkArtifacts.sol
coverage.json


================================================
FILE: .prettierrc
================================================
{
  "arrowParens": "avoid",
  "bracketSpacing": true,
  "endOfLine":"auto",
  "printWidth": 120,
  "useTabs": false,
  "singleQuote": false,
  "tabWidth": 2,
  "trailingComma": "all",
  "overrides": [
    {
      "files": "*.sol",
      "options": {
        "tabWidth": 4
      }
    }
  ]
}


================================================
FILE: .solhint.json
================================================
{
  "extends": "solhint:recommended",
  "plugins": ["prettier"],
  "rules": {
    "imports-on-top": "error",
    "no-unused-vars": "error",
    "code-complexity": ["error", 9],
    "compiler-version": ["error", "^0.8.0"],
    "const-name-snakecase": "error",
    "event-name-camelcase": "error",
    "constructor-syntax": "error",
    "func-name-mixedcase": "off",
    "func-param-name-mixedcase": "error",
    "modifier-name-mixedcase": "error",
    "private-vars-leading-underscore": "off",
    "var-name-mixedcase": "error",
    "func-visibility": ["error", { "ignoreConstructors": true }],
    "not-rely-on-time": "off",
    "no-empty-blocks": "off",
    "contract-name-camelcase": "off",
    "no-inline-assembly": "off",
    "prettier/prettier": [
      "error",
      {
        "arrowParens": "avoid",
        "bracketSpacing": true,
        "endOfLine": "auto",
        "printWidth": 120,
        "useTabs": false,
        "singleQuote": false,
        "tabWidth": 4,
        "trailingComma": "all",
        "explicitTypes": "always"
      }
    ],
    "reason-string": ["warn", { "maxLength": 64 }]
  }
}


================================================
FILE: .solhintignore
================================================
# folders
.yarn/
build/
dist/
node_modules/
contracts/openzeppelin-presets/


================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at <support@thirdweb.com>. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior,  harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations


================================================
FILE: LICENSE.md
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1.  Definitions.

    "License" shall mean the terms and conditions for use, reproduction,
    and distribution as defined by Sections 1 through 9 of this document.

    "Licensor" shall mean the copyright owner or entity authorized by
    the copyright owner that is granting the License.

    "Legal Entity" shall mean the union of the acting entity and all
    other entities that control, are controlled by, or are under common
    control with that entity. For the purposes of this definition,
    "control" means (i) the power, direct or indirect, to cause the
    direction or management of such entity, whether by contract or
    otherwise, or (ii) ownership of fifty percent (50%) or more of the
    outstanding shares, or (iii) beneficial ownership of such entity.

    "You" (or "Your") shall mean an individual or Legal Entity
    exercising permissions granted by this License.

    "Source" form shall mean the preferred form for making modifications,
    including but not limited to software source code, documentation
    source, and configuration files.

    "Object" form shall mean any form resulting from mechanical
    transformation or translation of a Source form, including but
    not limited to compiled object code, generated documentation,
    and conversions to other media types.

    "Work" shall mean the work of authorship, whether in Source or
    Object form, made available under the License, as indicated by a
    copyright notice that is included in or attached to the work
    (an example is provided in the Appendix below).

    "Derivative Works" shall mean any work, whether in Source or Object
    form, that is based on (or derived from) the Work and for which the
    editorial revisions, annotations, elaborations, or other modifications
    represent, as a whole, an original work of authorship. For the purposes
    of this License, Derivative Works shall not include works that remain
    separable from, or merely link (or bind by name) to the interfaces of,
    the Work and Derivative Works thereof.

    "Contribution" shall mean any work of authorship, including
    the original version of the Work and any modifications or additions
    to that Work or Derivative Works thereof, that is intentionally
    submitted to Licensor for inclusion in the Work by the copyright owner
    or by an individual or Legal Entity authorized to submit on behalf of
    the copyright owner. For the purposes of this definition, "submitted"
    means any form of electronic, verbal, or written communication sent
    to the Licensor or its representatives, including but not limited to
    communication on electronic mailing lists, source code control systems,
    and issue tracking systems that are managed by, or on behalf of, the
    Licensor for the purpose of discussing and improving the Work, but
    excluding communication that is conspicuously marked or otherwise
    designated in writing by the copyright owner as "Not a Contribution."

    "Contributor" shall mean Licensor and any individual or Legal Entity
    on behalf of whom a Contribution has been received by Licensor and
    subsequently incorporated within the Work.

2.  Grant of Copyright License. Subject to the terms and conditions of
    this License, each Contributor hereby grants to You a perpetual,
    worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    copyright license to reproduce, prepare Derivative Works of,
    publicly display, publicly perform, sublicense, and distribute the
    Work and such Derivative Works in Source or Object form.

3.  Grant of Patent License. Subject to the terms and conditions of
    this License, each Contributor hereby grants to You a perpetual,
    worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    (except as stated in this section) patent license to make, have made,
    use, offer to sell, sell, import, and otherwise transfer the Work,
    where such license applies only to those patent claims licensable
    by such Contributor that are necessarily infringed by their
    Contribution(s) alone or by combination of their Contribution(s)
    with the Work to which such Contribution(s) was submitted. If You
    institute patent litigation against any entity (including a
    cross-claim or counterclaim in a lawsuit) alleging that the Work
    or a Contribution incorporated within the Work constitutes direct
    or contributory patent infringement, then any patent licenses
    granted to You under this License for that Work shall terminate
    as of the date such litigation is filed.

4.  Redistribution. You may reproduce and distribute copies of the
    Work or Derivative Works thereof in any medium, with or without
    modifications, and in Source or Object form, provided that You
    meet the following conditions:

    (a) You must give any other recipients of the Work or
    Derivative Works a copy of this License; and

    (b) You must cause any modified files to carry prominent notices
    stating that You changed the files; and

    (c) You must retain, in the Source form of any Derivative Works
    that You distribute, all copyright, patent, trademark, and
    attribution notices from the Source form of the Work,
    excluding those notices that do not pertain to any part of
    the Derivative Works; and

    (d) If the Work includes a "NOTICE" text file as part of its
    distribution, then any Derivative Works that You distribute must
    include a readable copy of the attribution notices contained
    within such NOTICE file, excluding those notices that do not
    pertain to any part of the Derivative Works, in at least one
    of the following places: within a NOTICE text file distributed
    as part of the Derivative Works; within the Source form or
    documentation, if provided along with the Derivative Works; or,
    within a display generated by the Derivative Works, if and
    wherever such third-party notices normally appear. The contents
    of the NOTICE file are for informational purposes only and
    do not modify the License. You may add Your own attribution
    notices within Derivative Works that You distribute, alongside
    or as an addendum to the NOTICE text from the Work, provided
    that such additional attribution notices cannot be construed
    as modifying the License.

    You may add Your own copyright statement to Your modifications and
    may provide additional or different license terms and conditions
    for use, reproduction, or distribution of Your modifications, or
    for any such Derivative Works as a whole, provided Your use,
    reproduction, and distribution of the Work otherwise complies with
    the conditions stated in this License.

5.  Submission of Contributions. Unless You explicitly state otherwise,
    any Contribution intentionally submitted for inclusion in the Work
    by You to the Licensor shall be under the terms and conditions of
    this License, without any additional terms or conditions.
    Notwithstanding the above, nothing herein shall supersede or modify
    the terms of any separate license agreement you may have executed
    with Licensor regarding such Contributions.

6.  Trademarks. This License does not grant permission to use the trade
    names, trademarks, service marks, or product names of the Licensor,
    except as required for reasonable and customary use in describing the
    origin of the Work and reproducing the content of the NOTICE file.

7.  Disclaimer of Warranty. Unless required by applicable law or
    agreed to in writing, Licensor provides the Work (and each
    Contributor provides its Contributions) on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    implied, including, without limitation, any warranties or conditions
    of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    PARTICULAR PURPOSE. You are solely responsible for determining the
    appropriateness of using or redistributing the Work and assume any
    risks associated with Your exercise of permissions under this License.

8.  Limitation of Liability. In no event and under no legal theory,
    whether in tort (including negligence), contract, or otherwise,
    unless required by applicable law (such as deliberate and grossly
    negligent acts) or agreed to in writing, shall any Contributor be
    liable to You for damages, including any direct, indirect, special,
    incidental, or consequential damages of any character arising as a
    result of this License or out of the use or inability to use the
    Work (including but not limited to damages for loss of goodwill,
    work stoppage, computer failure or malfunction, or any and all
    other commercial damages or losses), even if such Contributor
    has been advised of the possibility of such damages.

9.  Accepting Warranty or Additional Liability. While redistributing
    the Work or Derivative Works thereof, You may choose to offer,
    and charge a fee for, acceptance of support, warranty, indemnity,
    or other liability obligations and/or rights consistent with this
    License. However, in accepting such obligations, You may act only
    on Your own behalf and on Your sole responsibility, not on behalf
    of any other Contributor, and only if You agree to indemnify,
    defend, and hold each Contributor harmless for any liability
    incurred by, or claims asserted against, such Contributor by reason
    of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

Copyright 2021 Non-Fungible Labs, Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


================================================
FILE: README.md
================================================
<p align="center">
<br />
<a href="https://thirdweb.com"><img src="https://github.com/thirdweb-dev/typescript-sdk/blob/main/logo.svg?raw=true" width="200" alt=""/></a>
<br />
</p>
<h1 align="center">thirdweb Contracts</h1>
<p align="center">
<a href="https://www.npmjs.com/package/@thirdweb-dev/contracts"><img src="https://img.shields.io/npm/v/@thirdweb-dev/contracts?color=red&logo=npm" alt="npm version"/></a>
<a href="https://github.com/thirdweb-dev/contracts/actions"><img alt="Build Status" src="https://github.com/thirdweb-dev/contracts/actions/workflows/tests.yml/badge.svg"/></a>
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>

</p>
<p align="center"><strong>Collection of smart contracts deployable via the thirdweb SDK, dashboard and CLI</strong></p>
<br />

## Installation

```shell
# Forge projects
forge install https://github.com/thirdweb-dev/contracts

# Hardhat / npm based projects
npm i @thirdweb-dev/contracts
```

```bash
contracts
|
|-- extension: "extensions that can be inherited by NON-upgradeable contracts"
|   |-- interface: "interfaces of all extension contracts"
|   |-- upgradeable: "extensions that can be inherited by upgradeable contracts"
|   |-- [$prebuilt-category]: "legacy extensions written specifically for a prebuilt contract"
|
|-- base: "NON-upgradeable base contracts to build on top of"
|   |-- interface: "interfaces for all base contracts"
|   |--  upgradeable: "upgradeable base contracts to build on top of"
|
|-- prebuilt: "audited, ready-to-deploy thirdweb smart contracts"
|   |-- interface: "interfaces for all prebuilt contracts"
|   |--[$prebuilt-category]: "feature-based group of prebuilt contracts"
|   |-- unaudited: "yet-to-audit thirdweb smart contracts"
|       |-- [$prebuilt-category]: "feature-based group of prebuilt contracts"
|
|-- infra: "onchain infrastructure contracts"
|   |-- interface: "interfaces for all infrastructure contracts"
|
|-- eip: "implementations of relevant EIP standards"
|   |-- interface "all interfaces of relevant EIP standards"
|
|-- lib: "Solidity libraries"
|
|-- external-deps: "modified / copied over external dependencies"
|   |-- openzeppelin: "modified / copied over openzeppelin dependencies"
|   |-- chainlink: "modified / copied over chainlink dependencies"
|
|-- legacy-contracts: "maintained legacy thirdweb contracts"
```

## Running Tests

1. `yarn`: install contracts dependencies
2. `forge install`: install tests dependencies
3. `forge test`: run the tests

This repository is a [forge](https://github.com/foundry-rs/foundry/tree/master/forge) project.

First install the relevant dependencies of the project:

```bash
yarn

forge install
```

To compile contracts, run:

```bash
forge build
```

To run tests:

```bash
forge test
```

## Pre-built Contracts

Pre-built contracts are written by the thirdweb team, and cover the most common use cases for smart contracts.

- [DropERC20](https://thirdweb.com/deployer.thirdweb.eth/DropERC20)
- [DropERC721](https://thirdweb.com/deployer.thirdweb.eth/DropERC721)
- [DropERC1155](https://thirdweb.com/deployer.thirdweb.eth/DropERC1155)
- [SignatureDrop](https://thirdweb.com/deployer.thirdweb.eth/SignatureDrop)
- [Marketplace](https://thirdweb.com/deployer.thirdweb.eth/Marketplace)
- [Multiwrap](https://thirdweb.com/deployer.thirdweb.eth/Multiwrap)
- [TokenERC20](https://thirdweb.com/deployer.thirdweb.eth/TokenERC20)
- [TokenERC721](https://thirdweb.com/deployer.thirdweb.eth/TokenERC721)
- [TokenERC1155](https://thirdweb.com/deployer.thirdweb.eth/TokenERC1155)
- [VoteERC20](https://thirdweb.com/deployer.thirdweb.eth/VoteERC20)
- [Split](https://thirdweb.com/deployer.thirdweb.eth/Split)

[Learn more about pre-built contracts](https://portal.thirdweb.com/pre-built-contracts)

## Extensions

Extensions are building blocks that help enrich smart contracts with features.

Some blocks come packaged together as Base Contracts, which come with a full set of features out of the box that you can modify and extend. These contracts are available at `contracts/base/`.

Other (smaller) blocks are Features, which provide a way for you to pick and choose which individual pieces you want to put into your contract; with full customization of how those features work. These are available at `contracts/extension/`.

[Learn more about extensions](https://portal.thirdweb.com/extensions)

## Contract Audits

- [Audit 1](audit-reports/audit-1.pdf)
- [Audit 2](audit-reports/audit-2.pdf)
- [Audit 3](audit-reports/audit-3.pdf)
- [Audit 4](audit-reports/audit-4.pdf)
- [Audit 5](audit-reports/audit-5.pdf)
- [Audit 6](audit-reports/audit-6.pdf)
- [Audit 7](audit-reports/audit-7.pdf)
- [Audit 8](audit-reports/audit-8.pdf)
- [Audit 9](audit-reports/audit-9.pdf)
- [Audit 10](audit-reports/audit-10.pdf)
- [Audit 11](audit-reports/audit-11.pdf)
- [Audit 12](audit-reports/audit-12.pdf)

## Bug reports

Found a security issue with our smart contracts? Send bug reports to security@thirdweb.com and we'll continue communicating with you from there. We're actively developing a bug bounty program; bug report payouts happen on a case by case basis, for now.

## Feedback

If you have any feedback, please reach out to us at support@thirdweb.com.

## Authors

- [thirdweb](https://thirdweb.com)

## License

[Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt)


================================================
FILE: audit-reports/preliminary-audits/airdroperc20-claimable.md
================================================
This document contains details on fixes / response to the preliminary audit reports added to this repository.

## [AirdropERC20Claimable](./airdroperc20-claimable.pdf)

### 01: Governance: TrustedForwarder can execute claims on behalf of other addresses

- The contract doesn't add a trusted-forwarder address by default. The deployer of AirdropERC20Claimable can specify which forwarder they want to use (if any), or leave as address zero.

### 02: Malicious users can steal the entire balance of the contract

- This refers to the possibility of a sybil attack on open/public claims, where multiple wallets can be created to claim the quantity specified by `openClaimLimitPerWallet`. To prevent this scenario or any kind of public claiming, deployer can set `openClaimLimitPerWallet` to zero when setting claim conditions during deployment.


================================================
FILE: contracts/base/ERC1155Base.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import { ERC1155 } from "../eip/ERC1155.sol";

import "../extension/ContractMetadata.sol";
import "../extension/Multicall.sol";
import "../extension/Ownable.sol";
import "../extension/Royalty.sol";
import "../extension/BatchMintMetadata.sol";

import "../lib/Strings.sol";

/**
 *  The `ERC1155Base` smart contract implements the ERC1155 NFT standard.
 *  It includes the following additions to standard ERC1155 logic:
 *
 *      - Ability to mint NFTs via the provided `mintTo` and `batchMintTo` functions.
 *
 *      - Contract metadata for royalty support on platforms such as OpenSea that use
 *        off-chain information to distribute roaylties.
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically
 *
 *      - EIP 2981 compliance for royalty support on NFT marketplaces.
 */

contract ERC1155Base is ERC1155, ContractMetadata, Ownable, Royalty, Multicall, BatchMintMetadata {
    using Strings for uint256;

    /*//////////////////////////////////////////////////////////////
                        State variables
    //////////////////////////////////////////////////////////////*/

    /// @dev The tokenId of the next NFT to mint.
    uint256 internal nextTokenIdToMint_;

    /*//////////////////////////////////////////////////////////////
                        Mappings
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice Returns the total supply of NFTs of a given tokenId
     *  @dev Mapping from tokenId => total circulating supply of NFTs of that tokenId.
     */
    mapping(uint256 => uint256) public totalSupply;

    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _royaltyRecipient,
        uint128 _royaltyBps
    ) ERC1155(_name, _symbol) {
        _setupOwner(_defaultAdmin);
        _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps);
    }

    /*//////////////////////////////////////////////////////////////
                    Overriden metadata logic
    //////////////////////////////////////////////////////////////*/

    /// @notice Returns the metadata URI for the given tokenId.
    /// @param _tokenId The tokenId of the token for which a URI should be returned.
    /// @return The metadata URI for the given tokenId.
    function uri(uint256 _tokenId) public view virtual override returns (string memory) {
        string memory uriForToken = _uri[_tokenId];
        if (bytes(uriForToken).length > 0) {
            return uriForToken;
        }

        string memory batchUri = _getBaseURI(_tokenId);
        return string(abi.encodePacked(batchUri, _tokenId.toString()));
    }

    /*//////////////////////////////////////////////////////////////
                        Mint / burn logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice          Lets an authorized address mint NFTs to a recipient.
     *  @dev             - The logic in the `_canMint` function determines whether the caller is authorized to mint NFTs.
     *                   - If `_tokenId == type(uint256).max` a new NFT at tokenId `nextTokenIdToMint` is minted. If the given
     *                     `tokenId < nextTokenIdToMint`, then additional supply of an existing NFT is being minted.
     *
     *  @param _to       The recipient of the NFTs to mint.
     *  @param _tokenId  The tokenId of the NFT to mint.
     *  @param _tokenURI The full metadata URI for the NFTs minted (if a new NFT is being minted).
     *  @param _amount   The amount of the same NFT to mint.
     */
    function mintTo(address _to, uint256 _tokenId, string memory _tokenURI, uint256 _amount) public virtual {
        require(_canMint(), "Not authorized to mint.");

        uint256 tokenIdToMint;
        uint256 nextIdToMint = nextTokenIdToMint();

        if (_tokenId == type(uint256).max) {
            tokenIdToMint = nextIdToMint;
            nextTokenIdToMint_ += 1;
            _setTokenURI(nextIdToMint, _tokenURI);
        } else {
            require(_tokenId < nextIdToMint, "invalid id");
            tokenIdToMint = _tokenId;
        }

        _mint(_to, tokenIdToMint, _amount, "");
    }

    /**
     *  @notice          Lets an authorized address mint multiple NEW NFTs at once to a recipient.
     *  @dev             The logic in the `_canMint` function determines whether the caller is authorized to mint NFTs.
     *                   If `_tokenIds[i] == type(uint256).max` a new NFT at tokenId `nextTokenIdToMint` is minted. If the given
     *                   `tokenIds[i] < nextTokenIdToMint`, then additional supply of an existing NFT is minted.
     *                   The metadata for each new NFT is stored at `baseURI/{tokenID of NFT}`
     *
     *  @param _to       The recipient of the NFT to mint.
     *  @param _tokenIds The tokenIds of the NFTs to mint.
     *  @param _amounts  The amounts of each NFT to mint.
     *  @param _baseURI  The baseURI for the `n` number of NFTs minted. The metadata for each NFT is `baseURI/tokenId`
     */
    function batchMintTo(
        address _to,
        uint256[] memory _tokenIds,
        uint256[] memory _amounts,
        string memory _baseURI
    ) public virtual {
        require(_canMint(), "Not authorized to mint.");
        require(_amounts.length > 0, "Minting zero tokens.");
        require(_tokenIds.length == _amounts.length, "Length mismatch.");

        uint256 nextIdToMint = nextTokenIdToMint();
        uint256 startNextIdToMint = nextIdToMint;

        uint256 numOfNewNFTs;

        for (uint256 i = 0; i < _tokenIds.length; i += 1) {
            if (_tokenIds[i] == type(uint256).max) {
                _tokenIds[i] = nextIdToMint;

                nextIdToMint += 1;
                numOfNewNFTs += 1;
            } else {
                require(_tokenIds[i] < nextIdToMint, "invalid id");
            }
        }

        if (numOfNewNFTs > 0) {
            _batchMintMetadata(startNextIdToMint, numOfNewNFTs, _baseURI);
        }

        nextTokenIdToMint_ = nextIdToMint;
        _mintBatch(_to, _tokenIds, _amounts, "");
    }

    /**
     *  @notice         Lets an owner or approved operator burn NFTs of the given tokenId.
     *
     *  @param _owner   The owner of the NFT to burn.
     *  @param _tokenId The tokenId of the NFT to burn.
     *  @param _amount  The amount of the NFT to burn.
     */
    function burn(address _owner, uint256 _tokenId, uint256 _amount) external virtual {
        address caller = msg.sender;

        require(caller == _owner || isApprovedForAll[_owner][caller], "Unapproved caller");
        require(balanceOf[_owner][_tokenId] >= _amount, "Not enough tokens owned");

        _burn(_owner, _tokenId, _amount);
    }

    /**
     *  @notice         Lets an owner or approved operator burn NFTs of the given tokenIds.
     *
     *  @param _owner    The owner of the NFTs to burn.
     *  @param _tokenIds The tokenIds of the NFTs to burn.
     *  @param _amounts  The amounts of the NFTs to burn.
     */
    function burnBatch(address _owner, uint256[] memory _tokenIds, uint256[] memory _amounts) external virtual {
        address caller = msg.sender;

        require(caller == _owner || isApprovedForAll[_owner][caller], "Unapproved caller");
        require(_tokenIds.length == _amounts.length, "Length mismatch");

        for (uint256 i = 0; i < _tokenIds.length; i += 1) {
            require(balanceOf[_owner][_tokenIds[i]] >= _amounts[i], "Not enough tokens owned");
        }

        _burnBatch(_owner, _tokenIds, _amounts);
    }

    /*//////////////////////////////////////////////////////////////
                            ERC165 Logic
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165
     * @inheritdoc IERC165
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, IERC165) returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155
            interfaceId == 0x0e89341c || // ERC165 Interface ID for ERC1155MetadataURI
            interfaceId == type(IERC2981).interfaceId; // ERC165 ID for ERC2981
    }

    /*//////////////////////////////////////////////////////////////
                            View functions
    //////////////////////////////////////////////////////////////*/

    /// @notice The tokenId assigned to the next new NFT to be minted.
    function nextTokenIdToMint() public view virtual returns (uint256) {
        return nextTokenIdToMint_;
    }

    /*//////////////////////////////////////////////////////////////
                    Internal (overrideable) functions
    //////////////////////////////////////////////////////////////*/

    /// @dev Returns whether contract metadata can be set in the given execution context.
    /// @return Whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether a token can be minted in the given execution context.
    /// @return Whether a token can be minted in the given execution context.
    function _canMint() internal view virtual returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether owner can be set in the given execution context.
    /// @return Whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether royalty info can be set in the given execution context.
    /// @return Whether royalty info can be set in the given execution context.
    function _canSetRoyaltyInfo() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Runs before every token transfer / mint / burn.
    /// @param operator The address of the caller.
    /// @param from The address of the sender.
    /// @param to The address of the recipient.
    /// @param ids The tokenIds of the tokens being transferred.
    /// @param amounts The amounts of the tokens being transferred.
    /// @param data Additional data with no specified format.
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual override {
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);

        if (from == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                totalSupply[ids[i]] += amounts[i];
            }
        }

        if (to == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                totalSupply[ids[i]] -= amounts[i];
            }
        }
    }
}


================================================
FILE: contracts/base/ERC1155DelayedReveal.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "./ERC1155LazyMint.sol";
import "../extension/DelayedReveal.sol";

/**
 *      BASE:      ERC1155LazyMint
 *      EXTENSION: DelayedReveal
 *
 *  The `ERC1155DelayedReveal` contract uses the `DelayedReveal` extension.
 *
 *  'Lazy minting' means defining the metadata of NFTs without minting it to an address. Regular 'minting'
 *  of  NFTs means actually assigning an owner to an NFT.
 *
 *  As a contract admin, this lets you prepare the metadata for NFTs that will be minted by an external party,
 *  without paying the gas cost for actually minting the NFTs.
 *
 *  'Delayed reveal' is a mechanism by which you can distribute NFTs to your audience and reveal the metadata of the distributed
 *  NFTs, after the fact.
 *
 *  You can read more about how the `DelayedReveal` extension works, here: https://blog.thirdweb.com/delayed-reveal-nfts
 */

contract ERC1155DelayedReveal is ERC1155LazyMint, DelayedReveal {
    using Strings for uint256;

    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _royaltyRecipient,
        uint128 _royaltyBps
    ) ERC1155LazyMint(_defaultAdmin, _name, _symbol, _royaltyRecipient, _royaltyBps) {}

    /*//////////////////////////////////////////////////////////////
                        Overriden Metadata logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice         Returns the metadata URI for an NFT.
     *  @dev            See `BatchMintMetadata` for handling of metadata in this contract.
     *
     *  @param _tokenId The tokenId of an NFT.
     */
    function uri(uint256 _tokenId) public view virtual override returns (string memory) {
        (uint256 batchId, ) = _getBatchId(_tokenId);
        string memory batchUri = _getBaseURI(_tokenId);

        if (isEncryptedBatch(batchId)) {
            return string(abi.encodePacked(batchUri, "0"));
        } else {
            return string(abi.encodePacked(batchUri, _tokenId.toString()));
        }
    }

    /*//////////////////////////////////////////////////////////////
                        Lazy minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice                  Lets an authorized address lazy mint a given amount of NFTs.
     *
     *  @param _amount           The number of NFTs to lazy mint.
     *  @param _baseURIForTokens The placeholder base URI for the 'n' number of NFTs being lazy minted, where the
     *                           metadata for each of those NFTs is `${baseURIForTokens}/${tokenId}`.
     *  @param _data             The encrypted base URI + provenance hash for the batch of NFTs being lazy minted.
     *  @return batchId          A unique integer identifier for the batch of NFTs lazy minted together.
     */
    function lazyMint(
        uint256 _amount,
        string calldata _baseURIForTokens,
        bytes calldata _data
    ) public virtual override returns (uint256 batchId) {
        if (_data.length > 0) {
            (bytes memory encryptedURI, bytes32 provenanceHash) = abi.decode(_data, (bytes, bytes32));
            if (encryptedURI.length != 0 && provenanceHash != "") {
                _setEncryptedData(nextTokenIdToLazyMint + _amount, _data);
            }
        }

        return super.lazyMint(_amount, _baseURIForTokens, _data);
    }

    /*//////////////////////////////////////////////////////////////
                        Delayed reveal logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice       Lets an authorized address reveal a batch of delayed reveal NFTs.
     *
     *  @param _index The ID for the batch of delayed-reveal NFTs to reveal.
     *  @param _key   The key with which the base URI for the relevant batch of NFTs was encrypted.
     */
    function reveal(uint256 _index, bytes calldata _key) external virtual override returns (string memory revealedURI) {
        require(_canReveal(), "Not authorized");

        uint256 batchId = getBatchIdAtIndex(_index);
        revealedURI = getRevealURI(batchId, _key);

        _setEncryptedData(batchId, "");
        _setBaseURI(batchId, revealedURI);

        emit TokenURIRevealed(_index, revealedURI);
    }

    /// @dev Checks whether NFTs can be revealed in the given execution context.
    function _canReveal() internal view virtual returns (bool) {
        return msg.sender == owner();
    }
}


================================================
FILE: contracts/base/ERC1155Drop.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import { ERC1155 } from "../eip/ERC1155.sol";

import "../extension/ContractMetadata.sol";
import "../extension/Multicall.sol";
import "../extension/Ownable.sol";
import "../extension/Royalty.sol";
import "../extension/BatchMintMetadata.sol";
import "../extension/PrimarySale.sol";
import "../extension/DropSinglePhase1155.sol";
import "../extension/LazyMint.sol";
import "../extension/DelayedReveal.sol";

import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";
import "../lib/Strings.sol";

/**
 *      BASE:      ERC1155Base
 *      EXTENSION: DropSinglePhase1155
 *
 *  The `ERC1155Base` smart contract implements the ERC1155 NFT standard.
 *  It includes the following additions to standard ERC1155 logic:
 *
 *      - Contract metadata for royalty support on platforms such as OpenSea that use
 *        off-chain information to distribute roaylties.
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically
 *
 *      - EIP 2981 compliance for royalty support on NFT marketplaces.
 *
 *  The `drop` mechanism in the `DropSinglePhase1155` extension is a distribution mechanism for lazy minted tokens. It lets
 *  you set restrictions such as a price to charge, an allowlist etc. when an address atttempts to mint lazy minted tokens.
 *
 *  The `ERC721Drop` contract lets you lazy mint tokens, and distribute those lazy minted tokens via the drop mechanism.
 */

contract ERC1155Drop is
    ERC1155,
    ContractMetadata,
    Ownable,
    Royalty,
    Multicall,
    BatchMintMetadata,
    PrimarySale,
    LazyMint,
    DelayedReveal,
    DropSinglePhase1155
{
    using Strings for uint256;

    /*//////////////////////////////////////////////////////////////
                        Mappings
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice Returns the total supply of NFTs of a given tokenId
     *  @dev Mapping from tokenId => total circulating supply of NFTs of that tokenId.
     */
    mapping(uint256 => uint256) public totalSupply;

    /*///////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Initializes the contract with the given parameters.
     *
     * @param _defaultAdmin         The default admin for the contract.
     * @param _name                 The name of the contract.
     * @param _symbol               The symbol of the contract.
     * @param _royaltyRecipient     The address to which royalties should be sent.
     * @param _royaltyBps           The royalty basis points to be charged. Max = 10000 (10000 = 100%, 1000 = 10%)
     * @param _primarySaleRecipient The address to which primary sale revenue should be sent.
     */
    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _royaltyRecipient,
        uint128 _royaltyBps,
        address _primarySaleRecipient
    ) ERC1155(_name, _symbol) {
        _setupOwner(_defaultAdmin);
        _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps);
        _setupPrimarySaleRecipient(_primarySaleRecipient);
    }

    /*//////////////////////////////////////////////////////////////
                            ERC165 Logic
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165
     * @inheritdoc IERC165
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, IERC165) returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155
            interfaceId == 0x0e89341c || // ERC165 Interface ID for ERC1155MetadataURI
            interfaceId == type(IERC2981).interfaceId; // ERC165 ID for ERC2981
    }

    /*//////////////////////////////////////////////////////////////
                        Minting/burning logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice         Lets an owner or approved operator burn NFTs of the given tokenId.
     *
     *  @param _owner   The owner of the NFT to burn.
     *  @param _tokenId The tokenId of the NFT to burn.
     *  @param _amount  The amount of the NFT to burn.
     */
    function burn(address _owner, uint256 _tokenId, uint256 _amount) external virtual {
        address caller = msg.sender;

        require(caller == _owner || isApprovedForAll[_owner][caller], "Unapproved caller");
        require(balanceOf[_owner][_tokenId] >= _amount, "Not enough tokens owned");

        _burn(_owner, _tokenId, _amount);
    }

    /**
     *  @notice         Lets an owner or approved operator burn NFTs of the given tokenIds.
     *
     *  @param _owner    The owner of the NFTs to burn.
     *  @param _tokenIds The tokenIds of the NFTs to burn.
     *  @param _amounts  The amounts of the NFTs to burn.
     */
    function burnBatch(address _owner, uint256[] memory _tokenIds, uint256[] memory _amounts) external virtual {
        address caller = msg.sender;

        require(caller == _owner || isApprovedForAll[_owner][caller], "Unapproved caller");
        require(_tokenIds.length == _amounts.length, "Length mismatch");

        for (uint256 i = 0; i < _tokenIds.length; i += 1) {
            require(balanceOf[_owner][_tokenIds[i]] >= _amounts[i], "Not enough tokens owned");
        }

        _burnBatch(_owner, _tokenIds, _amounts);
    }

    /*///////////////////////////////////////////////////////////////
                    Overriden metadata logic
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice         Returns the metadata URI for an NFT.
     * @dev            See `BatchMintMetadata` for handling of metadata in this contract.
     *
     * @param _tokenId The tokenId of an NFT.
     * @return         The metadata URI for the given NFT.
     */
    function uri(uint256 _tokenId) public view virtual override returns (string memory) {
        (uint256 batchId, ) = _getBatchId(_tokenId);
        string memory batchUri = _getBaseURI(_tokenId);

        if (isEncryptedBatch(batchId)) {
            return string(abi.encodePacked(batchUri, "0"));
        } else {
            return string(abi.encodePacked(batchUri, _tokenId.toString()));
        }
    }

    /*///////////////////////////////////////////////////////////////
                        Delayed reveal logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice       Lets an authorized address reveal a batch of delayed reveal NFTs.
     *
     *  @param _index       The ID for the batch of delayed-reveal NFTs to reveal.
     *  @param _key         The key with which the base URI for the relevant batch of NFTs was encrypted.
     *  @return revealedURI The revealed URI for the batch of NFTs.
     */
    function reveal(uint256 _index, bytes calldata _key) public virtual override returns (string memory revealedURI) {
        require(_canReveal(), "Not authorized");

        uint256 batchId = getBatchIdAtIndex(_index);
        revealedURI = getRevealURI(batchId, _key);

        _setEncryptedData(batchId, "");
        _setBaseURI(batchId, revealedURI);

        emit TokenURIRevealed(_index, revealedURI);
    }

    /*///////////////////////////////////////////////////////////////
                    Overriden lazy minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice                  Lets an authorized address lazy mint a given amount of NFTs.
     *
     *  @param _amount           The number of NFTs to lazy mint.
     *  @param _baseURIForTokens The placeholder base URI for the 'n' number of NFTs being lazy minted, where the
     *                           metadata for each of those NFTs is `${baseURIForTokens}/${tokenId}`.
     *  @param _data             The encrypted base URI + provenance hash for the batch of NFTs being lazy minted.
     *  @return batchId          A unique integer identifier for the batch of NFTs lazy minted together.
     */
    function lazyMint(
        uint256 _amount,
        string calldata _baseURIForTokens,
        bytes calldata _data
    ) public virtual override returns (uint256 batchId) {
        if (_data.length > 0) {
            (bytes memory encryptedURI, bytes32 provenanceHash) = abi.decode(_data, (bytes, bytes32));
            if (encryptedURI.length != 0 && provenanceHash != "") {
                _setEncryptedData(nextTokenIdToLazyMint + _amount, _data);
            }
        }

        return LazyMint.lazyMint(_amount, _baseURIForTokens, _data);
    }

    /// @notice The tokenId assigned to the next new NFT to be lazy minted.
    function nextTokenIdToMint() public view virtual returns (uint256) {
        return nextTokenIdToLazyMint;
    }

    /*///////////////////////////////////////////////////////////////
                        Internal functions
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev Runs before every `claim` function call.
     *
     * @param _tokenId The tokenId of the NFT being claimed.
     */
    function _beforeClaim(
        uint256 _tokenId,
        address,
        uint256,
        address,
        uint256,
        AllowlistProof calldata,
        bytes memory
    ) internal view virtual override {
        if (_tokenId >= nextTokenIdToLazyMint) {
            revert("Not enough minted tokens");
        }
    }

    /**
     * @dev Collects and distributes the primary sale value of NFTs being claimed.
     *
     * @param _primarySaleRecipient The address to which primary sale revenue should be sent.
     * @param _quantityToClaim      The quantity of NFTs being claimed.
     * @param _currency             The currency in which the NFTs are being sold.
     * @param _pricePerToken        The price per NFT being claimed.
     */

    function _collectPriceOnClaim(
        address _primarySaleRecipient,
        uint256 _quantityToClaim,
        address _currency,
        uint256 _pricePerToken
    ) internal virtual override {
        if (_pricePerToken == 0) {
            require(msg.value == 0, "!Value");
            return;
        }

        uint256 totalPrice = _quantityToClaim * _pricePerToken;

        bool validMsgValue;
        if (_currency == CurrencyTransferLib.NATIVE_TOKEN) {
            validMsgValue = msg.value == totalPrice;
        } else {
            validMsgValue = msg.value == 0;
        }
        require(validMsgValue, "Invalid msg value");

        address saleRecipient = _primarySaleRecipient == address(0) ? primarySaleRecipient() : _primarySaleRecipient;
        CurrencyTransferLib.transferCurrency(_currency, msg.sender, saleRecipient, totalPrice);
    }

    /**
     * @dev Transfers the NFTs being claimed.
     *
     * @param _to                    The address to which the NFTs are being transferred.
     * @param _tokenId               The tokenId of the NFTs being claimed.
     * @param _quantityBeingClaimed  The quantity of NFTs being claimed.
     */
    function _transferTokensOnClaim(
        address _to,
        uint256 _tokenId,
        uint256 _quantityBeingClaimed
    ) internal virtual override {
        _mint(_to, _tokenId, _quantityBeingClaimed, "");
    }

    /**
     * @dev Runs before every token transfer / mint / burn.
     *
     * @param operator The address performing the token transfer.
     * @param from     The address from which the token is being transferred.
     * @param to       The address to which the token is being transferred.
     * @param ids      The tokenIds of the tokens being transferred.
     * @param amounts  The amounts of the tokens being transferred.
     * @param data     Any additional data being passed in the token transfer.
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual override {
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);

        if (from == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                totalSupply[ids[i]] += amounts[i];
            }
        }

        if (to == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                totalSupply[ids[i]] -= amounts[i];
            }
        }
    }

    /// @dev Checks whether primary sale recipient can be set in the given execution context.
    function _canSetPrimarySaleRecipient() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Checks whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Checks whether royalty info can be set in the given execution context.
    function _canSetRoyaltyInfo() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Checks whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Checks whether platform fee info can be set in the given execution context.
    function _canSetClaimConditions() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether lazy minting can be done in the given execution context.
    function _canLazyMint() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Checks whether NFTs can be revealed in the given execution context.
    function _canReveal() internal view virtual returns (bool) {
        return msg.sender == owner();
    }
}


================================================
FILE: contracts/base/ERC1155LazyMint.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import { ERC1155 } from "../eip/ERC1155.sol";

import "../extension/ContractMetadata.sol";
import "../extension/Multicall.sol";
import "../extension/Ownable.sol";
import "../extension/Royalty.sol";
import "../extension/BatchMintMetadata.sol";
import "../extension/LazyMint.sol";
import "../extension/interface/IClaimableERC1155.sol";

import "../lib/Strings.sol";
import "../external-deps/openzeppelin/security/ReentrancyGuard.sol";

/**
 *      BASE:      ERC1155Base
 *      EXTENSION: LazyMint
 *
 *  The `ERC1155LazyMint` smart contract implements the ERC1155 NFT standard.
 *  It includes the following additions to standard ERC1155 logic:
 *
 *      - Lazy minting
 *
 *      - Ability to mint NFTs via the provided `mintTo` and `batchMintTo` functions.
 *
 *      - Contract metadata for royalty support on platforms such as OpenSea that use
 *        off-chain information to distribute roaylties.
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically
 *
 *      - EIP 2981 compliance for royalty support on NFT marketplaces.
 *
 *
 *  The `ERC1155LazyMint` contract uses the `LazyMint` extension.
 *
 *  'Lazy minting' means defining the metadata of NFTs without minting it to an address. Regular 'minting'
 *  of  NFTs means actually assigning an owner to an NFT.
 *
 *  As a contract admin, this lets you prepare the metadata for NFTs that will be minted by an external party,
 *  without paying the gas cost for actually minting the NFTs.
 *
 */

contract ERC1155LazyMint is
    ERC1155,
    ContractMetadata,
    Ownable,
    Royalty,
    Multicall,
    BatchMintMetadata,
    LazyMint,
    IClaimableERC1155,
    ReentrancyGuard
{
    using Strings for uint256;

    /*//////////////////////////////////////////////////////////////
                        Mappings
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice Returns the total supply of NFTs of a given tokenId
     *  @dev Mapping from tokenId => total circulating supply of NFTs of that tokenId.
     */
    mapping(uint256 => uint256) public totalSupply;

    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Initializes the contract during construction.
     *
     * @param _defaultAdmin     The default admin of the contract.
     * @param _name             The name of the contract.
     * @param _symbol           The symbol of the contract.
     * @param _royaltyRecipient The address to receive royalties.
     * @param _royaltyBps       The royalty basis points to be charged. Max = 10000 (10000 = 100%, 1000 = 10%)
     */
    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _royaltyRecipient,
        uint128 _royaltyBps
    ) ERC1155(_name, _symbol) {
        _setupOwner(_defaultAdmin);
        _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps);
    }

    /*//////////////////////////////////////////////////////////////
                    Overriden metadata logic
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Returns the metadata URI for the given tokenId.
     *
     * @param _tokenId The tokenId of the NFT.
     * @return The metadata URI for the given tokenId.
     */
    function uri(uint256 _tokenId) public view virtual override returns (string memory) {
        string memory batchUri = _getBaseURI(_tokenId);
        return string(abi.encodePacked(batchUri, _tokenId.toString()));
    }

    /*//////////////////////////////////////////////////////////////
                            CLAIM LOGIC
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice          Lets an address claim multiple lazy minted NFTs at once to a recipient.
     *                   This function prevents any reentrant calls, and is not allowed to be overridden.
     *
     *                   Contract creators should override `verifyClaim` and `transferTokensOnClaim`
     *                   functions to create custom logic for verification and claiming,
     *                   for e.g. price collection, allowlist, max quantity, etc.
     *
     *  @dev             The logic in `verifyClaim` determines whether the caller is authorized to mint NFTs.
     *                   The logic in `transferTokensOnClaim` does actual minting of tokens,
     *                   can also be used to apply other state changes.
     *
     *  @param _receiver  The recipient of the tokens to mint.
     *  @param _tokenId   The tokenId of the lazy minted NFT to mint.
     *  @param _quantity  The number of tokens to mint.
     */
    function claim(address _receiver, uint256 _tokenId, uint256 _quantity) public payable virtual nonReentrant {
        require(_tokenId < nextTokenIdToMint(), "invalid id");
        verifyClaim(msg.sender, _tokenId, _quantity); // Add your claim verification logic by overriding this function.

        _transferTokensOnClaim(_receiver, _tokenId, _quantity); // Mints tokens. Apply any state updates by overriding this function.
        emit TokensClaimed(msg.sender, _receiver, _tokenId, _quantity);
    }

    /**
     *  @notice          Override this function to add logic for claim verification, based on conditions
     *                   such as allowlist, price, max quantity etc.
     *
     *  @dev             Checks a request to claim NFTs against a custom condition.
     *
     *  @param _claimer   Caller of the claim function.
     *  @param _tokenId   The tokenId of the lazy minted NFT to mint.
     *  @param _quantity  The number of NFTs being claimed.
     */
    function verifyClaim(address _claimer, uint256 _tokenId, uint256 _quantity) public view virtual {}

    /**
     *  @notice         Lets an owner or approved operator burn NFTs of the given tokenId.
     *
     *  @param _owner   The owner of the NFT to burn.
     *  @param _tokenId The tokenId of the NFT to burn.
     *  @param _amount  The amount of the NFT to burn.
     */
    function burn(address _owner, uint256 _tokenId, uint256 _amount) external virtual {
        address caller = msg.sender;

        require(caller == _owner || isApprovedForAll[_owner][caller], "Unapproved caller");
        require(balanceOf[_owner][_tokenId] >= _amount, "Not enough tokens owned");

        _burn(_owner, _tokenId, _amount);
    }

    /**
     *  @notice         Lets an owner or approved operator burn NFTs of the given tokenIds.
     *
     *  @param _owner    The owner of the NFTs to burn.
     *  @param _tokenIds The tokenIds of the NFTs to burn.
     *  @param _amounts  The amounts of the NFTs to burn.
     */
    function burnBatch(address _owner, uint256[] memory _tokenIds, uint256[] memory _amounts) external virtual {
        address caller = msg.sender;

        require(caller == _owner || isApprovedForAll[_owner][caller], "Unapproved caller");
        require(_tokenIds.length == _amounts.length, "Length mismatch");

        for (uint256 i = 0; i < _tokenIds.length; i += 1) {
            require(balanceOf[_owner][_tokenIds[i]] >= _amounts[i], "Not enough tokens owned");
        }

        _burnBatch(_owner, _tokenIds, _amounts);
    }

    /*//////////////////////////////////////////////////////////////
                            ERC165 Logic
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165
     * @inheritdoc IERC165
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, IERC165) returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155
            interfaceId == 0x0e89341c || // ERC165 Interface ID for ERC1155MetadataURI
            interfaceId == type(IERC2981).interfaceId; // ERC165 ID for ERC2981
    }

    /*//////////////////////////////////////////////////////////////
                            View functions
    //////////////////////////////////////////////////////////////*/

    /// @notice The tokenId assigned to the next new NFT to be lazy minted.
    function nextTokenIdToMint() public view virtual returns (uint256) {
        return nextTokenIdToLazyMint;
    }

    /*//////////////////////////////////////////////////////////////
                        Internal functions
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice          Mints tokens to receiver on claim.
     *                   Any state changes related to `claim` must be applied
     *                   here by overriding this function.
     *
     *  @dev             Override this function to add logic for state updation.
     *                   When overriding, apply any state changes before `_mint`.
     *
     *  @param _receiver The receiver of the tokens to mint.
     *  @param _tokenId  The tokenId of the lazy minted NFT to mint.
     *  @param _quantity The number of tokens to mint.
     */
    function _transferTokensOnClaim(address _receiver, uint256 _tokenId, uint256 _quantity) internal virtual {
        _mint(_receiver, _tokenId, _quantity, "");
    }

    /// @dev Returns whether lazy minting can be done in the given execution context.
    function _canLazyMint() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether royalty info can be set in the given execution context.
    function _canSetRoyaltyInfo() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /**
     * @dev Runs before every token transfer / mint / burn.
     *
     * @param operator The address performing the token transfer.
     * @param from     The address from which the token is being transferred.
     * @param to       The address to which the token is being transferred.
     * @param ids      The tokenIds of the tokens being transferred.
     * @param amounts  The amounts of the tokens being transferred.
     * @param data     Any additional data being passed in the token transfer.
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual override {
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);

        if (from == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                totalSupply[ids[i]] += amounts[i];
            }
        }

        if (to == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                totalSupply[ids[i]] -= amounts[i];
            }
        }
    }
}


================================================
FILE: contracts/base/ERC1155SignatureMint.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "./ERC1155Base.sol";

import "../extension/PrimarySale.sol";
import "../extension/SignatureMintERC1155.sol";
import { ReentrancyGuard } from "../extension/upgradeable/ReentrancyGuard.sol";
import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";

/**
 *      BASE:      ERC1155Base
 *      EXTENSION: SignatureMintERC1155
 *
 *  The `ERC1155SignatureMint` contract uses the `ERC1155Base` contract, along with the `SignatureMintERC1155` extension.
 *
 *  The 'signature minting' mechanism in the `SignatureMintERC1155` extension uses EIP 712, and is a way for a contract
 *  admin to authorize an external party's request to mint tokens on the admin's contract. At a high level, this means
 *  you can authorize some external party to mint tokens on your contract, and specify what exactly will be minted by
 *  that external party.
 *
 */

contract ERC1155SignatureMint is ERC1155Base, PrimarySale, SignatureMintERC1155, ReentrancyGuard {
    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _royaltyRecipient,
        uint128 _royaltyBps,
        address _primarySaleRecipient
    ) ERC1155Base(_defaultAdmin, _name, _symbol, _royaltyRecipient, _royaltyBps) {
        _setupPrimarySaleRecipient(_primarySaleRecipient);
    }

    /*//////////////////////////////////////////////////////////////
                        Signature minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice           Mints tokens according to the provided mint request.
     *
     *  @param _req       The payload / mint request.
     *  @param _signature The signature produced by an account signing the mint request.
     */
    function mintWithSignature(
        MintRequest calldata _req,
        bytes calldata _signature
    ) external payable virtual override nonReentrant returns (address signer) {
        require(_req.quantity > 0, "Minting zero tokens.");

        uint256 tokenIdToMint;
        uint256 nextIdToMint = nextTokenIdToMint();

        if (_req.tokenId == type(uint256).max) {
            tokenIdToMint = nextIdToMint;
            nextTokenIdToMint_ += 1;
        } else {
            require(_req.tokenId < nextIdToMint, "invalid id");
            tokenIdToMint = _req.tokenId;
        }

        // Verify and process payload.
        signer = _processRequest(_req, _signature);

        address receiver = _req.to;

        // Collect price
        _collectPriceOnClaim(_req.primarySaleRecipient, _req.quantity, _req.currency, _req.pricePerToken);

        // Set royalties, if applicable.
        if (_req.royaltyRecipient != address(0)) {
            _setupRoyaltyInfoForToken(tokenIdToMint, _req.royaltyRecipient, _req.royaltyBps);
        }

        // Set URI
        if (_req.tokenId == type(uint256).max) {
            _setTokenURI(tokenIdToMint, _req.uri);
        }

        // Mint tokens.
        _mint(receiver, tokenIdToMint, _req.quantity, "");

        emit TokensMintedWithSignature(signer, receiver, tokenIdToMint, _req);
    }

    /*//////////////////////////////////////////////////////////////
                            Internal functions
    //////////////////////////////////////////////////////////////*/

    /// @dev Returns whether a given address is authorized to sign mint requests.
    function _canSignMintRequest(address _signer) internal view virtual override returns (bool) {
        return _signer == owner();
    }

    /// @dev Returns whether primary sale recipient can be set in the given execution context.
    function _canSetPrimarySaleRecipient() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Collects and distributes the primary sale value of NFTs being claimed.
    function _collectPriceOnClaim(
        address _primarySaleRecipient,
        uint256 _quantityToClaim,
        address _currency,
        uint256 _pricePerToken
    ) internal virtual {
        if (_pricePerToken == 0) {
            require(msg.value == 0, "!Value");
            return;
        }

        uint256 totalPrice = _quantityToClaim * _pricePerToken;

        bool validMsgValue;
        if (_currency == CurrencyTransferLib.NATIVE_TOKEN) {
            validMsgValue = msg.value == totalPrice;
        } else {
            validMsgValue = msg.value == 0;
        }
        require(validMsgValue, "Invalid msg value");

        address saleRecipient = _primarySaleRecipient == address(0) ? primarySaleRecipient() : _primarySaleRecipient;
        CurrencyTransferLib.transferCurrency(_currency, msg.sender, saleRecipient, totalPrice);
    }
}


================================================
FILE: contracts/base/ERC20Base.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "../external-deps/openzeppelin/token/ERC20/extensions/ERC20Permit.sol";

import "../extension/ContractMetadata.sol";
import "../extension/Multicall.sol";
import "../extension/Ownable.sol";
import "../extension/interface/IMintableERC20.sol";
import "../extension/interface/IBurnableERC20.sol";

/**
 *  The `ERC20Base` smart contract implements the ERC20 standard.
 *  It includes the following additions to standard ERC20 logic:
 *
 *      - Ability to mint & burn tokens via the provided `mint` & `burn` functions.
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically
 *
 *      - EIP 2612 compliance: See {ERC20-permit} method, which can be used to change an account's ERC20 allowance by
 *                             presenting a message signed by the account.
 */

contract ERC20Base is ContractMetadata, Multicall, Ownable, ERC20Permit, IMintableERC20, IBurnableERC20 {
    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(address _defaultAdmin, string memory _name, string memory _symbol) ERC20Permit(_name, _symbol) {
        _setupOwner(_defaultAdmin);
    }

    /*//////////////////////////////////////////////////////////////
                            Minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice          Lets an authorized address mint tokens to a recipient.
     *  @dev             The logic in the `_canMint` function determines whether the caller is authorized to mint tokens.
     *
     *  @param _to       The recipient of the tokens to mint.
     *  @param _amount   Quantity of tokens to mint.
     */
    function mintTo(address _to, uint256 _amount) public virtual {
        require(_canMint(), "Not authorized to mint.");
        require(_amount != 0, "Minting zero tokens.");

        _mint(_to, _amount);
    }

    /**
     *  @notice          Lets an owner a given amount of their tokens.
     *  @dev             Caller should own the `_amount` of tokens.
     *
     *  @param _amount   The number of tokens to burn.
     */
    function burn(uint256 _amount) external virtual {
        require(balanceOf(msg.sender) >= _amount, "not enough balance");
        _burn(msg.sender, _amount);
    }

    /**
     *  @notice          Lets an owner burn a given amount of an account's tokens.
     *  @dev             `_account` should own the `_amount` of tokens.
     *
     *  @param _account  The account to burn tokens from.
     *  @param _amount   The number of tokens to burn.
     */
    function burnFrom(address _account, uint256 _amount) external virtual override {
        require(_canBurn(), "Not authorized to burn.");
        require(balanceOf(_account) >= _amount, "not enough balance");
        uint256 decreasedAllowance = allowance(_account, msg.sender) - _amount;
        _approve(_account, msg.sender, 0);
        _approve(_account, msg.sender, decreasedAllowance);
        _burn(_account, _amount);
    }

    /*//////////////////////////////////////////////////////////////
                        Internal (overrideable) functions
    //////////////////////////////////////////////////////////////*/

    /// @dev Returns whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether tokens can be minted in the given execution context.
    function _canMint() internal view virtual returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether tokens can be burned in the given execution context.
    function _canBurn() internal view virtual returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @notice Returns the sender in the given execution context.
    function _msgSender() internal view override(Multicall, Context) returns (address) {
        return msg.sender;
    }
}


================================================
FILE: contracts/base/ERC20Drop.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "../external-deps/openzeppelin/token/ERC20/extensions/ERC20Permit.sol";

import "../extension/ContractMetadata.sol";
import "../extension/Multicall.sol";
import "../extension/Ownable.sol";
import "../extension/PrimarySale.sol";
import "../extension/DropSinglePhase.sol";
import "../extension/interface/IBurnableERC20.sol";

import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";

/**
 *      BASE:      ERC20
 *      EXTENSION: DropSinglePhase
 *
 *  The `ERC20Drop` smart contract implements the ERC20 standard.
 *  It includes the following additions to standard ERC20 logic:
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically
 *
 *      - EIP 2612 compliance: See {ERC20-permit} method, which can be used to change an account's ERC20 allowance by
 *                             presenting a message signed by the account.
 *
 *  The `drop` mechanism in the `DropSinglePhase` extension is a distribution mechanism for tokens. It lets
 *  you set restrictions such as a price to charge, an allowlist etc. when an address atttempts to mint tokens.
 *
 */

contract ERC20Drop is ContractMetadata, Multicall, Ownable, ERC20Permit, PrimarySale, DropSinglePhase, IBurnableERC20 {
    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _primarySaleRecipient
    ) ERC20Permit(_name, _symbol) {
        _setupOwner(_defaultAdmin);
        _setupPrimarySaleRecipient(_primarySaleRecipient);
    }

    /*//////////////////////////////////////////////////////////////
                            ERC20 logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice          Lets an owner a given amount of their tokens.
     *  @dev             Caller should own the `_amount` of tokens.
     *
     *  @param _amount   The number of tokens to burn.
     */
    function burn(uint256 _amount) external virtual {
        require(balanceOf(msg.sender) >= _amount, "not enough balance");
        _burn(msg.sender, _amount);
    }

    /**
     *  @notice          Lets an owner burn a given amount of an account's tokens.
     *  @dev             `_account` should own the `_amount` of tokens.
     *
     *  @param _account  The account to burn tokens from.
     *  @param _amount   The number of tokens to burn.
     */
    function burnFrom(address _account, uint256 _amount) external virtual override {
        require(_canBurn(), "Not authorized to burn.");
        require(balanceOf(_account) >= _amount, "not enough balance");
        uint256 decreasedAllowance = allowance(_account, msg.sender) - _amount;
        _approve(_account, msg.sender, 0);
        _approve(_account, msg.sender, decreasedAllowance);
        _burn(_account, _amount);
    }

    /*//////////////////////////////////////////////////////////////
                        Internal (overrideable) functions
    //////////////////////////////////////////////////////////////*/

    /// @dev Collects and distributes the primary sale value of tokens being claimed.
    function _collectPriceOnClaim(
        address _primarySaleRecipient,
        uint256 _quantityToClaim,
        address _currency,
        uint256 _pricePerToken
    ) internal virtual override {
        if (_pricePerToken == 0) {
            require(msg.value == 0, "!Value");
            return;
        }

        uint256 totalPrice = (_quantityToClaim * _pricePerToken) / 1 ether;
        require(totalPrice > 0, "quantity too low");

        bool validMsgValue;
        if (_currency == CurrencyTransferLib.NATIVE_TOKEN) {
            validMsgValue = msg.value == totalPrice;
        } else {
            validMsgValue = msg.value == 0;
        }
        require(validMsgValue, "Invalid msg value");

        address saleRecipient = _primarySaleRecipient == address(0) ? primarySaleRecipient() : _primarySaleRecipient;
        CurrencyTransferLib.transferCurrency(_currency, msg.sender, saleRecipient, totalPrice);
    }

    /// @dev Transfers the tokens being claimed.
    function _transferTokensOnClaim(
        address _to,
        uint256 _quantityBeingClaimed
    ) internal virtual override returns (uint256) {
        _mint(_to, _quantityBeingClaimed);
        return 0;
    }

    /// @dev Checks whether platform fee info can be set in the given execution context.
    function _canSetClaimConditions() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether tokens can be minted in the given execution context.
    function _canMint() internal view virtual returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether tokens can be burned in the given execution context.
    function _canBurn() internal view virtual returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether primary sale recipient can be set in the given execution context.
    function _canSetPrimarySaleRecipient() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @notice Returns the sender in the given execution context.
    function _msgSender() internal view override(Multicall, Context) returns (address) {
        return msg.sender;
    }
}


================================================
FILE: contracts/base/ERC20DropVote.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "../external-deps/openzeppelin/token/ERC20/extensions/ERC20Votes.sol";

import "../extension/ContractMetadata.sol";
import "../extension/Multicall.sol";
import "../extension/Ownable.sol";
import "../extension/PrimarySale.sol";
import "../extension/DropSinglePhase.sol";

import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";

/**
 *      BASE:      ERC20Votes
 *      EXTENSION: DropSinglePhase
 *
 *  The `ERC20Drop` contract uses the `DropSinglePhase` extensions, along with `ERC20Votes`.
 *  It implements the ERC20 standard, along with the following additions to standard ERC20 logic:
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically
 *
 *      - EIP 2612 compliance: See {ERC20-permit} method, which can be used to change an account's ERC20 allowance by
 *                             presenting a message signed by the account.
 *
 *  The `drop` mechanism in the `DropSinglePhase` extension is a distribution mechanism tokens. It lets
 *  you set restrictions such as a price to charge, an allowlist etc. when an address atttempts to mint tokens.
 *
 */

contract ERC20DropVote is ContractMetadata, Multicall, Ownable, ERC20Votes, PrimarySale, DropSinglePhase {
    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _primarySaleRecipient
    ) ERC20Permit(_name, _symbol) {
        _setupOwner(_defaultAdmin);
        _setupPrimarySaleRecipient(_primarySaleRecipient);
    }

    /*//////////////////////////////////////////////////////////////
                            ERC20 logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice          Lets an owner a given amount of their tokens.
     *  @dev             Caller should own the `_amount` of tokens.
     *
     *  @param _amount   The number of tokens to burn.
     */
    function burn(uint256 _amount) external virtual {
        require(balanceOf(msg.sender) >= _amount, "not enough balance");
        _burn(msg.sender, _amount);
    }

    /*//////////////////////////////////////////////////////////////
                        Internal (overrideable) functions
    //////////////////////////////////////////////////////////////*/

    /// @dev Collects and distributes the primary sale value of tokens being claimed.
    function _collectPriceOnClaim(
        address _primarySaleRecipient,
        uint256 _quantityToClaim,
        address _currency,
        uint256 _pricePerToken
    ) internal virtual override {
        if (_pricePerToken == 0) {
            require(msg.value == 0, "!Value");
            return;
        }

        uint256 totalPrice = (_quantityToClaim * _pricePerToken) / 1 ether;
        require(totalPrice > 0, "quantity too low");

        bool validMsgValue;
        if (_currency == CurrencyTransferLib.NATIVE_TOKEN) {
            validMsgValue = msg.value == totalPrice;
        } else {
            validMsgValue = msg.value == 0;
        }
        require(validMsgValue, "Invalid msg value");

        address saleRecipient = _primarySaleRecipient == address(0) ? primarySaleRecipient() : _primarySaleRecipient;
        CurrencyTransferLib.transferCurrency(_currency, msg.sender, saleRecipient, totalPrice);
    }

    /// @dev Transfers the tokens being claimed.
    function _transferTokensOnClaim(
        address _to,
        uint256 _quantityBeingClaimed
    ) internal virtual override returns (uint256) {
        _mint(_to, _quantityBeingClaimed);
        return 0;
    }

    /// @dev Checks whether platform fee info can be set in the given execution context.
    function _canSetClaimConditions() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether tokens can be minted in the given execution context.
    function _canMint() internal view virtual returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether primary sale recipient can be set in the given execution context.
    function _canSetPrimarySaleRecipient() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @notice Returns the sender in the given execution context.
    function _msgSender() internal view override(Multicall, Context) returns (address) {
        return msg.sender;
    }
}


================================================
FILE: contracts/base/ERC20SignatureMint.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "./ERC20Base.sol";

import "../extension/PrimarySale.sol";
import { SignatureMintERC20 } from "../extension/SignatureMintERC20.sol";
import { ReentrancyGuard } from "../extension/upgradeable/ReentrancyGuard.sol";
import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";

/**
 *      BASE:      ERC20
 *      EXTENSION: SignatureMintERC20
 *
 *  The `ERC20SignatureMint` contract uses the `ERC20Base` contract, along with the `SignatureMintERC20` extension.
 *
 *  The 'signature minting' mechanism in the `SignatureMintERC20` extension uses EIP 712, and is a way for a contract
 *  admin to authorize an external party's request to mint tokens on the admin's contract. At a high level, this means
 *  you can authorize some external party to mint tokens on your contract, and specify what exactly will be minted by
 *  that external party.
 *
 */

contract ERC20SignatureMint is ERC20Base, PrimarySale, SignatureMintERC20, ReentrancyGuard {
    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _primarySaleRecipient
    ) ERC20Base(_defaultAdmin, _name, _symbol) {
        _setupPrimarySaleRecipient(_primarySaleRecipient);
    }

    /*//////////////////////////////////////////////////////////////
                        Signature minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice           Mints tokens according to the provided mint request.
     *
     *  @param _req       The payload / mint request.
     *  @param _signature The signature produced by an account signing the mint request.
     */
    function mintWithSignature(
        MintRequest calldata _req,
        bytes calldata _signature
    ) external payable virtual nonReentrant returns (address signer) {
        require(_req.quantity > 0, "Minting zero tokens.");

        // Verify and process payload.
        signer = _processRequest(_req, _signature);

        address receiver = _req.to;

        // Collect price
        _collectPriceOnClaim(_req.primarySaleRecipient, _req.currency, _req.price);

        // Mint tokens.
        _mint(receiver, _req.quantity);

        emit TokensMintedWithSignature(signer, receiver, _req);
    }

    /*//////////////////////////////////////////////////////////////
                            Internal functions
    //////////////////////////////////////////////////////////////*/

    /// @dev Returns whether a given address is authorized to sign mint requests.
    function _canSignMintRequest(address _signer) internal view virtual override returns (bool) {
        return _signer == owner();
    }

    /// @dev Returns whether primary sale recipient can be set in the given execution context.
    function _canSetPrimarySaleRecipient() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Collects and distributes the primary sale value of tokens being claimed.
    function _collectPriceOnClaim(address _primarySaleRecipient, address _currency, uint256 _price) internal virtual {
        if (_price == 0) {
            require(msg.value == 0, "!Value");
            return;
        }

        if (_currency == CurrencyTransferLib.NATIVE_TOKEN) {
            require(msg.value == _price, "Must send total price.");
        } else {
            require(msg.value == 0, "msg value not zero");
        }

        address saleRecipient = _primarySaleRecipient == address(0) ? primarySaleRecipient() : _primarySaleRecipient;
        CurrencyTransferLib.transferCurrency(_currency, msg.sender, saleRecipient, _price);
    }
}


================================================
FILE: contracts/base/ERC20SignatureMintVote.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "./ERC20Vote.sol";

import "../extension/PrimarySale.sol";
import { SignatureMintERC20 } from "../extension/SignatureMintERC20.sol";
import { ReentrancyGuard } from "../extension/upgradeable/ReentrancyGuard.sol";
import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";

/**
 *      BASE:      ERC20Vote
 *      EXTENSION: SignatureMintERC20
 *
 *  The `ERC20SignatureMint` contract uses the `ERC20Vote` contract, along with the `SignatureMintERC20` extension.
 *
 *  The 'signature minting' mechanism in the `SignatureMintERC20` extension uses EIP 712, and is a way for a contract
 *  admin to authorize an external party's request to mint tokens on the admin's contract. At a high level, this means
 *  you can authorize some external party to mint tokens on your contract, and specify what exactly will be minted by
 *  that external party.
 *
 */

contract ERC20SignatureMintVote is ERC20Vote, PrimarySale, SignatureMintERC20, ReentrancyGuard {
    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _primarySaleRecipient
    ) ERC20Vote(_defaultAdmin, _name, _symbol) {
        _setupPrimarySaleRecipient(_primarySaleRecipient);
    }

    /*//////////////////////////////////////////////////////////////
                        Signature minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice           Mints tokens according to the provided mint request.
     *
     *  @param _req       The payload / mint request.
     *  @param _signature The signature produced by an account signing the mint request.
     */
    function mintWithSignature(
        MintRequest calldata _req,
        bytes calldata _signature
    ) external payable virtual nonReentrant returns (address signer) {
        require(_req.quantity > 0, "Minting zero tokens.");

        // Verify and process payload.
        signer = _processRequest(_req, _signature);

        /**
         *  Get receiver of tokens.
         *
         *  Note: If `_req.to == address(0)`, a `mintWithSignature` transaction sitting in the
         *        mempool can be frontrun by copying the input data, since the minted tokens
         *        will be sent to the `_msgSender()` in this case.
         */
        address receiver = _req.to == address(0) ? msg.sender : _req.to;

        // Collect price
        _collectPriceOnClaim(_req.primarySaleRecipient, _req.currency, _req.price);

        // Mint tokens.
        _mint(receiver, _req.quantity);

        emit TokensMintedWithSignature(signer, receiver, _req);
    }

    /*//////////////////////////////////////////////////////////////
                            Internal functions
    //////////////////////////////////////////////////////////////*/

    /// @dev Returns whether a given address is authorized to sign mint requests.
    function _canSignMintRequest(address _signer) internal view virtual override returns (bool) {
        return _signer == owner();
    }

    /// @dev Returns whether primary sale recipient can be set in the given execution context.
    function _canSetPrimarySaleRecipient() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Collects and distributes the primary sale value of tokens being claimed.
    function _collectPriceOnClaim(address _primarySaleRecipient, address _currency, uint256 _price) internal virtual {
        if (_price == 0) {
            require(msg.value == 0, "!Value");
            return;
        }

        if (_currency == CurrencyTransferLib.NATIVE_TOKEN) {
            require(msg.value == _price, "Must send total price.");
        } else {
            require(msg.value == 0, "msg value not zero");
        }

        address saleRecipient = _primarySaleRecipient == address(0) ? primarySaleRecipient() : _primarySaleRecipient;
        CurrencyTransferLib.transferCurrency(_currency, msg.sender, saleRecipient, _price);
    }
}


================================================
FILE: contracts/base/ERC20Vote.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "../external-deps/openzeppelin/token/ERC20/extensions/ERC20Votes.sol";

import "./ERC20Base.sol";
import "../extension/interface/IMintableERC20.sol";
import "../extension/interface/IBurnableERC20.sol";

/**
 *  The `ERC20Vote` smart contract implements the ERC20 standard and ERC20Votes.
 *  It includes the following additions to standard ERC20 logic:
 *
 *      - Ability to mint & burn tokens via the provided `mint` & `burn` functions.
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically
 *
 *      - Extension of ERC20 to support voting and delegation.
 *
 *      - EIP 2612 compliance: See {ERC20-permit} method, which can be used to change an account's ERC20 allowance by
 *                             presenting a message signed by the account.
 */

contract ERC20Vote is ContractMetadata, Multicall, Ownable, ERC20Votes, IMintableERC20, IBurnableERC20 {
    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(address _defaultAdmin, string memory _name, string memory _symbol) ERC20Permit(_name, _symbol) {
        _setupOwner(_defaultAdmin);
    }

    /*//////////////////////////////////////////////////////////////
                            Minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice          Lets an authorized address mint tokens to a recipient.
     *  @dev             The logic in the `_canMint` function determines whether the caller is authorized to mint tokens.
     *
     *  @param _to       The recipient of the tokens to mint.
     *  @param _amount   Quantity of tokens to mint.
     */
    function mintTo(address _to, uint256 _amount) public virtual {
        require(_canMint(), "Not authorized to mint.");
        require(_amount != 0, "Minting zero tokens.");

        _mint(_to, _amount);
    }

    /**
     *  @notice          Lets an owner a given amount of their tokens.
     *  @dev             Caller should own the `_amount` of tokens.
     *
     *  @param _amount   The number of tokens to burn.
     */
    function burn(uint256 _amount) external virtual {
        require(balanceOf(_msgSender()) >= _amount, "not enough balance");
        _burn(msg.sender, _amount);
    }

    /**
     *  @notice          Lets an owner burn a given amount of an account's tokens.
     *  @dev             `_account` should own the `_amount` of tokens.
     *
     *  @param _account  The account to burn tokens from.
     *  @param _amount   The number of tokens to burn.
     */
    function burnFrom(address _account, uint256 _amount) external virtual override {
        require(_canBurn(), "Not authorized to burn.");
        require(balanceOf(_account) >= _amount, "not enough balance");
        uint256 decreasedAllowance = allowance(_account, msg.sender) - _amount;
        _approve(_account, msg.sender, 0);
        _approve(_account, msg.sender, decreasedAllowance);
        _burn(_account, _amount);
    }

    /*//////////////////////////////////////////////////////////////
                        Internal (overrideable) functions
    //////////////////////////////////////////////////////////////*/

    /// @dev Returns whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether tokens can be minted in the given execution context.
    function _canMint() internal view virtual returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether tokens can be burned in the given execution context.
    function _canBurn() internal view virtual returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @notice Returns the sender in the given execution context.
    function _msgSender() internal view override(Multicall, Context) returns (address) {
        return msg.sender;
    }
}


================================================
FILE: contracts/base/ERC721Base.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "../eip/queryable/ERC721AQueryable.sol";

import "../extension/ContractMetadata.sol";
import "../extension/Multicall.sol";
import "../extension/Ownable.sol";
import "../extension/Royalty.sol";
import "../extension/BatchMintMetadata.sol";

import "../lib/Strings.sol";

/**
 *  The `ERC721Base` smart contract implements the ERC721 NFT standard, along with the ERC721A optimization to the standard.
 *  It includes the following additions to standard ERC721 logic:
 *
 *      - Ability to mint NFTs via the provided `mint` function.
 *
 *      - Contract metadata for royalty support on platforms such as OpenSea that use
 *        off-chain information to distribute roaylties.
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically
 *
 *      - EIP 2981 compliance for royalty support on NFT marketplaces.
 */

contract ERC721Base is ERC721AQueryable, ContractMetadata, Multicall, Ownable, Royalty, BatchMintMetadata {
    using Strings for uint256;

    /*//////////////////////////////////////////////////////////////
                            Mappings
    //////////////////////////////////////////////////////////////*/

    mapping(uint256 => string) private fullURI;

    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Initializes the contract during construction.
     *
     * @param _defaultAdmin     The default admin of the contract.
     * @param _name             The name of the contract.
     * @param _symbol           The symbol of the contract.
     * @param _royaltyRecipient The address to receive royalties.
     * @param _royaltyBps       The royalty basis points to be charged. Max = 10000 (10000 = 100%, 1000 = 10%)
     */
    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _royaltyRecipient,
        uint128 _royaltyBps
    ) ERC721A(_name, _symbol) {
        _setupOwner(_defaultAdmin);
        _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps);
    }

    /*//////////////////////////////////////////////////////////////
                            ERC165 Logic
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165
     * @inheritdoc IERC165
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, IERC165) returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0x80ac58cd || // ERC165 Interface ID for ERC721
            interfaceId == 0x5b5e139f || // ERC165 Interface ID for ERC721Metadata
            interfaceId == type(IERC2981).interfaceId; // ERC165 ID for ERC2981
    }

    /*//////////////////////////////////////////////////////////////
                        Overriden ERC721 logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice         Returns the metadata URI for an NFT.
     *  @dev            See `BatchMintMetadata` for handling of metadata in this contract.
     *
     *  @param _tokenId The tokenId of an NFT.
     */
    function tokenURI(uint256 _tokenId) public view virtual override(ERC721A, IERC721Metadata) returns (string memory) {
        string memory fullUriForToken = fullURI[_tokenId];
        if (bytes(fullUriForToken).length > 0) {
            return fullUriForToken;
        }

        string memory batchUri = _getBaseURI(_tokenId);
        return string(abi.encodePacked(batchUri, _tokenId.toString()));
    }

    /*//////////////////////////////////////////////////////////////
                            Minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice          Lets an authorized address mint an NFT to a recipient.
     *  @dev             The logic in the `_canMint` function determines whether the caller is authorized to mint NFTs.
     *
     *  @param _to       The recipient of the NFT to mint.
     *  @param _tokenURI The full metadata URI for the NFT minted.
     */
    function mintTo(address _to, string memory _tokenURI) public virtual {
        require(_canMint(), "Not authorized to mint.");
        _setTokenURI(nextTokenIdToMint(), _tokenURI);
        _safeMint(_to, 1, "");
    }

    /**
     *  @notice          Lets an authorized address mint multiple NFTs at once to a recipient.
     *  @dev             The logic in the `_canMint` function determines whether the caller is authorized to mint NFTs.
     *
     *  @param _to       The recipient of the NFT to mint.
     *  @param _quantity The number of NFTs to mint.
     *  @param _baseURI  The baseURI for the `n` number of NFTs minted. The metadata for each NFT is `baseURI/tokenId`
     *  @param _data     Additional data to pass along during the minting of the NFT.
     */
    function batchMintTo(address _to, uint256 _quantity, string memory _baseURI, bytes memory _data) public virtual {
        require(_canMint(), "Not authorized to mint.");
        _batchMintMetadata(nextTokenIdToMint(), _quantity, _baseURI);
        _safeMint(_to, _quantity, _data);
    }

    /**
     *  @notice         Lets an owner or approved operator burn the NFT of the given tokenId.
     *  @dev            ERC721A's `_burn(uint256,bool)` internally checks for token approvals.
     *
     *  @param _tokenId The tokenId of the NFT to burn.
     */
    function burn(uint256 _tokenId) external virtual {
        _burn(_tokenId, true);
    }

    /*//////////////////////////////////////////////////////////////
                        Public getters
    //////////////////////////////////////////////////////////////*/

    /// @notice The tokenId assigned to the next new NFT to be minted.
    function nextTokenIdToMint() public view virtual returns (uint256) {
        return _currentIndex;
    }

    /**
     * @notice Returns whether a given address is the owner, or approved to transfer an NFT.
     *
     * @param _operator The address to check.
     * @param _tokenId  The tokenId of the NFT to check.
     *
     * @return isApprovedOrOwnerOf Whether the given address is approved to transfer the given NFT.
     */
    function isApprovedOrOwner(
        address _operator,
        uint256 _tokenId
    ) public view virtual returns (bool isApprovedOrOwnerOf) {
        address owner = ownerOf(_tokenId);
        isApprovedOrOwnerOf = (_operator == owner ||
            isApprovedForAll(owner, _operator) ||
            getApproved(_tokenId) == _operator);
    }

    /*//////////////////////////////////////////////////////////////
                        Internal (overrideable) functions
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Sets the metadata URI for a given tokenId.
     *
     * @param _tokenId  The tokenId of the NFT to set the URI for.
     * @param _tokenURI The URI to set for the given tokenId.
     */
    function _setTokenURI(uint256 _tokenId, string memory _tokenURI) internal virtual {
        require(bytes(fullURI[_tokenId]).length == 0, "URI already set");
        fullURI[_tokenId] = _tokenURI;
    }

    /// @dev Returns whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether a token can be minted in the given execution context.
    function _canMint() internal view virtual returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether royalty info can be set in the given execution context.
    function _canSetRoyaltyInfo() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @notice Returns the sender in the given execution context.
    function _msgSender() internal view override(Multicall, Context) returns (address) {
        return msg.sender;
    }
}


================================================
FILE: contracts/base/ERC721DelayedReveal.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "./ERC721LazyMint.sol";

import "../extension/DelayedReveal.sol";

/**
 *      BASE:      ERC721LazyMint
 *      EXTENSION: DelayedReveal
 *
 *  The `ERC721DelayedReveal` contract uses the `ERC721LazyMint` contract, along with `DelayedReveal` extension.
 *
 *  'Lazy minting' means defining the metadata of NFTs without minting it to an address. Regular 'minting'
 *  of  NFTs means actually assigning an owner to an NFT.
 *
 *  As a contract admin, this lets you prepare the metadata for NFTs that will be minted by an external party,
 *  without paying the gas cost for actually minting the NFTs.
 *
 *  'Delayed reveal' is a mechanism by which you can distribute NFTs to your audience and reveal the metadata of the distributed
 *  NFTs, after the fact.
 *
 *  You can read more about how the `DelayedReveal` extension works, here: https://blog.thirdweb.com/delayed-reveal-nfts
 */

contract ERC721DelayedReveal is ERC721LazyMint, DelayedReveal {
    using Strings for uint256;

    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _royaltyRecipient,
        uint128 _royaltyBps
    ) ERC721LazyMint(_defaultAdmin, _name, _symbol, _royaltyRecipient, _royaltyBps) {}

    /*//////////////////////////////////////////////////////////////
                        Overriden ERC721 logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice         Returns the metadata URI for an NFT.
     *  @dev            See `BatchMintMetadata` for handling of metadata in this contract.
     *
     *  @param _tokenId The tokenId of an NFT.
     */
    function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
        (uint256 batchId, ) = _getBatchId(_tokenId);
        string memory batchUri = _getBaseURI(_tokenId);

        if (isEncryptedBatch(batchId)) {
            return string(abi.encodePacked(batchUri, "0"));
        } else {
            return string(abi.encodePacked(batchUri, _tokenId.toString()));
        }
    }

    /*//////////////////////////////////////////////////////////////
                        Lazy minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice                  Lets an authorized address lazy mint a given amount of NFTs.
     *
     *  @param _amount           The number of NFTs to lazy mint.
     *  @param _baseURIForTokens The placeholder base URI for the 'n' number of NFTs being lazy minted, where the
     *                           metadata for each of those NFTs is `${baseURIForTokens}/${tokenId}`.
     *  @param _data             The encrypted base URI + provenance hash for the batch of NFTs being lazy minted.
     *  @return batchId          A unique integer identifier for the batch of NFTs lazy minted together.
     */
    function lazyMint(
        uint256 _amount,
        string calldata _baseURIForTokens,
        bytes calldata _data
    ) public virtual override returns (uint256 batchId) {
        if (_data.length > 0) {
            (bytes memory encryptedURI, bytes32 provenanceHash) = abi.decode(_data, (bytes, bytes32));
            if (encryptedURI.length != 0 && provenanceHash != "") {
                _setEncryptedData(nextTokenIdToLazyMint + _amount, _data);
            }
        }

        return super.lazyMint(_amount, _baseURIForTokens, _data);
    }

    /*//////////////////////////////////////////////////////////////
                        Delayed reveal logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice       Lets an authorized address reveal a batch of delayed reveal NFTs.
     *
     *  @param _index The ID for the batch of delayed-reveal NFTs to reveal.
     *  @param _key   The key with which the base URI for the relevant batch of NFTs was encrypted.
     */
    function reveal(uint256 _index, bytes calldata _key) external virtual override returns (string memory revealedURI) {
        require(_canReveal(), "Not authorized");

        uint256 batchId = getBatchIdAtIndex(_index);
        revealedURI = getRevealURI(batchId, _key);

        _setEncryptedData(batchId, "");
        _setBaseURI(batchId, revealedURI);

        emit TokenURIRevealed(_index, revealedURI);
    }

    /// @dev Checks whether NFTs can be revealed in the given execution context.
    function _canReveal() internal view virtual returns (bool) {
        return msg.sender == owner();
    }
}


================================================
FILE: contracts/base/ERC721Drop.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import { ERC721A, Context } from "../eip/ERC721AVirtualApprove.sol";

import "../extension/ContractMetadata.sol";
import "../extension/Multicall.sol";
import "../extension/Ownable.sol";
import "../extension/Royalty.sol";
import "../extension/BatchMintMetadata.sol";
import "../extension/PrimarySale.sol";
import "../extension/DropSinglePhase.sol";
import "../extension/LazyMint.sol";
import "../extension/DelayedReveal.sol";

import "../lib/Strings.sol";
import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";

/**
 *      BASE:      ERC721A
 *      EXTENSION: DropSinglePhase
 *
 *  The `ERC721Drop` contract implements the ERC721 NFT standard, along with the ERC721A optimization to the standard.
 *  It includes the following additions to standard ERC721 logic:
 *
 *      - Contract metadata for royalty support on platforms such as OpenSea that use
 *        off-chain information to distribute roaylties.
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically
 *
 *      - EIP 2981 compliance for royalty support on NFT marketplaces.
 *
 *  The `drop` mechanism in the `DropSinglePhase` extension is a distribution mechanism for lazy minted tokens. It lets
 *  you set restrictions such as a price to charge, an allowlist etc. when an address atttempts to mint lazy minted tokens.
 *
 *  The `ERC721Drop` contract lets you lazy mint tokens, and distribute those lazy minted tokens via the drop mechanism.
 */

contract ERC721Drop is
    ERC721A,
    ContractMetadata,
    Multicall,
    Ownable,
    Royalty,
    BatchMintMetadata,
    PrimarySale,
    LazyMint,
    DelayedReveal,
    DropSinglePhase
{
    using Strings for uint256;

    /*///////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Initializes the contract during construction.
     *
     * @param _defaultAdmin     The default admin of the contract.
     * @param _name             The name of the contract.
     * @param _symbol           The symbol of the contract.
     * @param _royaltyRecipient The address to receive royalties.
     * @param _royaltyBps       The royalty basis points to be charged. Max = 10000 (10000 = 100%, 1000 = 10%)
     * @param _primarySaleRecipient The address to receive primary sale value.
     */
    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _royaltyRecipient,
        uint128 _royaltyBps,
        address _primarySaleRecipient
    ) ERC721A(_name, _symbol) {
        _setupOwner(_defaultAdmin);
        _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps);
        _setupPrimarySaleRecipient(_primarySaleRecipient);
    }

    /*//////////////////////////////////////////////////////////////
                            ERC165 Logic
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165
     * @inheritdoc IERC165
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, IERC165) returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0x80ac58cd || // ERC165 Interface ID for ERC721
            interfaceId == 0x5b5e139f || // ERC165 Interface ID for ERC721Metadata
            interfaceId == type(IERC2981).interfaceId; // ERC165 ID for ERC2981
    }

    /*///////////////////////////////////////////////////////////////
                    Overriden ERC 721 logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice         Returns the metadata URI for an NFT.
     *  @dev            See `BatchMintMetadata` for handling of metadata in this contract.
     *
     *  @param _tokenId The tokenId of an NFT.
     */
    function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
        (uint256 batchId, ) = _getBatchId(_tokenId);
        string memory batchUri = _getBaseURI(_tokenId);

        if (isEncryptedBatch(batchId)) {
            return string(abi.encodePacked(batchUri, "0"));
        } else {
            return string(abi.encodePacked(batchUri, _tokenId.toString()));
        }
    }

    /*///////////////////////////////////////////////////////////////
                    Overriden lazy minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice                  Lets an authorized address lazy mint a given amount of NFTs.
     *
     *  @param _amount           The number of NFTs to lazy mint.
     *  @param _baseURIForTokens The placeholder base URI for the 'n' number of NFTs being lazy minted, where the
     *                           metadata for each of those NFTs is `${baseURIForTokens}/${tokenId}`.
     *  @param _data             The encrypted base URI + provenance hash for the batch of NFTs being lazy minted.
     *  @return batchId          A unique integer identifier for the batch of NFTs lazy minted together.
     */
    function lazyMint(
        uint256 _amount,
        string calldata _baseURIForTokens,
        bytes calldata _data
    ) public virtual override returns (uint256 batchId) {
        if (_data.length > 0) {
            (bytes memory encryptedURI, bytes32 provenanceHash) = abi.decode(_data, (bytes, bytes32));
            if (encryptedURI.length != 0 && provenanceHash != "") {
                _setEncryptedData(nextTokenIdToLazyMint + _amount, _data);
            }
        }

        return LazyMint.lazyMint(_amount, _baseURIForTokens, _data);
    }

    /// @notice The tokenId assigned to the next new NFT to be lazy minted.
    function nextTokenIdToMint() public view virtual returns (uint256) {
        return nextTokenIdToLazyMint;
    }

    /// @notice The tokenId assigned to the next new NFT to be claimed.
    function nextTokenIdToClaim() public view virtual returns (uint256) {
        return _currentIndex;
    }

    /*///////////////////////////////////////////////////////////////
                        Delayed reveal logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice       Lets an authorized address reveal a batch of delayed reveal NFTs.
     *
     *  @param _index The ID for the batch of delayed-reveal NFTs to reveal.
     *  @param _key   The key with which the base URI for the relevant batch of NFTs was encrypted.
     */
    function reveal(uint256 _index, bytes calldata _key) public virtual override returns (string memory revealedURI) {
        require(_canReveal(), "Not authorized");

        uint256 batchId = getBatchIdAtIndex(_index);
        revealedURI = getRevealURI(batchId, _key);

        _setEncryptedData(batchId, "");
        _setBaseURI(batchId, revealedURI);

        emit TokenURIRevealed(_index, revealedURI);
    }

    /*//////////////////////////////////////////////////////////////
                        Minting/burning logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice         Lets an owner or approved operator burn the NFT of the given tokenId.
     *  @dev            ERC721A's `_burn(uint256,bool)` internally checks for token approvals.
     *
     *  @param _tokenId The tokenId of the NFT to burn.
     */
    function burn(uint256 _tokenId) external virtual {
        _burn(_tokenId, true);
    }

    /*///////////////////////////////////////////////////////////////
                        Internal functions
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev Runs before every `claim` function call.
     *
     * @param _quantity The quantity of NFTs being claimed.
     */
    function _beforeClaim(
        address,
        uint256 _quantity,
        address,
        uint256,
        AllowlistProof calldata,
        bytes memory
    ) internal view virtual override {
        if (_currentIndex + _quantity > nextTokenIdToLazyMint) {
            revert("Not enough minted tokens");
        }
    }

    /**
     * @dev Collects and distributes the primary sale value of NFTs being claimed.
     *
     * @param _primarySaleRecipient The address to receive the primary sale value.
     * @param _quantityToClaim      The quantity of NFTs being claimed.
     * @param _currency             The currency in which the NFTs are being claimed.
     * @param _pricePerToken        The price per token in the given currency.
     */
    function _collectPriceOnClaim(
        address _primarySaleRecipient,
        uint256 _quantityToClaim,
        address _currency,
        uint256 _pricePerToken
    ) internal virtual override {
        if (_pricePerToken == 0) {
            require(msg.value == 0, "!Value");
            return;
        }

        uint256 totalPrice = _quantityToClaim * _pricePerToken;

        bool validMsgValue;
        if (_currency == CurrencyTransferLib.NATIVE_TOKEN) {
            validMsgValue = msg.value == totalPrice;
        } else {
            validMsgValue = msg.value == 0;
        }
        require(validMsgValue, "Invalid msg value");

        address saleRecipient = _primarySaleRecipient == address(0) ? primarySaleRecipient() : _primarySaleRecipient;
        CurrencyTransferLib.transferCurrency(_currency, msg.sender, saleRecipient, totalPrice);
    }

    /**
     * @dev Transfers the NFTs being claimed.
     *
     * @param _to                    The address to which the NFTs are being transferred.
     * @param _quantityBeingClaimed  The quantity of NFTs being claimed.
     */
    function _transferTokensOnClaim(
        address _to,
        uint256 _quantityBeingClaimed
    ) internal virtual override returns (uint256 startTokenId) {
        startTokenId = _currentIndex;
        _safeMint(_to, _quantityBeingClaimed);
    }

    /// @dev Checks whether primary sale recipient can be set in the given execution context.
    function _canSetPrimarySaleRecipient() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Checks whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Checks whether royalty info can be set in the given execution context.
    function _canSetRoyaltyInfo() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Checks whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Checks whether platform fee info can be set in the given execution context.
    function _canSetClaimConditions() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether lazy minting can be done in the given execution context.
    function _canLazyMint() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Checks whether NFTs can be revealed in the given execution context.
    function _canReveal() internal view virtual returns (bool) {
        return msg.sender == owner();
    }

    /*///////////////////////////////////////////////////////////////
                        Miscellaneous
    //////////////////////////////////////////////////////////////*/

    function _dropMsgSender() internal view virtual override returns (address) {
        return msg.sender;
    }

    /// @notice Returns the sender in the given execution context.
    function _msgSender() internal view override(Multicall, Context) returns (address) {
        return msg.sender;
    }
}


================================================
FILE: contracts/base/ERC721LazyMint.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import { ERC721A, Context } from "../eip/ERC721AVirtualApprove.sol";

import "../extension/ContractMetadata.sol";
import "../extension/Multicall.sol";
import "../extension/Ownable.sol";
import "../extension/Royalty.sol";
import "../extension/BatchMintMetadata.sol";
import "../extension/LazyMint.sol";
import "../extension/interface/IClaimableERC721.sol";

import "../lib/Strings.sol";
import "../external-deps/openzeppelin/security/ReentrancyGuard.sol";

/**
 *      BASE:      ERC721A
 *      EXTENSION: LazyMint
 *
 *  The `ERC721LazyMint` smart contract implements the ERC721 NFT standard, along with the ERC721A optimization to the standard.
 *  It includes the following additions to standard ERC721 logic:
 *
 *      - Lazy minting
 *
 *      - Contract metadata for royalty support on platforms such as OpenSea that use
 *        off-chain information to distribute roaylties.
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically
 *
 *      - EIP 2981 compliance for royalty support on NFT marketplaces.
 *
 *  'Lazy minting' means defining the metadata of NFTs without minting it to an address. Regular 'minting'
 *  of  NFTs means actually assigning an owner to an NFT.
 *
 *  As a contract admin, this lets you prepare the metadata for NFTs that will be minted by an external party,
 *  without paying the gas cost for actually minting the NFTs.
 */

contract ERC721LazyMint is
    ERC721A,
    ContractMetadata,
    Multicall,
    Ownable,
    Royalty,
    BatchMintMetadata,
    LazyMint,
    IClaimableERC721,
    ReentrancyGuard
{
    using Strings for uint256;

    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Initializes the contract during construction.
     *
     * @param _defaultAdmin     The default admin of the contract.
     * @param _name             The name of the contract.
     * @param _symbol           The symbol of the contract.
     * @param _royaltyRecipient The address to receive royalties.
     * @param _royaltyBps       The royalty basis points to be charged. Max = 10000 (10000 = 100%, 1000 = 10%)
     */
    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _royaltyRecipient,
        uint128 _royaltyBps
    ) ERC721A(_name, _symbol) {
        _setupOwner(_defaultAdmin);
        _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps);
    }

    /*//////////////////////////////////////////////////////////////
                            ERC165 Logic
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165
     * @inheritdoc IERC165
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, IERC165) returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0x80ac58cd || // ERC165 Interface ID for ERC721
            interfaceId == 0x5b5e139f || // ERC165 Interface ID for ERC721Metadata
            interfaceId == type(IERC2981).interfaceId; // ERC165 ID for ERC2981
    }

    /*//////////////////////////////////////////////////////////////
                        Overriden ERC721 logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice         Returns the metadata URI for an NFT.
     *  @dev            See `BatchMintMetadata` for handling of metadata in this contract.
     *
     *  @param _tokenId The tokenId of an NFT.
     */
    function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
        string memory batchUri = _getBaseURI(_tokenId);
        return string(abi.encodePacked(batchUri, _tokenId.toString()));
    }

    /*//////////////////////////////////////////////////////////////
                            Claiming logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice          Lets an address claim multiple lazy minted NFTs at once to a recipient.
     *                   This function prevents any reentrant calls, and is not allowed to be overridden.
     *
     *  @dev             Contract creators should override `verifyClaim` and `transferTokensOnClaim`
     *                   functions to create custom logic for verification and claiming,
     *                   for e.g. price collection, allowlist, max quantity, etc.
     *                   The logic in `verifyClaim` determines whether the caller is authorized to mint NFTs.
     *                   The logic in `transferTokensOnClaim` does actual minting of tokens,
     *                   can also be used to apply other state changes.
     *
     *  @param _receiver  The recipient of the NFT to mint.
     *  @param _quantity  The number of NFTs to mint.
     */
    function claim(address _receiver, uint256 _quantity) public payable virtual nonReentrant {
        require(_currentIndex + _quantity <= nextTokenIdToLazyMint, "Not enough lazy minted tokens.");
        verifyClaim(msg.sender, _quantity); // Add your claim verification logic by overriding this function.

        uint256 startTokenId = _transferTokensOnClaim(_receiver, _quantity); // Mints tokens. Apply any state updates by overriding this function.
        emit TokensClaimed(msg.sender, _receiver, startTokenId, _quantity);
    }

    /**
     *  @notice          Checks a request to claim NFTs against a custom condition.
     *
     *  @dev             Override this function to add logic for claim verification, based on conditions
     *                   such as allowlist, price, max quantity etc.
     *
     *  @param _claimer   Caller of the claim function.
     *  @param _quantity  The number of NFTs being claimed.
     */
    function verifyClaim(address _claimer, uint256 _quantity) public view virtual {}

    /**
     *  @notice         Lets an owner or approved operator burn the NFT of the given tokenId.
     *  @dev            ERC721A's `_burn(uint256,bool)` internally checks for token approvals.
     *
     *  @param _tokenId The tokenId of the NFT to burn.
     */
    function burn(uint256 _tokenId) external virtual {
        _burn(_tokenId, true);
    }

    /// @notice The tokenId assigned to the next new NFT to be lazy minted.
    function nextTokenIdToMint() public view virtual returns (uint256) {
        return nextTokenIdToLazyMint;
    }

    /// @notice The tokenId assigned to the next new NFT to be claimed.
    function nextTokenIdToClaim() public view virtual returns (uint256) {
        return _currentIndex;
    }

    /*//////////////////////////////////////////////////////////////
                        Internal functions
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice          Mints tokens to receiver on claim.
     *                   Any state changes related to `claim` must be applied
     *                   here by overriding this function.
     *
     *  @dev             Override this function to add logic for state updation.
     *                   When overriding, apply any state changes before `_safeMint`.
     *
     * @param _receiver The recipient of the NFT to mint.
     * @param _quantity The number of NFTs to mint.
     *
     * @return startTokenId The tokenId of the first NFT minted.
     */
    function _transferTokensOnClaim(
        address _receiver,
        uint256 _quantity
    ) internal virtual returns (uint256 startTokenId) {
        startTokenId = _currentIndex;
        _safeMint(_receiver, _quantity);
    }

    /// @dev Returns whether lazy minting can be done in the given execution context.
    function _canLazyMint() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether royalty info can be set in the given execution context.
    function _canSetRoyaltyInfo() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @notice Returns the sender in the given execution context.
    function _msgSender() internal view override(Multicall, Context) returns (address) {
        return msg.sender;
    }
}


================================================
FILE: contracts/base/ERC721Multiwrap.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import { ERC721A, Context } from "../eip/ERC721AVirtualApprove.sol";

import "../extension/ContractMetadata.sol";
import "../extension/Ownable.sol";
import "../extension/Royalty.sol";
import "../extension/SoulboundERC721A.sol";
import "../extension/TokenStore.sol";
import "../extension/Multicall.sol";
import { ReentrancyGuard } from "../extension/upgradeable/ReentrancyGuard.sol";

/**
 *      BASE:      ERC721Base
 *      EXTENSION: TokenStore, SoulboundERC721A
 *
 *  The `ERC721Multiwrap` contract uses the `ERC721Base` contract, along with the `TokenStore` and
 *   `SoulboundERC721A` extension.
 *
 *  The `ERC721Multiwrap` contract lets you wrap arbitrary ERC20, ERC721 and ERC1155 tokens you own
 *  into a single wrapped token / NFT.
 *
 *  The `SoulboundERC721A` extension lets you make your NFTs 'soulbound' i.e. non-transferrable.
 *
 */

contract ERC721Multiwrap is
    Multicall,
    TokenStore,
    SoulboundERC721A,
    ERC721A,
    ContractMetadata,
    Ownable,
    Royalty,
    ReentrancyGuard
{
    /*//////////////////////////////////////////////////////////////
                    Permission control roles
    //////////////////////////////////////////////////////////////*/

    /// @dev Only MINTER_ROLE holders can wrap tokens, when wrapping is restricted.
    bytes32 private constant MINTER_ROLE = keccak256("MINTER_ROLE");
    /// @dev Only UNWRAP_ROLE holders can unwrap tokens, when unwrapping is restricted.
    bytes32 private constant UNWRAP_ROLE = keccak256("UNWRAP_ROLE");
    /// @dev Only assets with ASSET_ROLE can be wrapped, when wrapping is restricted to particular assets.
    bytes32 private constant ASSET_ROLE = keccak256("ASSET_ROLE");

    /*//////////////////////////////////////////////////////////////
                                Events
    //////////////////////////////////////////////////////////////*/

    /// @dev Emitted when tokens are wrapped.
    event TokensWrapped(
        address indexed wrapper,
        address indexed recipientOfWrappedToken,
        uint256 indexed tokenIdOfWrappedToken,
        Token[] wrappedContents
    );

    /// @dev Emitted when tokens are unwrapped.
    event TokensUnwrapped(
        address indexed unwrapper,
        address indexed recipientOfWrappedContents,
        uint256 indexed tokenIdOfWrappedToken
    );

    /*//////////////////////////////////////////////////////////////
                                Events
    //////////////////////////////////////////////////////////////*/

    /// @notice Checks whether the caller holds `role`, when restrictions for `role` are switched on.
    modifier onlyRoleWithSwitch(bytes32 role) {
        _checkRoleWithSwitch(role, msg.sender);
        _;
    }

    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Initializes the contract during construction.
     *
     * @param _defaultAdmin     The default admin of the contract.
     * @param _name             The name of the contract.
     * @param _symbol           The symbol of the contract.
     * @param _royaltyRecipient The address to receive royalties.
     * @param _royaltyBps       The royalty basis points to be charged. Max = 10000 (10000 = 100%, 1000 = 10%)
     * @param _nativeTokenWrapper The address of the ERC20 wrapper for the native token.
     */
    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _royaltyRecipient,
        uint128 _royaltyBps,
        address _nativeTokenWrapper
    ) ERC721A(_name, _symbol) TokenStore(_nativeTokenWrapper) {
        _setupOwner(_defaultAdmin);
        _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps);

        _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin);
        _setupRole(MINTER_ROLE, _defaultAdmin);
        _setupRole(TRANSFER_ROLE, _defaultAdmin);

        _setupRole(ASSET_ROLE, address(0));
        _setupRole(UNWRAP_ROLE, address(0));

        restrictTransfers(false);
    }

    /*///////////////////////////////////////////////////////////////
                        Public gette functions
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev See ERC165: https://eips.ethereum.org/EIPS/eip-165
     * @inheritdoc IERC165
     */
    function supportsInterface(
        bytes4 interfaceId
    ) public view virtual override(ERC1155Receiver, ERC721A, IERC165) returns (bool) {
        return
            super.supportsInterface(interfaceId) ||
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0x80ac58cd || // ERC165 Interface ID for ERC721
            interfaceId == 0x5b5e139f || // ERC165 Interface ID for ERC721Metadata
            interfaceId == type(IERC2981).interfaceId || // ERC165 ID for ERC2981
            interfaceId == type(IERC1155Receiver).interfaceId;
    }

    /*//////////////////////////////////////////////////////////////
                        Overriden ERC721 logic
    //////////////////////////////////////////////////////////////*/

    /// @dev Returns the URI for a given tokenId.
    function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
        return getUriOfBundle(_tokenId);
    }

    /*///////////////////////////////////////////////////////////////
                    Wrapping / Unwrapping logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice Wrap multiple ERC1155, ERC721, ERC20 tokens into a single wrapped NFT.
     *
     *  @param _tokensToWrap    The tokens to wrap.
     *  @param _uriForWrappedToken The metadata URI for the wrapped NFT.
     *  @param _recipient          The recipient of the wrapped NFT.
     *
     *  @return tokenId The tokenId of the wrapped NFT minted.
     */
    function wrap(
        Token[] calldata _tokensToWrap,
        string calldata _uriForWrappedToken,
        address _recipient
    ) public payable virtual onlyRoleWithSwitch(MINTER_ROLE) nonReentrant returns (uint256 tokenId) {
        if (!hasRole(ASSET_ROLE, address(0))) {
            for (uint256 i = 0; i < _tokensToWrap.length; i += 1) {
                _checkRole(ASSET_ROLE, _tokensToWrap[i].assetContract);
            }
        }

        tokenId = nextTokenIdToMint();

        _storeTokens(msg.sender, _tokensToWrap, _uriForWrappedToken, tokenId);

        _safeMint(_recipient, 1);

        emit TokensWrapped(msg.sender, _recipient, tokenId, _tokensToWrap);
    }

    /**
     *  @notice Unwrap a wrapped NFT to retrieve underlying ERC1155, ERC721, ERC20 tokens.
     *
     *  @param _tokenId   The token Id of the wrapped NFT to unwrap.
     *  @param _recipient The recipient of the underlying ERC1155, ERC721, ERC20 tokens of the wrapped NFT.
     */
    function unwrap(uint256 _tokenId, address _recipient) public virtual onlyRoleWithSwitch(UNWRAP_ROLE) nonReentrant {
        require(_tokenId < nextTokenIdToMint(), "wrapped NFT DNE.");
        require(isApprovedOrOwner(msg.sender, _tokenId), "caller not approved for unwrapping.");

        _burn(_tokenId);
        _releaseTokens(_recipient, _tokenId);

        emit TokensUnwrapped(msg.sender, _recipient, _tokenId);
    }

    /*//////////////////////////////////////////////////////////////
                        Public getters
    //////////////////////////////////////////////////////////////*/

    /// @notice The tokenId assigned to the next new NFT to be minted.
    function nextTokenIdToMint() public view virtual returns (uint256) {
        return _currentIndex;
    }

    /**
     * @notice Returns whether a given address is the owner, or approved to transfer an NFT.
     *
     * @param _operator The address to check.
     * @param _tokenId The tokenId to check.
     *
     * @return isApprovedOrOwnerOf Whether `_operator` is approved to transfer `_tokenId`.
     */
    function isApprovedOrOwner(
        address _operator,
        uint256 _tokenId
    ) public view virtual returns (bool isApprovedOrOwnerOf) {
        address owner = ownerOf(_tokenId);
        isApprovedOrOwnerOf = (_operator == owner ||
            isApprovedForAll(owner, _operator) ||
            getApproved(_tokenId) == _operator);
    }

    /*///////////////////////////////////////////////////////////////
                        Internal functions
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev See {ERC721-_beforeTokenTransfer}.
     * @inheritdoc ERC721A
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual override(ERC721A, SoulboundERC721A) {
        super._beforeTokenTransfers(from, to, startTokenId, quantity);
        SoulboundERC721A._beforeTokenTransfers(from, to, startTokenId, quantity);
    }

    /// @dev Returns whether transfers can be restricted in a given execution context.
    function _canRestrictTransfers() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether royalty info can be set in the given execution context.
    function _canSetRoyaltyInfo() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @notice Returns the sender in the given execution context.
    function _msgSender() internal view override(Multicall, Context) returns (address) {
        return msg.sender;
    }
}


================================================
FILE: contracts/base/ERC721SignatureMint.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "./ERC721Base.sol";

import "../extension/PrimarySale.sol";
import "../extension/PermissionsEnumerable.sol";
import "../extension/SignatureMintERC721.sol";
import { ReentrancyGuard } from "../extension/upgradeable/ReentrancyGuard.sol";
import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";

/**
 *      BASE:      ERC721A
 *      EXTENSION: SignatureMintERC721
 *
 *  The `ERC721SignatureMint` contract uses the `ERC721Base` contract, along with the `SignatureMintERC721` extension.
 *
 *  The 'signature minting' mechanism in the `SignatureMintERC721` extension uses EIP 712, and is a way for a contract
 *  admin to authorize an external party's request to mint tokens on the admin's contract. At a high level, this means
 *  you can authorize some external party to mint tokens on your contract, and specify what exactly will be minted by
 *  that external party.
 *
 */

contract ERC721SignatureMint is ERC721Base, PrimarySale, SignatureMintERC721, ReentrancyGuard {
    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        address _royaltyRecipient,
        uint128 _royaltyBps,
        address _primarySaleRecipient
    ) ERC721Base(_defaultAdmin, _name, _symbol, _royaltyRecipient, _royaltyBps) {
        _setupPrimarySaleRecipient(_primarySaleRecipient);
    }

    /*//////////////////////////////////////////////////////////////
                        Signature minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice           Mints tokens according to the provided mint request.
     *
     *  @param _req       The payload / mint request.
     *  @param _signature The signature produced by an account signing the mint request.
     */
    function mintWithSignature(
        MintRequest calldata _req,
        bytes calldata _signature
    ) external payable virtual override nonReentrant returns (address signer) {
        require(_req.quantity == 1, "quantiy must be 1");

        uint256 tokenIdToMint = nextTokenIdToMint();

        // Verify and process payload.
        signer = _processRequest(_req, _signature);

        address receiver = _req.to;

        // Collect price
        _collectPriceOnClaim(_req.primarySaleRecipient, _req.quantity, _req.currency, _req.pricePerToken);

        // Set royalties, if applicable.
        if (_req.royaltyRecipient != address(0) && _req.royaltyBps != 0) {
            _setupRoyaltyInfoForToken(tokenIdToMint, _req.royaltyRecipient, _req.royaltyBps);
        }

        // Mint tokens.
        _setTokenURI(tokenIdToMint, _req.uri);
        _safeMint(receiver, _req.quantity);

        emit TokensMintedWithSignature(signer, receiver, tokenIdToMint, _req);
    }

    /*//////////////////////////////////////////////////////////////
                            Internal functions
    //////////////////////////////////////////////////////////////*/

    /// @dev Returns whether a given address is authorized to sign mint requests.
    function _canSignMintRequest(address _signer) internal view virtual override returns (bool) {
        return _signer == owner();
    }

    /// @dev Returns whether primary sale recipient can be set in the given execution context.
    function _canSetPrimarySaleRecipient() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Collects and distributes the primary sale value of NFTs being claimed.
    function _collectPriceOnClaim(
        address _primarySaleRecipient,
        uint256 _quantityToClaim,
        address _currency,
        uint256 _pricePerToken
    ) internal virtual {
        if (_pricePerToken == 0) {
            require(msg.value == 0, "!Value");
            return;
        }

        uint256 totalPrice = _quantityToClaim * _pricePerToken;

        bool validMsgValue;
        if (_currency == CurrencyTransferLib.NATIVE_TOKEN) {
            validMsgValue = msg.value == totalPrice;
        } else {
            validMsgValue = msg.value == 0;
        }
        require(validMsgValue, "Invalid msg value");

        address saleRecipient = _primarySaleRecipient == address(0) ? primarySaleRecipient() : _primarySaleRecipient;
        CurrencyTransferLib.transferCurrency(_currency, msg.sender, saleRecipient, totalPrice);
    }
}


================================================
FILE: contracts/base/Staking1155Base.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "../extension/ContractMetadata.sol";
import "../extension/Multicall.sol";
import "../extension/Ownable.sol";
import "../extension/Staking1155.sol";

import "../eip/ERC165.sol";
import "../eip/interface/IERC20.sol";
import "../eip/interface/IERC1155Receiver.sol";

import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";

/**
 *
 *  EXTENSION: Staking1155
 *
 *  The `Staking1155Base` smart contract implements NFT staking mechanism.
 *  Allows users to stake their ERC-1155 NFTs and earn rewards in form of ERC-20 tokens.
 *
 *  Following features and implementation setup must be noted:
 *
 *      - ERC-1155 NFTs from only one collection can be staked.
 *
 *      - Contract admin can choose to give out rewards by either transferring or minting the rewardToken,
 *        which is an ERC20 token. See {_mintRewards}.
 *
 *      - To implement custom logic for staking, reward calculation, etc. corresponding functions can be
 *        overridden from the extension `Staking1155`.
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically.
 *
 */

/// note: This contract is provided as a base contract.
//        This is to support a variety of use-cases that can be build on top of this base.
//
//        Additional functionality such as deposit functions, reward-minting, etc.
//        must be implemented by the deployer of this contract, as needed for their use-case.

contract Staking1155Base is ContractMetadata, Multicall, Ownable, Staking1155, ERC165, IERC1155Receiver {
    /// @dev ERC20 Reward Token address. See {_mintRewards} below.
    address public immutable rewardToken;

    /// @dev The address of the native token wrapper contract.
    address internal immutable nativeTokenWrapper;

    /// @dev Total amount of reward tokens in the contract.
    uint256 private rewardTokenBalance;

    constructor(
        uint80 _defaultTimeUnit,
        address _defaultAdmin,
        uint256 _defaultRewardsPerUnitTime,
        address _stakingToken,
        address _rewardToken,
        address _nativeTokenWrapper
    ) Staking1155(_stakingToken) {
        _setupOwner(_defaultAdmin);
        _setDefaultStakingCondition(_defaultTimeUnit, _defaultRewardsPerUnitTime);

        rewardToken = _rewardToken;
        nativeTokenWrapper = _nativeTokenWrapper;
    }

    /// @dev Lets the contract receive ether to unwrap native tokens.
    receive() external payable virtual {
        require(msg.sender == nativeTokenWrapper, "caller not native token wrapper.");
    }

    /// @dev Admin deposits reward tokens.
    function depositRewardTokens(uint256 _amount) external payable virtual nonReentrant {
        _depositRewardTokens(_amount); // override this for custom logic.
    }

    /// @dev Admin can withdraw excess reward tokens.
    function withdrawRewardTokens(uint256 _amount) external virtual nonReentrant {
        _withdrawRewardTokens(_amount); // override this for custom logic.
    }

    /// @notice View total rewards available in the staking contract.
    function getRewardTokenBalance() external view virtual override returns (uint256) {
        return rewardTokenBalance;
    }

    /*///////////////////////////////////////////////////////////////
                        ERC 165 / 721 logic
    //////////////////////////////////////////////////////////////*/

    function onERC1155Received(address, address, uint256, uint256, bytes calldata) external view returns (bytes4) {
        require(isStaking == 2, "Direct transfer");
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external virtual returns (bytes4) {}

    function supportsInterface(bytes4 interfaceId) public view override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
    }

    /*//////////////////////////////////////////////////////////////
                        Minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @dev    Mint ERC20 rewards to the staker. Override for custom logic.
     *
     *  @param _staker    Address for which to calculated rewards.
     *  @param _rewards   Amount of tokens to be given out as reward.
     *
     */
    function _mintRewards(address _staker, uint256 _rewards) internal virtual override {
        require(_rewards <= rewardTokenBalance, "Not enough reward tokens");
        rewardTokenBalance -= _rewards;
        CurrencyTransferLib.transferCurrencyWithWrapper(
            rewardToken,
            address(this),
            _staker,
            _rewards,
            nativeTokenWrapper
        );
    }

    /*//////////////////////////////////////////////////////////////
                        Other Internal functions
    //////////////////////////////////////////////////////////////*/

    /// @dev Admin deposits reward tokens -- override for custom logic.
    function _depositRewardTokens(uint256 _amount) internal virtual {
        require(msg.sender == owner(), "Not authorized");

        address _rewardToken = rewardToken == CurrencyTransferLib.NATIVE_TOKEN ? nativeTokenWrapper : rewardToken;

        uint256 balanceBefore = IERC20(_rewardToken).balanceOf(address(this));
        CurrencyTransferLib.transferCurrencyWithWrapper(
            rewardToken,
            msg.sender,
            address(this),
            _amount,
            nativeTokenWrapper
        );
        uint256 actualAmount = IERC20(_rewardToken).balanceOf(address(this)) - balanceBefore;

        rewardTokenBalance += actualAmount;
    }

    /// @dev Admin can withdraw excess reward tokens -- override for custom logic.
    function _withdrawRewardTokens(uint256 _amount) internal virtual {
        require(msg.sender == owner(), "Not authorized");

        // to prevent locking of direct-transferred tokens
        rewardTokenBalance = _amount > rewardTokenBalance ? 0 : rewardTokenBalance - _amount;

        CurrencyTransferLib.transferCurrencyWithWrapper(
            rewardToken,
            address(this),
            msg.sender,
            _amount,
            nativeTokenWrapper
        );
    }

    /// @dev Returns whether staking restrictions can be set in given execution context.
    function _canSetStakeConditions() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }
}


================================================
FILE: contracts/base/Staking20Base.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "../extension/ContractMetadata.sol";
import "../extension/Multicall.sol";
import "../extension/Ownable.sol";
import "../extension/Staking20.sol";

import "../eip/interface/IERC20.sol";
import "../eip/interface/IERC20Metadata.sol";

import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";

/**
 *
 *  EXTENSION: Staking20
 *
 *  The `Staking20Base` smart contract implements Token staking mechanism.
 *  Allows users to stake their ERC-20 Tokens and earn rewards in form of another ERC-20 tokens.
 *
 *  Following features and implementation setup must be noted:
 *
 *      - ERC-20 Tokens from only one contract can be staked.
 *
 *      - Contract admin can choose to give out rewards by either transferring or minting the rewardToken,
 *        which is ideally a different ERC20 token. See {_mintRewards}.
 *
 *      - To implement custom logic for staking, reward calculation, etc. corresponding functions can be
 *        overridden from the extension `Staking20`.
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically.
 *
 */

/// note: This contract is provided as a base contract.
//        This is to support a variety of use-cases that can be build on top of this base.
//
//        Additional functionality such as deposit functions, reward-minting, etc.
//        must be implemented by the deployer of this contract, as needed for their use-case.

contract Staking20Base is ContractMetadata, Multicall, Ownable, Staking20 {
    /// @dev ERC20 Reward Token address. See {_mintRewards} below.
    address public immutable rewardToken;

    /// @dev Total amount of reward tokens in the contract.
    uint256 private rewardTokenBalance;

    constructor(
        uint80 _timeUnit,
        address _defaultAdmin,
        uint256 _rewardRatioNumerator,
        uint256 _rewardRatioDenominator,
        address _stakingToken,
        address _rewardToken,
        address _nativeTokenWrapper
    )
        Staking20(
            _nativeTokenWrapper,
            _stakingToken,
            IERC20Metadata(_stakingToken).decimals(),
            IERC20Metadata(_rewardToken).decimals()
        )
    {
        _setupOwner(_defaultAdmin);
        _setStakingCondition(_timeUnit, _rewardRatioNumerator, _rewardRatioDenominator);

        require(_rewardToken != _stakingToken, "Reward Token and Staking Token can't be same.");
        rewardToken = _rewardToken;
    }

    /// @dev Lets the contract receive ether to unwrap native tokens.
    receive() external payable virtual {
        require(msg.sender == nativeTokenWrapper, "caller not native token wrapper.");
    }

    /// @dev Admin deposits reward tokens.
    function depositRewardTokens(uint256 _amount) external payable virtual nonReentrant {
        _depositRewardTokens(_amount); // override this for custom logic.
    }

    /// @dev Admin can withdraw excess reward tokens.
    function withdrawRewardTokens(uint256 _amount) external virtual nonReentrant {
        _withdrawRewardTokens(_amount); // override this for custom logic.
    }

    /// @notice View total rewards available in the staking contract.
    function getRewardTokenBalance() external view virtual override returns (uint256) {
        return rewardTokenBalance;
    }

    /*//////////////////////////////////////////////////////////////
                        Minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @dev    Mint ERC20 rewards to the staker. Override for custom logic.
     *
     *  @param _staker    Address for which to calculated rewards.
     *  @param _rewards   Amount of tokens to be given out as reward.
     *
     */
    function _mintRewards(address _staker, uint256 _rewards) internal virtual override {
        require(_rewards <= rewardTokenBalance, "Not enough reward tokens");
        rewardTokenBalance -= _rewards;
        CurrencyTransferLib.transferCurrencyWithWrapper(
            rewardToken,
            address(this),
            _staker,
            _rewards,
            nativeTokenWrapper
        );
    }

    /*//////////////////////////////////////////////////////////////
                        Other Internal functions
    //////////////////////////////////////////////////////////////*/

    /// @dev Admin deposits reward tokens -- override for custom logic.
    function _depositRewardTokens(uint256 _amount) internal virtual {
        require(msg.sender == owner(), "Not authorized");

        address _rewardToken = rewardToken == CurrencyTransferLib.NATIVE_TOKEN ? nativeTokenWrapper : rewardToken;

        uint256 balanceBefore = IERC20(_rewardToken).balanceOf(address(this));
        CurrencyTransferLib.transferCurrencyWithWrapper(
            rewardToken,
            msg.sender,
            address(this),
            _amount,
            nativeTokenWrapper
        );
        uint256 actualAmount = IERC20(_rewardToken).balanceOf(address(this)) - balanceBefore;

        rewardTokenBalance += actualAmount;
    }

    /// @dev Admin can withdraw excess reward tokens -- override for custom logic.
    function _withdrawRewardTokens(uint256 _amount) internal virtual {
        require(msg.sender == owner(), "Not authorized");

        // to prevent locking of direct-transferred tokens
        rewardTokenBalance = _amount > rewardTokenBalance ? 0 : rewardTokenBalance - _amount;

        CurrencyTransferLib.transferCurrencyWithWrapper(
            rewardToken,
            address(this),
            msg.sender,
            _amount,
            nativeTokenWrapper
        );

        // The withdrawal shouldn't reduce staking token balance. `>=` accounts for any accidental transfers.
        address _stakingToken = stakingToken == CurrencyTransferLib.NATIVE_TOKEN ? nativeTokenWrapper : stakingToken;
        require(
            IERC20(_stakingToken).balanceOf(address(this)) >= stakingTokenBalance,
            "Staking token balance reduced."
        );
    }

    /// @dev Returns whether staking restrictions can be set in given execution context.
    function _canSetStakeConditions() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }
}


================================================
FILE: contracts/base/Staking721Base.sol
================================================
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @author thirdweb

import "../extension/ContractMetadata.sol";
import "../extension/Multicall.sol";
import "../extension/Ownable.sol";
import "../extension/Staking721.sol";

import "../eip/ERC165.sol";
import "../eip/interface/IERC20.sol";
import "../eip/interface/IERC721Receiver.sol";

import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";

/**
 *
 *  EXTENSION: Staking721
 *
 *  The `Staking721Base` smart contract implements NFT staking mechanism.
 *  Allows users to stake their ERC-721 NFTs and earn rewards in form of ERC-20 tokens.
 *
 *  Following features and implementation setup must be noted:
 *
 *      - ERC-721 NFTs from only one NFT collection can be staked.
 *
 *      - Contract admin can choose to give out rewards by either transferring or minting the rewardToken,
 *        which is an ERC20 token. See {_mintRewards}.
 *
 *      - To implement custom logic for staking, reward calculation, etc. corresponding functions can be
 *        overridden from the extension `Staking721`.
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically.
 *
 */

/// note: This contract is provided as a base contract.
//        This is to support a variety of use-cases that can be build on top of this base.
//
//        Additional functionality such as deposit functions, reward-minting, etc.
//        must be implemented by the deployer of this contract, as needed for their use-case.

contract Staking721Base is ContractMetadata, Multicall, Ownable, Staking721, ERC165, IERC721Receiver {
    /// @dev ERC20 Reward Token address. See {_mintRewards} below.
    address public immutable rewardToken;

    /// @dev The address of the native token wrapper contract.
    address public immutable nativeTokenWrapper;

    /// @dev Total amount of reward tokens in the contract.
    uint256 private rewardTokenBalance;

    constructor(
        address _defaultAdmin,
        uint256 _timeUnit,
        uint256 _rewardsPerUnitTime,
        address _stakingToken,
        address _rewardToken,
        address _nativeTokenWrapper
    ) Staking721(_stakingToken) {
        _setupOwner(_defaultAdmin);
        _setStakingCondition(_timeUnit, _rewardsPerUnitTime);

        rewardToken = _rewardToken;
        nativeTokenWrapper = _nativeTokenWrapper;
    }

    /// @dev Lets the contract receive ether to unwrap native tokens.
    receive() external payable virtual {
        require(msg.sender == nativeTokenWrapper, "caller not native token wrapper.");
    }

    /// @dev Admin deposits reward tokens.
    function depositRewardTokens(uint256 _amount) external payable virtual nonReentrant {
        _depositRewardTokens(_amount); // override this for custom logic.
    }

    /// @dev Admin can withdraw excess reward tokens.
    function withdrawRewardTokens(uint256 _amount) external virtual nonReentrant {
        _withdrawRewardTokens(_amount); // override this for custom logic.
    }

    /// @notice View total rewards available in the staking contract.
    function getRewardTokenBalance() external view virtual override returns (uint256) {
        return rewardTokenBalance;
    }

    /*///////////////////////////////////////////////////////////////
                        ERC 165 / 721 logic
    //////////////////////////////////////////////////////////////*/

    function onERC721Received(
        address,
        address,
        uint256,
        bytes calldata
    ) external view virtual override returns (bytes4) {
        require(isStaking == 2, "Direct transfer");
        return this.onERC721Received.selector;
    }

    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC721Receiver).interfaceId || super.supportsInterface(interfaceId);
    }

    /*//////////////////////////////////////////////////////////////
                        Minting logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @dev    Mint ERC20 rewards to the staker. Override for custom logic.
     *
     *  @param _staker    Address for which to calculated rewards.
     *  @param _rewards   Amount of tokens to be given out as reward.
     *
     */
    function _mintRewards(address _staker, uint256 _rewards) internal virtual override {
        require(_rewards <= rewardTokenBalance, "Not enough reward tokens");
        rewardTokenBalance -= _rewards;
        CurrencyTransferLib.transferCurrencyWithWrapper(
            rewardToken,
            address(this),
            _staker,
            _rewards,
            nativeTokenWrapper
        );
    }

    /*//////////////////////////////////////////////////////////////
                        Other Internal functions
    //////////////////////////////////////////////////////////////*/

    /// @dev Admin deposits reward tokens -- override for custom logic.
    function _depositRewardTokens(uint256 _amount) internal virtual {
        require(msg.sender == owner(), "Not authorized");

        address _rewardToken = rewardToken == CurrencyTransferLib.NATIVE_TOKEN ? nativeTokenWrapper : rewardToken;

        uint256 balanceBefore = IERC20(_rewardToken).balanceOf(address(this));
        CurrencyTransferLib.transferCurrencyWithWrapper(
            rewardToken,
            msg.sender,
            address(this),
            _amount,
            nativeTokenWrapper
        );
        uint256 actualAmount = IERC20(_rewardToken).balanceOf(address(this)) - balanceBefore;

        rewardTokenBalance += actualAmount;
    }

    /// @dev Admin can withdraw excess reward tokens -- override for custom logic.
    function _withdrawRewardTokens(uint256 _amount) internal virtual {
        require(msg.sender == owner(), "Not authorized");

        // to prevent locking of direct-transferred tokens
        rewardTokenBalance = _amount > rewardTokenBalance ? 0 : rewardTokenBalance - _amount;

        CurrencyTransferLib.transferCurrencyWithWrapper(
            rewardToken,
            address(this),
            msg.sender,
            _amount,
            nativeTokenWrapper
        );
    }

    /// @dev Returns whether staking restrictions can be set in given execution context.
    function _canSetStakeConditions() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether contract metadata can be set in the given execution context.
    function _canSetContractURI() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }
}


================================================
FILE: contracts/eip/ERC1155.sol
================================================
// SPDX-License-Identifier: Apache 2.0
pragma solidity ^0.8.0;

import "./interface/IERC1155.sol";
import "./interface/IERC1155Metadata.sol";
import "./interface/IERC1155Receiver.sol";

contract ERC1155 is IERC1155, IERC1155Metadata {
    /*//////////////////////////////////////////////////////////////
                        State variables
    //////////////////////////////////////////////////////////////*/

    string public name;
    string public symbol;

    /*//////////////////////////////////////////////////////////////
                            Mappings
    //////////////////////////////////////////////////////////////*/

    mapping(address => mapping(uint256 => uint256)) public balanceOf;

    mapping(address => mapping(address => bool)) public isApprovedForAll;

    mapping(uint256 => string) internal _uri;

    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(string memory _name, string memory _symbol) {
        name = _name;
        symbol = _symbol;
    }

    /*//////////////////////////////////////////////////////////////
                            View functions
    //////////////////////////////////////////////////////////////*/

    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155
            interfaceId == 0x0e89341c; // ERC165 Interface ID for ERC1155MetadataURI
    }

    function uri(uint256 tokenId) public view virtual override returns (string memory) {
        return _uri[tokenId];
    }

    function balanceOfBatch(
        address[] memory accounts,
        uint256[] memory ids
    ) public view virtual override returns (uint256[] memory) {
        require(accounts.length == ids.length, "LENGTH_MISMATCH");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf[accounts[i]][ids[i]];
        }

        return batchBalances;
    }

    /*//////////////////////////////////////////////////////////////
                            ERC1155 logic
    //////////////////////////////////////////////////////////////*/

    function setApprovalForAll(address operator, bool approved) public virtual override {
        address owner = msg.sender;
        require(owner != operator, "APPROVING_SELF");
        isApprovedForAll[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(from == msg.sender || isApprovedForAll[from][msg.sender], "!OWNER_OR_APPROVED");
        _safeTransferFrom(from, to, id, amount, data);
    }

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(from == msg.sender || isApprovedForAll[from][msg.sender], "!OWNER_OR_APPROVED");
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /*//////////////////////////////////////////////////////////////
                            Internal logic
    //////////////////////////////////////////////////////////////*/

    function _safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "TO_ZERO_ADDR");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);

        uint256 fromBalance = balanceOf[from][id];
        require(fromBalance >= amount, "INSUFFICIENT_BAL");
        unchecked {
            balanceOf[from][id] = fromBalance - amount;
        }
        balanceOf[to][id] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(ids.length == amounts.length, "LENGTH_MISMATCH");
        require(to != address(0), "TO_ZERO_ADDR");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = balanceOf[from][id];
            require(fromBalance >= amount, "INSUFFICIENT_BAL");
            unchecked {
                balanceOf[from][id] = fromBalance - amount;
            }
            balanceOf[to][id] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    function _setTokenURI(uint256 tokenId, string memory newuri) internal virtual {
        _uri[tokenId] = newuri;
    }

    function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual {
        require(to != address(0), "TO_ZERO_ADDR");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);

        balanceOf[to][id] += amount;
        emit TransferSingle(operator, address(0), to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
    }

    function _mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "TO_ZERO_ADDR");
        require(ids.length == amounts.length, "LENGTH_MISMATCH");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; i++) {
            balanceOf[to][ids[i]] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    function _burn(address from, uint256 id, uint256 amount) internal virtual {
        require(from != address(0), "FROM_ZERO_ADDR");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");

        uint256 fromBalance = balanceOf[from][id];
        require(fromBalance >= amount, "INSUFFICIENT_BAL");
        unchecked {
            balanceOf[from][id] = fromBalance - amount;
        }

        emit TransferSingle(operator, from, address(0), id, amount);
    }

    function _burnBatch(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual {
        require(from != address(0), "FROM_ZERO_ADDR");
        require(ids.length == amounts.length, "LENGTH_MISMATCH");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        for (uint256 i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = balanceOf[from][id];
            require(fromBalance >= amount, "INSUFFICIENT_BAL");
            unchecked {
                balanceOf[from][id] = fromBalance - amount;
            }
        }

        emit TransferBatch(operator, from, address(0), ids, amounts);
    }

    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.code.length > 0) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    revert("TOKENS_REJECTED");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("!ERC1155RECEIVER");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.code.length > 0) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    revert("TOKENS_REJECTED");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("!ERC1155RECEIVER");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}


================================================
FILE: contracts/eip/ERC1271.sol
================================================
// SPDX-License-Identifier: Apache 2.0
pragma solidity ^0.8.0;

abstract contract ERC1271 {
    // bytes4(keccak256("isValidSignature(bytes32,bytes)")
    bytes4 internal constant MAGICVALUE = 0x1626ba7e;

    /**
     * @dev
Download .txt
gitextract_k8lm443i/

├── .editorconfig
├── .eslintignore
├── .eslintrc.yaml
├── .gas-snapshot
├── .gitattributes
├── .github/
│   ├── composite-actions/
│   │   └── setup/
│   │       └── action.yml
│   └── workflows/
│       ├── dispatch_docs.yml
│       ├── lint.yml
│       ├── prettier.yml
│       ├── slither.yml
│       └── tests.yml
├── .gitignore
├── .gitmodules
├── .npmignore
├── .prettierignore
├── .prettierrc
├── .solhint.json
├── .solhintignore
├── CODE_OF_CONDUCT.md
├── LICENSE.md
├── README.md
├── audit-reports/
│   └── preliminary-audits/
│       └── airdroperc20-claimable.md
├── contracts/
│   ├── base/
│   │   ├── ERC1155Base.sol
│   │   ├── ERC1155DelayedReveal.sol
│   │   ├── ERC1155Drop.sol
│   │   ├── ERC1155LazyMint.sol
│   │   ├── ERC1155SignatureMint.sol
│   │   ├── ERC20Base.sol
│   │   ├── ERC20Drop.sol
│   │   ├── ERC20DropVote.sol
│   │   ├── ERC20SignatureMint.sol
│   │   ├── ERC20SignatureMintVote.sol
│   │   ├── ERC20Vote.sol
│   │   ├── ERC721Base.sol
│   │   ├── ERC721DelayedReveal.sol
│   │   ├── ERC721Drop.sol
│   │   ├── ERC721LazyMint.sol
│   │   ├── ERC721Multiwrap.sol
│   │   ├── ERC721SignatureMint.sol
│   │   ├── Staking1155Base.sol
│   │   ├── Staking20Base.sol
│   │   └── Staking721Base.sol
│   ├── eip/
│   │   ├── ERC1155.sol
│   │   ├── ERC1271.sol
│   │   ├── ERC165.sol
│   │   ├── ERC721A.sol
│   │   ├── ERC721AUpgradeable.sol
│   │   ├── ERC721AVirtualApprove.sol
│   │   ├── ERC721AVirtualApproveUpgradeable.sol
│   │   ├── interface/
│   │   │   ├── IERC1155.sol
│   │   │   ├── IERC1155Enumerable.sol
│   │   │   ├── IERC1155Metadata.sol
│   │   │   ├── IERC1155Receiver.sol
│   │   │   ├── IERC1155Supply.sol
│   │   │   ├── IERC165.sol
│   │   │   ├── IERC20.sol
│   │   │   ├── IERC20Metadata.sol
│   │   │   ├── IERC20Permit.sol
│   │   │   ├── IERC2981.sol
│   │   │   ├── IERC4906.sol
│   │   │   ├── IERC721.sol
│   │   │   ├── IERC721A.sol
│   │   │   ├── IERC721Enumerable.sol
│   │   │   ├── IERC721Metadata.sol
│   │   │   ├── IERC721Receiver.sol
│   │   │   └── IERC721Supply.sol
│   │   └── queryable/
│   │       ├── ERC721AQueryable.sol
│   │       ├── ERC721AQueryableUpgradeable.sol
│   │       ├── ERC721AStorage.sol
│   │       ├── ERC721AUpgradeable.sol
│   │       ├── ERC721A__Initializable.sol
│   │       ├── ERC721A__InitializableStorage.sol
│   │       ├── IERC721AQueryable.sol
│   │       ├── IERC721AQueryableUpgradeable.sol
│   │       └── IERC721AUpgradeable.sol
│   ├── extension/
│   │   ├── AppURI.sol
│   │   ├── BatchMintMetadata.sol
│   │   ├── BurnToClaim.sol
│   │   ├── ContractMetadata.sol
│   │   ├── DelayedReveal.sol
│   │   ├── Drop.sol
│   │   ├── Drop1155.sol
│   │   ├── DropSinglePhase.sol
│   │   ├── DropSinglePhase1155.sol
│   │   ├── Initializable.sol
│   │   ├── LazyMint.sol
│   │   ├── LazyMintWithTier.sol
│   │   ├── Multicall.sol
│   │   ├── NFTMetadata.sol
│   │   ├── OperatorFilterToggle.sol
│   │   ├── OperatorFilterer.sol
│   │   ├── OperatorFiltererUpgradeable.sol
│   │   ├── Ownable.sol
│   │   ├── Permissions.sol
│   │   ├── PermissionsEnumerable.sol
│   │   ├── PlatformFee.sol
│   │   ├── PrimarySale.sol
│   │   ├── Proxy.sol
│   │   ├── ProxyForUpgradeable.sol
│   │   ├── Royalty.sol
│   │   ├── SeaportEIP1271.sol
│   │   ├── SeaportOrderParser.sol
│   │   ├── SharedMetadata.sol
│   │   ├── SignatureAction.sol
│   │   ├── SignatureActionUpgradeable.sol
│   │   ├── SignatureMintERC1155.sol
│   │   ├── SignatureMintERC1155Upgradeable.sol
│   │   ├── SignatureMintERC20.sol
│   │   ├── SignatureMintERC20Upgradeable.sol
│   │   ├── SignatureMintERC721.sol
│   │   ├── SignatureMintERC721Upgradeable.sol
│   │   ├── SoulboundERC721A.sol
│   │   ├── Staking1155.sol
│   │   ├── Staking1155Upgradeable.sol
│   │   ├── Staking20.sol
│   │   ├── Staking20Upgradeable.sol
│   │   ├── Staking721.sol
│   │   ├── Staking721Upgradeable.sol
│   │   ├── TokenBundle.sol
│   │   ├── TokenStore.sol
│   │   ├── Upgradeable.sol
│   │   ├── interface/
│   │   │   ├── IAccountPermissions.sol
│   │   │   ├── IAppURI.sol
│   │   │   ├── IBurnToClaim.sol
│   │   │   ├── IBurnableERC1155.sol
│   │   │   ├── IBurnableERC20.sol
│   │   │   ├── IBurnableERC721.sol
│   │   │   ├── IClaimCondition.sol
│   │   │   ├── IClaimConditionMultiPhase.sol
│   │   │   ├── IClaimConditionsSinglePhase.sol
│   │   │   ├── IClaimableERC1155.sol
│   │   │   ├── IClaimableERC721.sol
│   │   │   ├── IContractFactory.sol
│   │   │   ├── IContractMetadata.sol
│   │   │   ├── IDelayedReveal.sol
│   │   │   ├── IDelayedRevealDeprecated.sol
│   │   │   ├── IDrop.sol
│   │   │   ├── IDrop1155.sol
│   │   │   ├── IDropSinglePhase.sol
│   │   │   ├── IDropSinglePhase1155.sol
│   │   │   ├── IERC2771Context.sol
│   │   │   ├── ILazyMint.sol
│   │   │   ├── ILazyMintWithTier.sol
│   │   │   ├── IMintableERC1155.sol
│   │   │   ├── IMintableERC20.sol
│   │   │   ├── IMintableERC721.sol
│   │   │   ├── IMulticall.sol
│   │   │   ├── INFTMetadata.sol
│   │   │   ├── IOperatorFilterRegistry.sol
│   │   │   ├── IOperatorFilterToggle.sol
│   │   │   ├── IOwnable.sol
│   │   │   ├── IPermissions.sol
│   │   │   ├── IPermissionsEnumerable.sol
│   │   │   ├── IPlatformFee.sol
│   │   │   ├── IPrimarySale.sol
│   │   │   ├── IRoyalty.sol
│   │   │   ├── IRoyaltyEngineV1.sol
│   │   │   ├── IRoyaltyPayments.sol
│   │   │   ├── IRulesEngine.sol
│   │   │   ├── ISharedMetadata.sol
│   │   │   ├── ISharedMetadataBatch.sol
│   │   │   ├── ISignatureAction.sol
│   │   │   ├── ISignatureMintERC1155.sol
│   │   │   ├── ISignatureMintERC20.sol
│   │   │   ├── ISignatureMintERC721.sol
│   │   │   ├── IStaking1155.sol
│   │   │   ├── IStaking20.sol
│   │   │   ├── IStaking721.sol
│   │   │   ├── ITokenBundle.sol
│   │   │   └── plugin/
│   │   │       ├── IContext.sol
│   │   │       ├── IPluginMap.sol
│   │   │       └── IRouter.sol
│   │   ├── plugin/
│   │   │   ├── ContractMetadataLogic.sol
│   │   │   ├── ContractMetadataStorage.sol
│   │   │   ├── ERC2771ContextConsumer.sol
│   │   │   ├── ERC2771ContextLogic.sol
│   │   │   ├── ERC2771ContextStorage.sol
│   │   │   ├── ERC2771ContextUpgradeableLogic.sol
│   │   │   ├── ERC2771ContextUpgradeableStorage.sol
│   │   │   ├── PermissionsEnumerableLogic.sol
│   │   │   ├── PermissionsEnumerableStorage.sol
│   │   │   ├── PermissionsLogic.sol
│   │   │   ├── PermissionsStorage.sol
│   │   │   ├── PlatformFeeLogic.sol
│   │   │   ├── PlatformFeeStorage.sol
│   │   │   ├── PluginMap.sol
│   │   │   ├── ReentrancyGuardLogic.sol
│   │   │   ├── ReentrancyGuardStorage.sol
│   │   │   ├── Router.sol
│   │   │   ├── RouterImmutable.sol
│   │   │   └── RoyaltyPayments.sol
│   │   └── upgradeable/
│   │       ├── AccountPermissions.sol
│   │       ├── BatchMintMetadata.sol
│   │       ├── BurnToClaim.sol
│   │       ├── ContractMetadata.sol
│   │       ├── DelayedReveal.sol
│   │       ├── Drop.sol
│   │       ├── ERC2771Context.sol
│   │       ├── ERC2771ContextConsumer.sol
│   │       ├── ERC2771ContextUpgradeable.sol
│   │       ├── Initializable.sol
│   │       ├── LazyMint.sol
│   │       ├── OperatorFilterToggle.sol
│   │       ├── OperatorFiltererUpgradeable.sol
│   │       ├── Ownable.sol
│   │       ├── Permissions.sol
│   │       ├── PermissionsEnumerable.sol
│   │       ├── PlatformFee.sol
│   │       ├── PrimarySale.sol
│   │       ├── ReentrancyGuard.sol
│   │       ├── Royalty.sol
│   │       ├── RoyaltyPayments.sol
│   │       ├── RulesEngine.sol
│   │       ├── SharedMetadataBatch.sol
│   │       ├── impl/
│   │       │   ├── ContractMetadataImpl.sol
│   │       │   ├── MetaTx.sol
│   │       │   ├── PermissionsEnumerableImpl.sol
│   │       │   └── PlatformFeeImpl.sol
│   │       └── init/
│   │           ├── ContractMetadataInit.sol
│   │           ├── ERC2771ContextInit.sol
│   │           ├── ERC721AInit.sol
│   │           ├── ERC721AQueryableInit.sol
│   │           ├── OwnableInit.sol
│   │           ├── PermissionsEnumerableInit.sol
│   │           ├── PermissionsInit.sol
│   │           ├── PlatformFeeInit.sol
│   │           ├── PrimarySaleInit.sol
│   │           ├── ReentrancyGuardInit.sol
│   │           └── RoyaltyInit.sol
│   ├── external-deps/
│   │   └── openzeppelin/
│   │       ├── ERC1155PresetUpgradeable.sol
│   │       ├── cryptography/
│   │       │   └── EIP712ChainlessDomain.sol
│   │       ├── finance/
│   │       │   └── PaymentSplitterUpgradeable.sol
│   │       ├── governance/
│   │       │   └── utils/
│   │       │       └── IVotes.sol
│   │       ├── metatx/
│   │       │   ├── ERC2771Context.sol
│   │       │   └── ERC2771ContextUpgradeable.sol
│   │       ├── proxy/
│   │       │   ├── Clones.sol
│   │       │   ├── ERC1967/
│   │       │   │   ├── ERC1967Proxy.sol
│   │       │   │   └── ERC1967Upgrade.sol
│   │       │   ├── IERC1822Proxiable.sol
│   │       │   ├── Proxy.sol
│   │       │   ├── beacon/
│   │       │   │   └── IBeacon.sol
│   │       │   └── utils/
│   │       │       └── Initializable.sol
│   │       ├── security/
│   │       │   ├── ReentrancyGuard.sol
│   │       │   └── ReentrancyGuardUpgradeable.sol
│   │       ├── token/
│   │       │   ├── ERC1155/
│   │       │   │   ├── IERC1155Receiver.sol
│   │       │   │   └── utils/
│   │       │   │       ├── ERC1155Holder.sol
│   │       │   │       └── ERC1155Receiver.sol
│   │       │   ├── ERC20/
│   │       │   │   ├── ERC20.sol
│   │       │   │   ├── extensions/
│   │       │   │   │   ├── ERC20Permit.sol
│   │       │   │   │   └── ERC20Votes.sol
│   │       │   │   └── utils/
│   │       │   │       └── SafeERC20.sol
│   │       │   └── ERC721/
│   │       │       ├── IERC721Receiver.sol
│   │       │       └── utils/
│   │       │           └── ERC721Holder.sol
│   │       └── utils/
│   │           ├── Base64.sol
│   │           ├── Context.sol
│   │           ├── Counters.sol
│   │           ├── Create2.sol
│   │           ├── ERC1155/
│   │           │   ├── ERC1155Holder.sol
│   │           │   └── ERC1155Receiver.sol
│   │           ├── ERC721/
│   │           │   └── ERC721Holder.sol
│   │           ├── EnumerableSet.sol
│   │           ├── cryptography/
│   │           │   ├── ECDSA.sol
│   │           │   └── EIP712.sol
│   │           ├── math/
│   │           │   ├── Math.sol
│   │           │   ├── SafeCast.sol
│   │           │   └── SafeMath.sol
│   │           └── structs/
│   │               └── EnumerableSet.sol
│   ├── infra/
│   │   ├── ContractPublisher.sol
│   │   ├── TWFactory.sol
│   │   ├── TWFee.sol
│   │   ├── TWMinimalFactory.sol
│   │   ├── TWMultichainRegistry.sol
│   │   ├── TWProxy.sol
│   │   ├── TWRegistry.sol
│   │   ├── TWStatelessFactory.sol
│   │   ├── forwarder/
│   │   │   ├── Forwarder.sol
│   │   │   ├── ForwarderChainlessDomain.sol
│   │   │   └── ForwarderConsumer.sol
│   │   ├── interface/
│   │   │   ├── IContractDeployer.sol
│   │   │   ├── IContractPublisher.sol
│   │   │   ├── ITWFee.sol
│   │   │   ├── ITWMultichainRegistry.sol
│   │   │   ├── ITWRegistry.sol
│   │   │   ├── IThirdwebContract.sol
│   │   │   └── IWETH.sol
│   │   └── registry/
│   │       ├── entrypoint/
│   │       │   └── TWMultichainRegistryRouter.sol
│   │       └── registry-extension/
│   │           ├── TWMultichainRegistryLogic.sol
│   │           └── TWMultichainRegistryStorage.sol
│   ├── lib/
│   │   ├── Address.sol
│   │   ├── BitMaps.sol
│   │   ├── BytesLib.sol
│   │   ├── CurrencyTransferLib.sol
│   │   ├── FeeType.sol
│   │   ├── MerkleProof.sol
│   │   ├── NFTMetadataRenderer.sol
│   │   ├── StorageSlot.sol
│   │   ├── StringSet.sol
│   │   └── Strings.sol
│   ├── package.json
│   └── prebuilts/
│       ├── account/
│       │   ├── dynamic/
│       │   │   ├── DynamicAccount.sol
│       │   │   └── DynamicAccountFactory.sol
│       │   ├── interfaces/
│       │   │   ├── IAccount.sol
│       │   │   ├── IAccountCore.sol
│       │   │   ├── IAccountExecute.sol
│       │   │   ├── IAccountFactory.sol
│       │   │   ├── IAccountFactoryCore.sol
│       │   │   ├── IAggregator.sol
│       │   │   ├── IEntryPoint.sol
│       │   │   ├── INonceManager.sol
│       │   │   ├── IOracle.sol
│       │   │   ├── IPaymaster.sol
│       │   │   ├── IStakeManager.sol
│       │   │   └── PackedUserOperation.sol
│       │   ├── managed/
│       │   │   ├── ManagedAccount.sol
│       │   │   └── ManagedAccountFactory.sol
│       │   ├── non-upgradeable/
│       │   │   ├── Account.sol
│       │   │   └── AccountFactory.sol
│       │   ├── token-bound-account/
│       │   │   ├── TokenBoundAccount.sol
│       │   │   └── erc6551-utils/
│       │   │       ├── ERC6551AccountLib.sol
│       │   │       ├── ERC6551BytecodeLib.sol
│       │   │       └── IERC6551Account.sol
│       │   ├── token-paymaster/
│       │   │   ├── BasePaymaster.sol
│       │   │   └── TokenPaymaster.sol
│       │   └── utils/
│       │       ├── AccountCore.sol
│       │       ├── AccountCoreStorage.sol
│       │       ├── AccountExtension.sol
│       │       ├── AccountSeaportBulkSigSupport.sol
│       │       ├── BaseAccount.sol
│       │       ├── BaseAccountFactory.sol
│       │       ├── EntryPoint.sol
│       │       ├── Exec.sol
│       │       ├── Helpers.sol
│       │       ├── NonceManager.sol
│       │       ├── OracleHelper.sol
│       │       ├── SenderCreator.sol
│       │       ├── StakeManager.sol
│       │       ├── TokenCallbackHandler.sol
│       │       ├── UniswapHelper.sol
│       │       └── UserOperationLib.sol
│       ├── airdrop/
│       │   └── Airdrop.sol
│       ├── drop/
│       │   ├── DropERC1155.sol
│       │   ├── DropERC20.sol
│       │   ├── DropERC721.sol
│       │   ├── DropERC721C.sol
│       │   └── drop.md
│       ├── evolving-nfts/
│       │   ├── EvolvingNFT.sol
│       │   ├── EvolvingNFTLogic.sol
│       │   └── extension/
│       │       └── RulesEngineExtension.sol
│       ├── interface/
│       │   ├── ILoyaltyCard.sol
│       │   ├── ILoyaltyPoints.sol
│       │   ├── IMultiwrap.sol
│       │   ├── IPack.sol
│       │   ├── IPackVRFDirect.sol
│       │   ├── airdrop/
│       │   │   ├── IAirdropERC1155.sol
│       │   │   ├── IAirdropERC1155Claimable.sol
│       │   │   ├── IAirdropERC20.sol
│       │   │   ├── IAirdropERC20Claimable.sol
│       │   │   ├── IAirdropERC721.sol
│       │   │   └── IAirdropERC721Claimable.sol
│       │   ├── drop/
│       │   │   ├── IDropClaimCondition.sol
│       │   │   ├── IDropERC1155.sol
│       │   │   ├── IDropERC20.sol
│       │   │   └── IDropERC721.sol
│       │   ├── marketplace/
│       │   │   └── IMarketplace.sol
│       │   ├── staking/
│       │   │   ├── IEditionStake.sol
│       │   │   ├── INFTStake.sol
│       │   │   └── ITokenStake.sol
│       │   └── token/
│       │       ├── ITokenERC1155.sol
│       │       ├── ITokenERC20.sol
│       │       └── ITokenERC721.sol
│       ├── loyalty/
│       │   └── LoyaltyCard.sol
│       ├── marketplace/
│       │   ├── IMarketplace.sol
│       │   ├── direct-listings/
│       │   │   ├── DirectListingsLogic.sol
│       │   │   └── DirectListingsStorage.sol
│       │   ├── english-auctions/
│       │   │   ├── EnglishAuctionsLogic.sol
│       │   │   └── EnglishAuctionsStorage.sol
│       │   ├── entrypoint/
│       │   │   └── MarketplaceV3.sol
│       │   ├── marketplace-v3.md
│       │   └── offers/
│       │       ├── OffersLogic.sol
│       │       └── OffersStorage.sol
│       ├── marketplace-legacy/
│       │   ├── Marketplace.sol
│       │   └── marketplace.md
│       ├── multiwrap/
│       │   ├── Multiwrap.sol
│       │   └── multiwrap.md
│       ├── open-edition/
│       │   ├── OpenEditionERC721.sol
│       │   └── OpenEditionERC721FlatFee.sol
│       ├── split/
│       │   └── Split.sol
│       ├── staking/
│       │   ├── EditionStake.sol
│       │   ├── NFTStake.sol
│       │   └── TokenStake.sol
│       ├── token/
│       │   ├── TokenERC1155.sol
│       │   ├── TokenERC20.sol
│       │   ├── TokenERC721.sol
│       │   └── signatureMint.md
│       ├── unaudited/
│       │   ├── airdrop/
│       │   │   ├── AirdropERC1155.sol
│       │   │   ├── AirdropERC1155Claimable.sol
│       │   │   ├── AirdropERC20.sol
│       │   │   ├── AirdropERC20Claimable.sol
│       │   │   ├── AirdropERC721.sol
│       │   │   └── AirdropERC721Claimable.sol
│       │   ├── burn-to-claim-drop/
│       │   │   ├── BurnToClaimDropERC721.sol
│       │   │   └── extension/
│       │   │       ├── BurnToClaimDrop721Logic.sol
│       │   │       └── BurnToClaimDrop721Storage.sol
│       │   ├── contract-builder/
│       │   │   ├── CoreRouter.sol
│       │   │   └── extension/
│       │   │       └── PermissionOverride.sol
│       │   └── loyalty/
│       │       └── LoyaltyPoints.sol
│       └── vote/
│           └── VoteERC20.sol
├── foundry.toml
├── funding.json
├── gasreport.txt
├── package.json
├── release.sh
├── scripts/
│   ├── deploy-prebuilt-deterministic/
│   │   ├── bootstrap-on-a-chain.ts
│   │   ├── bootstrap-verify.ts
│   │   ├── constants.ts
│   │   ├── deploy-deterministic-std-chains.ts
│   │   └── verify.ts
│   ├── package-release.ts
│   └── release/
│       ├── add_implementations_from_release.ts
│       ├── approve_implementations_from_release.ts
│       └── constants.ts
├── slither.config.json
├── src/
│   └── test/
│       ├── ContractPublisher.t.sol
│       ├── EvolvingNFT.t.sol
│       ├── Forwarder.t.sol
│       ├── ForwarderChainlessDomain.t.sol
│       ├── LoyaltyCard.t.sol
│       ├── LoyaltyPoints.t.sol
│       ├── Multicall.t.sol
│       ├── Multiwrap.t.sol
│       ├── OpenEditionERC721.t.sol
│       ├── OpenEditionERC721FlatFee.t.sol
│       ├── TWFactory.t.sol
│       ├── TWMultichainRegistry.t.sol
│       ├── TWRegistry.t.sol
│       ├── airdrop/
│       │   ├── Airdrop.t.sol
│       │   ├── AirdropERC1155.t.sol
│       │   ├── AirdropERC1155Claimable.t.sol
│       │   ├── AirdropERC20.t.sol
│       │   ├── AirdropERC20Claimable.t.sol
│       │   ├── AirdropERC721.t.sol
│       │   └── AirdropERC721Claimable.t.sol
│       ├── benchmark/
│       │   ├── AccountBenchmark.t.sol
│       │   ├── AirdropBenchmark.t.sol
│       │   ├── AirdropERC1155Benchmark.t.sol
│       │   ├── AirdropERC20Benchmark.t.sol
│       │   ├── AirdropERC721Benchmark.t.sol
│       │   ├── DropERC1155Benchmark.t.sol
│       │   ├── DropERC20Benchmark.t.sol
│       │   ├── DropERC721Benchmark.t.sol
│       │   ├── EditionStakeBenchmark.t.sol
│       │   ├── MultiwrapBenchmark.t.sol
│       │   ├── NFTStakeBenchmark.t.sol
│       │   ├── TokenERC1155Benchmark.t.sol
│       │   ├── TokenERC20Benchmark.t.sol
│       │   ├── TokenERC721Benchmark.t.sol
│       │   └── TokenStakeBenchmark.t.sol
│       ├── burn-to-claim-drop/
│       │   └── BurnToClaimDropERC721.t.sol
│       ├── burn-to-claim-drop-BTT/
│       │   ├── BurnToClaimDropERC721.t.sol
│       │   ├── logic/
│       │   │   ├── burn-and-claim/
│       │   │   │   ├── burnAndClaim.t.sol
│       │   │   │   └── burnAndClaim.tree
│       │   │   ├── lazy-mint/
│       │   │   │   ├── lazyMint.t.sol
│       │   │   │   └── lazyMint.tree
│       │   │   ├── other-functions/
│       │   │   │   ├── other.t.sol
│       │   │   │   └── other.tree
│       │   │   └── reveal/
│       │   │       ├── reveal.t.sol
│       │   │       └── reveal.tree
│       │   └── router/
│       │       ├── initialize/
│       │       │   ├── initialize.t.sol
│       │       │   └── initialize.tree
│       │       └── other-functions/
│       │           ├── other.t.sol
│       │           └── other.tree
│       ├── drop/
│       │   ├── DropERC1155.t.sol
│       │   ├── DropERC20.t.sol
│       │   ├── DropERC721.t.sol
│       │   ├── drop-erc1155/
│       │   │   ├── _beforeClaim/
│       │   │   │   ├── _beforeClaim.t.sol
│       │   │   │   └── _beforeClaim.tree
│       │   │   ├── _beforeTokenTransfer/
│       │   │   │   ├── _beforeTokenTransfer.sol
│       │   │   │   └── _beforeTokenTransfer.tree
│       │   │   ├── _canSetFunctions/
│       │   │   │   ├── _canSetFunctions.sol
│       │   │   │   └── _canSetFunctions.tree
│       │   │   ├── burnBatch/
│       │   │   │   ├── burnBatch.t.sol
│       │   │   │   └── burnBatch.tree
│       │   │   ├── collectPriceOnClaim/
│       │   │   │   ├── collectPriceOnClaim.t.sol
│       │   │   │   └── collectPriceOnClaim.tree
│       │   │   ├── freezeBatchBaseURI/
│       │   │   │   ├── freezeBatchBaseURI.t.sol
│       │   │   │   └── freezeBatchBaseURI.tree
│       │   │   ├── initialize/
│       │   │   │   ├── initialize.t.sol
│       │   │   │   └── initialize.tree
│       │   │   ├── miscellaneous/
│       │   │   │   ├── miscellaneous.t.sol
│       │   │   │   └── miscellaneous.tree
│       │   │   ├── setMaxTotalSupply/
│       │   │   │   ├── setMaxTotalSupply.t.sol
│       │   │   │   └── setMaxTotalSupply.tree
│       │   │   ├── setSaleRecipientForToken/
│       │   │   │   ├── setSaleRecipientForToken.t.sol
│       │   │   │   └── setSaleRecipientForToken.tree
│       │   │   ├── transferTokensOnClaim/
│       │   │   │   ├── transferTokensOnClaim.t.sol
│       │   │   │   └── transferTokensOnClaim.tree
│       │   │   └── updateBatchBaseURI/
│       │   │       ├── updateBatchBaseURI.t.sol
│       │   │       └── updateBatchBaseURI.tree
│       │   ├── drop-erc20/
│       │   │   ├── _beforeClaim/
│       │   │   │   ├── _beforeClaim.t.sol
│       │   │   │   └── _beforeClaim.tree
│       │   │   ├── _canSetFunctions/
│       │   │   │   ├── _canSetFunctions.t.sol
│       │   │   │   └── _canSetFunctions.tree
│       │   │   ├── _collectPriceOnClaim/
│       │   │   │   ├── _collectPriceOnClaim.t.sol
│       │   │   │   └── _collectPriceOnClaim.tree
│       │   │   ├── initialize/
│       │   │   │   ├── initialize.t.sol
│       │   │   │   └── intialize.tree
│       │   │   ├── miscellaneous/
│       │   │   │   ├── miscellaneous.t.sol
│       │   │   │   └── miscellaneous.tree
│       │   │   └── setMaxTotalSupply/
│       │   │       ├── setMaxTotalSupply.t.sol
│       │   │       └── setMaxTotalSupply.tree
│       │   └── drop-erc721/
│       │       ├── _beforeClaim/
│       │       │   ├── _beforeClaim.t.sol
│       │       │   └── _beforeClaim.tree
│       │       ├── _canSetFunctions/
│       │       │   ├── _canSetFunctions.t.sol
│       │       │   └── _canSetFunctions.tree
│       │       ├── _collectPriceOnClaim/
│       │       │   ├── _collectPriceOnClaim.t.sol
│       │       │   └── _collectPriceOnClaim.tree
│       │       ├── _transferTokensOnClaim/
│       │       │   ├── _tranferTokensOnClaim.tree
│       │       │   └── _transferTokensOnClaim.t.sol
│       │       ├── freezeBatchBaseURI/
│       │       │   ├── freezeBatchBaseURI.t.sol
│       │       │   └── freezeBatchBaseURI.tree
│       │       ├── initalizer/
│       │       │   ├── initializer.t.sol
│       │       │   └── initializer.tree
│       │       ├── lazyMint/
│       │       │   ├── lazyMint.t.sol
│       │       │   └── lazyMint.tree
│       │       ├── miscellaneous/
│       │       │   ├── miscellaneous.t.sol
│       │       │   └── miscellaneous.tree
│       │       ├── reveal/
│       │       │   ├── reveal.t.sol
│       │       │   └── reveal.tree
│       │       ├── setMaxTotalSupply/
│       │       │   ├── setMaxTotalSupply.t.sol
│       │       │   └── setMaxTotalSupply.tree
│       │       └── updateBatchBaseURI/
│       │           ├── updateBatchBaseURI.t.sol
│       │           └── updateBatchBaseURI.tree
│       ├── marketplace/
│       │   ├── DirectListings.t.sol
│       │   ├── EnglishAuctions.t.sol
│       │   ├── Offers.t.sol
│       │   ├── direct-listings/
│       │   │   ├── _payout/
│       │   │   │   ├── _payout.t.sol
│       │   │   │   └── _payout.tree
│       │   │   ├── _transferListingTokens/
│       │   │   │   ├── _transferListingTokens.t.sol
│       │   │   │   └── _transferListingTokens.tree
│       │   │   ├── _validateERC20BalAndAllowance/
│       │   │   │   ├── _validateERC20BalAndAllowance.t.sol
│       │   │   │   └── _validateERC20BalAndAllowance.tree
│       │   │   ├── _validateNewListing/
│       │   │   │   ├── _validateNewListing.t.sol
│       │   │   │   └── _validateNewListing.tree
│       │   │   ├── _validateOwnershipAndApproval/
│       │   │   │   ├── _validateOwnershipAndApproval.t.sol
│       │   │   │   └── _validateOwnershipAndApproval.tree
│       │   │   ├── approveBuyerForListing/
│       │   │   │   ├── approveBuyerForListing.t.sol
│       │   │   │   └── approveBuyerForListing.tree
│       │   │   ├── approveCurrencyForListing/
│       │   │   │   ├── approveCurrencyForListing.t.sol
│       │   │   │   └── approveCurrencyForListing.tree
│       │   │   ├── buyFromListing/
│       │   │   │   ├── buyFromListing.t.sol
│       │   │   │   └── buyFromListing.tree
│       │   │   ├── cancelListing/
│       │   │   │   ├── cancelListing.t.sol
│       │   │   │   └── cancelListing.tree
│       │   │   ├── createListing/
│       │   │   │   ├── createListing.t.sol
│       │   │   │   └── createListing.tree
│       │   │   └── updateListing/
│       │   │       ├── updateListing.t.sol
│       │   │       └── updateListing.tree
│       │   └── english-auctions/
│       │       ├── _payout/
│       │       │   ├── _payout.t.sol
│       │       │   └── _payout.tree
│       │       ├── _transferAuctionTokens/
│       │       │   ├── _transferAuctionTokens.t.sol
│       │       │   └── _transferAuctionTokens.tree
│       │       ├── _validateNewAuction/
│       │       │   ├── _validateNewAuction.t.sol
│       │       │   └── _validateNewAuction.tree
│       │       ├── bidInAuction/
│       │       │   ├── bidInAuction.t.sol
│       │       │   └── bidInAuction.tree
│       │       ├── cancelAuction/
│       │       │   ├── cancelAuction.t.sol
│       │       │   └── cancelAuction.tree
│       │       ├── collectAuctionPayout/
│       │       │   ├── collectAuctionPayout.t.sol
│       │       │   └── collectAuctionPayout.tree
│       │       ├── collectAuctionTokens/
│       │       │   ├── collectAuctionTokens.t.sol
│       │       │   └── collectAuctionTokens.tree
│       │       └── createAuction/
│       │           ├── createAuction.t.sol
│       │           └── createAuction.tree
│       ├── minimal-factory/
│       │   └── MinimalFactory.t.sol
│       ├── mocks/
│       │   ├── Mock.sol
│       │   ├── MockContractPublisher.sol
│       │   ├── MockERC1155.sol
│       │   ├── MockERC1155NonBurnable.sol
│       │   ├── MockERC20.sol
│       │   ├── MockERC20CustomDecimals.sol
│       │   ├── MockERC20NonCompliant.sol
│       │   ├── MockERC721.sol
│       │   ├── MockERC721NonBurnable.sol
│       │   ├── MockRoyaltyEngineV1.sol
│       │   ├── MockThirdwebContract.sol
│       │   ├── TestOracle2.sol
│       │   ├── TestUniswap.sol
│       │   └── WETH9.sol
│       ├── open-edition/
│       │   ├── _beforeTokenTransfers/
│       │   │   ├── _beforeTokenTransfers.t.sol
│       │   │   └── _beforeTokenTransfers.tree
│       │   ├── _canSetFunctions/
│       │   │   ├── _canSetFunctions.t.sol
│       │   │   └── _canSetFunctions.tree
│       │   ├── _collectPriceOnClaim/
│       │   │   ├── _collectPriceOnClaim.t.sol
│       │   │   └── _collectPriceOnClaim.tree
│       │   ├── _transferTokensOnClaim/
│       │   │   ├── _transferTokensOnClaim.t.sol
│       │   │   └── _transferTokensOnClaim.tree
│       │   ├── initialize/
│       │   │   ├── initialize.t.sol
│       │   │   └── initialize.tree
│       │   └── misc/
│       │       ├── misc.t.sol
│       │       └── misc.tree
│       ├── open-edition-flat-fee/
│       │   ├── _beforeTokenTransfers/
│       │   │   ├── _beforeTokenTransfers.t.sol
│       │   │   └── _beforeTokenTransfers.tree
│       │   ├── _canSetFunctions/
│       │   │   ├── _canSetFunctions.t.sol
│       │   │   └── _canSetFunctions.tree
│       │   ├── _collectPriceOnClaim/
│       │   │   ├── _collectPriceOnClaim.t.sol
│       │   │   └── _collectPriceOnClaim.tree
│       │   ├── _transferTokensOnClaim/
│       │   │   ├── _transferTokensOnClaim.t.sol
│       │   │   └── _transferTokensOnClaim.tree
│       │   ├── initialize/
│       │   │   ├── initialize.t.sol
│       │   │   └── initialize.tree
│       │   └── misc/
│       │       ├── misc.t.sol
│       │       └── misc.tree
│       ├── plugin/
│       │   ├── Map.t.sol
│       │   ├── Router.t.sol
│       │   └── RouterImmutable.t.sol
│       ├── scripts/
│       │   ├── generateRoot.ts
│       │   ├── generateRootAirdrop.ts
│       │   ├── generateRootAirdrop1155.ts
│       │   ├── getCloneAddress.ts
│       │   ├── getProof.ts
│       │   ├── getProofAirdrop.ts
│       │   └── getProofAirdrop1155.ts
│       ├── sdk/
│       │   ├── base/
│       │   │   ├── BaseUtilTest.sol
│       │   │   ├── ERC1155Base.t.sol
│       │   │   ├── ERC1155DelayedReveal.t.sol
│       │   │   ├── ERC1155Drop.t.sol
│       │   │   ├── ERC1155LazyMint.t.sol
│       │   │   ├── ERC1155SignatureMint.t.sol
│       │   │   ├── ERC20Base.t.sol
│       │   │   ├── ERC20Drop.t.sol
│       │   │   ├── ERC20DropVote.t.sol
│       │   │   ├── ERC20SignatureMint.t.sol
│       │   │   ├── ERC20SignatureMintVote.t.sol
│       │   │   ├── ERC20Vote.t.sol
│       │   │   ├── ERC721Base.t.sol
│       │   │   ├── ERC721DelayedReveal.t.sol
│       │   │   ├── ERC721Drop.t.sol
│       │   │   ├── ERC721LazyMint.t.sol
│       │   │   ├── ERC721Multiwrap.t.sol
│       │   │   └── ERC721SignatureMint.t.sol
│       │   └── extension/
│       │       ├── BatchMintMetadata.t.sol
│       │       ├── ContractMetadata.t.sol
│       │       ├── DelayedReveal.t.sol
│       │       ├── DropSinglePhase.t.sol
│       │       ├── DropSinglePhase1155.t.sol
│       │       ├── ExtensionUtilTest.sol
│       │       ├── LazyMint.t.sol
│       │       ├── NFTMetadata.t.sol
│       │       ├── Ownable.t.sol
│       │       ├── Permissions.t.sol
│       │       ├── PermissionsEnumerable.t.sol
│       │       ├── PlatformFee.t.sol
│       │       ├── PrimarySale.t.sol
│       │       ├── Royalty.t.sol
│       │       ├── SignatureMintERC1155.t.sol
│       │       ├── SignatureMintERC20.t.sol
│       │       ├── SignatureMintERC721.t.sol
│       │       ├── StakingExtension.t.sol
│       │       ├── TokenBundle.t.sol
│       │       ├── TokenStore.t.sol
│       │       ├── batch-mint-metadata/
│       │       │   ├── batch-mint-metadata/
│       │       │   │   ├── _batchMintMetadata.t.sol
│       │       │   │   └── _batchMintMetadata.tree
│       │       │   ├── freeze-base-uri/
│       │       │   │   ├── _freezeBaseURI.t.sol
│       │       │   │   └── _freezeBaseURI.tree
│       │       │   ├── get-base-uri/
│       │       │   │   ├── _getBaseURI.t.sol
│       │       │   │   └── _getBaseURI.tree
│       │       │   ├── get-batch-id/
│       │       │   │   ├── _getBatchId.t.sol
│       │       │   │   └── _getBatchId.tree
│       │       │   ├── get-batch-start-id/
│       │       │   │   ├── _getBatchStartId.t.sol
│       │       │   │   └── _getBatchStartId.tree
│       │       │   └── set-base-uri/
│       │       │       ├── _setBaseURI.t.sol
│       │       │       └── _setBaseURI.tree
│       │       ├── burn-to-claim/
│       │       │   ├── burn-tokens-on-origin/
│       │       │   │   ├── _burnTokensOnOrigin.t.sol
│       │       │   │   └── _burnTokensOnOrigin.tree
│       │       │   ├── set-burn-to-claim-info/
│       │       │   │   ├── setBurnToClaimInfo.t.sol
│       │       │   │   └── setBurnToClaimInfo.tree
│       │       │   └── verify-burn-to-claim/
│       │       │       ├── verifyBurnToClaim.t.sol
│       │       │       └── verifyBurnToClaim.tree
│       │       ├── contract-metadata/
│       │       │   └── set-contract-uri/
│       │       │       ├── setContractURI.t.sol
│       │       │       └── setContractURI.tree
│       │       ├── delayed-reveal/
│       │       │   ├── get-reveal-uri/
│       │       │   │   ├── getRevealURI.t.sol
│       │       │   │   └── getRevealURI.tree
│       │       │   └── set-encrypted-data/
│       │       │       ├── _setEncryptedData.t.sol
│       │       │       └── _setEncryptedData.tree
│       │       ├── drop/
│       │       │   ├── claim/
│       │       │   │   ├── claim.t.sol
│       │       │   │   └── claim.tree
│       │       │   ├── get-active-claim-condition-id/
│       │       │   │   ├── getActiveClaimConditionId.t.sol
│       │       │   │   └── getActiveClaimConditionId.tree
│       │       │   ├── set-claim-conditions/
│       │       │   │   ├── setClaimConditions.t.sol
│       │       │   │   └── setClaimConditions.tree
│       │       │   └── verify-claim/
│       │       │       ├── verifyClaim.t.sol
│       │       │       └── verifyClaim.tree
│       │       ├── lazy-mint/
│       │       │   └── lazy-mint/
│       │       │       ├── lazyMint.t.sol
│       │       │       └── lazyMint.tree
│       │       ├── ownable/
│       │       │   └── set-owner/
│       │       │       ├── setOwner.t.sol
│       │       │       └── setOwner.tree
│       │       ├── royalty/
│       │       │   ├── set-default-royalty-info/
│       │       │   │   ├── setDefaultRoyaltyInfo.t.sol
│       │       │   │   └── setDefaultRoyaltyInfo.tree
│       │       │   └── set-royalty-info-for-token/
│       │       │       ├── setRoyaltyInfoForToken.t.sol
│       │       │       └── setRoyaltyInfoForToken.tree
│       │       └── upgradeable/
│       │           ├── batch-mint-metadata/
│       │           │   ├── batch-mint-metadata/
│       │           │   │   ├── _batchMintMetadata.t.sol
│       │           │   │   └── _batchMintMetadata.tree
│       │           │   ├── freeze-base-uri/
│       │           │   │   ├── _freezeBaseURI.t.sol
│       │           │   │   └── _freezeBaseURI.tree
│       │           │   ├── get-base-uri/
│       │           │   │   ├── _getBaseURI.t.sol
│       │           │   │   └── _getBaseURI.tree
│       │           │   ├── get-batch-id/
│       │           │   │   ├── _getBatchId.t.sol
│       │           │   │   └── _getBatchId.tree
│       │           │   ├── get-batch-start-id/
│       │           │   │   ├── _getBatchStartId.t.sol
│       │           │   │   └── _getBatchStartId.tree
│       │           │   └── set-base-uri/
│       │           │       ├── _setBaseURI.t.sol
│       │           │       └── _setBaseURI.tree
│       │           ├── burn-to-claim/
│       │           │   ├── burn-tokens-on-origin/
│       │           │   │   ├── _burnTokensOnOrigin.t.sol
│       │           │   │   └── _burnTokensOnOrigin.tree
│       │           │   ├── set-burn-to-claim-info/
│       │           │   │   ├── setBurnToClaimInfo.t.sol
│       │           │   │   └── setBurnToClaimInfo.tree
│       │           │   └── verify-burn-to-claim/
│       │           │       ├── verifyBurnToClaim.t.sol
│       │           │       └── verifyBurnToClaim.tree
│       │           ├── contract-metadata/
│       │           │   └── set-contract-uri/
│       │           │       ├── setContractURI.t.sol
│       │           │       └── setContractURI.tree
│       │           ├── delayed-reveal/
│       │           │   ├── get-reveal-uri/
│       │           │   │   ├── getRevealURI.t.sol
│       │           │   │   └── getRevealURI.tree
│       │           │   └── set-encrypted-data/
│       │           │       ├── _setEncryptedData.t.sol
│       │           │       └── _setEncryptedData.tree
│       │           ├── drop/
│       │           │   ├── claim/
│       │           │   │   ├── claim.t.sol
│       │           │   │   └── claim.tree
│       │           │   ├── get-active-claim-condition-id/
│       │           │   │   ├── getActiveClaimConditionId.t.sol
│       │           │   │   └── getActiveClaimConditionId.tree
│       │           │   ├── set-claim-conditions/
│       │           │   │   ├── setClaimConditions.t.sol
│       │           │   │   └── setClaimConditions.tree
│       │           │   └── verify-claim/
│       │           │       ├── verifyClaim.t.sol
│       │           │       └── verifyClaim.tree
│       │           ├── lazy-mint/
│       │           │   └── lazy-mint/
│       │           │       ├── lazyMint.t.sol
│       │           │       └── lazyMint.tree
│       │           ├── ownable/
│       │           │   └── set-owner/
│       │           │       ├── setOwner.t.sol
│       │           │       └── setOwner.tree
│       │           └── royalty/
│       │               ├── set-default-royalty-info/
│       │               │   ├── setDefaultRoyaltyInfo.t.sol
│       │               │   └── setDefaultRoyaltyInfo.tree
│       │               └── set-royalty-info-for-token/
│       │                   ├── setRoyaltyInfoForToken.t.sol
│       │                   └── setRoyaltyInfoForToken.tree
│       ├── smart-wallet/
│       │   ├── Account.t.sol
│       │   ├── AccountVulnPOC.t.sol
│       │   ├── DynamicAccount.t.sol
│       │   ├── ManagedAccount.t.sol
│       │   ├── account-core/
│       │   │   ├── isValidSigner.t.sol
│       │   │   └── isValidSigner.tree
│       │   ├── account-permissions/
│       │   │   ├── setPermissionsForSigner.t.sol
│       │   │   └── setPermissionsForSigner.tree
│       │   ├── token-paymaster/
│       │   │   └── TokenPaymaster.t.sol
│       │   └── utils/
│       │       ├── AABenchmarkArtifacts.sol
│       │       ├── AABenchmarkPrepare.sol
│       │       ├── AABenchmarkTest.t.sol
│       │       ├── AATestArtifacts.sol
│       │       ├── AATestBase.sol
│       │       ├── BasePaymaster.sol
│       │       ├── MessageHashUtils.sol
│       │       └── VerifyingPaymaster.sol
│       ├── split-BTT/
│       │   ├── distribute-erc20/
│       │   │   ├── distribute.t.sol
│       │   │   └── distribute.tree
│       │   ├── distribute-native-token/
│       │   │   ├── distribute.t.sol
│       │   │   └── distribute.tree
│       │   ├── initialize/
│       │   │   ├── initialize.t.sol
│       │   │   └── initialize.tree
│       │   ├── other-functions/
│       │   │   ├── other.t.sol
│       │   │   └── other.tree
│       │   ├── release-erc20/
│       │   │   ├── release.t.sol
│       │   │   └── release.tree
│       │   ├── release-native-token/
│       │   │   ├── release.t.sol
│       │   │   └── release.tree
│       │   └── set-contract-uri/
│       │       ├── setContractURI.t.sol
│       │       └── setContractURI.tree
│       ├── staking/
│       │   ├── EditionStake.t.sol
│       │   ├── EditionStake_EthReward.t.sol
│       │   ├── NFTStake.t.sol
│       │   ├── NFTStake_EthReward.t.sol
│       │   ├── TokenStake.t.sol
│       │   ├── TokenStake_EthReward.t.sol
│       │   └── TokenStake_EthStake.t.sol
│       ├── token/
│       │   ├── TokenERC1155.t.sol
│       │   ├── TokenERC20.t.sol
│       │   └── TokenERC721.t.sol
│       ├── tokenerc1155-BTT/
│       │   ├── burn/
│       │   │   ├── burn.t.sol
│       │   │   └── burn.tree
│       │   ├── burn-batch/
│       │   │   ├── burnBatch.t.sol
│       │   │   └── burnBatch.tree
│       │   ├── initialize/
│       │   │   ├── initialize.t.sol
│       │   │   └── initialize.tree
│       │   ├── mint-to/
│       │   │   ├── mintTo.t.sol
│       │   │   └── mintTo.tree
│       │   ├── mint-with-signature/
│       │   │   ├── mintWithSignature.t.sol
│       │   │   └── mintWithSignature.tree
│       │   ├── other-functions/
│       │   │   ├── other.t.sol
│       │   │   └── other.tree
│       │   ├── owner/
│       │   │   ├── owner.t.sol
│       │   │   └── owner.tree
│       │   ├── set-contract-uri/
│       │   │   ├── setContractURI.t.sol
│       │   │   └── setContractURI.tree
│       │   ├── set-default-royalty-info/
│       │   │   ├── setDefaultRoyaltyInfo.t.sol
│       │   │   └── setDefaultRoyaltyInfo.tree
│       │   ├── set-flat-platform-fee-info/
│       │   │   ├── setFlatPlatformFeeInfo.t.sol
│       │   │   └── setFlatPlatformFeeInfo.tree
│       │   ├── set-owner/
│       │   │   ├── setOwner.t.sol
│       │   │   └── setOwner.tree
│       │   ├── set-platform-fee-info/
│       │   │   ├── setPlatformFeeInfo.t.sol
│       │   │   └── setPlatformFeeInfo.tree
│       │   ├── set-platform-fee-type/
│       │   │   ├── setPlatformFeeType.t.sol
│       │   │   └── setPlatformFeeType.tree
│       │   ├── set-primary-sale-recipient/
│       │   │   ├── setPrimarySaleRecipient.t.sol
│       │   │   └── setPrimarySaleRecipient.tree
│       │   ├── set-royalty-info-for-token/
│       │   │   ├── setRoyaltyInfoForToken.t.sol
│       │   │   └── setRoyaltyInfoForToken.tree
│       │   ├── uri/
│       │   │   ├── tokenURI.t.sol
│       │   │   └── tokenURI.tree
│       │   └── verify/
│       │       ├── verify.t.sol
│       │       └── verify.tree
│       ├── tokenerc20-BTT/
│       │   ├── initialize/
│       │   │   ├── initialize.t.sol
│       │   │   └── initialize.tree
│       │   ├── mint-to/
│       │   │   ├── mintTo.t.sol
│       │   │   └── mintTo.tree
│       │   ├── mint-with-signature/
│       │   │   ├── mintWithSignature.t.sol
│       │   │   └── mintWithSignature.tree
│       │   ├── other-functions/
│       │   │   ├── other.t.sol
│       │   │   └── other.tree
│       │   ├── set-contract-uri/
│       │   │   ├── setContractURI.t.sol
│       │   │   └── setContractURI.tree
│       │   ├── set-platform-fee-info/
│       │   │   ├── setPlatformFeeInfo.t.sol
│       │   │   └── setPlatformFeeInfo.tree
│       │   ├── set-primary-sale-recipient/
│       │   │   ├── setPrimarySaleRecipient.t.sol
│       │   │   └── setPrimarySaleRecipient.tree
│       │   └── verify/
│       │       ├── verify.t.sol
│       │       └── verify.tree
│       ├── tokenerc721-BTT/
│       │   ├── burn/
│       │   │   ├── burn.t.sol
│       │   │   └── burn.tree
│       │   ├── initialize/
│       │   │   ├── initialize.t.sol
│       │   │   └── initialize.tree
│       │   ├── mint-to/
│       │   │   ├── mintTo.t.sol
│       │   │   └── mintTo.tree
│       │   ├── mint-with-signature/
│       │   │   ├── mintWithSignature.t.sol
│       │   │   └── mintWithSignature.tree
│       │   ├── other-functions/
│       │   │   ├── other.t.sol
│       │   │   └── other.tree
│       │   ├── owner/
│       │   │   ├── owner.t.sol
│       │   │   └── owner.tree
│       │   ├── set-contract-uri/
│       │   │   ├── setContractURI.t.sol
│       │   │   └── setContractURI.tree
│       │   ├── set-default-royalty-info/
│       │   │   ├── setDefaultRoyaltyInfo.t.sol
│       │   │   └── setDefaultRoyaltyInfo.tree
│       │   ├── set-owner/
│       │   │   ├── setOwner.t.sol
│       │   │   └── setOwner.tree
│       │   ├── set-platform-fee-info/
│       │   │   ├── setPlatformFeeInfo.t.sol
│       │   │   └── setPlatformFeeInfo.tree
│       │   ├── set-primary-sale-recipient/
│       │   │   ├── setPrimarySaleRecipient.t.sol
│       │   │   └── setPrimarySaleRecipient.tree
│       │   ├── set-royalty-info-for-token/
│       │   │   ├── setRoyaltyInfoForToken.t.sol
│       │   │   └── setRoyaltyInfoForToken.tree
│       │   ├── token-uri/
│       │   │   ├── tokenURI.t.sol
│       │   │   └── tokenURI.tree
│       │   └── verify/
│       │       ├── verify.t.sol
│       │       └── verify.tree
│       ├── utils/
│       │   ├── BaseTest.sol
│       │   ├── Console.sol
│       │   ├── SignatureMint1155Utils.sol
│       │   └── Wallet.sol
│       └── vote-BTT/
│           ├── initialize/
│           │   ├── initialize.t.sol
│           │   └── initialize.tree
│           ├── other-functions/
│           │   ├── other.t.sol
│           │   └── other.tree
│           ├── propose/
│           │   ├── propose.t.sol
│           │   └── propose.tree
│           └── set-contract-uri/
│               ├── setContractURI.t.sol
│               └── setContractURI.tree
├── tsconfig.build.json
└── tsconfig.json
Download .txt
SYMBOL INDEX (9 symbols across 8 files)

FILE: scripts/deploy-prebuilt-deterministic/bootstrap-on-a-chain.ts
  function main (line 30) | async function main() {

FILE: scripts/deploy-prebuilt-deterministic/bootstrap-verify.ts
  function main (line 8) | async function main() {

FILE: scripts/deploy-prebuilt-deterministic/constants.ts
  constant DEFAULT_CHAINS (line 24) | const DEFAULT_CHAINS = [

FILE: scripts/deploy-prebuilt-deterministic/deploy-deterministic-std-chains.ts
  function main (line 28) | async function main() {

FILE: scripts/deploy-prebuilt-deterministic/verify.ts
  function main (line 9) | async function main() {

FILE: scripts/package-release.ts
  function getAllSolidityFiles (line 16) | async function getAllSolidityFiles(dir: string): Promise<string[]> {
  function main (line 31) | async function main() {

FILE: scripts/release/add_implementations_from_release.ts
  function main (line 14) | async function main() {

FILE: scripts/release/approve_implementations_from_release.ts
  function main (line 14) | async function main() {
Condensed preview — 873 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (5,070K chars).
[
  {
    "path": ".editorconfig",
    "chars": 254,
    "preview": "# EditorConfig  http://EditorConfig.org\n\n# top-most EditorConfig file\nroot = true\n\n# All files\n[*]\ncharset = utf-8\nend_o"
  },
  {
    "path": ".eslintignore",
    "chars": 117,
    "preview": "# folders\nartifacts/\nbuild/\ncache/\ncoverage/\ndist/\nlib/\nnode_modules/\ntypechain/\n\n# files\n.solcover.js\ncoverage.json\n"
  },
  {
    "path": ".eslintrc.yaml",
    "chars": 531,
    "preview": "extends:\n  - \"eslint:recommended\"\n  - \"plugin:@typescript-eslint/eslint-recommended\"\n  - \"plugin:@typescript-eslint/reco"
  },
  {
    "path": ".gas-snapshot",
    "chars": 4887,
    "preview": "AABenchmarkPrepare:test_prepareBenchmarkFile() (gas: 2926370)\nAccountBenchmarkTest:test_state_accountReceivesNativeToken"
  },
  {
    "path": ".gitattributes",
    "chars": 32,
    "preview": "*.sol linguist-language=Solidity"
  },
  {
    "path": ".github/composite-actions/setup/action.yml",
    "chars": 449,
    "preview": "name: \"Install\"\ndescription: \"Sets up Node.js and runs install\"\n\nruns:\n  using: composite\n  steps:\n    - name: Setup Nod"
  },
  {
    "path": ".github/workflows/dispatch_docs.yml",
    "chars": 354,
    "preview": "name: Dispatch Doc Generation\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  dispatch:\n    runs-on: ubuntu-latest\n    "
  },
  {
    "path": ".github/workflows/lint.yml",
    "chars": 1028,
    "preview": "# This is a basic workflow to help you get started with Actions\n\nname: Solhint Lint\n\n# Controls when the workflow will r"
  },
  {
    "path": ".github/workflows/prettier.yml",
    "chars": 964,
    "preview": "# This is a basic workflow to help you get started with Actions\n\nname: Prettier Formatting\n\n# Controls when the workflow"
  },
  {
    "path": ".github/workflows/slither.yml",
    "chars": 1116,
    "preview": "name: Slither Analysis\n\non:\n  push:\n    branches: [main]\n  pull_request:\n    branches: [main]\n\n# cancel previous runs if"
  },
  {
    "path": ".github/workflows/tests.yml",
    "chars": 1593,
    "preview": "# This is a basic workflow to help you get started with Actions\n\nname: Tests\n\n# Controls when the workflow will run\non:\n"
  },
  {
    "path": ".gitignore",
    "chars": 662,
    "preview": "# folders\n.coverage_artifacts/\n.coverage_cache/\n.coverage_contracts/\nartifacts/@chainlink\nartifacts/@openzeppelin\nartifa"
  },
  {
    "path": ".gitmodules",
    "chars": 2083,
    "preview": "[submodule \"lib/forge-std\"]\n\tpath = lib/forge-std\n\turl = https://github.com/brockelmore/forge-std\n[submodule \"lib/ds-tes"
  },
  {
    "path": ".npmignore",
    "chars": 14,
    "preview": "node_modules/\n"
  },
  {
    "path": ".prettierignore",
    "chars": 169,
    "preview": "# folders\nartifacts/\nartifacts_forge/\nbuild/\ncache/\ncoverage/\ndist/\nnode_modules/\ntypechain/\n\n# files\nsrc/test/smart-wal"
  },
  {
    "path": ".prettierrc",
    "chars": 292,
    "preview": "{\n  \"arrowParens\": \"avoid\",\n  \"bracketSpacing\": true,\n  \"endOfLine\":\"auto\",\n  \"printWidth\": 120,\n  \"useTabs\": false,\n  \""
  },
  {
    "path": ".solhint.json",
    "chars": 1113,
    "preview": "{\n  \"extends\": \"solhint:recommended\",\n  \"plugins\": [\"prettier\"],\n  \"rules\": {\n    \"imports-on-top\": \"error\",\n    \"no-unu"
  },
  {
    "path": ".solhintignore",
    "chars": 76,
    "preview": "# folders\n.yarn/\nbuild/\ndist/\nnode_modules/\ncontracts/openzeppelin-presets/\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 5478,
    "preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participa"
  },
  {
    "path": "LICENSE.md",
    "chars": 10942,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "README.md",
    "chars": 5461,
    "preview": "<p align=\"center\">\n<br />\n<a href=\"https://thirdweb.com\"><img src=\"https://github.com/thirdweb-dev/typescript-sdk/blob/m"
  },
  {
    "path": "audit-reports/preliminary-audits/airdroperc20-claimable.md",
    "chars": 843,
    "preview": "This document contains details on fixes / response to the preliminary audit reports added to this repository.\n\n## [Airdr"
  },
  {
    "path": "contracts/base/ERC1155Base.sol",
    "chars": 11479,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport { ERC1155 } from \"../eip/ER"
  },
  {
    "path": "contracts/base/ERC1155DelayedReveal.sol",
    "chars": 4739,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./ERC1155LazyMint.sol\";\nim"
  },
  {
    "path": "contracts/base/ERC1155Drop.sol",
    "chars": 14307,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport { ERC1155 } from \"../eip/ER"
  },
  {
    "path": "contracts/base/ERC1155LazyMint.sol",
    "chars": 11590,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport { ERC1155 } from \"../eip/ER"
  },
  {
    "path": "contracts/base/ERC1155SignatureMint.sol",
    "chars": 4943,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./ERC1155Base.sol\";\n\nimpor"
  },
  {
    "path": "contracts/base/ERC20Base.sol",
    "chars": 4498,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../external-deps/openzeppe"
  },
  {
    "path": "contracts/base/ERC20Drop.sol",
    "chars": 6119,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../external-deps/openzeppe"
  },
  {
    "path": "contracts/base/ERC20DropVote.sol",
    "chars": 5197,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../external-deps/openzeppe"
  },
  {
    "path": "contracts/base/ERC20SignatureMint.sol",
    "chars": 3910,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./ERC20Base.sol\";\n\nimport "
  },
  {
    "path": "contracts/base/ERC20SignatureMintVote.sol",
    "chars": 4281,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./ERC20Vote.sol\";\n\nimport "
  },
  {
    "path": "contracts/base/ERC20Vote.sol",
    "chars": 4489,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../external-deps/openzeppe"
  },
  {
    "path": "contracts/base/ERC721Base.sol",
    "chars": 8541,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../eip/queryable/ERC721AQu"
  },
  {
    "path": "contracts/base/ERC721DelayedReveal.sol",
    "chars": 4775,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./ERC721LazyMint.sol\";\n\nim"
  },
  {
    "path": "contracts/base/ERC721Drop.sol",
    "chars": 12133,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport { ERC721A, Context } from \""
  },
  {
    "path": "contracts/base/ERC721LazyMint.sol",
    "chars": 8994,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport { ERC721A, Context } from \""
  },
  {
    "path": "contracts/base/ERC721Multiwrap.sol",
    "chars": 10087,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport { ERC721A, Context } from \""
  },
  {
    "path": "contracts/base/ERC721SignatureMint.sol",
    "chars": 4609,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./ERC721Base.sol\";\n\nimport"
  },
  {
    "path": "contracts/base/Staking1155Base.sol",
    "chars": 7191,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../extension/ContractMetad"
  },
  {
    "path": "contracts/base/Staking20Base.sol",
    "chars": 6822,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../extension/ContractMetad"
  },
  {
    "path": "contracts/base/Staking721Base.sol",
    "chars": 6958,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../extension/ContractMetad"
  },
  {
    "path": "contracts/eip/ERC1155.sol",
    "chars": 9798,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\nimport \"./interface/IERC1155.sol\";\nimport \"./interface/I"
  },
  {
    "path": "contracts/eip/ERC1271.sol",
    "chars": 762,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\nabstract contract ERC1271 {\n    // bytes4(keccak256(\"isV"
  },
  {
    "path": "contracts/eip/ERC165.sol",
    "chars": 997,
    "preview": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8."
  },
  {
    "path": "contracts/eip/ERC721A.sol",
    "chars": 21138,
    "preview": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v3.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport \"./i"
  },
  {
    "path": "contracts/eip/ERC721AUpgradeable.sol",
    "chars": 23801,
    "preview": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v3.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\n////////// "
  },
  {
    "path": "contracts/eip/ERC721AVirtualApprove.sol",
    "chars": 21175,
    "preview": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v3.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\n////////// "
  },
  {
    "path": "contracts/eip/ERC721AVirtualApproveUpgradeable.sol",
    "chars": 22201,
    "preview": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v3.3.0\n// Creator: Chiru Labs\n\n////////// CHANGELOG: turn `approve`"
  },
  {
    "path": "contracts/eip/interface/IERC1155.sol",
    "chars": 7639,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/**\n    @title ERC-1155 Multi Token Standard\n    @dev Se"
  },
  {
    "path": "contracts/eip/interface/IERC1155Enumerable.sol",
    "chars": 456,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @title ERC1155 Non-Fungible Token Standard, optional"
  },
  {
    "path": "contracts/eip/interface/IERC1155Metadata.sol",
    "chars": 502,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/**\n    Note: The ERC-165 identifier for this interface "
  },
  {
    "path": "contracts/eip/interface/IERC1155Receiver.sol",
    "chars": 2478,
    "preview": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npr"
  },
  {
    "path": "contracts/eip/interface/IERC1155Supply.sol",
    "chars": 505,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @title ERC1155S Non-Fungible Token Standard, optiona"
  },
  {
    "path": "contracts/eip/interface/IERC165.sol",
    "chars": 857,
    "preview": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8"
  },
  {
    "path": "contracts/eip/interface/IERC20.sol",
    "chars": 802,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/**\n * @title ERC20 interface\n * @dev see https://github"
  },
  {
    "path": "contracts/eip/interface/IERC20Metadata.sol",
    "chars": 367,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/**\n * @title ERC20Metadata interface\n * @dev see https:"
  },
  {
    "path": "contracts/eip/interface/IERC20Permit.sol",
    "chars": 2252,
    "preview": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma"
  },
  {
    "path": "contracts/eip/interface/IERC2981.sol",
    "chars": 798,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Interface for the N"
  },
  {
    "path": "contracts/eip/interface/IERC4906.sol",
    "chars": 689,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\nimport \"./IERC165.sol\";\nimport \"./IERC721.sol\";\n\ninterf"
  },
  {
    "path": "contracts/eip/interface/IERC721.sol",
    "chars": 4555,
    "preview": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\n/*"
  },
  {
    "path": "contracts/eip/interface/IERC721A.sol",
    "chars": 2888,
    "preview": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v3.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport \"./I"
  },
  {
    "path": "contracts/eip/interface/IERC721Enumerable.sol",
    "chars": 1168,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @title ERC-721 Non-Fungible Token Standard, optional"
  },
  {
    "path": "contracts/eip/interface/IERC721Metadata.sol",
    "chars": 913,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @title ERC-721 Non-Fungible Token Standard, optional"
  },
  {
    "path": "contracts/eip/interface/IERC721Receiver.sol",
    "chars": 964,
    "preview": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0."
  },
  {
    "path": "contracts/eip/interface/IERC721Supply.sol",
    "chars": 576,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @title ERC-721 Non-Fungible Token Standard, optional"
  },
  {
    "path": "contracts/eip/queryable/ERC721AQueryable.sol",
    "chars": 6158,
    "preview": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v3.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport \"./I"
  },
  {
    "path": "contracts/eip/queryable/ERC721AQueryableUpgradeable.sol",
    "chars": 7789,
    "preview": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.2.3\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport \"./I"
  },
  {
    "path": "contracts/eip/queryable/ERC721AStorage.sol",
    "chars": 1955,
    "preview": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary ERC721AStorage {\n    // Bypass for a `--via-ir` bug (h"
  },
  {
    "path": "contracts/eip/queryable/ERC721AUpgradeable.sol",
    "chars": 43547,
    "preview": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.2.3\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport \"./I"
  },
  {
    "path": "contracts/eip/queryable/ERC721A__Initializable.sol",
    "chars": 3357,
    "preview": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @dev This is a base contract to aid in writing upgradeab"
  },
  {
    "path": "contracts/eip/queryable/ERC721A__InitializableStorage.sol",
    "chars": 752,
    "preview": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is a base storage for the  initialization fun"
  },
  {
    "path": "contracts/eip/queryable/IERC721AQueryable.sol",
    "chars": 2316,
    "preview": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v3.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport \"../"
  },
  {
    "path": "contracts/eip/queryable/IERC721AQueryableUpgradeable.sol",
    "chars": 2182,
    "preview": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.2.3\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport \"./I"
  },
  {
    "path": "contracts/eip/queryable/IERC721AUpgradeable.sol",
    "chars": 8626,
    "preview": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.2.3\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\n/**\n * @dev"
  },
  {
    "path": "contracts/extension/AppURI.sol",
    "chars": 989,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IAppURI.sol\";\n"
  },
  {
    "path": "contracts/extension/BatchMintMetadata.sol",
    "chars": 5357,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  @title   Batch-mint Metada"
  },
  {
    "path": "contracts/extension/BurnToClaim.sol",
    "chars": 2718,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport { ERC1155Burnable } from \"@"
  },
  {
    "path": "contracts/extension/ContractMetadata.sol",
    "chars": 1744,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IContractMetad"
  },
  {
    "path": "contracts/extension/DelayedReveal.sol",
    "chars": 4497,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IDelayedReveal"
  },
  {
    "path": "contracts/extension/Drop.sol",
    "chars": 11220,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IDrop.sol\";\nim"
  },
  {
    "path": "contracts/extension/Drop1155.sol",
    "chars": 11848,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IDrop1155.sol\""
  },
  {
    "path": "contracts/extension/DropSinglePhase.sol",
    "chars": 8924,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IDropSinglePha"
  },
  {
    "path": "contracts/extension/DropSinglePhase1155.sol",
    "chars": 8181,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IDropSinglePha"
  },
  {
    "path": "contracts/extension/Initializable.sol",
    "chars": 5569,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\nimport \"../lib/Address.sol\";\n\n/**\n * @dev This is a base"
  },
  {
    "path": "contracts/extension/LazyMint.sol",
    "chars": 2161,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/ILazyMint.sol\""
  },
  {
    "path": "contracts/extension/LazyMintWithTier.sol",
    "chars": 4023,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/ILazyMintWithT"
  },
  {
    "path": "contracts/extension/Multicall.sol",
    "chars": 1435,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../lib/Address.sol\";\nimpor"
  },
  {
    "path": "contracts/extension/NFTMetadata.sol",
    "chars": 1786,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\nimport \"./interface/INFTMetadata.sol\";\n\nabstract contrac"
  },
  {
    "path": "contracts/extension/OperatorFilterToggle.sol",
    "chars": 696,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IOperatorFilte"
  },
  {
    "path": "contracts/extension/OperatorFilterer.sol",
    "chars": 3135,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IOperatorFilte"
  },
  {
    "path": "contracts/extension/OperatorFiltererUpgradeable.sol",
    "chars": 2977,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IOperatorFilte"
  },
  {
    "path": "contracts/extension/Ownable.sol",
    "chars": 1847,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IOwnable.sol\";"
  },
  {
    "path": "contracts/extension/Permissions.sol",
    "chars": 6466,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IPermissions.s"
  },
  {
    "path": "contracts/extension/PermissionsEnumerable.sol",
    "chars": 4241,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IPermissionsEn"
  },
  {
    "path": "contracts/extension/PlatformFee.sol",
    "chars": 4520,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IPlatformFee.s"
  },
  {
    "path": "contracts/extension/PrimarySale.sol",
    "chars": 2175,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IPrimarySale.s"
  },
  {
    "path": "contracts/extension/Proxy.sol",
    "chars": 3187,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback f"
  },
  {
    "path": "contracts/extension/ProxyForUpgradeable.sol",
    "chars": 1286,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./Proxy.sol\";\nimport \"../e"
  },
  {
    "path": "contracts/extension/Royalty.sol",
    "chars": 5472,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IRoyalty.sol\";"
  },
  {
    "path": "contracts/extension/SeaportEIP1271.sol",
    "chars": 3838,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\nimport { ECDSA } from \"solady/src/utils/ECDSA.sol\";\nimp"
  },
  {
    "path": "contracts/extension/SeaportOrderParser.sol",
    "chars": 22984,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/* solhint-disable */\n\nimport { OrderParameters } from "
  },
  {
    "path": "contracts/extension/SharedMetadata.sol",
    "chars": 2077,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.10;\n\n/// @author thirdweb\n\nimport \"../lib/NFTMetadataRendere"
  },
  {
    "path": "contracts/extension/SignatureAction.sol",
    "chars": 2416,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/ISignatureActi"
  },
  {
    "path": "contracts/extension/SignatureActionUpgradeable.sol",
    "chars": 2617,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/ISignatureActi"
  },
  {
    "path": "contracts/extension/SignatureMintERC1155.sol",
    "chars": 3137,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/ISignatureMint"
  },
  {
    "path": "contracts/extension/SignatureMintERC1155Upgradeable.sol",
    "chars": 3450,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/ISignatureMint"
  },
  {
    "path": "contracts/extension/SignatureMintERC20.sol",
    "chars": 2749,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/ISignatureMint"
  },
  {
    "path": "contracts/extension/SignatureMintERC20Upgradeable.sol",
    "chars": 3138,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/ISignatureMint"
  },
  {
    "path": "contracts/extension/SignatureMintERC721.sol",
    "chars": 3637,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/ISignatureMint"
  },
  {
    "path": "contracts/extension/SignatureMintERC721Upgradeable.sol",
    "chars": 3992,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/ISignatureMint"
  },
  {
    "path": "contracts/extension/SoulboundERC721A.sol",
    "chars": 2183,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./PermissionsEnumerable.so"
  },
  {
    "path": "contracts/extension/Staking1155.sol",
    "chars": 21005,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\nimport \"../external-deps/openzepp"
  },
  {
    "path": "contracts/extension/Staking1155Upgradeable.sol",
    "chars": 21044,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\nimport \"@openzeppelin/contracts-u"
  },
  {
    "path": "contracts/extension/Staking20.sol",
    "chars": 14196,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\nimport \"../external-deps/openzepp"
  },
  {
    "path": "contracts/extension/Staking20Upgradeable.sol",
    "chars": 14323,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\nimport \"@openzeppelin/contracts-u"
  },
  {
    "path": "contracts/extension/Staking721.sol",
    "chars": 13676,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\nimport \"../external-deps/openzepp"
  },
  {
    "path": "contracts/extension/Staking721Upgradeable.sol",
    "chars": 13763,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\nimport \"@openzeppelin/contracts-u"
  },
  {
    "path": "contracts/extension/TokenBundle.sol",
    "chars": 5394,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/ITokenBundle.s"
  },
  {
    "path": "contracts/extension/TokenStore.sol",
    "chars": 3724,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n//  ==========  External imports  "
  },
  {
    "path": "contracts/extension/Upgradeable.sol",
    "chars": 4218,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../external-deps/openzeppe"
  },
  {
    "path": "contracts/extension/interface/IAccountPermissions.sol",
    "chars": 5495,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\ninterface IAccountPermissions {\n  "
  },
  {
    "path": "contracts/extension/interface/IAppURI.sol",
    "chars": 682,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Thirdweb's `AppURI` is a c"
  },
  {
    "path": "contracts/extension/interface/IBurnToClaim.sol",
    "chars": 1439,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\ninterface IBurnToClaim {\n    /// @"
  },
  {
    "path": "contracts/extension/interface/IBurnableERC1155.sol",
    "chars": 661,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  `SignatureMint1155` is an "
  },
  {
    "path": "contracts/extension/interface/IBurnableERC20.sol",
    "chars": 628,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\ninterface IBurnableERC20 {\n    /**"
  },
  {
    "path": "contracts/extension/interface/IBurnableERC721.sol",
    "chars": 328,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\ninterface IBurnableERC721 {\n    /*"
  },
  {
    "path": "contracts/extension/interface/IClaimCondition.sol",
    "chars": 2064,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  The interface `IClaimCondi"
  },
  {
    "path": "contracts/extension/interface/IClaimConditionMultiPhase.sol",
    "chars": 1822,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./IClaimCondition.sol\";\n\n/"
  },
  {
    "path": "contracts/extension/interface/IClaimConditionsSinglePhase.sol",
    "chars": 1271,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../../lib/BitMaps.sol\";\nim"
  },
  {
    "path": "contracts/extension/interface/IClaimableERC1155.sol",
    "chars": 1622,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\ninterface IClaimableERC1155 {\n    "
  },
  {
    "path": "contracts/extension/interface/IClaimableERC721.sol",
    "chars": 1445,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\ninterface IClaimableERC721 {\n    /"
  },
  {
    "path": "contracts/extension/interface/IContractFactory.sol",
    "chars": 702,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\ninterface IContractFactory {\n    /"
  },
  {
    "path": "contracts/extension/interface/IContractMetadata.sol",
    "chars": 836,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Thirdweb's `ContractMetada"
  },
  {
    "path": "contracts/extension/interface/IDelayedReveal.sol",
    "chars": 1283,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Thirdweb's `DelayedReveal`"
  },
  {
    "path": "contracts/extension/interface/IDelayedRevealDeprecated.sol",
    "chars": 1556,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n// [ DEPRECATED CONTRACT: use `con"
  },
  {
    "path": "contracts/extension/interface/IDrop.sol",
    "chars": 3168,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./IClaimConditionMultiPhas"
  },
  {
    "path": "contracts/extension/interface/IDrop1155.sol",
    "chars": 3392,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./IClaimConditionMultiPhas"
  },
  {
    "path": "contracts/extension/interface/IDropSinglePhase.sol",
    "chars": 3081,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./IClaimCondition.sol\";\n\n/"
  },
  {
    "path": "contracts/extension/interface/IDropSinglePhase1155.sol",
    "chars": 3338,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./IClaimCondition.sol\";\n\n/"
  },
  {
    "path": "contracts/extension/interface/IERC2771Context.sol",
    "chars": 175,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\ninterface IERC2771Context {\n    function isTrustedForwar"
  },
  {
    "path": "contracts/extension/interface/ILazyMint.sol",
    "chars": 1334,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Thirdweb's `LazyMint` is a"
  },
  {
    "path": "contracts/extension/interface/ILazyMintWithTier.sol",
    "chars": 1730,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Thirdweb's `LazyMintWithTi"
  },
  {
    "path": "contracts/extension/interface/IMintableERC1155.sol",
    "chars": 907,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  `SignatureMint1155` is an "
  },
  {
    "path": "contracts/extension/interface/IMintableERC20.sol",
    "chars": 489,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\ninterface IMintableERC20 {\n    ///"
  },
  {
    "path": "contracts/extension/interface/IMintableERC721.sol",
    "chars": 565,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\ninterface IMintableERC721 {\n    //"
  },
  {
    "path": "contracts/extension/interface/IMulticall.sol",
    "chars": 413,
    "preview": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n * @dev Provides a function to batch "
  },
  {
    "path": "contracts/extension/interface/INFTMetadata.sol",
    "chars": 586,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\nimport \"../../eip/interface/IERC4906.sol\";\n\ninterface IN"
  },
  {
    "path": "contracts/extension/interface/IOperatorFilterRegistry.sol",
    "chars": 2197,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\ninterface IOperatorFilterRegistry "
  },
  {
    "path": "contracts/extension/interface/IOperatorFilterToggle.sol",
    "chars": 302,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\ninterface IOperatorFilterToggle {\n"
  },
  {
    "path": "contracts/extension/interface/IOwnable.sol",
    "chars": 807,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Thirdweb's `Ownable` is a "
  },
  {
    "path": "contracts/extension/interface/IPermissions.sol",
    "chars": 2885,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n * @dev External interface of "
  },
  {
    "path": "contracts/extension/interface/IPermissionsEnumerable.sol",
    "chars": 1181,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./IPermissions.sol\";\n\n/**\n"
  },
  {
    "path": "contracts/extension/interface/IPlatformFee.sol",
    "chars": 1278,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Thirdweb's `PlatformFee` i"
  },
  {
    "path": "contracts/extension/interface/IPrimarySale.sol",
    "chars": 812,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Thirdweb's `Primary` is a "
  },
  {
    "path": "contracts/extension/interface/IRoyalty.sol",
    "chars": 1573,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../../eip/interface/IERC29"
  },
  {
    "path": "contracts/extension/interface/IRoyaltyEngineV1.sol",
    "chars": 1452,
    "preview": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/// @author: manifold.xyz\n\nimport \"@openzeppelin/contracts/uti"
  },
  {
    "path": "contracts/extension/interface/IRoyaltyPayments.sol",
    "chars": 1265,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"@openzeppelin/contracts/ut"
  },
  {
    "path": "contracts/extension/interface/IRulesEngine.sol",
    "chars": 1527,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\ninterface IRulesEngine {\n    enum TokenType {\n        E"
  },
  {
    "path": "contracts/extension/interface/ISharedMetadata.sol",
    "chars": 959,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.10;\n\n/// @author thirdweb\n\ninterface ISharedMetadata {\n    /"
  },
  {
    "path": "contracts/extension/interface/ISharedMetadataBatch.sol",
    "chars": 1659,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.10;\n\n/// @author thirdweb\n\ninterface ISharedMetadataBatch {\n"
  },
  {
    "path": "contracts/extension/interface/ISignatureAction.sol",
    "chars": 1799,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  thirdweb's `SignatureActio"
  },
  {
    "path": "contracts/extension/interface/ISignatureMintERC1155.sol",
    "chars": 3139,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  The 'signature minting' me"
  },
  {
    "path": "contracts/extension/interface/ISignatureMintERC20.sol",
    "chars": 2503,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  The 'signature minting' me"
  },
  {
    "path": "contracts/extension/interface/ISignatureMintERC721.sol",
    "chars": 3019,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  The 'signature minting' me"
  },
  {
    "path": "contracts/extension/interface/IStaking1155.sol",
    "chars": 3641,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\ninterface IStaking1155 {\n    /// "
  },
  {
    "path": "contracts/extension/interface/IStaking20.sol",
    "chars": 3129,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\ninterface IStaking20 {\n    /// @d"
  },
  {
    "path": "contracts/extension/interface/IStaking721.sol",
    "chars": 2676,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\ninterface IStaking721 {\n    /// @"
  },
  {
    "path": "contracts/extension/interface/ITokenBundle.sol",
    "chars": 1838,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Group together arbitrary E"
  },
  {
    "path": "contracts/extension/interface/plugin/IContext.sol",
    "chars": 240,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\ninterface IContext {\n    function "
  },
  {
    "path": "contracts/extension/interface/plugin/IPluginMap.sol",
    "chars": 1276,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\ninterface IPluginMap {\n    /**\n  "
  },
  {
    "path": "contracts/extension/interface/plugin/IRouter.sol",
    "chars": 1007,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\nimport \"./IPluginMap.sol\";\n\ninter"
  },
  {
    "path": "contracts/extension/plugin/ContractMetadataLogic.sol",
    "chars": 1983,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./ContractMetadataStorage."
  },
  {
    "path": "contracts/extension/plugin/ContractMetadataStorage.sol",
    "chars": 779,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  @author  thirdweb.com\n */\n"
  },
  {
    "path": "contracts/extension/plugin/ERC2771ContextConsumer.sol",
    "chars": 1015,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./ERC2771ContextLogic.sol\""
  },
  {
    "path": "contracts/extension/plugin/ERC2771ContextLogic.sol",
    "chars": 1382,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./ERC2771ContextStorage.so"
  },
  {
    "path": "contracts/extension/plugin/ERC2771ContextStorage.sol",
    "chars": 753,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nlibrary ERC2771ContextStorage {\n  "
  },
  {
    "path": "contracts/extension/plugin/ERC2771ContextUpgradeableLogic.sol",
    "chars": 1578,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./ERC2771ContextStorage.so"
  },
  {
    "path": "contracts/extension/plugin/ERC2771ContextUpgradeableStorage.sol",
    "chars": 604,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nlibrary ERC2771ContextUpgradeableS"
  },
  {
    "path": "contracts/extension/plugin/PermissionsEnumerableLogic.sol",
    "chars": 4198,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./PermissionsEnumerableSto"
  },
  {
    "path": "contracts/extension/plugin/PermissionsEnumerableStorage.sol",
    "chars": 1461,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../interface/IPermissionsE"
  },
  {
    "path": "contracts/extension/plugin/PermissionsLogic.sol",
    "chars": 7506,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../interface/IPermissions."
  },
  {
    "path": "contracts/extension/plugin/PermissionsStorage.sol",
    "chars": 1009,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  @author  thirdweb.com\n */\n"
  },
  {
    "path": "contracts/extension/plugin/PlatformFeeLogic.sol",
    "chars": 2396,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./PlatformFeeStorage.sol\";"
  },
  {
    "path": "contracts/extension/plugin/PlatformFeeStorage.sol",
    "chars": 925,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  @author  thirdweb.com\n */\n"
  },
  {
    "path": "contracts/extension/plugin/PluginMap.sol",
    "chars": 3120,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../interface/plugin/IPlugi"
  },
  {
    "path": "contracts/extension/plugin/ReentrancyGuardLogic.sol",
    "chars": 2998,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./ReentrancyGuardStorage.s"
  },
  {
    "path": "contracts/extension/plugin/ReentrancyGuardStorage.sol",
    "chars": 734,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nlibrary ReentrancyGuardStorage {\n "
  },
  {
    "path": "contracts/extension/plugin/Router.sol",
    "chars": 10650,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../interface/plugin/IRoute"
  },
  {
    "path": "contracts/extension/plugin/RouterImmutable.sol",
    "chars": 794,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./Router.sol\";\n\n/**\n *  @a"
  },
  {
    "path": "contracts/extension/plugin/RoyaltyPayments.sol",
    "chars": 4919,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../interface/IRoyaltyPayme"
  },
  {
    "path": "contracts/extension/upgradeable/AccountPermissions.sol",
    "chars": 10524,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../interface/IAccountPermi"
  },
  {
    "path": "contracts/extension/upgradeable/BatchMintMetadata.sol",
    "chars": 5999,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\nlibrary BatchMintMetadataStorage {\n    /// @custom:stora"
  },
  {
    "path": "contracts/extension/upgradeable/BurnToClaim.sol",
    "chars": 3659,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport { ERC1155Burnable } from \"@"
  },
  {
    "path": "contracts/extension/upgradeable/ContractMetadata.sol",
    "chars": 2692,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../interface/IContractMeta"
  },
  {
    "path": "contracts/extension/upgradeable/DelayedReveal.sol",
    "chars": 5169,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../interface/IDelayedRevea"
  },
  {
    "path": "contracts/extension/upgradeable/Drop.sol",
    "chars": 11009,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../interface/IDrop.sol\";\ni"
  },
  {
    "path": "contracts/extension/upgradeable/ERC2771Context.sol",
    "chars": 2082,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\nimport \"../interface/IERC2771Context.sol\";\n\n/**\n * @dev "
  },
  {
    "path": "contracts/extension/upgradeable/ERC2771ContextConsumer.sol",
    "chars": 978,
    "preview": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\ninterface IERC2771Context {\n    fu"
  },
  {
    "path": "contracts/extension/upgradeable/ERC2771ContextUpgradeable.sol",
    "chars": 2403,
    "preview": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\nimport \"../interface/IERC2771Context.sol\";\nimport \"./Ini"
  }
]

// ... and 673 more files (download for full content)

About this extraction

This page contains the full source code of the nftlabs/nftlabs-protocols GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 873 files (4.6 MB), approximately 1.3M tokens, and a symbol index with 9 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!