How to use ModuleKit to deploy modules
The ModuleKit has a helper to easily deploy modules and register them on the Module Registry. This will allow easy discoverability and useage of your module.
Create the .env file
Create a .env
file in the root directory based on the .env.example
(if you are using the module template) file and fill in the variables:
Create the deployment script
To use the RegistryDeployer
, you need to create a new Foundry script and import the following objects:
Write the deployment script
Then, create a new contract, like the following example:
Replace MODULE_CONTRACT
with the contract you want to deploy. In most cases, metadata
and resolverContext
can be left empty.
Run the deployment script
To run the deployment script, you can use the following command:
Note: you might need to adjust the script path and name to match your setup.
Your module is now deployed to the blockchain and verified on Etherscan.
Manually verify the module (optional)
If the verification on the block explorer fails, you can manually verify it on Etherscan using the following command (replace the placeholders with your actual values):