### Install SeaDrop Dependencies and Build Source: https://github.com/projectopensea/seadrop/blob/main/README.md Installs project dependencies and compiles the contracts. Ensure you have Git and Yarn installed. ```bash git clone --recurse-submodules https://github.com/ProjectOpenSea/seadrop && cd seadrop yarn install yarn build ``` -------------------------------- ### Deploy and Configure Example Token Source: https://github.com/projectopensea/seadrop/blob/main/docs/SeaDropTokenDeployment.md Use this script to deploy and configure an example token contract. Ensure you have the necessary RPC URL, private key, and Etherscan API key. ```bash forge script script/DeployAndConfigureExampleToken.s.sol --rpc-url ${RPC_URL} --broadcast -vvvv --private-key ${PK} --etherscan-api-key ${ETHERSCAN_API_KEY} --verify --retries 10 ``` -------------------------------- ### Install Foundry Dependencies Source: https://github.com/projectopensea/seadrop/blob/main/README.md Installs project dependencies required for Foundry development. This command should be run after cloning the repository and installing Foundry. ```bash forge install ``` -------------------------------- ### Install Foundry for Solidity Development Source: https://github.com/projectopensea/seadrop/blob/main/README.md Installs Foundry, a fast, portable, and modular toolkit for Ethereum application development written in Rust. This is a prerequisite for running Foundry tests. ```bash curl -L https://foundry.paradigm.xyz | bash foundryup ``` -------------------------------- ### Seadrop Project Data Example Source: https://github.com/projectopensea/seadrop/blob/main/docs/SeaDropTokenDeployment.md This section provides an example of the data structure used within the Seadrop project. ```APIDOC ## Seadrop Project Data Example ### Description This section provides an example of the data structure used within the Seadrop project. ### Request Example ```json [ { "address": "0xf0E16c071E2cd421974dCb76d9af4DeDB578E059", "mintPrice": 1000000000000000000, "maxTotalMintableByWallet": 10, "startTime": 1659045594, "endTime": 1659045594, "dropStageIndex": 1, "maxTokenSupplyForStage": 1000, "feeBps": 1000, "restrictFeeRecipients": true }, { "address": "0x829bd824b016326a401d083b33d092293333a830", "mintPrice": 1000000000000000000, "maxTotalMintableByWallet": 5, "startTime": 1659045594, "endTime": 1659045594, "dropStageIndex": 2, "maxTokenSupplyForStage": 500, "feeBps": 1250, "restrictFeeRecipients": false } ] ``` ``` -------------------------------- ### Deploy SeaDrop Instance with Forge Source: https://github.com/projectopensea/seadrop/blob/main/docs/SeaDropDeployment.md Use this command to deploy your own SeaDrop instance. Ensure you have Forge installed and your RPC URL, private key, and Etherscan API key are set. ```bash forge create --rpc-url ${RPC_URL} src/SeaDrop.sol:SeaDrop --private-key ${PK} --etherscan-api-key ${ETHERSCAN_API_KEY} --verify ``` -------------------------------- ### Example Drop URI JSON Structure Source: https://github.com/projectopensea/seadrop/blob/main/docs/SeaDropTokenDeployment.md This JSON structure defines the metadata and stages for a drop. It includes details like name, description, mint price, and timing for each stage. ```json { "name": "An Example Drop", "description": "This is the description for this example drop.", "stages": [ { "name": "My Public Stage", "description": "My public stage description.", "uuid": "ecae5ad4-fa40-4e79-856b-ec304c3ea5d4", "isPublic": true, "mintPrice": 1000000000000000000, "maxTotalMintableByWallet": 50, "maxTokenSupplyForStage": 5000, "startTime": 1659045594, "endTime": 1659045594, "feeBps": 500 }, { "name": "My Private Allow List Stage", "description": "My private stage description", "uuid": "07e7a791-42ad-46e6-968a-564acf0c06dc", "isPublic": false, "mintPrice": 1000000000000000, "maxTotalMintableByWallet": 5, "maxTokenSupplyForStage": 1000, "startTime": 1659043594, "endTime": 1659044594, "feeBps": 500 } ] } ``` -------------------------------- ### Configure Public Drop Stage Source: https://context7.com/projectopensea/seadrop/llms.txt Configure a public drop stage, specifying mint price, start and end times, maximum mints per wallet, fee basis points, and whether to restrict fee recipients. ```solidity import { PublicDrop } from "seadrop/src/lib/SeaDropStructs.sol"; ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); address seaDropAddress = 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5; PublicDrop memory publicDrop = PublicDrop({ mintPrice: 0.08 ether, // 0.08 ETH per token startTime: uint48(block.timestamp + 1 days), endTime: uint48(block.timestamp + 8 days), maxTotalMintableByWallet: 10, // Max 10 per wallet feeBps: 500, // 5% fee restrictFeeRecipients: true // Only allowed fee recipients }); token.updatePublicDrop(seaDropAddress, publicDrop); ``` -------------------------------- ### Generate IPFS Hash and Keccak256 Hash Source: https://github.com/projectopensea/seadrop/blob/main/docs/ProvenanceHash.md Use `ipfs add` with specific flags for consistent hashing, then pipe the output to `cast keccak` to generate the provenance hash. Ensure you have IPFS and Foundry installed. ```console ❯ brew install ipfs ``` ```console ❯ ipfs add -Qr --only-hash --cid-version=1 --hash=sha2-256 metadata/json bafybeiawolpr2o2b33js3bvpzt2buvrp6b3xdor45u44qybkhgvqv46pqq ❯ cast keccak $(ipfs add -Qr --only-hash --cid-version=1 --hash=sha2-256 metadata/json) 0xa61351a696813e65b2a71768ca1f5ad69f1f5515b93978cede59b82628a29509 ``` -------------------------------- ### Run Foundry Tests with Verbose Logging Source: https://github.com/projectopensea/seadrop/blob/main/README.md Executes Foundry tests with increased verbosity levels to display logs, stack traces, and setup traces for failing tests. Use -vv to -vvvvv for more detailed output. ```bash forge test -vv ``` -------------------------------- ### Get Minting Statistics Source: https://context7.com/projectopensea/seadrop/llms.txt Retrieve minting statistics for a specific minter address, including the number of tokens minted by that address, the current total supply, and the maximum supply. ```solidity import { INonFungibleSeaDropToken } from "seadrop/src/interfaces/INonFungibleSeaDropToken.sol"; INonFungibleSeaDropToken token = INonFungibleSeaDropToken(TOKEN_ADDRESS); address minter = 0xMinterAddress; ( uint256 minterNumMinted, // Tokens minted by this address uint256 currentTotalSupply, // Total tokens minted uint256 maxSupply // Maximum token supply ) = token.getMintStats(minter); // Check if minter can still mint uint256 remainingForMinter = maxPerWallet - minterNumMinted; uint256 remainingSupply = maxSupply - currentTotalSupply; ``` -------------------------------- ### getMintStats Source: https://context7.com/projectopensea/seadrop/llms.txt Get minting statistics for a specific minter address. ```APIDOC ## getMintStats ### Description Get minting statistics for a specific minter address. ### Method GET (Smart Contract Call) ### Parameters #### Path Parameters - **minter** (address) - Required - The address of the minter. ### Response #### Success Response (200) - **minterNumMinted** (uint256) - Tokens minted by this address. - **currentTotalSupply** (uint256) - Total tokens minted. - **maxSupply** (uint256) - Maximum token supply. ``` -------------------------------- ### Environment Variables for Deployment Source: https://github.com/projectopensea/seadrop/blob/main/src-upgradeable/README.md Set these environment variables in your .env file for deploying to testnets or mainnets. Ensure you replace placeholder values with your actual keys and URLs. ```bash export PRIVATE_KEY="Your Wallet Private Key" export SEPOLIA_RPC_URL="https://Infura Or Alchemy URL With API Key" export ETHERSCAN_API_KEY="Your Etherscan API Key" ``` -------------------------------- ### Deploy Upgradeable Contract with Hardhat Source: https://github.com/projectopensea/seadrop/blob/main/src-upgradeable/README.md Run this command in the 'src-upgradeable' directory to deploy your upgradeable SeaDrop contract to the Sepolia network using Hardhat. ```bash npx hardhat run --config hardhat.config.ts --network sepolia scripts/deploy.ts ``` -------------------------------- ### multiConfigure Source: https://context7.com/projectopensea/seadrop/llms.txt Configures multiple token and drop settings in a single transaction. ```APIDOC ## multiConfigure ### Description Configure multiple token and drop settings in a single transaction. ### Method multiConfigure(ERC721SeaDropStructsErrorsAndEvents.MultiConfigureStruct memory config) ### Parameters - **config** (MultiConfigureStruct) - Required - Struct containing supply, URIs, public drop settings, and fee recipients. ``` -------------------------------- ### Clone Factory Deployment Source: https://context7.com/projectopensea/seadrop/llms.txt Create a gas-efficient clone of the ERC721SeaDrop implementation using the factory pattern. ```solidity import { ERC721SeaDropCloneFactory } from "seadrop/src/clones/ERC721SeaDropCloneFactory.sol"; contract DeployViaClone { ERC721SeaDropCloneFactory factory = ERC721SeaDropCloneFactory(FACTORY_ADDRESS); function createCollection( string memory name, string memory symbol, bytes32 salt ) external returns (address) { // Creates a minimal proxy clone with the default SeaDrop address // (0x00005EA00Ac477B1030CE78506496e8C2dE24bf5) pre-configured address clone = factory.createClone(name, symbol, salt); return clone; } } ``` -------------------------------- ### Query Drop Configuration Helpers Source: https://context7.com/projectopensea/seadrop/llms.txt Provides various helper functions to retrieve drop state, including payout addresses, merkle roots, and allowed signers or payers. ```solidity import { ISeaDrop } from "seadrop/src/interfaces/ISeaDrop.sol"; ISeaDrop seaDrop = ISeaDrop(0x00005EA00Ac477B1030CE78506496e8C2dE24bf5); address nftContract = TOKEN_ADDRESS; // Get creator payout address address payoutAddress = seaDrop.getCreatorPayoutAddress(nftContract); // Get allow list merkle root bytes32 merkleRoot = seaDrop.getAllowListMerkleRoot(nftContract); // Get all allowed fee recipients address[] memory feeRecipients = seaDrop.getAllowedFeeRecipients(nftContract); // Check if specific fee recipient is allowed bool isAllowed = seaDrop.getFeeRecipientIsAllowed(nftContract, feeRecipient); // Get all signers for signed mints address[] memory signers = seaDrop.getSigners(nftContract); // Get all allowed payers address[] memory payers = seaDrop.getPayers(nftContract); // Check if specific payer is allowed bool payerAllowed = seaDrop.getPayerIsAllowed(nftContract, payerAddress); // Get all token-gated allowed tokens address[] memory gatedTokens = seaDrop.getTokenGatedAllowedTokens(nftContract); ``` -------------------------------- ### Mint Tokens with Allow List Proof Source: https://context7.com/projectopensea/seadrop/llms.txt Use this function to mint tokens by providing a Merkle proof for an allow list. Ensure MintParams match the off-chain generated leaf. ```solidity import { ISeaDrop } from "seadrop/src/interfaces/ISeaDrop.sol"; import { MintParams } from "seadrop/src/lib/SeaDropStructs.sol"; ISeaDrop seaDrop = ISeaDrop(0x00005EA00Ac477B1030CE78506496e8C2dE24bf5); address nftContract = TOKEN_ADDRESS; address feeRecipient = 0xFeeRecipient; // MintParams must match exactly what was used to generate the merkle leaf MintParams memory mintParams = MintParams({ mintPrice: 0.05 ether, maxTotalMintableByWallet: 5, startTime: 1659043594, endTime: 1659144594, dropStageIndex: 1, maxTokenSupplyForStage: 1000, feeBps: 500, restrictFeeRecipients: true }); // Merkle proof generated off-chain bytes32[] memory proof = new bytes32[](3); proof[0] = 0xabc123...; proof[1] = 0xdef456...; proof[2] = 0x789ghi...; uint256 quantity = 2; seaDrop.mintAllowList{value: quantity * mintParams.mintPrice}( nftContract, feeRecipient, address(0), // mint to msg.sender quantity, mintParams, proof ); ``` -------------------------------- ### Configure Allow List Drop Stage Source: https://context7.com/projectopensea/seadrop/llms.txt Configure a merkle tree-based allow list drop stage. This involves generating a merkle root off-chain from allow list entries and providing URIs for public or encrypted data. ```solidity import { AllowListData, MintParams } from "seadrop/src/lib/SeaDropStructs.sol"; import { MerkleProof } from "openzeppelin-contracts/utils/cryptography/MerkleProof.sol"; // Off-chain: Generate merkle tree from allow list entries // Each leaf = keccak256(abi.encode(address, MintParams)) ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); address seaDropAddress = 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5; AllowListData memory allowListData = AllowListData({ merkleRoot: 0xabc123..., // Root of merkle tree publicKeyURIs: new string[](0), // Optional: encryption keys for private lists allowListURI: "ipfs://QmAllowList..." // URI to allow list data }); token.updateAllowList(seaDropAddress, allowListData); ``` -------------------------------- ### Run Foundry Gas Snapshot Source: https://github.com/projectopensea/seadrop/blob/main/README.md Takes a gas snapshot of the tests. This is useful for tracking gas usage changes over time. ```bash forge snapshot ``` -------------------------------- ### Set Public Drop Stage Source: https://github.com/projectopensea/seadrop/blob/main/docs/SeaDropTokenDeployment.md Configure a public drop stage, allowing anyone to mint tokens under the specified conditions. ```bash token.updatePublicDrop() ``` -------------------------------- ### Configure Token-Gated Drop Stage Source: https://context7.com/projectopensea/seadrop/llms.txt Sets up a drop stage where only holders of a specific NFT can mint. Ensure the `dropStageIndex` is non-zero for token-gated stages. ```solidity import { TokenGatedDropStage } from "seadrop/src/lib/SeaDropStructs.sol"; ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); address seaDropAddress = 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5; address allowedNftToken = 0xExistingNFTCollection; // e.g., BAYC, CryptoPunks TokenGatedDropStage memory dropStage = TokenGatedDropStage({ mintPrice: 0.05 ether, maxTotalMintableByWallet: 5, startTime: uint48(block.timestamp), endTime: uint48(block.timestamp + 7 days), dropStageIndex: 1, // Non-zero for token-gated stages maxTokenSupplyForStage: 1000, // Max 1000 tokens for this stage feeBps: 500, restrictFeeRecipients: true }); token.updateTokenGatedDrop(seaDropAddress, allowedNftToken, dropStage); ``` -------------------------------- ### mintAllowList Source: https://context7.com/projectopensea/seadrop/llms.txt Mint tokens using a merkle proof from an allow list. ```APIDOC ## mintAllowList ### Description Mint tokens using a merkle proof from an allow list. ### Method POST (Smart Contract Call) ### Parameters #### Request Body - **nftContract** (address) - Required - The address of the NFT contract. - **feeRecipient** (address) - Required - The address receiving the fees. - **minter** (address) - Required - The address receiving the minted tokens. - **quantity** (uint256) - Required - Number of tokens to mint. - **mintParams** (MintParams) - Required - Struct containing minting configuration. - **proof** (bytes32[]) - Required - Merkle proof generated off-chain. ``` -------------------------------- ### Batch Configure SeaDrop Settings Source: https://context7.com/projectopensea/seadrop/llms.txt Configures multiple token and drop settings simultaneously in a single transaction for efficiency. This includes basic parameters, public drop settings, and fee recipients. ```solidity import { ERC721SeaDropStructsErrorsAndEvents } from "seadrop/src/lib/ERC721SeaDropStructsErrorsAndEvents.sol"; import { PublicDrop, AllowListData } from "seadrop/src/lib/SeaDropStructs.sol"; ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); address seaDropAddress = 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5; ERC721SeaDropStructsErrorsAndEvents.MultiConfigureStruct memory config; // Set basic parameters config.maxSupply = 10000; config.baseURI = "ipfs://QmMetadata.../"; config.contractURI = "ipfs://QmContract.../contract.json"; config.seaDropImpl = seaDropAddress; config.creatorPayoutAddress = 0xCreatorAddress; // Configure public drop config.publicDrop = PublicDrop({ mintPrice: 0.08 ether, startTime: uint48(block.timestamp + 1 days), endTime: uint48(block.timestamp + 8 days), maxTotalMintableByWallet: 10, feeBps: 500, restrictFeeRecipients: true }); config.dropURI = "ipfs://QmDrop.../drop.json"; // Configure fee recipients config.allowedFeeRecipients = new address[](1); config.allowedFeeRecipients[0] = 0xFeeRecipient; // Apply all configuration in one transaction token.multiConfigure(config); ``` -------------------------------- ### Run Foundry Tests Source: https://github.com/projectopensea/seadrop/blob/main/README.md Executes the test suite written in Solidity using Foundry. This is part of the fuzzing test suite for SeaDrop. ```bash forge test ``` -------------------------------- ### Drop Stage Configuration Source: https://context7.com/projectopensea/seadrop/llms.txt Functions for configuring public drop stages and allow lists. ```APIDOC ## updatePublicDrop ### Description Configure a public drop stage with pricing, timing, and limits. ### Method `updatePublicDrop(address seaDropAddress, PublicDrop memory publicDrop)` ### Endpoint `TOKEN_ADDRESS` ### Request Example ```solidity import { PublicDrop } from "seadrop/src/lib/SeaDropStructs.sol"; ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); address seaDropAddress = 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5; PublicDrop memory publicDrop = PublicDrop({ mintPrice: 0.08 ether, // 0.08 ETH per token startTime: uint48(block.timestamp + 1 days), endTime: uint48(block.timestamp + 8 days), maxTotalMintableByWallet: 10, // Max 10 per wallet feeBps: 500, // 5% fee restrictFeeRecipients: true // Only allowed fee recipients }); token.updatePublicDrop(seaDropAddress, publicDrop); ``` ## updateAllowList ### Description Configure a merkle tree-based allow list drop stage. ### Method `updateAllowList(address seaDropAddress, AllowListData memory allowListData)` ### Endpoint `TOKEN_ADDRESS` ### Request Example ```solidity import { AllowListData, MintParams } from "seadrop/src/lib/SeaDropStructs.sol"; import { MerkleProof } from "openzeppelin-contracts/utils/cryptography/MerkleProof.sol"; // Off-chain: Generate merkle tree from allow list entries // Each leaf = keccak256(abi.encode(address, MintParams)) ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); address seaDropAddress = 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5; AllowListData memory allowListData = AllowListData({ merkleRoot: 0xabc123..., // Root of merkle tree publicKeyURIs: new string[](0), // Optional: encryption keys for private lists allowListURI: "ipfs://QmAllowList..." // URI to allow list data }); token.updateAllowList(seaDropAddress, allowListData); ``` ``` -------------------------------- ### Set Royalty Information Source: https://context7.com/projectopensea/seadrop/llms.txt Configure EIP-2981 royalty information for secondary sales, specifying the royalty recipient address and basis points (percentage). ```solidity import { ISeaDropTokenContractMetadata } from "seadrop/src/interfaces/ISeaDropTokenContractMetadata.sol"; ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); // Set 5% royalty (500 basis points) to specified address ISeaDropTokenContractMetadata.RoyaltyInfo memory royaltyInfo = ISeaDropTokenTokenContractMetadata.RoyaltyInfo({ royaltyAddress: 0xRoyaltyRecipient, royaltyBps: 500 // 5% }); token.setRoyaltyInfo(royaltyInfo); ``` -------------------------------- ### Upgrade Upgradeable Contract with Hardhat Source: https://github.com/projectopensea/seadrop/blob/main/src-upgradeable/README.md Execute this command in the 'src-upgradeable' directory to upgrade your existing upgradeable SeaDrop contract on the Sepolia network using Hardhat. ```bash npx hardhat run --config hardhat.config.ts --network sepolia scripts/upgrade.ts ``` -------------------------------- ### Metadata Configuration Source: https://context7.com/projectopensea/seadrop/llms.txt Functions for setting token and contract metadata URIs. ```APIDOC ## setBaseURI ### Description Set the base URI for token metadata. Supports both directory-style (with trailing slash) and single-URI patterns. ### Method `setBaseURI(string memory baseURI_)` ### Endpoint `TOKEN_ADDRESS` ### Request Example ```solidity ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); // Directory-style URI (returns baseURI + tokenId for each token) token.setBaseURI("ipfs://QmXyz.../"); // Single URI (returns the same URI for all tokens - useful for unrevealed state) token.setBaseURI("ipfs://QmXyz.../unrevealed.json"); ``` ## setContractURI ### Description Set the contract-level metadata URI for marketplace display. ### Method `setContractURI(string memory contractURI_)` ### Endpoint `TOKEN_ADDRESS` ### Request Example ```solidity ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); // Set contract metadata URI token.setContractURI("ipfs://QmContractMetadata.../contract.json"); // Expected contract.json format: // { // "name": "My Collection", // "description": "Collection description", // "image": "ipfs://...", // "external_link": "https://..." // } ``` ``` -------------------------------- ### Run Lint Checks with Prettier and Solhint Source: https://github.com/projectopensea/seadrop/blob/main/README.md Performs linting checks on the codebase using Prettier and Solhint to enforce code style and quality standards. Configuration for these tools is specified in package.json. ```bash yarn lint:check ``` -------------------------------- ### Run Hardhat Tests and Coverage Source: https://github.com/projectopensea/seadrop/blob/main/README.md Executes the test suite and generates code coverage reports using Hardhat. These commands are useful for verifying contract functionality. ```bash yarn test yarn coverage ``` -------------------------------- ### Retrieve Public Drop Configuration Source: https://context7.com/projectopensea/seadrop/llms.txt Fetch the current public drop configuration for a given NFT contract address. This view function returns details like mint price, start/end times, and supply limits. ```solidity import { ISeaDrop } from "seadrop/src/interfaces/ISeaDrop.sol"; import { PublicDrop } from "seadrop/src/lib/SeaDropStructs.sol"; ISeaDrop seaDrop = ISeaDrop(0x00005EA00Ac477B1030CE78506496e8C2dE24bf5); address nftContract = TOKEN_ADDRESS; PublicDrop memory drop = seaDrop.getPublicDrop(nftContract); // Access drop parameters uint256 price = drop.mintPrice; uint48 startTime = drop.startTime; uint48 endTime = drop.endTime; uint16 maxPerWallet = drop.maxTotalMintableByWallet; uint16 feeBps = drop.feeBps; bool restricted = drop.restrictFeeRecipients; ``` -------------------------------- ### Set Contract Metadata URI Source: https://context7.com/projectopensea/seadrop/llms.txt Set the contract-level metadata URI, which is used for marketplace display. The JSON format should include name, description, image, and external_link. ```solidity ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); // Set contract metadata URI token.setContractURI("ipfs://QmContractMetadata.../contract.json"); // Expected contract.json format: // { // "name": "My Collection", // "description": "Collection description", // "image": "ipfs://...", // "external_link": "https://..." // } ``` -------------------------------- ### Retrieve Token-Gated Drop Configuration Source: https://context7.com/projectopensea/seadrop/llms.txt Fetches the configuration for a token-gated drop stage and checks if a specific token ID has been redeemed. ```solidity import { ISeaDrop } from "seadrop/src/interfaces/ISeaDrop.sol"; import { TokenGatedDropStage } from "seadrop/src/lib/SeaDropStructs.sol"; ISeaDrop seaDrop = ISeaDrop(0x00005EA00Ac477B1030CE78506496e8C2dE24bf5); address nftContract = TOKEN_ADDRESS; address allowedNftToken = 0xExistingNFTCollection; TokenGatedDropStage memory stage = seaDrop.getTokenGatedDrop( nftContract, allowedNftToken ); // Check if a specific token ID has been redeemed uint256 tokenId = 42; bool isRedeemed = seaDrop.getAllowedNftTokenIdIsRedeemed( nftContract, allowedNftToken, tokenId ); ``` -------------------------------- ### Configure Signed Mint Validation Parameters Source: https://context7.com/projectopensea/seadrop/llms.txt Sets server-side signed mint validation parameters to restrict signer authority. This is useful for controlling minting limits and fees. ```solidity import { SignedMintValidationParams } from "seadrop/src/lib/SeaDropStructs.sol"; ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); address seaDropAddress = 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5; address signer = 0xServerSideSignerAddress; SignedMintValidationParams memory params = SignedMintValidationParams({ minMintPrice: 0.01 ether, // Minimum allowed mint price maxMaxTotalMintableByWallet: 100, // Max allowed per-wallet limit minStartTime: uint40(block.timestamp), maxEndTime: uint40(block.timestamp + 365 days), maxMaxTokenSupplyForStage: 10000, minFeeBps: 250, // Min 2.5% fee maxFeeBps: 1000 // Max 10% fee }); token.updateSignedMintValidationParams(seaDropAddress, signer, params); ``` -------------------------------- ### PublicDrop Struct Definition Source: https://context7.com/projectopensea/seadrop/llms.txt Defines configuration for a public mint stage, optimized to fit in a single storage slot. ```solidity struct PublicDrop { uint80 mintPrice; // Price per token in wei (up to ~1.2M ETH) uint48 startTime; // Unix timestamp for drop start uint48 endTime; // Unix timestamp for drop end uint16 maxTotalMintableByWallet; // Max tokens per wallet (up to 65,535) uint16 feeBps; // Fee in basis points (100 = 1%) bool restrictFeeRecipients; // If true, only allowed fee recipients } ``` -------------------------------- ### Profile Gas Usage with Hardhat Source: https://github.com/projectopensea/seadrop/blob/main/README.md Profiles the gas usage of contract functions. This helps in optimizing gas costs for deployed contracts. ```bash yarn profile ``` -------------------------------- ### updateDropURI Source: https://context7.com/projectopensea/seadrop/llms.txt Sets the drop metadata URI containing stage information. ```APIDOC ## updateDropURI ### Description Set the drop metadata URI containing stage information. ### Method updateDropURI(address seaDropAddress, string calldata dropURI) ### Parameters - **seaDropAddress** (address) - Required - The address of the SeaDrop contract. - **dropURI** (string) - Required - The URI pointing to the drop metadata JSON. ``` -------------------------------- ### Set Base URI for Token Metadata Source: https://context7.com/projectopensea/seadrop/llms.txt Configure the base URI for token metadata. Supports directory-style URIs for individual token metadata and single URIs for unrevealed states. ```solidity ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); // Directory-style URI (returns baseURI + tokenId for each token) token.setBaseURI("ipfs://QmXyz.../"); // Single URI (returns the same URI for all tokens - useful for unrevealed state) token.setBaseURI("ipfs://QmXyz.../unrevealed.json"); ``` -------------------------------- ### Update Allow List Drop Stage Source: https://github.com/projectopensea/seadrop/blob/main/docs/SeaDropTokenDeployment.md Configure an allow list drop stage for the ERC721SeaDrop contract. This allows specific addresses to mint under certain conditions. ```bash token.updateAllowList() ``` -------------------------------- ### Prettier and Prettier Plugin Solidity Versions Source: https://github.com/projectopensea/seadrop/blob/main/README.md Specifies the versions of Prettier and prettier-plugin-solidity used for code formatting and linting. These are typically defined in the project's package.json file. ```json "prettier": "^2.5.1", "prettier-plugin-solidity": "^1.0.0-beta.24" ``` -------------------------------- ### Update Token Gated Drop Stage Source: https://github.com/projectopensea/seadrop/blob/main/docs/SeaDropTokenDeployment.md Configure a token-gated drop stage, where holders of specific tokens can mint. ```bash token.updateTokenGatedDrop() ``` -------------------------------- ### MintParams Struct Definition Source: https://context7.com/projectopensea/seadrop/llms.txt Parameters for allow list and signed mints, encoded in merkle leaves or signatures. ```solidity struct MintParams { uint256 mintPrice; // Price per token in wei uint256 maxTotalMintableByWallet; // Max tokens per wallet uint256 startTime; // Unix timestamp for stage start uint256 endTime; // Unix timestamp for stage end uint256 dropStageIndex; // Stage identifier (non-zero for allow list) uint256 maxTokenSupplyForStage; // Max supply for this stage uint256 feeBps; // Fee in basis points bool restrictFeeRecipients; // If true, only allowed fee recipients } ``` -------------------------------- ### TokenGatedDropStage Struct Definition Source: https://context7.com/projectopensea/seadrop/llms.txt Configuration for token-gated mints where NFT ownership grants minting rights. ```solidity struct TokenGatedDropStage { uint80 mintPrice; // Price per token uint16 maxTotalMintableByWallet; // Max tokens per wallet uint48 startTime; // Stage start time uint48 endTime; // Stage end time uint8 dropStageIndex; // Stage identifier (non-zero) uint32 maxTokenSupplyForStage; // Max supply for this stage uint16 feeBps; // Fee in basis points uint16 restrictFeeRecipients; // Restrict fee recipients } ``` -------------------------------- ### mintSigned Source: https://context7.com/projectopensea/seadrop/llms.txt Mint tokens using a server-side signature (one-time use). ```APIDOC ## mintSigned ### Description Mint tokens using a server-side signature (one-time use). ### Method POST (Smart Contract Call) ### Parameters #### Request Body - **nftContract** (address) - Required - The address of the NFT contract. - **feeRecipient** (address) - Required - The address receiving the fees. - **minter** (address) - Required - The address receiving the minted tokens. - **quantity** (uint256) - Required - Number of tokens to mint. - **mintParams** (MintParams) - Required - Struct containing minting configuration. - **salt** (uint256) - Required - Unique salt to prevent replay attacks. - **signature** (bytes) - Required - Server-generated EIP-712 signature. ``` -------------------------------- ### Provenance and Royalties Source: https://context7.com/projectopensea/seadrop/llms.txt Functions for setting provenance hash and royalty information. ```APIDOC ## setProvenanceHash ### Description Set the provenance hash for verifiable random reveals. Must be called before the first mint. ### Method `setProvenanceHash(bytes32 provenanceHash_)` ### Endpoint `TOKEN_ADDRESS` ### Request Example ```solidity ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); // Hash of concatenated metadata hashes in the final reveal order bytes32 provenanceHash = 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef; // Must be set before any tokens are minted token.setProvenanceHash(provenanceHash); ``` ## setRoyaltyInfo ### Description Configure EIP-2981 royalty information for secondary sales. ### Method `setRoyaltyInfo(ISeaDropTokenContractMetadata.RoyaltyInfo memory royaltyInfo_)` ### Endpoint `TOKEN_ADDRESS` ### Request Example ```solidity import { ISeaDropTokenContractMetadata } from "seadrop/src/interfaces/ISeaDropTokenContractMetadata.sol"; ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); // Set 5% royalty (500 basis points) to specified address ISeaDropTokenContractMetadata.RoyaltyInfo memory royaltyInfo = ISeaDropTokenContractMetadata.RoyaltyInfo({ royaltyAddress: 0xRoyaltyRecipient, royaltyBps: 500 // 5% }); token.setRoyaltyInfo(royaltyInfo); ``` ``` -------------------------------- ### Update Creator Payout Address Source: https://context7.com/projectopensea/seadrop/llms.txt Set the address that will receive mint proceeds, after deducting any applicable fees. ```solidity ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); address seaDropAddress = 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5; // Set the creator payout address token.updateCreatorPayoutAddress( seaDropAddress, 0xCreatorPayoutAddress ); ``` -------------------------------- ### Update Drop URI Source: https://github.com/projectopensea/seadrop/blob/main/docs/SeaDropTokenDeployment.md Set the URI that contains metadata and stage information for the drop. This can be an on-chain data blob or an external URI like IPFS. ```bash token.updateDropURI() ``` -------------------------------- ### Set Provenance Hash for Metadata Reveals Source: https://github.com/projectopensea/seadrop/blob/main/docs/SeaDropTokenDeployment.md Set the provenance hash for random metadata reveals. This must be set before the first token is minted. ```bash token.setProvenanceHash() ``` -------------------------------- ### Creator and Fee Payout Configuration Source: https://context7.com/projectopensea/seadrop/llms.txt Functions for updating creator payout addresses and allowed fee recipients. ```APIDOC ## updateCreatorPayoutAddress ### Description Set the address that receives mint proceeds (minus fees). ### Method `updateCreatorPayoutAddress(address seaDropAddress, address creatorPayoutAddress)` ### Endpoint `TOKEN_ADDRESS` ### Request Example ```solidity ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); address seaDropAddress = 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5; // Set the creator payout address token.updateCreatorPayoutAddress( seaDropAddress, 0xCreatorPayoutAddress ); ``` ## updateAllowedFeeRecipient ### Description Configure allowed fee recipients for restricted drops. ### Method `updateAllowedFeeRecipient(address seaDropAddress, address feeRecipient, bool allowed)` ### Endpoint `TOKEN_ADDRESS` ### Request Example ```solidity ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); address seaDropAddress = 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5; // Allow a fee recipient token.updateAllowedFeeRecipient( seaDropAddress, 0xFeeRecipientAddress, true // allowed ); // Disallow a fee recipient token.updateAllowedFeeRecipient( seaDropAddress, 0xFeeRecipientAddress, false // not allowed ); ``` ``` -------------------------------- ### Update Drop URI Source: https://context7.com/projectopensea/seadrop/llms.txt Sets the metadata URI for the drop, which should contain stage information in a specific JSON format. This allows for dynamic updates to drop details. ```solidity ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); address seaDropAddress = 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5; // Set drop URI with stage information token.updateDropURI(seaDropAddress, "ipfs://QmDropMetadata.../drop.json"); // Expected drop.json format: // { // "name": "My Drop", // "description": "Drop description", // "stages": [ // { // "name": "Public Sale", // "isPublic": true, // "mintPrice": 80000000000000000, // "maxTotalMintableByWallet": 10, // "startTime": 1659045594, // "endTime": 1659145594, // "feeBps": 500 // } // ] // } ``` -------------------------------- ### mintPublic Source: https://context7.com/projectopensea/seadrop/llms.txt Mint tokens during a public drop stage. ```APIDOC ## mintPublic ### Description Mint tokens during a public drop stage. ### Method mintPublic(address nftContract, address feeRecipient, address minterIfNotPayer, uint256 quantity) ### Parameters - **nftContract** (address) - Required - The address of the NFT contract. - **feeRecipient** (address) - Required - The address to receive fees. - **minterIfNotPayer** (address) - Required - The recipient address (use address(0) for msg.sender). - **quantity** (uint256) - Required - Number of tokens to mint. ``` -------------------------------- ### Set Provenance Hash Source: https://context7.com/projectopensea/seadrop/llms.txt Set the provenance hash for verifiable random reveals. This must be called before the first token is minted. ```solidity ERC721SeaDrop token = ERC721SeaDrop(TOKEN_ADDRESS); // Hash of concatenated metadata hashes in the final reveal order bytes32 provenanceHash = 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef; // Must be set before any tokens are minted token.setProvenanceHash(provenanceHash); ``` -------------------------------- ### ERC721SeaDrop Deployment Source: https://context7.com/projectopensea/seadrop/llms.txt Deploy a new ERC721SeaDrop token contract using Foundry or Solidity. ```bash # Deploy using Foundry # forge create --rpc-url ${RPC_URL} \ # src/ERC721SeaDrop.sol:ERC721SeaDrop \ # --constructor-args "MyCollection" "MYC" \ # [0x00005EA00Ac477B1030CE78506496e8C2dE24bf5] \ # --private-key ${PK} ``` ```solidity // Solidity deployment import { ERC721SeaDrop } from "seadrop/src/ERC721SeaDrop.sol"; contract Deploy { function deployToken() external returns (address) { address[] memory allowedSeaDrop = new address[](1); allowedSeaDrop[0] = 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5; ERC721SeaDrop token = new ERC721SeaDrop( "My NFT Collection", "MYC", allowedSeaDrop ); return address(token); } } ``` -------------------------------- ### updatePayer Source: https://context7.com/projectopensea/seadrop/llms.txt Allows or disallows a third-party address to pay for mints on behalf of others. ```APIDOC ## updatePayer ### Description Allow a third-party address to pay for mints on behalf of others. ### Method updatePayer(address seaDropAddress, address payer, bool allowed) ### Parameters - **seaDropAddress** (address) - Required - The address of the SeaDrop contract. - **payer** (address) - Required - The address of the payer. - **allowed** (bool) - Required - Boolean flag to enable or disable the payer. ``` -------------------------------- ### updateSignedMintValidationParams Source: https://context7.com/projectopensea/seadrop/llms.txt Configures validation parameters for server-side signed mints to restrict signer authority. ```APIDOC ## updateSignedMintValidationParams ### Description Configure server-side signed mints with validation parameters to limit signer authority. ### Method updateSignedMintValidationParams(address seaDropAddress, address signer, SignedMintValidationParams memory params) ### Parameters - **seaDropAddress** (address) - Required - The address of the SeaDrop contract. - **signer** (address) - Required - The address of the authorized signer. - **params** (SignedMintValidationParams) - Required - Struct containing min/max constraints for minting parameters. ```