Overview
TheProxyDeployer
handles deployment and verification of the deterministic deployment proxy contract. This proxy is required for CREATE2-based deterministic contract deployments, ensuring that contracts can be deployed at predictable addresses across different test runs.
Why Use ProxyDeployer?
CREATE2 allows contracts to be deployed at deterministic addresses, but it requires a factory contract. The ProxyDeployer manages this factory (proxy) contract, which is deployed at a fixed address across all networks.
Constructor
The local Ethereum node manager instance
Properties
The fixed address at which the proxy is deployed:
0x4e59b44847b379578588920cA78FbF26c0B4956C
Raw transaction data for deploying the proxy
viem public client for interacting with the node
RPC URL of the local node
Methods
isProxyDeployed()
true
if the proxy is deployed, false
otherwise
Example:
ensureProxyDeployed()
getProxyAddress()
0x4e59b44847b379578588920cA78FbF26c0B4956C
)
Example:
How It Works
The ProxyDeployer uses a pre-signed transaction to deploy the deterministic deployment proxy. This ensures that:- The proxy is always deployed at the same address
- No private keys are needed for deployment
- The deployment is deterministic across all networks
Deployment Process
Technical Details
Proxy Contract
The deterministic deployment proxy is a minimal contract that enables CREATE2 deployments. It’s based on this method for deterministic contract deployment.Fixed Address
The proxy is always deployed at0x4e59b44847b379578588920cA78FbF26c0B4956C
across all EVM-compatible chains. This address is derived from:
- A specific deployer address
- A zero nonce
- The proxy’s bytecode
Best Practices
Always ensure the proxy is deployed before attempting CREATE2 deployments. The
SmartContractManager
handles this automatically.Don’t attempt to deploy contracts via CREATE2 without the proxy. It will fail with an error.
See Also
- SmartContractManager - High-level contract management
- LocalNodeManager - Node management for testing
- CREATE2 Opcode - EIP-1014 specification