A repository for blockchain protocols to submit and test their ERC4337 (Account Abstraction) configurations. These configurations are used by DappRadar to correctly parse and decode ERC4337 transactions across different chains.
This repository serves two main purposes:
- Collect ERC4337 configurations from different blockchain protocols
- Provide tools to test and validate these configurations
- Node.js installed
- Access to chain RPC endpoints
- Clone the repository
git clone [email protected]:dappradar/erc4337-configurations.git
- Install dependencies
npm install
- Add your RPC URLs in the format:
RPC_CHAINNAME=your_rpc_url
- Create a new directory in
chain-config/
with your chain name - Add an
erc4337.json
file with your configuration:
{
"configurations": [
{
"entrypoint_address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789",
"entrypoint_function_name": "handleOps",
"entrypoint_function_abi": "function handleOps((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[], address)",
"scw_function_name": "execute",
"scw_function_abi": "function execute(address,uint256,bytes)"
}
]
}
- Add a test file in
test/chains/<chain>.test.json
:
"from" -> User address
"to" -> Smart contract address (with which user interacts)
{
"chainId": "your_chain_name",
"tests": [
{
"txHash": "0x...",
"expected": [
{
"from": "0x...",
"to": "0x..."
},
{
"from": "0x...",
"to": "0x..."
}
]
}
]
}
Test your configuration by decoding an actual ERC4337 transaction from your chain:
npm run decode <chain> <txHash>
Example:
npm run decode ethereum 0x123...abc
After adding test case for your chain - run it:
npm run test <chain>
Example:
npm run test b3
Each test case verifies that the transaction can be decoded correctly and matches the expected from
and to
addresses.
Each configuration should include:
entrypoint_address
: The address of the EntryPoint contractentrypoint_function_name
: The function name (typically "handleOps")entrypoint_function_abi
: The ABI of the entry point functionscw_function_name
: The smart contract wallet function namescw_function_abi
: The ABI of the smart contract wallet function
- Fork the repository
- Create your feature branch (
git checkout -b feature/chain-name
) - Add your configuration in
chain-config/<chain-name>/erc4337.json
- Add test cases in
test/chains/<chain-name>.test.json
- Test your configuration:
- Run manual tests with
npm run decode
- Run automated tests with
npm run test <chain-name>
- Run manual tests with
- Commit your changes (
git commit -m 'Add CHAIN_NAME configuration'
) - Push to the branch (
git push origin feature/chain-name
) - Open a Pull Request
For questions and support, please open an issue in the repository.