Skip to content

CeloSequencerFeeVault#444

Open
m-chrzan wants to merge 6 commits into
celo-contracts/v5.0.0from
m-chrzan/fee-vault
Open

CeloSequencerFeeVault#444
m-chrzan wants to merge 6 commits into
celo-contracts/v5.0.0from
m-chrzan/fee-vault

Conversation

@m-chrzan
Copy link
Copy Markdown

Implements an extension to the standard SequencerFeeVault that also allows withdrawals of ERC-20 tokens, as the CELO system allows for gas payments in some non-native tokens.

Because some of the tokens use a special adapter contract, the "base" withdrawToken function takes two arguments: registered and actual. registered refers to the token as registered in the FeeCurrencyDirectory, which can be an adapter wrapper contract. actual refers to the actual ERC-20 token that should be transferred. A single-argument convenience overload is provided. On withdrawal, the token is verified to be registered in the FeeCurrencyDirectory.

Some design decisions:

  • We don't use a minimal withdrawal amount mechanism as with the original native token implementation. This isn't a security check, and maintaining a configuration to work with multiple tokens that have varying real-world values, and decimals, would add unnecessary complexity.
  • We only do this for the SequencerFeeVault, rather than a more general solution like extending FeeVault (the parent of all fee vaults), as currently, and for the foreseeable future, Celo only uses the SequencerFeeVault, and might even opt out of it in favor of a different mechanism in the future.

Drive by changes

  • Updated mise.toml, [alias] was deprecated in favor of [tool_alias].
  • Linting fix.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f421fbd18

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/contracts-bedrock/scripts/L2Genesis.s.sol
@m-chrzan m-chrzan changed the base branch from celo-contracts/v5.0.0 to op-deployer/v5.0.0 May 11, 2026 14:43
Comment thread packages/contracts-bedrock/src/L2/CeloSequencerFeeVault.sol
Comment thread packages/contracts-bedrock/test/setup/Setup.sol
Comment thread packages/contracts-bedrock/src/L2/CeloSequencerFeeVault.sol Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 66444d2883

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".


emit TokenWithdrawal(_registered, _actual, value, RECIPIENT, msg.sender);

IERC20(_actual).safeTransfer(RECIPIENT, 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.

P1 Badge Enforce L2 withdrawal network for token withdrawals

withdrawToken always performs a local safeTransfer to RECIPIENT and never checks WITHDRAWAL_NETWORK, so configurations that still use WithdrawalNetwork.L1 will not bridge token fees to L1—they are sent to the same 20-byte address on L2 instead. This is a loss-of-funds risk when the configured sequencer fee recipient is an L1-only contract/multisig (a common setup), because the tokens become stranded on L2; the function should either require WITHDRAWAL_NETWORK == L2 or implement an L1 withdrawal path for tokens.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't think it is an issue, but could you double check @m-chrzan 🙏 ?

Copy link
Copy Markdown

@Mc01 Mc01 left a comment

Choose a reason for hiding this comment

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

LGTM 👏

@Mc01 Mc01 added the v6.0.0 label May 28, 2026
@m-chrzan m-chrzan force-pushed the m-chrzan/fee-vault branch from 66444d2 to 80a1239 Compare May 28, 2026 09:56
@m-chrzan m-chrzan changed the base branch from op-deployer/v5.0.0 to celo-contracts/v5.0.0 May 28, 2026 09:56
chatgpt-codex-connector[bot]

This comment was marked as off-topic.

@Mc01
Copy link
Copy Markdown

Mc01 commented Jun 2, 2026

If we want to change base from celo-contracts/v5.0.0 to celo-contracts/v6.0.0 than this PR might need more work, since FeeVault contracts was rewritten by OP in v6.0.0

Copy link
Copy Markdown

@Mc01 Mc01 left a comment

Choose a reason for hiding this comment

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

Although this PR was approved against v5.0.0
We need to change base to v6.0.0 and bundle it with future upgrade
So forward-port would be needed due to the fact that FeeVault was rewritten in v6.0.0

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants