erc8056

Reference implementation and canonical explainer for ERC-8056 (uiMultiplier()), the corporate-actions standard behind Robinhood's Stock Tokens on Robinhood Chain (chain ID 4663).
Two things ship here: an auditable Solidity reference implementation, and the exact-bigint
TypeScript library that makes integrating it hard to get wrong. If you display a portfolio,
price a token, or index transfers of a tokenized equity, this is the standard you have to
handle, and there are exactly two rules you have to get right.
Docs: https://nirholas.github.io/robinhood-chain-erc8056/
The problem
A tokenized share has to survive corporate actions. When an issuer runs a 4:1 split, one
share becomes four. Neither obvious on-chain answer works:
- Mint to every holder. Needs unbounded iteration over the holder set, and is simply
impossible for tokens sitting in AMM pools, vaults, and bridges that were never built to
receive an airdrop.
- Rebase. Redefine
balanceOf so every balance scales. This breaks every cached
balance, every AMM invariant, and every accounting system that assumes transfer(x) moves
exactly x. Rebasing tokens are notorious for exactly this reason.
ERC-8056 takes a third path. Balances are immutable ledger units, and a single global
uiMultiplier() records how many shares one token currently represents. A 4:1 split
multiplies that number by four. No balance moves, no Transfer event fires, no AMM
invariant shifts, and every integration that never opted in keeps working on unchanged
numbers instead of silently computing wrong ones.
The cost of that design is that the token now has two units, and mixing them up is the whole
integration risk:
| Unit | What it is | Changes on a split? |
|---|
| TOKEN | What balanceOf returns, what transfer moves, what a pool holds | No |
| SHARE-EQUIVALENT | What the holder economically owns, what a statement prints | Yes |
The two rules
Rule 1. A Chainlink Robinhood feed answer is already multiplier-adjusted. It is the price
of one TOKEN, not one share. To get the share price, divide by the multiplier. Never
multiply. To value a position, multiply the raw balance by the feed price.
Rule 2. Share-equivalent quantities are balance * uiMultiplier / 1e18, truncating. The
raw balanceOf value stops being a share count the moment a corporate action lands.
Both rules are enforced by the type system in this package, not merely documented.
TokenAmount and ShareAmount are distinct types; TokenPrice and SharePrice carry a
runtime-inspectable unit tag; and positionValue demands a TokenPrice, so pairing a
share price with a raw balance does not compile.
Evidence: this is live, not theoretical
The standard is easy to dismiss because 93 of the 95 canonical Stock Tokens sit at exactly
1e18 today. Two do not, and they prove the mechanism is load-bearing right now:
npm run verify:onchain
Robinhood Chain mainnet (chain 4663) via https://rpc.mainnet.chain.robinhood.com
Block 14994060
Checking ERC-8056 invariants across all 95 canonical Stock Tokens...
95/95 tokens implement uiMultiplier()
totalSupplyUI() == truncating mulDiv(totalSupply, uiMultiplier, 1e18) on every one of them
Tokens with a corporate action already applied (uiMultiplier != 1.0):
SGOV 0x92FD66527192E3e61d4DDd13322Aa222DE86F9B5 uiMultiplier() = 1000957519890990718
= 1.000957519890990718 shares per token iShares 0-3 Month Treasury Bond - Robinhood Token
WEEK 0xc93a8c440CEa26D7445dF01729f193b27965099f uiMultiplier() = 2006182524271844660
= 2.00618252427184466 shares per token Roundhill Weekly T-Bill ETF - Robinhood Token
Rule 1 on live data (SGOV, feed 0xa0DF4ee0fFf975306345875E3548Fcc519577A11):
Chainlink answer 10068131213 (100.68131213 per TOKEN)
divided by the multiplier 100.58499999 per SHARE
the wrong way (multiply) 100.77771648 <- overstates the share price
Pre-ERC-8056 fallback (a real contract with no uiMultiplier()):
WETH 0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73 implemented = false, resolves to 1000000000000000000 [OK]