From 411646077c7f252625170350d6aff3d8b8a56792 Mon Sep 17 00:00:00 2001 From: petarTxFusion Date: Mon, 7 Oct 2024 18:11:30 +0200 Subject: [PATCH] fix(provider): `estimateDefaultBridgeDepositL2Gas` use `ETH_ADDRESS_IN_CONTRACTS` for base token --- src/provider.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/provider.ts b/src/provider.ts index 7c765fd..48e3b5f 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -1134,6 +1134,9 @@ export function JsonRpcApiProvider< // due to storage slot aggregation, the gas estimation will depend on the address // and so estimation for the zero address may be smaller than for the sender. from ??= ethers.Wallet.createRandom().address; + token = isAddressEq(token, LEGACY_ETH_ADDRESS) + ? ETH_ADDRESS_IN_CONTRACTS + : token; if (await this.isBaseToken(token)) { return await this.estimateL1ToL2Execute({ contractAddress: to,