Skip to content

Conversation

@hexshire
Copy link
Contributor

Description

Based on top of #17412

Enables OP Stack chains to use an asset other than ETH as their native fee currency by introducing a minimal, flexible, and standardizable Custom Gas Token (CGT) architecture. To do so, it introduces new predeploys (NativeAssetLiquidity and LiquidityController) that decouple native asset management from core bridging operations while using a single isCustomGasToken() flag that disables ETH transfer flows in all bridging methods. The two new pre-deploys manage the native asset supply.

Tests

Core contracts:

  • OptimismPortal and L1Block: Tests for isCustomGasToken() flag blocking ETH deposits/withdrawals
  • NativeAssetLiquidity: Tests deposit/withdraw access control and functionality
  • LiquidityController: Tests minter authorization, mint/burn operations, and metadata functions

Metadata


Contributors

hexshire and others added 30 commits September 13, 2025 15:07
Signed-off-by: Hex <[email protected]>
Co-authored-by: niha <[email protected]>
Co-authored-by: Ashitaka <[email protected]>
Co-authored-by: AgusDuha <[email protected]>
* feat: add L1BlockCGT

* feat: add L2ToL1MessagePasserCGT

* chore: remove test exclution in test validation
* test(cgt): fix failing tests

* test(cgt): fix portal version

* test(cgt): skip tests on forked mode

* fix: predeploys test cgt mismatch

* test(cgt): minor fixes

---------

Co-authored-by: niha <[email protected]>
Updates the implementation to use the new feature flagging system
Use the legacy config name so that less needs to change for legacy CGT
chains
Remove leftover merge conflict
Add a specific test for CGT in the intent
Keeps it simple because development on Jovian is happening and we will
inherit any Jovian modifications automatically
@tynes
Copy link
Contributor

tynes commented Nov 18, 2025

/ci authorize f621b77

@agusduha agusduha mentioned this pull request Nov 19, 2025
@agusduha
Copy link
Contributor

/ci authorize 43c0c81

@mds1 mds1 enabled auto-merge November 21, 2025 21:05
@tynes tynes requested a review from Copilot November 24, 2025 02:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a Custom Gas Token (CGT) architecture that enables OP Stack chains to use an asset other than ETH as their native fee currency. The implementation introduces two new predeploys (NativeAssetLiquidity and LiquidityController) and uses an isCustomGasToken() flag to disable ETH transfer flows in bridging operations.

Key changes:

  • Added NativeAssetLiquidity and LiquidityController predeploy contracts to manage native asset supply
  • Introduced CUSTOM_GAS_TOKEN feature flag in SystemConfig and L1Block contracts
  • Modified OptimismPortal2, L2StandardBridge, and L2ToL1MessagePasser to reject ETH transfers when CGT is enabled
  • Extended test infrastructure to support CGT mode and added comprehensive test coverage

Reviewed changes

Copilot reviewed 109 out of 109 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/L2/NativeAssetLiquidity.sol New predeploy for managing native asset liquidity
src/L2/LiquidityController.sol New predeploy for controlling liquidity minting/burning operations
src/L2/L1BlockCGT.sol CGT-specific variant of L1Block with custom gas token support
src/L2/L2ToL1MessagePasserCGT.sol CGT-specific variant blocking value transfers in CGT mode
src/L1/OptimismPortal2.sol Added CGT checks to prevent ETH deposits/withdrawals
src/L1/SystemConfig.sol Added isCustomGasToken() helper method
src/libraries/Features.sol Added CUSTOM_GAS_TOKEN feature constant
src/libraries/Predeploys.sol Added new predeploy addresses and support checks
scripts/L2Genesis.s.sol Added CGT initialization logic
op-deployer/pkg/deployer/state/chain_intent.go Added CGT configuration types and validation
op-chain-ops/genesis/config.go Updated gas token configuration structure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tynes
Copy link
Contributor

tynes commented Nov 24, 2025

Looks like we need review from @ethereum-optimism/op-stack before we can merge

@0xMario27
Copy link

0xMario27 commented Nov 24, 2025

Looks like we need review from @ethereum-optimism/op-stack before we can merge

Really looking forward to this feature.

@mds1 mds1 added this pull request to the merge queue Nov 24, 2025
Merged via the queue into ethereum-optimism:develop with commit 87d406d Nov 24, 2025
77 checks passed
@0xMario27
Copy link

Is it still not possible to test on Sepolia now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants