Skip to content

docs(b20): use Cobalt ERC-8056 multiplier interface in examples - #2026

Merged
roethke merged 4 commits into
masterfrom
roethke/b20-cobalt-multiplier-examples
Sep 29, 2026
Merged

roethke merged 4 commits into
masterfrom
roethke/b20-cobalt-multiplier-examples

Conversation

@roethke

@roethke roethke commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

What changed? Why?

Eric Brown asked that all B20 examples in docs use the new interface from the Cobalt multiplier changelog. Examples still used the Beryl names.

Beryl name (status at Cobalt per base-std) Now used (Cobalt, ERC-8056)
updateMultiplier(uint256) (deprecated, emergency setter) updateUIMultiplier(uint256,uint256)
multiplier() (canonical; ERC-8056 alias added) uiMultiplier()
scaledBalanceOf(address) (canonical; ERC-8056 alias added) balanceOfUI(address)
toScaledBalance / toRawBalance (deprecated) toUIAmount / fromUIAmount
MultiplierUpdated (deprecated, instant setter only) UIMultiplierUpdated
  • Vibenet engine (docs/static/vibenet-engine.txt): ABI and helpers switched to updateUIMultiplier, uiMultiplier, balanceOfUI. New latestTimestamp and waitForTimestamp helpers (60s timeout). ENGINE_VERSION 4 → 5 and loader cache key ?v=4 → ?v=5, so browsers don't serve the stale engine.
  • Live split demo (AssetDemo.jsx): schedules the 2-for-1 split ~15s ahead (margin for a faucet top-up, the cross-tab send lock, or a slow RPC), waits for effectiveAt, then reads uiMultiplier() and balanceOfUI(). The offline fallback shows the same calls.
  • B20PlaygroundDemo.jsx: offline split uses updateUIMultiplier / UIMultiplierUpdated, and the caption says balances double at effectiveAt, not in the same call.
  • Verified sample ABI (abi.ts): removed the 3 deprecated entries; no sample called them.
  • List Tokenized Stocks guide: helper table now lists the ERC-8056 functions, and says which Beryl names stay canonical vs deprecated. The history section now cites UIMultiplierUpdated (the old text said MultiplierUpdated fires on scheduled updates, but it only fires on the instant setter), keys changes by effectiveAtTimestamp, and says to drop updates later cancelled by UIMultiplierUpdateCancelled.
  • constants.mdx: wording uses the new names; removed an em-dash.
  • upgrades/beryl/b20.mdx: table left as-is (accurate for Beryl); added a Note that maps each name to its Cobalt status and notes that the scheduled setter emits only UIMultiplierUpdated.

Notes to reviewers

  • Out of scope: reference pages for the deprecated functions (eg, update-multiplier.mdx, scaled-balance-of.mdx) still document them, with deprecation warnings. apply-a-multiplier.mdx and the concept pages already lead with the new names.

  • Vibenet support: confirmed on a live Vibenet token (VIBE, 0xb200…133d) that uiMultiplier, newUIMultiplier, effectiveAt, totalSupplyUI, and MAX_UI_MULTIPLIER all respond. Vibenet produces ~5–8 blocks/s with 1s timestamps, so the demo's ~15s wait is short.

  • For the B20 team: deprecation status of multiplier() / scaledBalanceOf. base-std (changelog/02_Cobalt_B20Asset_multiplier.md, IB20Asset.sol) marks them "unchanged (canonical name)", with uiMultiplier() / balanceOfUI as ERC-8056 aliases. The rendered Cobalt changelog on master labeled them "deprecated-name-kept", and this PR originally repeated that. This PR now follows base-std, and docs(upgrades): rename Cobalt B20 pages, add Denim B20 upgrade pages #2025 fixes the rendered changelog table. Examples still use the ERC-8056 names per Eric's request, since both return the same values. Please confirm base-std is the intended status.

  • For the B20 team: demo effectiveAt margin. updateUIMultiplier reverts EffectiveAtInPast unless effectiveAt > block.timestamp at inclusion. The demo picks effectiveAt before sending, so a slow send path can make it land late. 15s is a judgment call between reliability and how long the reader waits; a retry on EffectiveAtInPast would be the more robust option if you prefer.

How has it been tested?

  • node scripts/test-vibenet-engine.mjs: passes, with a new assertion that the updateMultiplier helper is gone (re-run after review fixes: passes)
  • tsc --noEmit on examples/verified-doc-samples/typescript: passes
  • node scripts/validate-docs-structure.js: passes
  • node scripts/lint-mdx.js: 0 errors on changed pages
  • Not yet done: clicking through the live split demo in a browser preview

Screenshots

TODO: capture the Apply a Multiplier demo split step (live and offline).

Move docs examples off the deprecated Beryl multiplier names
(updateMultiplier, multiplier, scaledBalanceOf, MultiplierUpdated) to
the Cobalt ERC-8056 surface (updateUIMultiplier, uiMultiplier,
balanceOfUI, UIMultiplierUpdated).

- Vibenet engine: scheduled setter, uiMultiplier/balanceOfUI reads,
  waitForTimestamp helper; bump ENGINE_VERSION to 5 and loader to ?v=5
- AssetDemo live + offline split and B20PlaygroundDemo
- Verified-sample asset ABI drops the deprecated entries
- List Tokenized Stocks helper table and history event
- Constants wording; Beryl B20 page gets a pointer note

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@mintlify

mintlify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
base 🟢 Ready View Preview Sep 29, 2026, 3:17 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@cb-heimdall

cb-heimdall commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Heimdall Review Status

Requirement Status More Info
Reviews ✅ 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

- multiplier()/scaledBalanceOf stay canonical per base-std; only
  toScaledBalance/toRawBalance/updateMultiplier are deprecated
- AssetDemo: effectiveAt margin 5s -> 15s; waitForTimestamp timeout 60s
- Playground: split takes effect at effectiveAt, not in the same call
- History reconstruction: key by effectiveAtTimestamp, drop cancelled
  updates (UIMultiplierUpdateCancelled)
- Beryl note: event change; constants: remove em-dash

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@roethke
roethke merged commit 9b678e7 into master Sep 29, 2026
16 checks passed
@roethke
roethke deleted the roethke/b20-cobalt-multiplier-examples branch September 29, 2026 15:18

This branch was successfully deployed

1 active deployment
staging - docs — ebd8e973 Deployed Sep 29, 2026 by mintlify[bot]
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