Skip to content

Commit

Permalink
Make deterministic deployer configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
plusminushalf committed Dec 20, 2024
1 parent 8b18957 commit 3cf44ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/cli/config/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const bundlerArgsSchema = z.object({
)
return validatedAddresses
}),
"deterministic-deployer-address": addressSchema,
"entrypoint-simulation-contract": z.preprocess(
(v) => (v === "" ? undefined : v),
addressSchema.optional()
Expand Down
7 changes: 7 additions & 0 deletions src/cli/config/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ export const bundlerOptions: CliCommandOptions<IBundlerArgsInput> = {
alias: "e",
require: true
},
"deterministic-deployer-address": {
description: "Address of the deterministic deployer contract",
type: "string",
alias: "d",
require: false,
default: "0x4e59b44847b379578588920ca78fbf26c0b4956c"
},
"entrypoint-simulation-contract": {
description: "Address of the EntryPoint simulations contract",
type: "string",
Expand Down
8 changes: 3 additions & 5 deletions src/cli/deploySimulationsContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import {
import type { CamelCasedProperties } from "./parseArgs"
import type { IOptions } from "@alto/cli"

const DETERMINISTIC_DEPLOYER = "0x4e59b44847b379578588920ca78fbf26c0b4956c"

const isContractDeployed = async ({
publicClient,
address
Expand Down Expand Up @@ -60,7 +58,7 @@ export const deploySimulationsContract = async ({
if (
!(await isContractDeployed({
publicClient,
address: DETERMINISTIC_DEPLOYER
address: args.deterministicDeployerAddress
}))
) {
const deterministicDeployHash = await walletClient.sendRawTransaction({
Expand All @@ -75,7 +73,7 @@ export const deploySimulationsContract = async ({
const contractAddress = getContractAddress({
opcode: "CREATE2",
bytecode: PimlicoEntryPointSimulationsDeployBytecode,
from: DETERMINISTIC_DEPLOYER,
from: args.deterministicDeployerAddress,
salt: "0x3132333400000000000000000000000000000000000000000000000000000000" as Hex
})

Expand All @@ -85,7 +83,7 @@ export const deploySimulationsContract = async ({

const deployHash = await walletClient.sendTransaction({
chain: publicClient.chain,
to: DETERMINISTIC_DEPLOYER,
to: args.deterministicDeployerAddress,
data: ENTRY_POINT_SIMULATIONS_CREATECALL
})

Expand Down

0 comments on commit 3cf44ec

Please sign in to comment.