Skip to content

feat(b20): rename SEIZE_HOLDER_POLICY to SEIZE_EXEMPT_POLICY - #214

Merged
rayyan224 merged 2 commits into
mainfrom
rename/seize-exempt-policy
Sep 2, 2026
Merged

feat(b20): rename SEIZE_HOLDER_POLICY to SEIZE_EXEMPT_POLICY#214
rayyan224 merged 2 commits into
mainfrom
rename/seize-exempt-policy

Conversation

@rayyan224

Copy link
Copy Markdown
Collaborator

Summary

  • Rename the seize-from policy scope from SEIZE_HOLDER_POLICY to SEIZE_EXEMPT_POLICY so the identifier matches the inverted check: authorized accounts are seize-exempt.
  • Update the IB20 getter, B20Constants keccak preimage, mocks, tests, smoke journey, and Cobalt changelog (selector 0xfeb346ec, value keccak256("SEIZE_EXEMPT_POLICY")).
  • Guard the rename: SEIZE_HOLDER_POLICY() must not resolve; SEIZE_EXEMPT_POLICY() must match the new digest.

This is a Cobalt wire change (the scope hash and getter selector both change). The Rust precompile in base/base needs the same preimage before live-precompile tests can pass.

Test plan

  • forge test (735 passed locally)
  • forge fmt --check
  • Confirm token.SEIZE_EXEMPT_POLICY() == keccak256("SEIZE_EXEMPT_POLICY")
  • Confirm SEIZE_HOLDER_POLICY() no longer resolves
  • Land the matching constant rename in base/base before base-forge test / make fork-tests

Made with Cursor

Authorized accounts cannot be seized, so the scope name now states that polarity instead of sounding like a seizable-holder list.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Interface Coverage

✅ All interface functions have test coverage.

@github-actions

github-actions Bot commented Sep 2, 2026

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

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

