From 2292e8be80fdea0a3ec636b2148e7aa8a6e0214f Mon Sep 17 00:00:00 2001 From: jsy1218 <91580504+jsy1218@users.noreply.github.com> Date: Wed, 13 Mar 2024 18:44:59 -0700 Subject: [PATCH] fix: op gas oracles (#513) * fix op gas oracles * fix to not use destructure * remove array * fix bignumbrt --- src/providers/v3/gas-data-provider.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/providers/v3/gas-data-provider.ts b/src/providers/v3/gas-data-provider.ts index c076ca0b7..8ef60e1cd 100644 --- a/src/providers/v3/gas-data-provider.ts +++ b/src/providers/v3/gas-data-provider.ts @@ -54,7 +54,7 @@ export class OptimismGasDataProvider providerConfig?: ProviderConfig ): Promise { // TODO: Also get the gasPrice from GasPriceOracle.sol - const funcNames = ['l1BaseFee', 'scalar', 'decimals', 'overhead']; + const funcNames = ['l1BaseFee', 'decimals']; const tx = await this.multicall2Provider.callMultipleFunctionsOnSameContract< undefined, @@ -68,9 +68,7 @@ export class OptimismGasDataProvider if ( !tx.results[0]?.success || - !tx.results[1]?.success || - !tx.results[2]?.success || - !tx.results[3]?.success + !tx.results[1]?.success ) { log.info( { results: tx.results }, @@ -81,16 +79,17 @@ export class OptimismGasDataProvider ); } + // TODO: replace the hardcoded scalar and overhead with op gas estimate sdk const { result: l1BaseFee } = tx.results![0]; - const { result: scalar } = tx.results![1]; - const { result: decimals } = tx.results![2]; - const { result: overhead } = tx.results![3]; + const scalar = BigNumber.from(1) + const { result: decimals } = tx.results![1]; + const overhead = BigNumber.from(0); return { l1BaseFee: l1BaseFee[0], - scalar: scalar[0], + scalar: scalar, decimals: decimals[0], - overhead: overhead[0], + overhead: overhead, }; } }