A template for building smart account modules using the ModuleKit
pnpm install
pnpm update rhinestonewtf/modulekit
- Create a new file in
src
and inherit from the appropriate interface (see templates) - After you finished writing your module, run the following command:
forge build
- Create a new
.t.sol
file intest
and inherit from the correct testing kit (see templates) - After you finished writing your tests, run the following command:
forge test
- Import your modules into the
script/DeployModule.s.sol
file. - Create a
.env
file in the root directory based on the.env.example
file and fill in the variables. - Run the following command:
source .env && forge script script/DeployModule.s.sol:DeployModuleScript --rpc-url $DEPLOYMENT_RPC --broadcast --sender $DEPLOYMENT_SENDER --verify
Your module is now deployed to the blockchain and verified on Etherscan.
If the verification fails, you can manually verify it on Etherscan using the following command:
source .env && forge verify-contract --chain-id [YOUR_CHAIN_ID] --watch --etherscan-api-key $ETHERSCAN_API_KEY [YOUR_MODULE_ADDRESS] src/[PATH_TO_MODULE].sol:[MODULE_CONTRACT_NAME]
For general explainers and guided walkthroughs of building a module, check out our documentation.