feat(b20-asset): ERC-8056 scaled multiplier (scheduled updates + conformance)#173
Open
robriks wants to merge 2 commits into
Open
feat(b20-asset): ERC-8056 scaled multiplier (scheduled updates + conformance)#173robriks wants to merge 2 commits into
robriks wants to merge 2 commits into
Conversation
robriks
requested review from
amiecorso,
eric-ships,
ilikesymmetry,
rayyan224 and
stevieraykatz
as code owners
July 21, 2026 17:37
Interface Coverage✅ All interface functions have test coverage. |
📊 Forge Coverage (
|
| File | Lines | Stmts | Branches | Funcs |
|---|---|---|---|---|
| 🔴 B20FactoryLib.sol | 95.40% | 96.00% | 100.00% | 90.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% | 100.00% | 100.00% | 100.00% |
| 🟢 MockPolicyRegistryStorage.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| Total | 96.41% | 97.02% | 98.51% | 96.15% |
Full report: download artifact. To browse locally: make coverage (runs forge coverage + genhtml + opens the HTML report).
Re-adds test/unit/storage/MockB20AssetSlotHelpers.t.sol, the sole caller of MockB20AssetStorage.pendingMultiplierValue / pendingEffectiveAt. It had been dropped, leaving those packed-slot decoders uncovered and failing the Interface Coverage CI gate on #173. Co-authored-by: Cursor <cursoragent@cursor.com>
|
rayyan224
reviewed
Jul 21, 2026
| /// @dev `uiMultiplier` aliases `multiplier`; `balanceOfUI` aliases `scaledBalanceOf`; the pending | ||
| /// surface, `totalSupplyUI`, and `supportsInterface` all resolve. These typed calls only | ||
| /// compile against the current interface, so their presence is the guard. Regression: BOP-431. | ||
| function test_erc8056Surface_success_aliasesResolve(uint256 amount) public { |
Collaborator
There was a problem hiding this comment.
Hey question is regressions testing pass versions ?
rayyan224
reviewed
Jul 21, 2026
|
|
||
| /// @notice Emitted by `updateMultiplier`. | ||
| event MultiplierUpdated(uint256 multiplier); | ||
| /// @notice Base-local companion to ERC-8056's `UIMultiplierUpdated`. Fills the standard's |
Collaborator
There was a problem hiding this comment.
I think we can simplify this comment to. Old multiprler scheduled has been cancelled something along those lines
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
ERC-8056 ("Scaled UI Amount") conformance for the B20 Asset variant, plus on-chain scheduling of multiplier updates for corporate actions (stock splits / reinvested dividends).
setUIMultiplier(new, effectiveAt)+cancelScheduledMultiplier; instantupdateMultiplierretained as a failsafe ("useful tech debt").uiMultiplier,newUIMultiplier/effectiveAt, Balances (balanceOfUI/totalSupplyUI), ERC-165; event widened toUIMultiplierUpdated, newMultiplierUpdateCancelled.PendingMultiplierat slot 4 ofbase.b20.asset(uint128 ceiling as guard against unlikely-but-possible eventual multiplier overflow after repeated splits)BOP-431