Skip to content

fix(BOP-511): reject from == address(0) in seizeWithMemo - #198

Merged
stephancill merged 1 commit into
mainfrom
stephancilliers/bop-511-seize-zero-from
Aug 11, 2026
Merged

fix(BOP-511): reject from == address(0) in seizeWithMemo#198
stephancill merged 1 commit into
mainfrom
stephancilliers/bop-511-seize-zero-from

Conversation

@stephancill

Copy link
Copy Markdown
Contributor

Summary

  • seizeWithMemo rejected to == address(0) (and, since fix(BOP-510): reject from == to in seizeWithMemo (self-seize) #195, from == to) but not from == address(0). With SEIZE_ROLE and a non-default SeizeHolder that treats the zero address as seizable, a zero-amount seize from address(0) could succeed and emit Transfer(0x0, to, 0), which indexers often read as a mint. No onchain inflation; the default ALWAYS_ALLOW SeizeHolder already blocks this path.
  • MockB20.seizeWithMemo now reverts InvalidSender when from == address(0), placed right after the zero-receiver check and before from == to/policy checks so it fires unconditionally. This is the Solidity reference companion to the Rust precompile fix in base/base#4353.
  • Updates the IB20.seizeWithMemo natspec, adds test_seizeWithMemo_revert_zeroFrom plus 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 --check clean.
  • python3 script/check-coverage.py — all interface functions covered.

Co-authored-by: OpenCode <opencode-noreply@coinbase.com>
@linear

linear Bot commented Aug 11, 2026

Copy link
Copy Markdown

BOP-511

@github-actions

Copy link
Copy Markdown

Interface Coverage

✅ All interface functions have test coverage.

@github-actions

Copy link
Copy Markdown

📊 Forge Coverage (src/lib/)

🟡 ≥95% across all metrics — some metrics below 99%.

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).

@github-actions

Copy link
Copy Markdown

⚠️ Fork tests: 4 failed, 719 passed

These failures indicate divergences where base/base needs to catch up to the base-std spec. This check is advisory and does not block merging.

Failing tests
  • test_seizeWithMemo_revertOrder_zeroSender_beats_blocked(address): Error != expected error: AccountNotSeizable(0x0000000000000000000000000000000000000000) != InvalidSender(0x0000000000000000000000000000000000000000); counterexample: calldata=0xfb590705000000000000000000000000000000000000000000000000000000000000018a args=[0x000000000000000000000000000000000000018a]
  • test_seizeWithMemo_revert_zeroFrom(address,uint256): Error != expected error: InsufficientBalance(0x0000000000000000000000000000000000000000, 0, 318321813755946454831 [3.183e20]) != InvalidSender(0x0000000000000000000000000000000000000000); counterexample: calldata=0xdf1bcb7a0000000000000000000000005d19c6673e25a367e22c0951fd27d90f07bc0713000000000000000000000000000000000000000000000011419a4311dd3dcf2f args=[0x5d19c6673e25a367e22C0951Fd27D90F07BC0713, 318321813755946454831 [3.183e20]]

@stephancill
stephancill merged commit 3f89900 into main Aug 11, 2026
10 checks passed
@stephancill
stephancill deleted the stephancilliers/bop-511-seize-zero-from branch August 11, 2026 14:20
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