Skip to content

Wrap native in Vaults and Blue bundles, refund native#82

Open
QGarchery wants to merge 13 commits into
mainfrom
wrap-native
Open

Wrap native in Vaults and Blue bundles, refund native#82
QGarchery wants to merge 13 commits into
mainfrom
wrap-native

Conversation

@QGarchery

Copy link
Copy Markdown
Collaborator

@QGarchery QGarchery changed the title Wrap native (WI Wrap native (WIP) Jul 23, 2026
@QGarchery QGarchery self-assigned this Jul 23, 2026
@QGarchery QGarchery changed the title Wrap native (WIP) [wrap native] return native Jul 23, 2026
This reverts commit fbfb661.
@QGarchery
QGarchery changed the base branch from main to wrap-native-return-wrapped July 23, 2026 17:06
@QGarchery QGarchery changed the title [wrap native] return native [wrap native] refund native Jul 23, 2026
@QGarchery
QGarchery changed the base branch from wrap-native-return-wrapped to main July 24, 2026 13:05
@QGarchery QGarchery changed the title [wrap native] refund native Wrap native in Vaults and Blue bundles, refund native Jul 24, 2026
This was referenced Jul 24, 2026
@QGarchery
QGarchery marked this pull request as ready for review July 24, 2026 13:19
@QGarchery
QGarchery requested review from MathisGD and bhargavbh and removed request for bhargavbh July 24, 2026 13:19

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

Copy link
Copy Markdown

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: 81dee74fda

ℹ️ 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 src/blue/BlueBundlesV1.sol Outdated
Comment thread src/libraries/TokenLib.sol
Comment thread src/libraries/TokenLib.sol
Comment thread src/vault/VaultBundlesV1.sol
QGarchery and others added 2 commits July 24, 2026 16:21
The wrap-native change makes BlueBundlesV1 mint WNative to the bundler
via WNative.deposit on native supply/repay and burn it via
WNative.withdraw when refunding the unused native remainder. NoResidue
only summarized ERC20 transfers and Morpho methods, so these calls left
the persistent bundlerBalance ghost stale on native paths and the
no-residue rules compared against a wrong balance.

Add deposit/withdraw summaries that credit/debit bundlerBalance by the
wrapped/unwrapped amount, keeping the no-residue rules exact on native
paths instead of restricting them to msg.value == 0.

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

Copy link
Copy Markdown

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: 528ca0393f

ℹ️ 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 src/blue/BlueBundlesV1.sol
Comment thread certora/specs/NoResidue.spec
function _.deposit() external with(env e) => summaryWrapNative(calledContract, e.msg.value) expect void;
function _.withdraw(uint256 amount) external => summaryUnwrapNative(calledContract, amount) expect void;

// Summarized without state changes, as the HAVOC_ECF allows the callee to credit native tokens to the caller.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

See this resource https://docs.certora.com/en/latest/docs/cvl/methods.html#havoc-summaries-havoc-all-and-havoc-ecf. Third paragraph:

A HAVOC_ECF summarization for a method encodes the assumption that the called method is not reentrant. This summarization approximates a method call by assuming it can have arbitrary effects on contracts other than the contract being verified, but that it can neither change the current contract’s state nor decrease its ETH balance

Comment thread src/blue/BlueBundlesV1.sol
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.

3 participants