LUSG docsLIUM FINANCE Vibenet live · Base Sepolia next Open the app →
Contents
Reference

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

ContractAddress
LUSG (B20 Asset)0xb200000000000000000000b4BAc3eD491f25252f
LusgClock0x75d13F320cEACbbdE0C768C84587005A3dFC523B
LusgDesk0x4FC30aCD4AcCD6F0A511Fb8F28D5A05b2421D94e
BillOracle0xF49A3EFcfb7f0D82645E46CE4110445608C35175
USDV (Vibenet faucet dollar)0x81764F32B52cB424C6df38513c7F884FBdb0f99d
BillOracle v0 (retired: rate rounding)0x5a97E5615F91C71079bac24e9EBfe6E22bB59ADA

LusgClock

FunctionWhoDoes
tick() returns (bool)anyoneSchedules the next whole minute's multiplier; false while a step is pending or before the first mint
check() returns (int256 gapBps, bool alert)anyoneMarket against amortized value; alert above 50 bps
settleMatured()anyoneMoves matured lots into cash at face; value unchanged
depositCash(uint256 usd, bytes32 ref) / withdrawCash(…)managerBooks money in or out
buyLot(bytes9 cusip, uint128 face, uint128 cost)managerBuys a bill from cash at a stated all-in cost
buyLotAtMarket(bytes9 cusip, uint128 face)managerBuys a bill from cash at the oracle's price
nav(), navAt(t), marketNav(), multiplierAt(t), usdValueOf(account)viewBasket value, the multiplier, a holder's value to the second
lotCount(), lotAt(i), lotValueAt(i, t), cash()viewThe books
setManager, setOraclemanagerHand 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

SuiteTestsCovers
test/Lusg.t.sol15Exact 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.sol10Buy 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.