### Setup Creator Core Extensions Project Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/README.md Clone the repository including submodules and install dependencies for a specific package. Ensure you have an NPM registry access token for scoped packages. ```bash git clone --recurse-submodules git@github.com:manifoldxyz/creator-core-extensions-solidity.git cd creator-core-extensions-solidity # Install dependencies for a specific package cd packages/ echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc yarn install ``` -------------------------------- ### Environment Setup for Package Development Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Set up the npm registry configuration and install dependencies for a specific package using yarn. ```bash //registry.npmjs.org/:_authToken=$NPM_TOKEN yarn install ``` -------------------------------- ### Run Package Unit Tests Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/lazywhitelist/README.md Commands to install dependencies, compile contracts, start a development server, deploy migrations, and run tests for the package. ```Shell yarn truffle compile ganache-cli -l 20000000 truffle migrate truffle test ``` -------------------------------- ### Start Development Server Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/edition/README.md Starts a local Ethereum development blockchain using Ganache CLI with a gas limit of 20,000,000. ```bash ganache-cli -l 20000000 ``` -------------------------------- ### Install Dependencies Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/dynamic/README.md Installs the necessary project dependencies using npm. ```bash npm install ``` -------------------------------- ### Solidity Type Conversion Examples Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/types-and-storage-protocols.md Provides examples of common type conversions in Solidity, including time, price (Wei to Ether), token counts, and variation indexing. ```Solidity // Time conversion uint48 startDate = uint48(block.timestamp); uint48 endDate = uint48(block.timestamp + 7 days); // Price conversion (Wei to Ether display) uint256 priceWei = 1 ether; // 1,000,000,000,000,000,000 Wei uint256 priceEther = priceWei / 1e18; // 1.0 // Token count uint32 supply = 1000; uint32 minted = 500; uint32 remaining = supply - minted; // Variation indexing uint8 totalVariations = 10; for(uint8 i = 0; i < totalVariations; i++) { // process variation i } ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/edition/README.md Installs the project's dependencies using Yarn. ```bash yarn ``` -------------------------------- ### Install Dependencies and Compile Solidity Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Commands to set up npm token, clean and reinstall dependencies, and compile the Solidity contracts. Ensure the correct compiler version is used. ```bash # Ensure npm token is set echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc # Clean and reinstall rm -rf node_modules package-lock.json yarn install # Check compiler version yarn compile --version # Should be ^0.8.17 ``` -------------------------------- ### StorageProtocol NONE Examples Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/types-and-storage-protocols.md For static, unchanging URIs. The 'location' field contains the complete token URI or data URI. ```solidity // Example: Direct URI location: "https://example.com/metadata/{tokenId}.json" location: "ipfs://QmXxxx" location: "data:application/json;base64,..." ``` -------------------------------- ### Install Global Dependencies Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/edition/README.md Installs Truffle and Ganache CLI globally, which are required for running package unit tests. ```bash yarn global add truffle yarn global add ganache-cli ``` -------------------------------- ### Get Edition Info Function Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/editions-singles-metadata.md Retrieves the configuration details for a specific edition series. ```solidity function getEditionInfo(address creatorCore, uint256 instanceId) external view returns(EditionInfo memory) ``` -------------------------------- ### StorageProtocol IPFS Example Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/types-and-storage-protocols.md Uses InterPlanetary File System with CID-based retrieval. Metadata is accessed at IPFS gateways. ```solidity // Example: IPFS CID location: "QmYourIPFSCIDHere" // Retrieved as: https://ipfs.io/ipfs/{cid}/{tokenId}.json // Or gateway: https://gateway.pinata.cloud/ipfs/{cid}/{tokenId}.json ``` -------------------------------- ### Relative vs. Absolute Import Example Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/dependencies-and-utilities.md Demonstrates the convention of using absolute imports for external packages and relative imports for internal contracts within the same repository. ```solidity // External - absolute import "@openzeppelin/contracts/..."; // Internal - relative import "../interfaces/IMyContract.sol"; ``` -------------------------------- ### Build and Test Manifold Extensions Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/README.md Commands for installing dependencies, building, testing, linting, and deploying the Manifold Creator Core extensions using Forge. Includes options for verbose testing and gas reporting. ```bash # Install and build cd packages/manifold npm install forge build # Run tests forge test forge test -vvv # Verbose forge test --gas-report # With gas usage # Lint npm run lint # Deploy to testnet forge script script/ContractName.s.sol \ --rpc-url $SEPOLIA_RPC_URL \ --broadcast ``` -------------------------------- ### initializeCollectible Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/physical-crosschain-collectible.md Initializes a new collectible sale with specified parameters. This is a one-time setup for a collectible instance. ```APIDOC ## initializeCollectible ### Description Initialize a new collectible sale. ### Method `external` ### Parameters - **creatorContractAddress** (address) - The address of the creator contract. - **instanceId** (uint256) - The unique identifier for the collectible instance. - **initializationParameters** (InitializationParameters calldata) - The configuration parameters for the collectible sale. ``` -------------------------------- ### Manifold Creator Core Extensions Development Workflow Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md A comprehensive set of commands for cloning the repository, installing dependencies, compiling, testing, linting, and deploying contracts. Includes steps for setting up RPC URLs and broadcasting deployments. ```bash # 1. Clone and setup git clone --recurse-submodules https://github.com/manifoldxyz/creator-core-extensions-solidity.git cd creator-core-extensions-solidity # 2. Install dependencies cd packages/manifold npm install # 3. Make changes # Edit contracts in src/ # 4. Compile forge build # 5. Run tests forge test -vvv # 6. Check gas forge test --gas-report # 7. Lint npm run lint # 8. Deploy to testnet forge script script/ContractName.s.sol \ --rpc-url $SEPOLIA_RPC_URL \ --broadcast \ --verify ``` -------------------------------- ### Get Burn Redeem Configuration Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/burn-redeem.md Retrieves the burn redeem configuration for a given creator contract and instance ID. Use this to fetch the parameters associated with a specific burn redeem setup. ```solidity function getBurnRedeem(address creatorContractAddress, uint256 instanceId) external view returns(BurnRedeem memory) ``` -------------------------------- ### StorageProtocol ARWEAVE Example Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/types-and-storage-protocols.md Uses Arweave permanent storage with hash-based retrieval. Metadata is accessed at https://arweave.net/{location}/{tokenId}.json. ```solidity // Example: Arweave hash location: "K47iq6Z7G4KkWJEzewFj9CxrYLaLMQVk0SHwUL7EEO4" // Retrieved as: https://arweave.net/{hash}/{tokenId}.json ``` -------------------------------- ### Get Edition Instance IDs for Tokens Function Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/editions-singles-metadata.md Returns the edition instance IDs corresponding to a list of token IDs. ```solidity function getInstanceIdsForTokens(address creatorCore, uint256[] calldata tokenIds) external view returns(uint256[] memory) ``` -------------------------------- ### StorageProtocol ADDRESS Example Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/types-and-storage-protocols.md The 'location' field contains a contract address string. The referenced contract must implement the ICreatorExtensionTokenURI interface for on-chain metadata generation. ```solidity // The location field contains the contract address string location: "0x1234567890123456789012345678901234567890" // Contract implements tokenURI interface ``` -------------------------------- ### Get Token IDs for Edition Instance Function Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/editions-singles-metadata.md Returns all token IDs associated with a specific edition instance ID. ```solidity function getInstanceTokenIds(address creatorCore, uint256 instanceId) external view returns(uint256[] memory) ``` -------------------------------- ### Mint Dynamic Token in Example Contract Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/soulbound-dynamic-whitelist.md Mint a dynamic token to a specified address. This function is restricted to the owner of the contract. ```Solidity function mint(address to) external onlyOwner ``` -------------------------------- ### Handle Errors with Try/Catch in Solidity Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/errors-and-exceptions.md Use try/catch blocks to gracefully handle potential reverts from external contract calls. This example shows how to catch specific errors and check conditions after a successful call. ```solidity try IBurnRedeemCore(burnRedeemAddress).getBurnRedeem(creator, instanceId) returns (IBurnRedeemCore.BurnRedeem memory config) { // Handle success require(config.redeemedCount < config.totalSupply, "Sold out"); } catch Error(string memory reason) { // Handle revert with reason if (keccak256(abi.encodePacked(reason)) == keccak256("BurnRedeemDoesNotExist")) { // Need to initialize } } ``` -------------------------------- ### Set Merkle Whitelist Root and Get Proof Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/quick-reference.md Client-side JavaScript to generate a Merkle tree and root for whitelist minting. The root is set on the contract, and users can obtain their proof for minting. ```JavaScript // Client-side: Generate tree const { MerkleTree } = require('merkletreejs'); const keccak256 = require('keccak256'); const addresses = ['0x...', '0x...', '0x...']; const leaves = addresses.map(addr => keccak256(addr)); const tree = new MerkleTree(leaves, keccak256, { sort: true }); const root = tree.getRoot(); // Admin: Set root await contract.setAllowList(root); // User: Get proof for minting const proof = tree.getProof(keccak256(userAddress)); await contract.mint(proof); ``` -------------------------------- ### Multi-Package Build Commands Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Commands for managing a multi-package project using Yarn. Use these for installing dependencies, building, testing, and linting. ```bash # Install all packages yarn install # Build all packages yarn run build # Test all packages yarn run test # Lint all packages yarn run lint ``` -------------------------------- ### Get Edition Information Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/editions-singles-metadata.md Retrieves detailed information about a specific edition series. This function requires the edition contract address, creator contract address, and instance ID to fetch the EditionInfo. ```Solidity // Get edition info EditionInfo memory info = IManifoldERC721Edition(editionAddress).getEditionInfo( creatorContractAddress, instanceId ); ``` -------------------------------- ### Merkle Tree Whitelist Claim Pattern Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/soulbound-dynamic-whitelist.md Example of claiming a token using a Merkle proof. It verifies the proof against a Merkle root and checks if the token has already been claimed. Requires importing OpenZeppelin's MerkleProof library. ```Solidity import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; bytes32 merkleRoot = 0x...; mapping(address => bool) claimed; function claim(bytes32[] calldata proof) external { require(!claimed[msg.sender], "Already claimed"); bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require( MerkleProof.verify(proof, merkleRoot, leaf), "Invalid proof" ); claimed[msg.sender] = true; // mint token } ``` -------------------------------- ### Generate Dynamic SVG Metadata URI Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/soulbound-dynamic-whitelist.md Generate a complete SVG metadata URI for a dynamic NFT, with content (colors, shapes) based on the time elapsed since the token's creation. This is an example implementation. ```Solidity function tokenURI(address creator, uint256 tokenId) external view returns (string memory) ``` -------------------------------- ### Get Burn Redeem Configuration for Token Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/burn-redeem.md Retrieves the burn redeem configuration and instance ID for a specific minted token. This is useful when you need to find the associated burn redeem setup for an existing token. ```solidity function getBurnRedeemForToken(address creatorContractAddress, uint256 tokenId) external view returns(uint256, BurnRedeem memory) ``` -------------------------------- ### Merkle Proof Verification in Solidity Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/types-and-storage-protocols.md Demonstrates how to use OpenZeppelin's MerkleProof library to verify a leaf against a Merkle root using a provided proof. ```Solidity import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; bytes32 leaf = keccak256(abi.encodePacked(address, value)); require( MerkleProof.verify(proof, root, leaf), "Invalid proof" ); ``` -------------------------------- ### Deploy Migrations Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/edition/README.md Deploys smart contracts using Truffle migrations. ```bash truffle migrate ``` -------------------------------- ### Standard Solidity Imports Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/dependencies-and-utilities.md Illustrates common import patterns for Creator Core, Manifold Libraries, OpenZeppelin contracts, and local repository files. ```solidity // Creator Core import "@manifoldxyz/creator-core-solidity/contracts/core/IERC721CreatorCore.sol"; import "@manifoldxyz/creator-core-solidity/contracts/extensions/CreatorExtension.sol"; // Manifold Libraries import "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol"; // OpenZeppelin import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; // This repo import "../libraries/single-creator/ERC721/ERC721SingleCreatorExtension.sol"; import "../libraries/ABDKMath64x64.sol"; ``` -------------------------------- ### OpenZeppelin Strings Library Usage Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/dependencies-and-utilities.md Demonstrates using the OpenZeppelin Strings library for converting uint256 to string and string concatenation. Ensure the library is imported and used with the `using for` directive. ```solidity import "@openzeppelin/contracts/utils/Strings.sol"; using Strings for uint256; string memory tokenIdString = tokenId.toString(); string memory uri = string(abi.encodePacked( "ipfs://QmXxx/", tokenIdString, ".json" )); ``` -------------------------------- ### Build and Test Dynamic Package Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Navigate to the 'packages/dynamic' directory and run 'forge build' to compile contracts and 'forge test' to execute tests. ```bash cd packages/dynamic forge build forge test ``` -------------------------------- ### Gas Optimization Patterns in Solidity Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/manifold/CLAUDE.md Illustrates common gas optimization techniques used in Solidity, such as unchecked increments, bitmask tracking, and max value constants. ```solidity // Unchecked increments in loops unchecked { ++i; } // Bitmask tracking for merkle mints uint256 internal constant MINT_INDEX_BITMASK = 0xFF; // Max value constants uint256 internal constant MAX_UINT_24 = 0xffffff; ``` -------------------------------- ### Build and Test Edition Package Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Navigate to the 'packages/edition' directory and run 'yarn test' to execute tests. Compilation is handled by yarn. ```bash cd packages/edition yarn test ``` -------------------------------- ### Activate ERC721Collectible Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/physical-crosschain-collectible.md Activates the ERC721Collectible contract, setting the start time, duration, and presale intervals. Ensure `startTime` and `duration` are correctly set. ```solidity // Activate collectible ICollectibleCore(collectibleAddress).activate( creatorContractAddress, instanceId, ActivationParameters({ startTime: uint48(block.timestamp), duration: 7 days, presaleInterval: 1 days, claimStartTime: 0, claimEndTime: 0 }) ); ``` -------------------------------- ### Build and Test Enumerable Package Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Navigate to the 'packages/enumerable' directory and run 'forge build' to compile contracts and 'forge test' to execute tests. ```bash cd packages/enumerable forge build forge test ``` -------------------------------- ### ABDKMath64x64 Fixed-Point Math Operations Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/dependencies-and-utilities.md Demonstrates common fixed-point arithmetic operations using the ABDKMath64x64 library. Ensure the library is imported and used with the `using for` directive. ```solidity using ABDKMath64x64 for int128; int128 value = ABDKMath64x64.div(48, 100); // 0.48 int128 power = value.pow(3); // 0.48^3 int128 exp = ABDKMath64x64.exp_2(value); // 2^0.48 ``` -------------------------------- ### Run Tests Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/edition/README.md Executes the package's unit tests using Truffle. ```bash truffle test ``` -------------------------------- ### Initialize Shared Extension Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Initializes a shared extension directly with the creator contract and instance details. Use this for extensions deployed once and used by multiple creators. ```solidity // No installation needed - contract is already deployed // Creator admin directly initializes: IBurnRedeemCore(burnRedeemAddress).initializeBurnRedeem( creatorAddress, instanceId, BurnRedeemParameters({ paymentReceiver: payable(receiver), storageProtocol: StorageProtocol.ARWEAVE, redeemAmount: 1, totalSupply: 1000, startDate: uint48(block.timestamp), endDate: 0, cost: 0, location: "arweaveHash", burnSet: burnGroups }) ); ``` -------------------------------- ### Get Total Mints by Wallet Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/lazy-payable-claims.md Retrieves the total number of mints a specific wallet has made for a given claim. Applicable to non-merkle claims with a wallet maximum limit. ```solidity function getTotalMints(address minter, address creatorContractAddress, uint256 instanceId) external view returns (uint32) ``` -------------------------------- ### InitializationParameters Structure Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/physical-crosschain-collectible.md Defines the configuration parameters for initializing a collectible sale. ```solidity struct InitializationParameters { bool useDynamicPresalePurchaseLimit; uint16 transactionLimit; uint16 purchaseMax; uint16 purchaseLimit; uint16 presalePurchaseLimit; uint256 purchasePrice; uint256 presalePurchasePrice; address signingAddress; address payable paymentReceiver; } ``` -------------------------------- ### Build and Test with Foundry Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/README.md Compile contracts and run tests using Foundry for packages that support it. Coverage reports can also be generated. ```bash forge build forge test forge coverage ``` -------------------------------- ### Get Token IDs in an Edition Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/editions-singles-metadata.md Retrieves an array of all token IDs belonging to a specific edition instance. This function requires the edition contract address, creator contract address, and instance ID. ```Solidity // Get tokens in an edition uint256[] memory tokenIds = IManifoldERC721Edition(editionAddress).getInstanceTokenIds( creatorContractAddress, instanceId ); ``` -------------------------------- ### Compile Contracts Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/edition/README.md Compiles the Solidity smart contracts using Truffle. ```bash truffle compile ``` -------------------------------- ### Build and Test Redeem Package Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Navigate to the 'packages/redeem' directory and run 'yarn test' to execute tests. Compilation is handled by yarn. ```bash cd packages/redeem yarn test ``` -------------------------------- ### Run Tests Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/quick-reference.md Execute tests using Forge or Truffle. Forge provides options for verbose output and gas usage reports. ```bash # Test forge test # Foundry yarn test # Truffle forge test -vvv # Verbose output forge test --gas-report # Gas usage ``` -------------------------------- ### OpenZeppelin Utilities Imports Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/dependencies-and-utilities.md Imports for general utility functions from OpenZeppelin, including Strings and IERC165. ```solidity // Utilities import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; ``` -------------------------------- ### Build and Test LazyWhitelist Package Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Navigate to the 'packages/lazywhitelist' directory and run 'yarn test' to execute tests. Compilation is handled by yarn. ```bash cd packages/lazywhitelist yarn test ``` -------------------------------- ### activate Method Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/physical-crosschain-collectible.md Activates a collectible sale using the specified timing parameters. ```solidity function activate( address creatorContractAddress, uint256 instanceId, ActivationParameters calldata activationParameters ) external ``` -------------------------------- ### Solidity Method: sponsorMints Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/gacha-deck-frame-claims.md Allows anyone to sponsor free mints for a claim. Emits a `FrameClaimSponsored` event upon successful sponsorship. ```solidity function sponsorMints( address creatorContractAddress, uint256 instanceId, uint56 amount ) external payable ``` -------------------------------- ### Bitmasking Pattern for Tracking Usage in Solidity Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/types-and-storage-protocols.md Explains how to use bitmasking with mappings to efficiently track the usage status of many boolean flags, saving gas. ```Solidity // Track which mint indices have been used mapping(address => mapping(uint256 => mapping(uint256 => uint256))) usedIndices; // Set bit for index uint256 wordIndex = mintIndex / 256; uint256 bitIndex = mintIndex % 256; usedIndices[creator][instance][wordIndex] |= (1 << bitIndex); // Check if used bool used = (usedIndices[creator][instance][wordIndex] >> bitIndex) & 1 == 1; ``` -------------------------------- ### Efficient Integer Sizes for Storage Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Demonstrates the use of optimized integer types to reduce gas costs for storage. Use smaller integer types where possible to minimize gas consumption. ```solidity uint16 count // Most counts (2-byte) uint32 supply // Supplies (4-byte) uint48 timestamp // Times (6-byte) uint160 price // Prices (20-byte) ``` -------------------------------- ### Compile Contracts Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/dynamic/README.md Compiles the Solidity smart contracts using the Forge build tool. ```bash forge build ``` -------------------------------- ### initializeCollectible Method Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/physical-crosschain-collectible.md Initializes a new collectible sale with the provided parameters. ```solidity function initializeCollectible( address creatorContractAddress, uint256 instanceId, InitializationParameters calldata initializationParameters ) external ``` -------------------------------- ### Project Structure Overview Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/manifold/CLAUDE.md Provides a high-level view of the contract directories within the Manifold Creator Core Extensions project. ```bash contracts/ ├── burnredeem/ # Burn-to-redeem NFT mechanics ├── burnredeemUpdatableFee/ # V2 with updatable fees ├── collectible/ # Collectible extensions (ERC721) ├── crossChainBurn/ # Cross-chain burn functionality ├── edition/ # ERC721 batch minting editions ├── frameclaims/ # Farcaster Frame claim extensions ├── gachaclaims/ # Serendipity/gacha mechanics ├── lazyclaim/ # Lazy payable claim pages (ETH) ├── lazyUpdatableFeeClaim/ # V2 lazy claims with updatable fees ├── libraries/ # Shared libraries & interfaces ├── metadata/ # Frozen metadata extensions ├── operatorfilterer/ # OpenSea operator filter support ├── physicalclaim/ # Physical item redemption ├── single/ # Single-creator extensions └── soulbound/ # Soulbound token extensions test/ # Foundry tests (.t.sol) & Truffle tests (.js) script/ # Foundry deployment scripts (.s.sol) ``` -------------------------------- ### Run Unit Tests Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/dynamic/README.md Executes the package's unit tests using the Forge testing framework. ```bash forge test ``` -------------------------------- ### Development Commands for Manifold Creator Core Extensions Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/manifold/CLAUDE.md Common commands for managing dependencies, building contracts, running tests, and linting the project. ```bash # Install dependencies npm install # Build contracts forge build # Run all tests forge test # Run specific test file forge test --match-path test/lazyclaim/ERC721LazyPayableClaim.t.sol # Run with verbosity forge test -vvv # Lint npm run lint ``` -------------------------------- ### Compile Contracts Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/quick-reference.md Compile smart contracts using Forge or Truffle. Forge is typically used for Manifold, dynamic, and enumerable contracts, while Truffle is used for others. ```bash # Compile forge build # Forge (manifold, dynamic, enumerable) yarn compile # Truffle (others) ``` -------------------------------- ### Manual Deployment with Truffle Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Navigate to the 'packages/manifold' directory, compile contracts using 'yarn compile', and deploy to a local or test network using 'yarn deployLocal'. Network configuration is managed in 'truffle-config.js'. ```bash cd packages/manifold # Compile yarn compile # Deploy to local/testnet yarn deployLocal # Configure network in truffle-config.js ``` -------------------------------- ### Solidity Structure: Mint Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/gacha-deck-frame-claims.md Defines a batch mint instruction for Farcaster Frame Claims, including the creator contract address, instance ID, and an array of recipients. ```solidity struct Mint { address creatorContractAddress; uint256 instanceId; Recipient[] recipients; } ``` -------------------------------- ### Register Single-Creator Extension Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Registers a single-creator extension with the creator contract and initializes the extension. Use this for extensions specific to one creator contract. ```solidity // Creator contract calls (creator admin only) IERC721CreatorCore(creatorAddress).registerExtension( editionExtensionAddress, "ipfs://extension-uri" ); // Extension initializes itself IManifoldERC721Edition(editionExtensionAddress).initialize( creatorAddress, maxSupply, baseURI ); ``` -------------------------------- ### Forge Standard Library Testing Utilities Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/dependencies-and-utilities.md Shows basic usage of Forge Standard Library for testing, including assertions and common cheats like `prank`, `deal`, and `warp`. Import `forge-std/Test.sol` to use these functions. ```solidity import "forge-std/Test.sol"; function test_example() public { // Assertions assertEq(a, b); assertGt(a, b); assertTrue(condition); // Cheats vm.prank(user); vm.deal(user, 1 ether); vm.warp(block.timestamp + 1 days); } ``` -------------------------------- ### Solidity Method: mint for Frame Claims Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/gacha-deck-frame-claims.md Executes frame-based mints from Farcaster Frame transactions. Requires a valid frame signature and sufficient payment. ```solidity function mint(Mint[] calldata mints) external payable ``` -------------------------------- ### Build and Test Manifold Package Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Navigate to the 'packages/manifold' directory and run 'forge build' to compile contracts and 'forge test' to execute tests. ```bash cd packages/manifold forge build forge test ``` -------------------------------- ### configureToken (Batch) Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/soulbound-dynamic-whitelist.md Configures multiple tokens with the same soulbound and burnable settings in a single transaction. This function requires the caller to be an admin on the specified creator contract. ```APIDOC ## configureToken (Batch) ### Description Configure multiple tokens with same settings. ### Method external ### Parameters #### Path Parameters - **creatorContractAddress** (address) - Required - Creator contract address - **tokenIds** (uint256[]) - Required - Array of token IDs to configure - **soulbound** (bool) - Required - True to make soulbound (non-transferable) - **burnable** (bool) - Required - True to allow burning ### Requirements Requires caller to be admin on creator contract. ``` -------------------------------- ### Configure Merkle Root for Whitelist Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Generates a Merkle tree from a list of addresses and updates the claim contract with the Merkle root. Use this for signature-based claims with whitelists. ```javascript // Client-side: Generate merkle tree const leaves = addresses.map(addr => keccak256(addr)); const tree = new MerkleTree(leaves, keccak256, { sort: true }); const root = tree.getRoot(); // Admin: Set merkle root await claimContract.updateMerkleRoot(instanceId, root); ``` -------------------------------- ### Deploy Contracts with Forge Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Command to deploy smart contracts using Forge, specifying the RPC URL for the target network. Use this for deploying contracts to various Ethereum networks. ```bash forge script script/ContractName.s.sol \ --rpc-url $RPC_URL_ \ --broadcast ``` -------------------------------- ### Create Edition Series Function Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/editions-singles-metadata.md Use to create a new edition series and mint initial tokens. Requires specifying max supply, storage protocol, metadata location, and initial recipients. ```solidity function createSeries( address creatorCore, uint256 instanceId, uint24 maxSupply_, StorageProtocol storageProtocol, string calldata location, Recipient[] memory recipients ) external ``` -------------------------------- ### Indexed Arrays Pattern in Solidity Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/types-and-storage-protocols.md Demonstrates the indexed arrays pattern for efficient referencing of complex nested structures by storing items in an array and referencing them by index. ```Solidity // Store items in array BurnGroup[] burnSet; // Reference by index struct BurnToken { uint48 groupIndex; // Index in burnSet uint48 itemIndex; // Index in burnSet[groupIndex].items ... } ``` -------------------------------- ### Registering an Extension Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/dynamic/README.md Call this function to approve an extension for a Creator Core contract. The baseURI can be left blank if tokenURI functionality is being overridden. ```solidity registerExtension(address extension, string memory baseURI) ``` -------------------------------- ### updateInitializationParameters Method Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/physical-crosschain-collectible.md Updates the sale parameters such as prices and limits for a collectible. ```solidity function updateInitializationParameters( address creatorContractAddress, uint256 instanceId, UpdateInitializationParameters calldata initializationParameters ) external ``` -------------------------------- ### Deploy to Testnet Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/quick-reference.md Deploy contracts to a testnet using Forge scripts. Ensure the necessary RPC URL environment variable is set. ```bash # Deploy to testnet forge script script/Contract.s.sol \ --rpc-url $SEPOLIA_RPC_URL \ --broadcast ``` -------------------------------- ### IManifoldERC721Edition Interface Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/editions-singles-metadata.md Interface for edition controller for batch ERC721 minting. ```APIDOC ## IManifoldERC721Edition ### Description Interface for edition controller for batch ERC721 minting. ### Enums **StorageProtocol** ```solidity enum StorageProtocol { INVALID, NONE, ARWEAVE, IPFS } ``` ### Structures **Recipient** ```solidity struct Recipient { address recipient; uint16 count; } ``` Recipient address and token count for batch minting. **EditionInfo** ```solidity struct EditionInfo { uint192 firstTokenId; uint8 contractVersion; uint24 totalSupply; uint24 maxSupply; StorageProtocol storageProtocol; string location; } ``` Information about an edition series. | Field | Type | Description | |-------|------|-------------| | firstTokenId | uint192 | First token ID minted in this series | | contractVersion | uint8 | Contract version | | totalSupply | uint24 | Current number minted | | maxSupply | uint24 | Maximum tokens that can be minted | | storageProtocol | StorageProtocol | URI storage protocol | | location | string | Metadata location (Arweave hash, IPFS CID, full URI) | ### Custom Errors | Error | Trigger Condition | |-------|-------------------| | `InvalidEdition()` | Edition configuration is invalid | | `InvalidInput()` | Invalid input parameters | | `TooManyRequested()` | Minting would exceed max supply | | `InvalidToken()` | Token doesn't exist or isn't in this edition | ### Events ```solidity event SeriesCreated(address caller, address creatorCore, uint256 series, uint256 maxSupply) ``` ### Methods **createSeries** ```solidity function createSeries( address creatorCore, uint256 instanceId, uint24 maxSupply_, StorageProtocol storageProtocol, string calldata location, Recipient[] memory recipients ) external ``` Create a new edition series and mint initial tokens. | Parameter | Type | Description | |-----------|------|-------------| | creatorCore | address | Creator contract address | | instanceId | uint256 | Extension instance ID | | maxSupply_ | uint24 | Maximum tokens this series can mint | | storageProtocol | StorageProtocol | How URIs are stored | | location | string | Metadata location | | recipients | Recipient[] | Initial recipients and mint counts | **setTokenURI** ```solidity function setTokenURI( address creatorCore, uint256 instanceId, StorageProtocol storageProtocol, string calldata location ) external ``` Update the token URI configuration for a series. **mint** ```solidity function mint( address creatorCore, uint256 instanceId, uint24 currentSupply, Recipient[] memory recipients ) external ``` Mint tokens to multiple recipients. | Parameter | Type | Description | |-----------|------|-------------| | creatorCore | address | Creator contract address | | instanceId | uint256 | Extension instance ID | | currentSupply | uint24 | Current supply count for validation | | recipients | Recipient[] | Recipients and mint counts | **getEditionInfo** ```solidity function getEditionInfo(address creatorCore, uint256 instanceId) external view returns(EditionInfo memory) ``` Retrieve edition configuration. **getInstanceIdsForTokens** ```solidity function getInstanceIdsForTokens(address creatorCore, uint256[] calldata tokenIds) external view returns(uint256[] memory) ``` Get edition instance IDs for given token IDs. **getInstanceTokenIds** ```solidity function getInstanceTokenIds(address creatorCore, uint256 instanceId) external view returns(uint256[] memory) ``` Get all token IDs for an edition instance. ``` -------------------------------- ### Lint Code Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/quick-reference.md Lint smart contracts using Solhint to enforce code style and identify potential issues. ```bash # Lint npm run lint # Solhint ``` -------------------------------- ### Initialize Edition Contract Internal Function Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/editions-singles-metadata.md Internal function to initialize an edition contract with the creator's address and the maximum supply. ```solidity function _initialize(address creator, uint256 maxSupply_) internal ``` -------------------------------- ### Common Solidity Imports for Manifold Extensions Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/manifold/CLAUDE.md Shows essential imports for access control, ERC20 interaction, Merkle proofs, and ECDSA signatures. ```solidity import "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; ``` -------------------------------- ### Unchecked Arithmetic for Gas Optimization Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/dependencies-and-utilities.md Demonstrates using the `unchecked` block for gas optimization in loops where overflow risk is negligible. This bypasses Solidity's default overflow/underflow checks. ```solidity for (uint256 i = 0; i < arr.length;) { // process arr[i] unchecked { ++i; } } ``` -------------------------------- ### Batch Mint Multiple Tokens Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/lazy-payable-claims.md Use this function for batch minting multiple tokens. Specify the total payment required using the `value` option. Provide the creator contract address, instance ID, the number of tokens to mint, arrays of indices and proofs, and the sender's address. ```solidity // Batch minting multiple tokens ILazyPayableClaim(claimAddress).mintBatch{value: totalPaymentRequired}( creatorContractAddress, instanceId, 3, // mintCount [index1, index2, index3], [proof1, proof2, proof3], msg.sender ); ``` -------------------------------- ### Initialize Lazy Payable Claim Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Initializes a lazy payable claim with specified parameters. Use this when setting up a claim contract that allows users to claim tokens. ```solidity ILazyPayableClaimCore(claimAddress).initializeClaim( creatorContractAddress, instanceId, ILazyPayableClaimCore.ClaimParameters({ merkleRoot: 0x..., storageProtocol: StorageProtocol.ARWEAVE, cost: 1 ether, endDate: uint48(block.timestamp + 30 days), location: "arweaveHash", maxClaimSupply: 1000, maxUserClaimCount: 10, startDate: uint48(block.timestamp), tokenAddress: address(0), // ETH signingAddress: signerAddress, useMerkleProof: false, storageLocation: 0 }) ); ``` -------------------------------- ### OpenZeppelin Cryptography Imports Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/dependencies-and-utilities.md Imports for cryptographic utilities from OpenZeppelin, such as ECDSA and MerkleProof. ```solidity // Cryptography import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; ``` -------------------------------- ### Count Fields in Solidity Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/types-and-storage-protocols.md Illustrates the use of various integer types (uint16, uint24, uint32, uint56) for token and mint counts based on required range. ```Solidity uint16 count; uint24 maxSupply; uint32 redeemAmount; uint56 amount; ``` -------------------------------- ### mint (DynamicSVGExample) Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/soulbound-dynamic-whitelist.md Mints a new dynamic token to a specified address. This function can only be called by the owner of the contract. ```APIDOC ## mint (DynamicSVGExample) ### Description Mint a dynamic token to address. ### Method external onlyOwner ### Parameters #### Path Parameters - **to** (address) - Required - The address to mint the token to ``` -------------------------------- ### Bit Packing and Manipulation Patterns Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/dependencies-and-utilities.md Provides common bitwise operations for checking, setting, clearing, and toggling bits within a bitmap. Useful for efficient storage. ```solidity // Check if bit set bool used = (bitmap[word] >> bitIndex) & 1 == 1; // Set bit bitmap[word] |= (1 << bitIndex); // Clear bit bitmap[word] &= ~(1 << bitIndex); // Toggle bit bitmap[word] ^= (1 << bitIndex); ``` -------------------------------- ### UserMintDetails Structure Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/gacha-deck-frame-claims.md Tracks the number of reserved and delivered mints for a user in a Gacha claim. Used to manage user minting status. ```Solidity struct UserMintDetails { uint32 reservedCount; uint32 deliveredCount; } ``` -------------------------------- ### getCollectible Method Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/physical-crosschain-collectible.md Retrieves the full configuration details of a collectible instance. ```solidity function getCollectible(address creatorContractAddress, uint256 index) external view returns (CollectibleInstance memory) ``` -------------------------------- ### CollectibleInstance Structure Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/physical-crosschain-collectible.md Represents the complete configuration for a collectible sale instance. ```solidity struct CollectibleInstance { bool isActive; bool useDynamicPresalePurchaseLimit; bool isTransferLocked; uint8 contractVersion; uint16 transactionLimit; uint16 purchaseMax; uint16 purchaseLimit; uint16 presalePurchaseLimit; uint16 purchaseCount; uint48 startTime; uint48 endTime; uint48 presaleInterval; uint48 claimStartTime; uint48 claimEndTime; uint256 purchasePrice; uint256 presalePurchasePrice; string baseURI; address payable paymentReceiver; } ``` -------------------------------- ### Linked Enum Pattern for State Machines in Solidity Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/types-and-storage-protocols.md Illustrates using enums to represent states in a state machine, making contract logic clearer and more maintainable. ```Solidity enum Phase { PRESALE, // 0 PUBLIC, // 1 CLAIM // 2 } function getCurrentPhase() internal view returns(Phase) { uint48 now = uint48(block.timestamp); if (now < presaleStart) return Phase.PRESALE; if (now < publicStart) return Phase.PUBLIC; return Phase.CLAIM; } ``` -------------------------------- ### Mint a Single Token Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/lazy-payable-claims.md Claim a single token using creator contract address, instance ID, and mint parameters. Requires payment. ```solidity function mint( address creatorContractAddress, uint256 instanceId, uint32 mintIndex, bytes32[] calldata merkleProof, address mintFor ) external payable ``` -------------------------------- ### OpenZeppelin ERC20 Imports Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/dependencies-and-utilities.md Imports for ERC20 token interfaces and utilities from OpenZeppelin, including IERC20 and SafeERC20. ```solidity // Tokens import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; ``` -------------------------------- ### Configure Storage Location for Token URI Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Sets the metadata URI for a token, specifying the storage protocol and the hash or CID. Use this to link token metadata to its storage location. ```solidity // Set metadata URI await claimContract.setTokenURI( instanceId, StorageProtocol.ARWEAVE, "QmYourArweaveHashOrIPFSCID" ); ``` -------------------------------- ### ClaimMint Structure Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/gacha-deck-frame-claims.md Represents a complete mint instruction, including the creator contract address, instance ID, and an array of variation mints. This structure is shared between Gacha and Deck claim contracts. ```Solidity struct ClaimMint { address creatorContractAddress; uint256 instanceId; VariationMint[] variationMints; } ``` -------------------------------- ### ActivationParameters Structure Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/physical-crosschain-collectible.md Defines the time-based parameters for activating a collectible sale. ```solidity struct ActivationParameters { uint48 startTime; uint48 duration; uint48 presaleInterval; uint48 claimStartTime; uint48 claimEndTime; } ``` -------------------------------- ### Custom Error Usage in Solidity Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/packages/manifold/CLAUDE.md Demonstrates the use of custom errors for reverting transactions, which is more gas-efficient than using require strings. ```solidity revert ILazyPayableClaimCore.ClaimInactive(); revert ILazyPayableClaimCore.InvalidInput(); ``` -------------------------------- ### Soulbound Token Configuration Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/soulbound-dynamic-whitelist.md Configure Soulbound token settings, including soulbound and burnable flags. This can be done for a single token or in batches. ```Solidity // Soulbound configuration ISoulbound(soulboundAddress).configureToken( creatorContractAddress, tokenId, true, // soulbound true // burnable ); ``` ```Solidity // Batch configure uint256[] memory tokenIds = new uint256[](3); tokenIds[0] = 1; tokenIds[1] = 2; tokenIds[2] = 3; ISoulbound(soulboundAddress).configureToken( creatorContractAddress, tokenIds, false, // not soulbound false // not burnable ); ``` -------------------------------- ### Process Batch Claim (LazyPayable) Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/quick-reference.md Use for claiming multiple tokens via a LazyPayable contract. Ensure the total value sent matches the claim price multiplied by the count. ```Solidity ILazyPayableClaim(claimAddress).mintBatch{value: claimPrice * 3}( creator, instanceId, 3, // count new uint32[](0), // indices new bytes32[][](0), // proofs msg.sender ); ``` -------------------------------- ### Proxy Mint for Another Address Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/lazy-payable-claims.md Allows services or aggregators to mint tokens on behalf of users. Requires batch mint parameters. ```solidity function mintProxy( address creatorContractAddress, uint256 instanceId, uint16 mintCount, uint32[] calldata mintIndices, bytes32[][] calldata merkleProofs, address mintFor ) external payable ``` -------------------------------- ### Solidity Method: updateSponsoredMintFee Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/gacha-deck-frame-claims.md Sets the fee for sponsored mints in Frame Claims. This function is restricted to admin users. ```solidity function updateSponsoredMintFee(uint256 fee) external ``` -------------------------------- ### Admin Access Control Interface Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/dependencies-and-utilities.md Interface for checking administrative access within the Creator Core system. ```solidity function isAdmin(address account) external view returns (bool) ``` -------------------------------- ### Merkle Proof Verification in Solidity Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/dependencies-and-utilities.md Implement Merkle proof verification to efficiently check if a leaf node is part of a Merkle tree. This is useful for batch operations or access control where a large dataset needs to be verified with minimal on-chain computation. ```solidity import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; bytes32 leaf = keccak256(abi.encodePacked(user, amount)); require( MerkleProof.verify(merkleProof, merkleRoot, leaf), "Invalid proof" ); ``` -------------------------------- ### mint Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/gacha-deck-frame-claims.md Executes frame-based mints from Farcaster Frame transactions. This function processes an array of mint instructions, requiring a valid frame signature and sufficient payment. ```APIDOC ## mint ### Description Execute frame-based mints from Farcaster Frame transactions. ### Method external payable ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **mints** (Mint[]) - Required - Array of mint instructions ### Request Example None ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### tokenURI (DynamicSVGExample) Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/soulbound-dynamic-whitelist.md Generates an SVG metadata URI based on the time elapsed since the token's creation. This method returns a complete SVG with animated colors and shapes. ```APIDOC ## tokenURI (DynamicSVGExample) ### Description Generate SVG based on time elapsed since creation. ### Method view ### Parameters #### Path Parameters - **creator** (address) - Required - The address of the creator contract - **tokenId** (uint256) - Required - The ID of the token ### Returns - **string memory** - Complete SVG with animated colors and shapes. ``` -------------------------------- ### Custom Token URI Provider Interface Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/dependencies-and-utilities.md Interface for custom token URI providers in the Creator Core system. ```solidity function tokenURI(address creator, uint256 tokenId) external view returns (string memory) ``` -------------------------------- ### Deploy and Verify ERC721LazyPayableClaim with Forge Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/architecture-and-deployment.md Deploy the ERC721LazyPayableClaim contract using Forge scripts, broadcasting the transaction, and verifying it on Etherscan. ```bash cd packages/manifold forge script script/ERC721LazyPayableClaim.s.sol \ --rpc-url $RPC_URL \ --private-key $PRIVATE_KEY \ --broadcast \ --verify forge verify-contract
src/lazyclaim/ERC721LazyPayableClaim.sol:ERC721LazyPayableClaim \ --etherscan-api-key $ETHERSCAN_API_KEY ``` -------------------------------- ### Deliver Pre-assigned Variations with Deck Source: https://github.com/manifoldxyz/creator-core-extensions-solidity/blob/main/_autodocs/gacha-deck-frame-claims.md Utilize the Deck contract to deliver mints with pre-assigned variations to a specific user. This method is suitable when the variation for each mint is determined beforehand. ```Solidity // Deck: Pre-assigned variations ClaimMint[] memory deckMints = new ClaimMint[](1); VariationMint[] memory deckVariations = new VariationMint[](1); deckVariations[0] = VariationMint({variationIndex: 5, amount: 1, recipient: user}); deckMints[0] = ClaimMint({ creatorContractAddress: creatorContractAddress, instanceId: instanceId, variationMints: deckVariations }); IDeck(deckAddress).deliverMints(deckMints); ```