Skip to content

Commit

Permalink
Added signer in estimateDeploymentTransaction
Browse files Browse the repository at this point in the history
- Same signer is used as deployer in every chain, that also includes zkSync based networks
  • Loading branch information
federava authored and Uxio0 committed Sep 29, 2023
1 parent 86c8cad commit ccb8b54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { promises as filesystem } from 'fs'
import { CompilerOutputContract } from 'solc'
import { arrayFromHexString, compileContracts } from './utils';

const signer = "0xE1CB04A0fA36DdD16a06ea828007E35e1a3cBC37";

export interface DeploymentEstimation {
chainId: number
gasLimit: ethers.BigNumber
Expand Down Expand Up @@ -61,7 +63,7 @@ export async function estimateDeploymentTransaction(rpcUrl: string): Promise<Dep
const compilerOutput = await compileContracts()
const contract = compilerOutput.contracts['deterministic-deployment-proxy.yul']['Proxy']
const data = "0x" + contract.evm.bytecode.object
const gasLimit = await provider.estimateGas({ data })
const gasLimit = await provider.estimateGas({ data, from: signer })
console.log({estimate: gasLimit.toString() })
const gasPrice = await provider.getGasPrice()
console.log({gasPriceGwei: ethers.utils.formatUnits(gasPrice, "gwei"), gasPrice: gasPrice.toString() })
Expand Down

0 comments on commit ccb8b54

Please sign in to comment.