Immutable zkEVM Collection Requirements
All NFT collections deployed on Immutable zkEVM must implement:- Royalty Enforcement: EIP-2981 royalty standard with on-chain enforcement via the Operator Allowlist
- Operator Allowlist: Restrict transfers to approved marketplaces and platforms
- Metadata Standards: ERC-721/ERC-1155 metadata standards with proper token/collection URIs
See the Operator Allowlist and Royalties documentation for detailed implementation guidance.
Setup Hardhat
Install and configure Hardhat following the official Hardhat setup guide. Install the toolbox anddotenv packages:
Configure Hardhat
To deploy contracts to Immutable zkEVM, configure yourhardhat.config.ts file with network settings:
Network Details:
The deployer account must have sufficient IMX for gas fees. Get testnet IMX from the Immutable Testnet Faucet.
Environment Variables
Create a.env file in your project root:
Add Contract
After installing the preset contract library (npm install @imtbl/contracts), create a contracts directory and add your contract file.
Operator Allowlist Addresses (required constructor parameter):
The Operator Allowlist restricts NFT transfers to approved marketplaces. For details on how it works and how to manage the allowlist, see Operator Allowlist.
- ImmutableERC721 Preset
- ImmutableERC1155 Preset
Create
contracts/MyERC721.sol:Compile
Compile your contracts to generate artifacts and type definitions:- Contract artifacts in
artifacts/ - ABI files for contract interaction
Test
Write tests in thetest/ directory using Hardhat’s testing framework (Mocha and Chai):
Hardhat automatically compiles contracts before running tests, so
npx hardhat compile is not required before testing.Deploy
Write Deployment Script
Important: Immutable zkEVM requires specific gas configuration. Always include transaction overrides withmaxFeePerGas, maxPriorityFeePerGas, and gasLimit.
Create scripts/deploy.ts:
- Deploy ERC-721 Preset
- Deploy ERC-1155 Preset
Constructor Parameters:
owner: Address with admin rights (typically deployer)name: Collection name (e.g., “My NFT Collection”)symbol: Token symbol for ERC-721 (e.g., “MYC”)baseURI: Base URI for token metadata (e.g., “https://api.example.com/metadata/”)contractURI: Collection-level metadata URIoperatorAllowlist: Address of the Operator Allowlist contract (see table above)royaltyReceiver: Address that receives royalty paymentsfeeNumerator: Royalty percentage in basis points (200 = 2%, 1000 = 10%)
Deploy to Testnet
Deploy your contract to Immutable zkEVM testnet:Deploy to Mainnet
Gas Pricing
Immutable zkEVM enforces a minimum gas price of 10 gwei to protect against spam traffic and ensure efficient transaction processing.Minimum Requirements
- Minimum Gas Price: Transactions with a tip cap below 10 gwei are rejected by the RPC
- Fee Cap: Must be greater than or equal to 10 gwei
- Base Fee: Transactions only mine when the gas fee cap is greater than or equal to the base fee
Recommended Gas Configuration
When deploying contracts, use the following gas settings:maxPriorityFeePerGas: Priority fee (tip) you’re willing to pay to miners (minimum 10 gwei)maxFeePerGas: Maximum total fee per gas unit (base fee + priority fee)gasLimit: Maximum gas units the transaction can consume (set higher for contract deployments)
Troubleshooting
UNPREDICTABLE_GAS_LIMIT Error
Error message:- Incorrect constructor arguments: Verify all parameters are correct (especially addresses)
- Insufficient gas limit: The default limit may be too low for complex contracts
- Contract logic error: The contract may revert due to a bug
- Verify constructor arguments: Double-check all addresses, strings, and numbers
- Estimate and increase gas limit: First estimate the required gas, then set
gasLimitaccordingly: - Test locally: Run
npx hardhat testto catch errors before deployment
Link Contract to Immutable Hub
After deployment, link your contract via Immutable Hub to enable metadata management, analytics, and Minting API support.Minting API Prerequisites
If your contract will use the Minting API for programmatic minting, grant the Minting API the requiredMINTER_ROLE:
Contract Verification
Verify your contract on Immutable Explorer to receive a green checkmark indicating legitimacy.1
Navigate to contract on Explorer
Go to your contract on Immutable Explorer:
- Testnet:
https://explorer.testnet.immutable.com/address/YOUR_CONTRACT_ADDRESS - Mainnet:
https://explorer.immutable.com/address/YOUR_CONTRACT_ADDRESS
2
Click 'Verify & Publish'
Select the verification method (via source code or compiler settings).
3
Submit source code and compiler settings
Provide your contract source code and match the compiler settings from your
hardhat.config.ts.4
Receive verification badge
Once verified, your contract displays a green checkmark and users can read the source code directly on Explorer.
Next Steps
Interact with Contracts
Send transactions and interact with your deployed contracts using Passport
Minting API
Mint NFTs programmatically using Immutable’s Minting API
Manage Metadata
Configure token and collection metadata for your NFTs
Royalties
Understand how royalties work and how to configure them