From c4ddf9820c88e17de360d45d28a98ff4035a22ee Mon Sep 17 00:00:00 2001 From: peachbits Date: Wed, 10 Jan 2024 18:25:38 -0800 Subject: [PATCH] fixup! Add L1 fee estimation --- .../policyAdapters/TarotPoolAdaptor.ts | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/plugins/stake-plugins/generic/policyAdapters/TarotPoolAdaptor.ts b/src/plugins/stake-plugins/generic/policyAdapters/TarotPoolAdaptor.ts index 277ce4f5cda..50762019544 100644 --- a/src/plugins/stake-plugins/generic/policyAdapters/TarotPoolAdaptor.ts +++ b/src/plugins/stake-plugins/generic/policyAdapters/TarotPoolAdaptor.ts @@ -54,18 +54,6 @@ const SLIPPAGE = 0.02 // 2% const SLIPPAGE_FACTOR = 1 + SLIPPAGE // A multiplier to get a minimum amount const DEADLINE_OFFSET = 60 * 60 * 12 // 12 hours -// ported from edge-currency-accountbased: -let l1RollupParams = { - gasPriceL1Wei: '1000000000', - gasPricel1BaseFeeMethod: '0x519b4bd3', - maxGasPriceL1Multiplier: '1.25', - fixedOverhead: '2100', - dynamicOverhead: '1000000', - oracleContractAddress: '0x420000000000000000000000000000000000000F', - dynamicOverheadMethod: '0xf45e65d800000000000000000000000000000000000000000000000000000000', - proxyContract: '0xc0d3C0d3C0d3c0D3C0D3C0d3C0d3C0D3C0D3000f' -} - type ChainableTransaction = (previousTx?: ethers.providers.TransactionResponse) => Promise export const makeTarotPoolAdapter = (policyConfig: StakePolicyConfig): StakePolicyAdapter => { @@ -101,6 +89,17 @@ export const makeTarotPoolAdapter = (policyConfig: StakePolicyConfig new ethers.providers.JsonRpcProvider(url))) // L1 fee utils ported from edge-currency-accountbased: + + let l1RollupParams = { + gasPriceL1Wei: '1000000000', + gasPricel1BaseFeeMethod: '0x519b4bd3', + maxGasPriceL1Multiplier: '1.25', + fixedOverhead: '2100', + dynamicOverhead: '1000000', + oracleContractAddress: '0x420000000000000000000000000000000000000F', + dynamicOverheadMethod: '0xf45e65d800000000000000000000000000000000000000000000000000000000', + proxyContract: '0xc0d3C0d3C0d3c0D3C0D3C0d3C0d3C0D3C0D3000f' + } async function updateL1RollupParams(): Promise { try { const oracleContract = OptimismFeeOracle__factory.connect(l1RollupParams.proxyContract, provider)