Skip to content

Commit

Permalink
fix: op gas oracles (Uniswap#513)
Browse files Browse the repository at this point in the history
* fix op gas oracles

* fix to not use destructure

* remove array

* fix bignumbrt
  • Loading branch information
jsy1218 authored Mar 14, 2024
1 parent e753a80 commit 2292e8b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/providers/v3/gas-data-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class OptimismGasDataProvider
providerConfig?: ProviderConfig
): Promise<OptimismGasData> {
// 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,
Expand All @@ -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 },
Expand All @@ -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,
};
}
}
Expand Down

0 comments on commit 2292e8b

Please sign in to comment.