Skip to content

Commit

Permalink
fix: add buffer to create rollup retryable (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
spsjvc authored Oct 17, 2024
1 parent 87cafa9 commit ecfec5a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/createRollupGetRetryablesFees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,17 @@ export async function createRollupGetRetryablesFees<TChain extends Chain | undef
gas: gasWithBuffer,
});

return decodeFunctionResult({
const decodedResult = decodeFunctionResult({
abi: deployHelperABI,
functionName: 'getDeploymentTotalCost',
data: result!,
});

return isCustomGasToken
? // for custom gas token chains, retryable fees don't scale with parent base fee, so there's no need for any buffer
decodedResult
: // for eth chains, add 3% buffer
applyPercentIncrease({ base: decodedResult, percentIncrease: 3n });
}

export async function createRollupGetRetryablesFeesWithDefaults<TChain extends Chain | undefined>(
Expand Down

0 comments on commit ecfec5a

Please sign in to comment.