
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@rhinestone/modulekit
Advanced tools
A development kit for building and testing smart account modules.
A development kit for building and testing smart account modules
ModuleKit allows you to:
In-depth documentation is available at docs.rhinestone.wtf.
The ModuleKit is in active development and is subject to breaking changes. If you spot a bug, please take out an issue and we will fix it as soon as we can.
Use the module-template to create a new repo and install the dependencies:
pnpm install
forge install rhinestonewtf/modulekit
cd lib/modulekit
pnpm install
pnpm install @rhinestone/modulekit --shamefully-hoist
cp node_modules/@rhinestone/modulekit/remappings.txt remappings.txt
The ModuleKit can be used to build, test and deploy smart account modules. The full documentation is available at docs.rhinestone.wtf, but the following aims to provide a quick overview.
Import Module bases from modulekit/Modules.sol
. The core bases include:
ERC7579ValidatorBase
: A base for building validatorsERC7579ExecutorBase
: A base for building executorsERC7579HookBase
: A base for building hooksERC7579HookDestruct
: A base for building hooks with destructured calldata (e.g. onExecute
or onInstallModule
)ERC7579FallbackBase
: A base for building fallbacksWe also provide more advanced bases like:
SchedulingBase
: A base for building schedule-based executorsERC7484RegistryAdapter
: A base for querying the Module RegistryThe ModuleKit provides an integration test suite for testing your modules across different modular accounts. To use the test suite, inherit from RhinestoneModuleKit
and create an account instance using makeAccountInstance(accountName)
. To learn more about using this instance, visit the documentation for our integration test suite.
You can then run the tests using the following commands:
forge test
Using a different account type (one of SAFE
and KERNEL
):
ACCOUNT_TYPE=SAFE forge test
To validate the ERC-4337 rules:
SIMULATE=true forge test
To calculate gas consumption of modules using instance.log4337Gas("identifier")
:
GAS=true forge test
To deploy modules using the Module Registry, you can use the RegistryDeployer
in a foundry script. You can then deploy your module using the following command:
address module = deployModule({
code: bytecode,
deployParams: deployParams,
salt: bytes32(0),
data: additionalData
});
For module examples, check out our core modules or our experimental modules and for module inspiration see our module idea list. For general examples, check out the awesome modular accounts repo.
To install dependencies, run:
pnpm install
To build the project, run:
pnpm build
To run tests, run:
pnpm test
To run the linter, run:
pnpm lint:sol
For feature or change requests, feel free to open a PR, start a discussion or get in touch with us.
FAQs
A development kit for building and testing smart account modules.
The npm package @rhinestone/modulekit receives a total of 347 weekly downloads. As such, @rhinestone/modulekit popularity was classified as not popular.
We found that @rhinestone/modulekit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.