Skip to content

Commit

Permalink
fixup! Add L1 fee estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
peachbits committed Jan 11, 2024
1 parent 8f3054b commit c4ddf98
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ethers.PopulatedTransaction>

export const makeTarotPoolAdapter = (policyConfig: StakePolicyConfig<TarotPoolAdapterConfig>): StakePolicyAdapter => {
Expand Down Expand Up @@ -101,6 +89,17 @@ export const makeTarotPoolAdapter = (policyConfig: StakePolicyConfig<TarotPoolAd
const provider = new ethers.providers.FallbackProvider(rpcProviderUrls.map(url => 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<void> {
try {
const oracleContract = OptimismFeeOracle__factory.connect(l1RollupParams.proxyContract, provider)
Expand Down

0 comments on commit c4ddf98

Please sign in to comment.