Contract reference.
Addresses on Base Vibenet (chain 84538453), then every external function. Sources are plain Solidity 0.8, compiled with Solar v0.3.0.
Addresses
| Contract | Address |
|---|---|
| LUSG (B20 Asset) | 0xb200000000000000000000b4BAc3eD491f25252f |
| LusgClock | 0x75d13F320cEACbbdE0C768C84587005A3dFC523B |
| LusgDesk | 0x4FC30aCD4AcCD6F0A511Fb8F28D5A05b2421D94e |
| BillOracle | 0xF49A3EFcfb7f0D82645E46CE4110445608C35175 |
| USDV (Vibenet faucet dollar) | 0x81764F32B52cB424C6df38513c7F884FBdb0f99d |
| BillOracle v0 (retired: rate rounding) | 0x5a97E5615F91C71079bac24e9EBfe6E22bB59ADA |
LusgClock
| Function | Who | Does |
|---|---|---|
tick() returns (bool) | anyone | Schedules the next whole minute's multiplier; false while a step is pending or before the first mint |
check() returns (int256 gapBps, bool alert) | anyone | Market against amortized value; alert above 50 bps |
settleMatured() | anyone | Moves matured lots into cash at face; value unchanged |
depositCash(uint256 usd, bytes32 ref) / withdrawCash(…) | manager | Books money in or out |
buyLot(bytes9 cusip, uint128 face, uint128 cost) | manager | Buys a bill from cash at a stated all-in cost |
buyLotAtMarket(bytes9 cusip, uint128 face) | manager | Buys a bill from cash at the oracle's price |
nav(), navAt(t), marketNav(), multiplierAt(t), usdValueOf(account) | view | Basket value, the multiplier, a holder's value to the second |
lotCount(), lotAt(i), lotValueAt(i, t), cash() | view | The books |
setManager, setOracle | manager | Hand over the books; repoint the oracle |
Events: Ticked(multiplier, effectiveAt, nav), MarketChecked(amortized, market, gapBps, alert), LotBought, LotSettled, CashMoved. Errors: NotManager, InsufficientCash, BadLot, UnknownBill.
LusgDesk
See Buy and redeem for the interface. Events: Bought(buyer, usdIn, lusgOut, price), Redeemed(holder, lusgIn, usdOut, price), TestKycGranted(account), KycSet. Errors: AboveMaxBuy, Slippage, NotEnoughLiquidity(available, needed), NotOwner, NotCompliance.
BillOracle
See Bill oracle. Events: RatesPosted(asOf, rates), BillSet(cusip, maturity). Errors: Stale(asOf), BadDate, BadRate, UnknownBill, NotPoster.
Tests
| Suite | Tests | Covers |
|---|---|---|
test/Lusg.t.sol | 15 | Exact oracle prices, staleness, dates only forward, straight-line accretion, one pending step, catch-up after missed minutes, settlement, the market check and its alert, the per-second value |
test/LusgDesk.t.sol | 10 | Buy at current price with test KYC, price unchanged by trades, redemption with accrual, the liquidity cap, blocklisted buyers and redeemers, slippage, max buy, access, two buyers sharing fairly |
forge test --use solar # 25 passed, 0 failed
Local tests use mocks of the B20 surface, because Foundry can't execute Base's precompiles. Everything that touches a precompile was verified on Vibenet instead.