Draft
Conversation
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
…stnet Add Mantle Sepolia (chain ID 0x138b) to MantleLayer1GasFeeFlow so the tokenRatio conversion applies to testnet transactions as well.
ae1371c to
ccea4fa
Compare
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
The existing
MantleLayer1GasFeeFlow(added in #8376) handles Mantle mainnet's custom L1 gas fee calculation, which multiplies the oracle's ETH-denominatedgetL1FeebytokenRatio()to convert to MNT. This PR extends that same flow to also support Mantle Sepolia testnet (chain ID0x138b/ 5003).The Sepolia oracle lives at the same OP Stack predeploy address (
0x420...000F) and exposes the same ABI (getL1Fee,tokenRatio,getOperatorFee). No new logic is needed -- the testnet chain ID is simply added to the existingMANTLE_CHAIN_IDSarray so the flow matches both networks.On-chain verification confirms:
getL1Fee(bytes)works on both mainnet and SepoliatokenRatio()works on both (mainnet: 3232, Sepolia: 3234)getOperatorFee(uint256)reverts on mainnet (handled gracefully, defaults to 0) and works on SepoliaChanges
constants.tsMANTLE_SEPOLIA: '0x138b'MantleLayer1GasFeeFlow.tsCHAIN_IDS.MANTLE_SEPOLIAtoMANTLE_CHAIN_IDSarrayMantleLayer1GasFeeFlow.test.tsCHANGELOG.mdReferences
https://rpc.sepolia.mantle.xyzChecklist