Set up local contract development
Create project
This section uses Hardhat for managing the smart contract development environment. Follow the steps in their tutorial in order to:
- set up your local environment
- create a new Hardhat project
When running npx hardhat init
, you may be presented with the options:
- Create a TypeScript project
- Create a TypeScript project (with Viem)
In order for the tutorials in this section to work, select Create a TypeScript project
(not viem).
Run this command to install additionally required libraries:
npm install @nomicfoundation/hardhat-toolbox dotenv
Alternatives to using Hardhat
Foundry is another popular alternative that can be used to set up your own smart contract development environment.
Add contracts
Immutable zkEVM is fully EVM compatible, which means it can support all Solidity contracts. Additionally, we provide a contracts library which contains a set of recommended smart contract presets.
contracts
Once you have successfully created a Hardhat project, you can add one of our recommended smart contract presets by installing the library as a package inside your smart contract project.
Run this command to install the contracts library:
npm install @imtbl/contracts
You can see a full list of recommended presets here.
Immutable zkEVM collection requirements
All collections deployed on Immutable's zkEVM must utilise the operator allowlist to protect content creator (eg: you, the game studio's) royalty fees and Immutable's 2% protocol fees.
This can be achieved through embedding the following into your smart contract collection designs:
Recommended Approach: For seamless implementation use or inherit Immutable's preset contracts tailored for gas-efficient creation of Web3 gaming assets on the zkEVM network. Immutable offers the following 2 preset contracts:
- Recommended Preset for Web3 Games: ImmutableERC721.sol - Multiple batch minting functions for optimised gas efficiency. Required for use of Minting API (upcoming feature)
- Alternative Presets:
Minimally Required Standard: If the above options are not compatible with your game design, it is mandatory for your collection to inherit the OperatorAllowlistEnforced.sol contract, allowing your collection to interact with the
OperatorAllowlist
.OperatorAllowlistEnforced
includes the functions to identify compliant smart contracts for approvals and transfers, ensuring the preservation of content creators’ royalty fees and protocol fees in third-party marketplace transactions.- If your game design restricts your collections from importing Immutable's preset contracts, please note that your request for inclusion on the Mainnet's deployer allowlist may undergo additional processing time. Immutable will conduct thorough verification to ensure that your collections comply with our mandated standards, safeguarding content creators on the network. Thank you for your understanding and cooperation in ensuring Immutable's zkEVM network remains secure for our web3 gaming community.
The use of the preset contracts accelerates integration with Immutable's ecosystem. If your studio has developed custom ERC721 or ERC1155 collections, ensure they adhere to their respective standards in addition to inheriting the OperatorAllowlistEnforced.sol contract, to safeguard compatibility with Immutable's ecosystem.