Overview

The ProxyDeployer 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

new ProxyDeployer(node: LocalNodeManager)
Creates a new ProxyDeployer instance.
node
LocalNodeManager
required
The local Ethereum node manager instance

Properties

PROXY_ADDRESS
Address
The fixed address at which the proxy is deployed: 0x4e59b44847b379578588920cA78FbF26c0B4956C
PROXY_DEPLOYMENT_TX
string
Raw transaction data for deploying the proxy
publicClient
PublicClient
viem public client for interacting with the node
rpcUrl
string
RPC URL of the local node

Methods

isProxyDeployed()

async isProxyDeployed(): Promise<boolean>
Checks if the deterministic deployment proxy is already deployed. Returns: true if the proxy is deployed, false otherwise Example:
const isDeployed = await proxyDeployer.isProxyDeployed();
if (!isDeployed) {
  console.log('Proxy needs to be deployed');
}

ensureProxyDeployed()

async ensureProxyDeployed(): Promise<void>
Deploys the proxy if not already present. This method is idempotent - it’s safe to call multiple times. Example:
await proxyDeployer.ensureProxyDeployed();
// Proxy is now guaranteed to be deployed

getProxyAddress()

getProxyAddress(): Address
Returns the address of the deterministic deployment proxy. Returns: The proxy address (0x4e59b44847b379578588920cA78FbF26c0B4956C) Example:
const proxyAddress = proxyDeployer.getProxyAddress();
console.log(`Proxy deployed at: ${proxyAddress}`);

How It Works

The ProxyDeployer uses a pre-signed transaction to deploy the deterministic deployment proxy. This ensures that:
  1. The proxy is always deployed at the same address
  2. No private keys are needed for deployment
  3. 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 at 0x4e59b44847b379578588920cA78FbF26c0B4956C 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