fix(BOP-511): reject from == address(0) in seizeWithMemo - #198
Merged
Conversation
Co-authored-by: OpenCode <opencode-noreply@coinbase.com>
stephancill
requested review from
amiecorso,
eric-ships,
ilikesymmetry,
rayyan224 and
stevieraykatz
as code owners
August 11, 2026 13:55
Interface Coverage✅ All interface functions have test coverage. |
📊 Forge Coverage (
|
| File | Lines | Stmts | Branches | Funcs |
|---|---|---|---|---|
| 🟡 B20FactoryLib.sol | 97.70% | 98.00% | 100.00% | 95.00% |
| 🔴 test/lib/ForceFeeder.sol | 0.00% | 0.00% | 100.00% | 0.00% |
| 🔴 test/lib/PrecompileProbe.sol | 0.00% | 0.00% | 0.00% | 0.00% |
| 🟢 MockActivationRegistry.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟢 MockActivationRegistryStorage.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟢 MockB20.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟢 MockB20Asset.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟡 MockB20Factory.sol | 98.96% | 99.10% | 100.00% | 100.00% |
| 🟢 MockB20Stablecoin.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟢 MockB20Storage.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟡 MockPolicyRegistry.sol | 100.00% | 99.54% | 97.67% | 100.00% |
| 🟢 MockPolicyRegistryStorage.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| Total | 97.07% | 97.52% | 98.16% | 97.00% |
Full report: download artifact. To browse locally: make coverage (runs forge coverage + genhtml + opens the HTML report).
|
rayyan224
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
seizeWithMemorejectedto == address(0)(and, since fix(BOP-510): reject from == to in seizeWithMemo (self-seize) #195,from == to) but notfrom == address(0). WithSEIZE_ROLEand a non-defaultSeizeHolderthat treats the zero address as seizable, a zero-amount seize fromaddress(0)could succeed and emitTransfer(0x0, to, 0), which indexers often read as a mint. No onchain inflation; the defaultALWAYS_ALLOWSeizeHolderalready blocks this path.MockB20.seizeWithMemonow revertsInvalidSenderwhenfrom == address(0), placed right after the zero-receiver check and beforefrom == to/policy checks so it fires unconditionally. This is the Solidity reference companion to the Rust precompile fix in base/base#4353.IB20.seizeWithMemonatspec, addstest_seizeWithMemo_revert_zeroFromplus two revert-order tests (zeroReceiver_beats_zeroSender,zeroSender_beats_blocked), and extends the seize smoke journey with a zero-source edge step.Linear
BOP-511 — Cantina finding L-02.
Test plan
forge test— 731 passed, 0 failed (incl. new zero-from unit + revert-order tests).forge fmt --checkclean.python3 script/check-coverage.py— all interface functions covered.