@@ -29,16 +29,7 @@ async function main() {
2929 const chainConfig = await getChainConfig ( Number ( chainId ) ) ;
3030 const output : DeploymentAddresses = loadOutput ( ) ;
3131
32- let gasOverrides : any = chainConfig . gasParams ;
33-
34- // For chains that need auto gas estimation, remove gasLimit
35- if ( chainConfig . skipGasEstimation ) {
36- const { gasLimit, ...gasOverridesWithoutLimit } = gasOverrides ;
37- gasOverrides = gasOverridesWithoutLimit ;
38- console . log (
39- 'ℹ️ Chain configured for auto gas estimation (no gasLimit override)'
40- ) ;
41- }
32+ const gasOverrides = chainConfig . gasParams ;
4233
4334 // Handle BigBlocks setup automatically if supported
4435 if ( isBigBlocksSupported ( Number ( chainId ) ) ) {
@@ -56,33 +47,22 @@ async function main() {
5647 // Estimate gas costs for all potential deployments
5748 let totalEstimatedCost = 0n ;
5849
59- // For chains with very high gas limits (like Mantle) or chains that skip gas estimation
60- const useConfiguredGasLimit =
61- gasOverrides . gasLimit && gasOverrides . gasLimit > 10_000_000_000 ;
50+ // For chains with very high gas limits (like Mantle), skip estimation and use configured limit
51+ const useConfiguredGasLimit = gasOverrides . gasLimit > 10_000_000_000 ; // > 10 billion
6252
6353 if ( useConfiguredGasLimit ) {
6454 console . log (
6555 `⚠️ Using configured gas limit (${ gasOverrides . gasLimit } ) instead of estimation for this chain`
6656 ) ;
67- } else if ( chainConfig . skipGasEstimation ) {
68- console . log (
69- 'ℹ️ Skipping gas estimation, will use auto-estimation during deployment'
70- ) ;
7157 }
7258
7359 // Only estimate if we need to deploy (not already deployed)
7460 if (
7561 ! output . walletImplementation ||
7662 ! ( await isContractDeployed ( output . walletImplementation ) )
7763 ) {
78- if ( useConfiguredGasLimit && gasOverrides . gasLimit ) {
64+ if ( useConfiguredGasLimit ) {
7965 totalEstimatedCost += BigInt ( gasOverrides . gasLimit ) ;
80- } else if (
81- chainConfig . skipGasEstimation &&
82- chainConfig . defaultGasEstimate
83- ) {
84- // Skip estimation - use configured default for cost check
85- totalEstimatedCost += BigInt ( chainConfig . defaultGasEstimate ) ;
8666 } else {
8767 const WalletSimple = await ethers . getContractFactory (
8868 chainConfig . walletImplementationContractName
@@ -99,13 +79,8 @@ async function main() {
9979 ! output . walletFactory ||
10080 ! ( await isContractDeployed ( output . walletFactory ) )
10181 ) {
102- if ( useConfiguredGasLimit && gasOverrides . gasLimit ) {
82+ if ( useConfiguredGasLimit ) {
10383 totalEstimatedCost += BigInt ( gasOverrides . gasLimit ) ;
104- } else if (
105- chainConfig . skipGasEstimation &&
106- chainConfig . defaultGasEstimate
107- ) {
108- totalEstimatedCost += BigInt ( chainConfig . defaultGasEstimate ) ;
10984 } else {
11085 const WalletFactory = await ethers . getContractFactory (
11186 chainConfig . walletFactoryContractName
@@ -125,13 +100,8 @@ async function main() {
125100 ! output . forwarderImplementation ||
126101 ! ( await isContractDeployed ( output . forwarderImplementation ) )
127102 ) {
128- if ( useConfiguredGasLimit && gasOverrides . gasLimit ) {
103+ if ( useConfiguredGasLimit ) {
129104 totalEstimatedCost += BigInt ( gasOverrides . gasLimit ) ;
130- } else if (
131- chainConfig . skipGasEstimation &&
132- chainConfig . defaultGasEstimate
133- ) {
134- totalEstimatedCost += BigInt ( chainConfig . defaultGasEstimate ) ;
135105 } else {
136106 const ForwarderV4 = await ethers . getContractFactory (
137107 chainConfig . forwarderContractName
@@ -148,13 +118,8 @@ async function main() {
148118 ! output . forwarderFactory ||
149119 ! ( await isContractDeployed ( output . forwarderFactory ) )
150120 ) {
151- if ( useConfiguredGasLimit && gasOverrides . gasLimit ) {
121+ if ( useConfiguredGasLimit ) {
152122 totalEstimatedCost += BigInt ( gasOverrides . gasLimit ) ;
153- } else if (
154- chainConfig . skipGasEstimation &&
155- chainConfig . defaultGasEstimate
156- ) {
157- totalEstimatedCost += BigInt ( chainConfig . defaultGasEstimate ) ;
158123 } else {
159124 const ForwarderFactory = await ethers . getContractFactory (
160125 chainConfig . forwarderFactoryContractName
0 commit comments