⚠️ Fork tests: 44 failed, 703 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_policyId_success_reflectsUpdatePolicy(uint8,uint64): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0xa21d943e000000000000000000000000000000000000000000000000000000000000001b0000000000000000000000000000000000000000000000006e60885ac9d7bd16 args=[27, 7953506865451089174 [7.953e18]]
  • test_seizeWithMemo_revertOrder_receiver_beats_balance(address,address): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0xc375ac63000000000000000000000000af8385f92bbba2a41459f3865eda1cb6342d148500000000000000000000000081cd152f91652b18eca53ae39bff503f8d9873d2 args=[0xaf8385f92BBba2a41459f3865EdA1CB6342d1485, 0x81Cd152f91652B18eCa53ae39Bff503f8D9873D2]
  • test_seizeWithMemo_revert_insufficientBalance(address,address,uint256): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0x033c50050000000000000000000000009c1f872d495eadb6e76175dd58f2163a15202a950000000000000000000000001e8f07030d36b2a8396144a9659a653490268d82fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe args=[0x9C1F872D495eadB6e76175dD58F2163A15202a95, 0x1e8f07030D36B2A8396144a9659A653490268d82, 115792089237316195423570985008687907853269984665640564039457584007913129639934 [1.157e77]]
  • test_seizeWithMemo_revert_invalidReceiver(address,uint256): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0x92e9b388000000000000000000000000e3c565e2fe3647972689eb9ce02f78772bf8ef740000000000000000000000000000000000000deeabf8de1b824b53f594d396cd args=[0xe3C565E2FE3647972689Eb9cE02F78772bF8ef74, 282580850325022152270578799843021 [2.825e32]]
  • test_seizeWithMemo_revert_receiverPolicyForbids(address,address,uint256): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0x05a3631f000000000000000000000000fc4502e706923b38113b5e5840145be8bb9fab36000000000000000000000000b650aed98f1597b46fb25e039d21cead6557084d0000000000000000000000000000000000000000000000000000000000000001 args=[0xFC4502E706923B38113B5E5840145BE8BB9Fab36, 0xB650AEd98f1597B46fb25e039D21cEAd6557084D, 1]
  • test_seizeWithMemo_revert_selfSeize(address,uint256): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0xffbeec220000000000000000000000003a72c3293263be359b26c39514dea57a794b79b400000000000000000000000f3c074e058b23f4de77309b94324cb24d7c3014e7 args=[0x3A72c3293263Be359B26C39514DEa57A794b79b4, 22265226908074027759112817501204590039383086732519 [2.226e49]]
  • test_seizeWithMemo_revert_whenSeizePaused(address,address,uint256): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0x83c47ba40000000000000000000000004d2870fd1e86d6b30e5b9eb57caf045af3c2405f00000000000000000000000039b0717771f5c57e799545d72a0c38a862d34259fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd args=[0x4d2870fD1e86d6b30E5B9EB57Caf045af3c2405F, 0x39b0717771f5C57E799545D72A0c38A862d34259, 115792089237316195423570985008687907853269984665640564039457584007913129639933 [1.157e77]]
  • test_seizeWithMemo_revert_zeroFrom(address,uint256): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0xdf1bcb7a0000000000000000000000002f606be83dda5e46f3d0e9e9020e21dcffdee0c6000000000000000000000000000000000000000000000000000000000000001f args=[0x2f606BE83dDa5e46f3d0E9e9020e21DcfFdeE0C6, 31]
  • test_seizeWithMemo_success_configuredReceiverPolicyAllows(address,address,uint256): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0xd1038b0d0000000000000000000000008a516124f686ccf58bbfb74be8730a36e45b37e8000000000000000000000000a1e4e3b40e3cb521521d3a32e6af35d182de44ef003be3d39a6c02fb76405025eac396b823794b62ecfd97c5ee07826d0ea6bbea args=[0x8A516124F686cCf58bBfB74be8730A36E45B37E8, 0xA1E4E3B40e3Cb521521D3A32e6aF35D182dE44EF, 105816378053919234543773881807356129612880372117378624437551384426445192170 [1.058e74]]
  • test_seizeWithMemo_success_emitsEvents(address,address,uint256,bytes32): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0x984936cb000000000000000000000000ebc77e206ff6de9d64a827fd78e15bd7e790e2cb000000000000000000000000b6314dce1024116da60880c2dfe0ce6c37d8ffa900000000000000000000000000000000000000004f0de14c49a3ac35320cbdcac9cf0fc1453a7e315a34eb6ed71c54eab6aa956265f888b07d8b80c25bfe953e args=[0xeBC77e206ff6DE9D64A827fD78E15bd7E790e2cB, 0xB6314dce1024116da60880c2Dfe0CE6C37d8ffa9, 24466095751258720011073404362 [2.446e28], 0xc9cf0fc1453a7e315a34eb6ed71c54eab6aa956265f888b07d8b80c25bfe953e]
  • test_seizeWithMemo_success_ignoresReceiverPolicy(address,address,uint256): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0x6358be6c000000000000000000000000889d48f20b743cf36ceac5dae751e85adfdfc9d3000000000000000000000000889e5f7e7bfab86044bff9ea936f0e05f31c12d400000000000000000000000000000000000000000000000000003fe5223ea96a args=[0x889d48f20b743cF36CEaC5daE751E85aDFdfC9D3, 0x889E5f7E7Bfab86044bFF9EA936F0e05f31c12D4, 70253354592618 [7.025e13]]
  • test_seizeWithMemo_success_movesBalance(address,address,uint256): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0xc4ab022a00000000000000000000000063b037658711b3230a7ebe366e6505e33928ec8d000000000000000000000000238aee90a704d912e3f4339c039133b87e12dac8000000000000000000000002384888b15660d7e885fe7fe879dd8070fc62ec12 args=[0x63B037658711B3230A7eBE366e6505E33928EC8D, 0x238Aee90a704D912E3f4339C039133b87e12Dac8, 3244324319097917166306658042606445572515522866194 [3.244e48]]
  • test_seizeWithMemo_success_noAllowanceRequired(address,address,uint256): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0xdc26e1f50000000000000000000000000000000000000000000000000000000000003d4b00000000000000000000000000000000000000000000000000000000000016f20000000000000000000000001d96f2f6bef1202e4ce1ff6dad0c2cb002861d3e args=[0x0000000000000000000000000000000000003D4b, 0x00000000000000000000000000000000000016f2, 168927009270134003651979802273137161033195330878 [1.689e47]]
  • test_seizeWithMemo_success_unsetReceiverPolicyAllowsAnyDestination(address,address,uint256): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0x47ad42e2000000000000000000000000516f749a1d1eee19039541a2d4f67e2fd23d01420000000000000000000000000db95199fd29521272887fa931b9ccb6853d673200000000000000000000000000000000000000000000000000d901531db191b5 args=[0x516f749a1D1eEe19039541a2d4F67e2fd23d0142, 0x0db95199FD29521272887Fa931b9ccb6853D6732, 61081526438302133 [6.108e16]]
  • test_updatePolicy_revert_policyNotFound(uint8,uint64): Error != expected error: UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed) != PolicyNotFound(11718 [1.171e4]); counterexample: calldata=0x74fd7f39000000000000000000000000000000000000000000000000000000000000006f00000000000000000000000000000000000000000000000000000000002dc6c0 args=[111, 3000000 [3e6]]
  • test_updatePolicy_success_builtinAllow(uint8): UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed); counterexample: calldata=0xde997e8b000000000000000000000000000000000000000000000000000000000000003f args=[63]
  • test_updatePolicy_success_emitsPolicyUpdated(uint8,uint64): log != expected log; counterexample: calldata=0x59afa2fa0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000ffffffffffffffff args=[3, 18446744073709551615 [1.844e19]]
    [FAIL: SEIZE_HOLDER_POLICY() must not resolve (renamed to SEIZE_EXEMPT_POLICY)] test_seizeHolderPolicy_revert_selectorRemoved() (gas: 8601)
    [FAIL: UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed)] test_b20Layout_success_populatedSnapshotMatchesAllSlots() (gas: 618346)
    [FAIL: UnsupportedPolicyType(0xedb5da348cfb67af08746d3afd1be81034b50d5c8576f31aff688f39dfd540ed)] test_seizePolicyIdsSlot_success_decodesExemptLane() (gas: 12527)
    [FAIL: custom error 0xfeb346ec] test_SEIZE_EXEMPT_POLICY_success_matchesExpected() (gas: 5185)
    [FAIL: custom error 0xfeb346ec] test_seizeExemptPolicy_success_renamedFromSeizeHolder() (gas: 5187)

