Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ca94ce2
chore(cgt): remove current spec
hexshire Jul 24, 2025
6473b98
feat(cgt): related specs
hexshire Aug 19, 2025
4ea7fd6
Merge branch 'main' into chore/custom-gas-token-sync-main
hexshire Aug 19, 2025
f1c9e12
Merge pull request #50 from defi-wonderland/chore/custom-gas-token-sy…
hexshire Aug 19, 2025
ba023c5
fix: run linter
hexshire Aug 19, 2025
4f0bf69
fix: run linter
hexshire Aug 19, 2025
26df4a1
chore: add deauthorize function
hexshire Aug 26, 2025
a46d18a
chore: address review comments
hexshire Aug 28, 2025
101df4d
chore: cgt review comments 2
hexshire Sep 3, 2025
36f8a2a
Merge branch 'main' into chore/cgt-sync-main
hexshire Sep 3, 2025
1672b38
chore(cgt): sync main
hexshire Sep 3, 2025
6761a31
chore(cgt): run checks and linters
hexshire Sep 3, 2025
2057f6c
chore(cgt): run checks and linters
hexshire Sep 3, 2025
01a542c
chore: add deauthorize details
hexshire Sep 3, 2025
2322526
chore: add missing words
hexshire Sep 3, 2025
39efa5e
fix: update with the latest features
ashitakah Sep 22, 2025
025eb38
fix: comments
ashitakah Sep 23, 2025
28e3388
fix: comments
ashitakah Sep 24, 2025
7cceae3
Merge branch 'sc-feat/custom-gas-token' into chore/cgt-sync-main
ashitakah Sep 24, 2025
a658f26
chore: run linters
hexshire Sep 29, 2025
df521a4
chore: update spec
hexshire Sep 29, 2025
cdc2aa0
fix: cgt flag (#74)
ashitakah Nov 12, 2025
3f85e88
feat: remove fund func (#75)
ashitakah Nov 12, 2025
573fdb3
feat: liquidity event (#76)
ashitakah Nov 12, 2025
abad267
fix: donate eth (#73)
ashitakah Nov 13, 2025
3c740d5
fix: merge
ashitakah Nov 13, 2025
6f89469
Merge branch 'main' into sc-feat/custom-gas-token
hexshire Nov 24, 2025
f6daa32
chore: run linter
hexshire Nov 24, 2025
4d6b803
chore: fix ci warning
hexshire Nov 24, 2025
724976f
chore: fix words file
hexshire Nov 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion specs/interop/managed-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ the file containing the jwt secret should be provided to the supervisor instance
## Node `->` Supervisor

Events that a supervisor should subscribe to, originating from the node, handled by the supervisor. For the used types,
refer [this](#Types) section.
refer [this](#types) section.

Every event sent from the node is of type `ManagedEvent` whose fields are populated with the events that occurred. All
non-null events are sent at once. The other fields are omitted.
Expand Down
19 changes: 19 additions & 0 deletions specs/protocol/jovian/bridges.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Bridges

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Overview](#overview)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Overview

ETH bridging functions MUST revert when Custom Gas Token mode is enabled and the function involves ETH transfers.
This revert behavior is necessary because when a chain operates in Custom Gas Token mode, ETH is no longer the native
asset used for gas fees and transactions. The chain has shifted to using a different native asset entirely.
Allowing ETH transfers could create confusion about which asset serves as the native currency, potentially leading
to user errors and lost funds. Additionally, the custom gas token's supply is managed independently through
dedicated contracts (`NativeAssetLiquidity` and `LiquidityController`), and combining ETH bridging with custom gas
token operations introduces additional complexity to supply management and accounting.
13 changes: 13 additions & 0 deletions specs/protocol/jovian/messengers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Cross Domain Messengers

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Message Passing](#message-passing)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Message Passing

The `sendMessage` function MUST revert when Custom Gas Token mode is enabled and `msg.value > 0`.
42 changes: 42 additions & 0 deletions specs/protocol/jovian/optimism-portal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Optimism Portal

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Definitions](#definitions)
- [Custom Gas Token Flag](#custom-gas-token-flag)
- [Rationale](#rationale)
- [Function Specification](#function-specification)
- [isCustomGasToken](#iscustomgastoken)
- [donateETH](#donateeth)
- [depositTransaction](#deposittransaction)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Definitions

### Custom Gas Token Flag

The **Custom Gas Token Flag** (`isCustomGasToken`) is a boolean value that indicates
whether the chain is operating in Custom Gas Token mode.

## Rationale

The OptimismPortal's ETH-related logic must revert when Custom Gas Token mode is enabled to prevent ETH from
acting as the native asset. Since the client side does not discern native asset supply creation, allowing
ETH deposits would incorrectly imply that it can be minted in the chain.

## Function Specification

### isCustomGasToken

Returns true if the gas token is a custom gas token, false otherwise.

### donateETH

- MUST revert if `isCustomGasToken()` returns `true` and `msg.value > 0`.

### depositTransaction

- MUST revert if `isCustomGasToken()` returns `true` and `msg.value > 0`.
45 changes: 45 additions & 0 deletions specs/protocol/jovian/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

- [Execution Layer](#execution-layer)
- [Consensus Layer](#consensus-layer)
- [Smart Contracts](#smart-contracts)
- [Core L2 Smart Contracts](#core-l2-smart-contracts)
- [Custom Gas Token](#custom-gas-token)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand All @@ -14,3 +17,45 @@ This document is not finalized and should be considered experimental.
## Execution Layer

## Consensus Layer

## Smart Contracts

- [Predeploys](./predeploys.md)
- [Bridges](./bridges.md)
- [Cross Domain Messengers](./messengers.md)
- [System Config](./system-config.md)
- [Withdrawals](./withdrawals.md)
- [Optimism Portal](./optimism-portal.md)

### Core L2 Smart Contracts

#### Custom Gas Token

The Custom Gas Token (CGT) feature allows OP Stack chains to use a native asset other than ETH as the gas
currency. This implementation introduces a streamlined approach with minimal core code intrusion through a
single `isCustomGasToken()` flag.

Key components:

- **NativeAssetLiquidity**: A predeploy contract containing pre-minted native assets, deployed only for
CGT-enabled chains.
- **LiquidityController**: An owner-governed mint/burn router that manages supply control, deployed only for
CGT-enabled chains.
- **ETH Transfer Blocking**: When CGT is enabled, all ETH transfer flows in bridging methods are disabled via
the `isCustomGasToken()` flag.
- **ETH Bridging Disabled**: ETH bridging functions in `L2ToL1MessagePasser` and `OptimismPortal` MUST revert
when CGT mode is enabled to prevent confusion about which asset is the native currency.
- **Native Asset Bridging**: Custom Gas Token chains use dedicated CGT bridges (`L1CGTBridge` and
`L2CGTBridge`) for native asset transfers between L1 ERC20 tokens and L2 native assets.

Choose a reason for hiding this comment

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

Where are L1CGTBridge/L2CGTBridge defined? More importantly, do they interact with L1CrossDomainMessenger/L2CrossDomainMessenger?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The L1CGTBridge/L2CGTBridge will be defined in a following spec.

- **WETH as ERC20**: ETH can still be bridged as WETH using the standard `OptimismMintableERC20` bridging
path through `L2StandardBridge`.

OP Stack chains that use a native asset other than ETH (or the native asset of the settlement layer)
introduce custom requirements that go beyond the current supply management model based on deposits and
withdrawals. This architecture decouples and winds down the native bridging for the native asset, shifting
the responsibility for supply management to the application layer. The chain operator becomes responsible
for defining and assigning meaning to the native asset, which is managed through a new set of predeployed
contracts.

This approach preserves full alignment with EVM equivalence and client-side compatibility as provided by the
standard OP Stack. No new functionalities outside the execution environment are required to make it work.
Loading