Skip to content

feat(cgt): bridge spec#48

Merged
hexshire merged 9 commits intofeat/cgt-related-specsfrom
feat/cgt-bridge-spec
Aug 13, 2025
Merged

feat(cgt): bridge spec#48
hexshire merged 9 commits intofeat/cgt-related-specsfrom
feat/cgt-bridge-spec

Conversation

@hexshire
Copy link
Copy Markdown
Member

@hexshire hexshire commented Aug 11, 2025

Closes OPT-1011

@hexshire hexshire self-assigned this Aug 11, 2025
@hexshire hexshire changed the title feat: cgt bridge spec feat(cgt): bridge spec Aug 11, 2025
Copy link
Copy Markdown

@ashitakah ashitakah left a comment

Choose a reason for hiding this comment

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

Looks good overall, few comments!

Comment thread specs/protocol/jovian/bridges.md Outdated
- [Overview](#overview)
- [Custom Gas Token Bridges](#custom-gas-token-bridges)
- [Token Flow](#token-flow)
- [L1CGTBridge](#l1cgtbridge)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In the other documents the bridges are named like StandardBridge and L2StandardBridge, I propose to name it like :
L1StandardCGTBridge and L2StandardCGTBridge

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think they won't be standard anymore :(

Comment thread specs/protocol/jovian/bridges.md Outdated

## Custom Gas Token Bridges

The Custom Gas Token (CGT) bridges enable bidirectional transfers between L1 ERC20 tokens and L2 native assets on chains using Custom Gas Token mode. Unlike standard bridges that handle ETH and generic ERC20 tokens, CGT bridges are specifically designed to convert between a designated L1 ERC20 token and the L2's native gas-paying asset.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The Custom Gas Token (CGT) bridges enable bidirectional transfers between a specific L1 ERC20 token, designated for CGT mode, and the L2’s native gas-paying asset. Standard bridges typically handle ETH and generic ERC20 tokens, but CGT bridges are purpose-built to support the conversion between the chosen L1 token and the L2 native asset

I suggest to made it clear the ERC20 is the one picked for CGT mode, not arbitrary. Also, “unlike” sounds like a drawback, instead of a feature.

Comment thread specs/protocol/jovian/bridges.md Outdated

**L1 → L2 Flow (ERC20 to Native Asset):**

1. User calls `bridgeCGTTo()` on L1CGTBridge with ERC20 tokens
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bridgeCGT

Comment thread specs/protocol/jovian/bridges.md Outdated

**L1 → L2 Flow (ERC20 to Native Asset):**

1. User calls `bridgeCGTTo()` on L1CGTBridge with ERC20 tokens
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion
User calls bridgeCGT() on L1CGTBridge to transfer the specified amount of the designated ERC20 for bridging.
L1CGTBridge locks ERC20 tokens and sends a cross-domain message to L2CGTBridge via L1CrossDomainMessenger

Comment thread specs/protocol/jovian/bridges.md Outdated

**L2 → L1 Flow (Native Asset to ERC20):**

1. User calls `bridgeCGTTo()` on L2CGTBridge with native assets (msg.value)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

User calls bridgeCGT()

Comment thread specs/protocol/jovian/bridges.md Outdated
- MUST revert if `_amount` is zero
- MUST revert if caller has insufficient token balance or allowance

#### `bridgeCGTTo`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Change to bridgeCGT
Bridges the specified amount of the designated ERC20 from L1 to L2 to a specified recipient.

Comment thread specs/protocol/jovian/bridges.md Outdated
- MUST transfer `_amount` of CGT ERC20 tokens from `msg.sender` to the bridge contract
- MUST send a message to L2CGTBridge via CrossDomainMessenger to mint equivalent native assets to `_to`
- MUST emit `CGTBridgeInitiated` event
- MUST revert if `_to` is zero address
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

delete it, if zero address msg.sender is the destination address

Comment thread specs/protocol/jovian/bridges.md Outdated

The L2CGTBridge is a predeploy contract that handles the L2 side of CGT bridging operations. See the [L2CGTBridge predeploy specification](predeploys.md#l2cgtbridge) for complete interface and function definitions.

Address: `0x420000000000000000000000000000000000002B`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not predeploy

Comment thread specs/protocol/jovian/bridges.md Outdated
2. Verifying the `xDomainMessageSender()` matches the expected counterpart bridge address
3. Only processing messages that originate from the trusted counterpart bridge

## Security Considerations
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We should add here the precompute address for L1 and L2 bridges

Comment thread specs/protocol/jovian/predeploys.md Outdated
| -------------------- | ------------------------------------------ | ---------- | ---------- | ------- |
| NativeAssetLiquidity | 0x4200000000000000000000000000000000000029 | Jovian | No | Yes |
| LiquidityController | 0x420000000000000000000000000000000000002A | Jovian | No | Yes |
| L2CGTBridge | 0x420000000000000000000000000000000000002B | Jovian | No | Yes |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not predeploy anymore

@linear
Copy link
Copy Markdown

linear Bot commented Aug 13, 2025

OPT-1011 Rework Bridges

@hexshire hexshire merged commit a25aa9d into feat/cgt-related-specs Aug 13, 2025
2 checks passed
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.

2 participants