From e770df767c7f952c2fcd71f3d47c08a1643dc16c Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Wed, 20 Nov 2024 04:12:17 +0000 Subject: [PATCH] init --- src/modes/interOrderbook.ts | 4 ++-- src/modes/intraOrderbook.ts | 4 ++-- src/modes/routeProcessor.ts | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/modes/interOrderbook.ts b/src/modes/interOrderbook.ts index b5be7a2b..8dcff154 100644 --- a/src/modes/interOrderbook.ts +++ b/src/modes/interOrderbook.ts @@ -118,7 +118,7 @@ export async function dryrun({ } catch { /**/ } - gasLimit = ethers.BigNumber.from(await signer.estimateGas(rawtx)) + gasLimit = ethers.BigNumber.from(await signer.estimateGas({ ...rawtx, type: "legacy" })) .mul(config.gasLimitMultiplier) .div(100); } catch (e) { @@ -162,7 +162,7 @@ export async function dryrun({ try { blockNumber = Number(await viemClient.getBlockNumber()); spanAttributes["blockNumber"] = blockNumber; - gasLimit = ethers.BigNumber.from(await signer.estimateGas(rawtx)) + gasLimit = ethers.BigNumber.from(await signer.estimateGas({ ...rawtx, type: "legacy" })) .mul(config.gasLimitMultiplier) .div(100); rawtx.gas = gasLimit.toBigInt(); diff --git a/src/modes/intraOrderbook.ts b/src/modes/intraOrderbook.ts index 7cb2c52f..3750daa3 100644 --- a/src/modes/intraOrderbook.ts +++ b/src/modes/intraOrderbook.ts @@ -115,7 +115,7 @@ export async function dryrun({ } catch { /**/ } - gasLimit = ethers.BigNumber.from(await signer.estimateGas(rawtx)) + gasLimit = ethers.BigNumber.from(await signer.estimateGas({ ...rawtx, type: "legacy" })) .mul(config.gasLimitMultiplier) .div(100); } catch (e) { @@ -169,7 +169,7 @@ export async function dryrun({ try { blockNumber = Number(await viemClient.getBlockNumber()); spanAttributes["blockNumber"] = blockNumber; - gasLimit = ethers.BigNumber.from(await signer.estimateGas(rawtx)) + gasLimit = ethers.BigNumber.from(await signer.estimateGas({ ...rawtx, type: "legacy" })) .mul(config.gasLimitMultiplier) .div(100); rawtx.gas = gasLimit.toBigInt(); diff --git a/src/modes/routeProcessor.ts b/src/modes/routeProcessor.ts index 452bbda3..9960cef3 100644 --- a/src/modes/routeProcessor.ts +++ b/src/modes/routeProcessor.ts @@ -183,7 +183,7 @@ export async function dryrun({ } catch { /**/ } - gasLimit = ethers.BigNumber.from(await signer.estimateGas(rawtx)) + gasLimit = ethers.BigNumber.from(await signer.estimateGas({ ...rawtx, type: "legacy" })) .mul(config.gasLimitMultiplier) .div(100); } catch (e) { @@ -229,7 +229,9 @@ export async function dryrun({ try { blockNumber = Number(await viemClient.getBlockNumber()); spanAttributes["blockNumber"] = blockNumber; - gasLimit = ethers.BigNumber.from(await signer.estimateGas(rawtx)) + gasLimit = ethers.BigNumber.from( + await signer.estimateGas({ ...rawtx, type: "legacy" }), + ) .mul(config.gasLimitMultiplier) .div(100); rawtx.gas = gasLimit.toBigInt();