Comment thread changelog/02_Cobalt_B20_seize.md Outdated
| Bits | Lane | Field | Scope |
| ------- | ---- | ---------- | ----------------------- |
| 0–63 | 0 | `seizable` | `SEIZE_HOLDER_POLICY` |
| 0–63 | 0 | `seizable` | `SEIZE_EXEMPT_POLICY` |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Naming doesn't make sense between seizable and policy name

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.

good catch, the packed struct filed seems to be not caught. Updated

Comment thread test/lib/mocks/MockB20Storage.sol Outdated

/// @notice Extracts the seize-holder policy id (lane 0) from the seize packed slot.
/// @notice Extracts the seize-exempt policy id (lane 0) from the seize packed slot.
function seizablePolicyId(uint256 packed) internal pure returns (uint64) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Feels like cruft we should clean up when you have downtime. There are two policies under seize operation

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.

Fixed now, later sometimes never comes hahah

The SEIZE_EXEMPT_POLICY lane and its accessors still used the pre-rename
"seizable" name, which no longer matches the policy and reads backwards
(exempt accounts are NOT seizable). Mirrors how the receiver lane already
matches SEIZE_RECEIVER_POLICY.

Addresses review comments on PR #214.

Co-Authored-By: Claude <noreply@anthropic.com>
@rayyan224
rayyan224 merged commit 607ef9a into main Sep 2, 2026
10 checks passed
@rayyan224
rayyan224 deleted the rename/seize-exempt-policy branch September 2, 2026 18:21
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