Open
Conversation
ae1371c to
ccea4fa
Compare
de0943f to
69daaa0
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 69daaa0. Configure here.
69daaa0 to
e977458
Compare
Mantle uses MNT as its native gas token, but the OP Stack oracle's getL1Fee returns values denominated in ETH. Add MantleLayer1GasFeeFlow that multiplies the L1 fee by tokenRatio (ETH/MNT exchange rate from the oracle contract) before adding the operator fee. - New MantleLayer1GasFeeFlow extending OracleLayer1GasFeeFlow - Registered first in #getLayer1GasFeeFlows() to match before Optimism - Added MANTLE chain ID (0x1388) to constants - 8 unit tests covering conversion, operator fee, error handling
…ss logic Add protected transformOracleFee hook to OracleLayer1GasFeeFlow so subclasses can transform the oracle fee without reimplementing the entire getLayer1Fee method. Simplify MantleLayer1GasFeeFlow to only override transformOracleFee (tokenRatio multiplication) and matchesTransaction.
…stnet Add Mantle Sepolia (chain ID 0x138b) to MantleLayer1GasFeeFlow so the tokenRatio conversion applies to testnet transactions as well.
a3e0431 to
197e1b7
Compare
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Explanation
Add Mantle Sepolia testnet (chain ID
0x138b/ 5003) support toMantleLayer1GasFeeFlowfor accurate MNT-denominated L1 gas fee estimates on the testnet.The Sepolia oracle lives at the same OP Stack predeploy address (
0x420...000F) and exposes the same ABI (getL1Fee,tokenRatio,getOperatorFee). The testnet chain ID is added to theMANTLE_CHAIN_IDSarray so the flow matches both mainnet and Sepolia.Verified on-chain:
getL1Fee(bytes)works on SepoliatokenRatio()returns ~3328 on SepoliagetOperatorFee(uint256)works on Sepolia (Arsia upgrade is deployed on testnet)Changes
constants.tsMANTLE_SEPOLIA: '0x138b'MantleLayer1GasFeeFlow.tsCHAIN_IDS.MANTLE_SEPOLIAtoMANTLE_CHAIN_IDSarrayMantleLayer1GasFeeFlow.test.tsCHANGELOG.mdReferences
https://rpc.sepolia.mantle.xyzChecklist
Note
Medium Risk
Touches layer-1 fee estimation plumbing by adding a new transformation hook in
OracleLayer1GasFeeFlowand wiring a new Mantle-specific flow intoTransactionController, which could affect fee calculations if assumptions about oracle values or chain matching are wrong.Overview
Adds Mantle (mainnet + Sepolia) support for OP-Stack-style L1 fee estimation by introducing
MantleLayer1GasFeeFlow, which converts oraclegetL1Feeresults into MNT using the on-chaintokenRatiobefore combining with any operator fee.Updates the core
OracleLayer1GasFeeFlowto call an overridabletransformOracleFeestep prior to adding operator fees, registers the Mantle flow inTransactionController’s layer-1 fee flows, and extendsCHAIN_IDSwithMANTLE/MANTLE_SEPOLIAplus new unit tests and a changelog entry.Reviewed by Cursor Bugbot for commit 197e1b7. Bugbot is set up for automated code reviews on this repo. Configure here.