Skip to content

fix(tests): Cap B20 Interface Balances#162

Merged
refcell merged 1 commit into
mainfrom
rf/fix/cap-b20-interface-test-amounts
Jun 11, 2026
Merged

fix(tests): Cap B20 Interface Balances#162
refcell merged 1 commit into
mainfrom
rf/fix/cap-b20-interface-test-amounts

Conversation

@refcell

@refcell refcell commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

This updates the B20 interface and Solidity mock to include the new per-account max-balance error used by the Base precompile. It bounds balance-bearing fuzz inputs to the supported uint128 max balance and adds explicit regression coverage for mint and transfer paths that exceed the cap. The mock transfer and mint accounting now mirrors the precompile behavior so the Base Std Interface Tests can run against the capped implementation.

@refcell refcell added the bug Something isn't working label Jun 11, 2026
@refcell refcell self-assigned this Jun 11, 2026
@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 100.00% 100.00% 100.00% 100.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% 99.65% 98.21% 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% 100.00% 100.00% 100.00%
🟢 MockPolicyRegistryStorage.sol 100.00% 100.00% 100.00% 100.00%
Total 96.73% 97.15% 97.64% 96.91%

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, 613 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_mint_revert_maxBalanceExceeded(address,uint256): next call did not revert as expected; counterexample: calldata=0x489d54c40000000000000000000000000000000000000000000000000000000000000503cdcc772fe4cbdb1029f822861176d09e646db96723d4c1e82ddfdeb8163ef54c args=[0x0000000000000000000000000000000000000503, 93085393359812225330546714545801767655967775857010822972004765400649682580812 [9.308e76]]
  • test_transfer_revert_maxBalanceExceeded(address,address): next call did not revert as expected; counterexample: calldata=0x1ccd7caf0000000000000000000000002363007a384acc32c8582b4d29622213d27771ce000000000000000000000000e86470397421d4e348cf0680ea8f92deb18a43cb args=[0x2363007a384acc32C8582b4D29622213D27771Ce, 0xe86470397421D4E348CF0680ea8F92deb18a43cb]

@refcell refcell marked this pull request as ready for review June 11, 2026 14:00
@refcell refcell merged commit 38d1632 into main Jun 11, 2026
10 checks passed
@refcell refcell deleted the rf/fix/cap-b20-interface-test-amounts branch June 11, 2026 14:02
ilikesymmetry added a commit that referenced this pull request Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants