Constants
A useful collection of reference values related to the ERC-4337 protocol.
While building out your applications, you may require a reference to certain static values that don't change. For example, the EntryPoint contract or various account factories. The Constants
module provides a quick way to access these values.
View the source code on GitHub.
import { Constants } from "userop";
ERC4337
ERC4337
A collection of values related to the core ERC-4337 protocol.
EntryPoint
EntryPoint
The address to the canonical EntryPoint contract.
Constants.ERC4337.EntryPoint
SimpleAccount
factory
SimpleAccount
factoryThe address to the factory contract used to deploy the sample SimpleAccount.sol
.
Constants.ERC4337.SimpleAccount.Factory
Kernel
Kernel
A collection of values related to the ZeroDev Kernel contract account framework.
Factory
The address to the factory used to deploy a Kernel
account. This is the factory to use if you need to deploy a Kernel
account with a custom default validator.
Constants.Kernel.factory
ECDSA factory
The address to the factory used to deploy a Kernel
account with an ECDSA validator as the default. This is equivalent to creating an account with the base factory using the ECDSA validator address.
Constants.Kernel.ECDSAFactory
ECDSA validator
The address to the ECDSA validator contract. This is a plugin that allows User Operations sent to a Kernel
account to be validated with an ECDSA key pair.
Constants.Kernel.ECDSAValidator
Modes
A Kernel
account can be executed under different modes. These are constant values which can be concatenated to the start of the UserOperation signature
field.
Constants.Kernel.Modes.Sudo
Constants.Kernel.Modes.Plugin
Constants.Kernel.Modes.Enable
Safe
Safe
A collection of values related to the Safe contract ecosystem.
MultiSend
The address to the MultiSend.sol
contract which allows batching of multiple transactions. The addresses here are equivalent to v1.3.0 of the safe deployments.
// Addresses are not the same for all networks and requires a lookup by the chainID string.
Constants.Safe.MultiSend[chainID]
Updated about 1 year ago