- Why: ERC-4337(aka: Account abstraction) introduces new core components to make managing crypto simple. It has potential, but it can be difficult for developers and users to use all its core components. We have a solution that simplifies interacting with those core components.
- What: SmartHub is a snap that makes it easy for developers and MetaMask wallet users to use ERC-4337 without dealing with its complexity.
- How: The snap adds extra features to MetaMask by including RPC methods that work with ERC-4337 core components.
⚠️ This repository is currently under active development, and contracts/snap is not audited.
- In dapp transaction flow. You don't need to confirm transactions/user operations in the browser extension window. Enjoy a web2-like experience with full in-dapp confirm/reject transaction flow.
- Access and control smart accounts with MetaMask. Enjoy smart contract functionality with ease and convenience.
- Manage ERC-4337 accounts deposit/withdraw and with supported entrypoint contract(paymaster support coming soon).
- No lock-in; bring your own bundler; use the settings tab to choose which bundler URL to send user operations to.
- Sign/send regular Ethereum transactions with the owner EOA of the smart account.
- Get wallet notifications when transactions/user operations and confirmed onchain.
To interact with the Snaps, you must install MetaMask Flask, a canary distribution for developers that provides access to upcoming features.
- MetaMask Flask
- Docker
- yarn
- npm
The snap requires a connection to ERC4337 Bundler. We will use Transeptor Bundler running alongside a geth client to set up the local ERC-4337 environment. Follow the steps below to set up the local environment:
- Create a
.envfile and copy values in.env.sampleto a the.envfile. - Add
GATSBY_SNAP_ORIGIN=local:http://localhost:8080to the./packages/site/.env.developmentfile. git submodule update --init- Run
make bundlerto start the bundler.
The Bundler will start running on http://localhost:3000/rpc. You will
need to have Metamask Flask installed and listening to
localhost:8545 network.
Make sure you follow the steps in Set up before starting the snap
nvm useyarn set version 3.2.1yarn installSet SNAP_ORIGIN=prod:http://localhost:8080 in local .env file
yarn startSite will be running on http://localhost:8000
Run yarn test to run the tests once.
Run yarn lint to run the linter, or run yarn lint:fix to run the linter and fix any automatically fixable issues.
Invalid nonceerrors: if you are seeing this error on thenpx hardhat nodeconsole, try resetting your Metamask account. This will reset the account's transaction history and also the nonce. Open Metamask, click on your account followed bySettings > Advanced > Clear activity tab data.
We welcome contributions to enhance our SmartHub Snap. If you would like to contribute, please follow these guidelines here.