CovenantNotes
CovenantNotes
Every position is an ERC-721 token, so the storage is keyed by token id rather than by address. That is what lets one wallet hold several distinct positions, each with its own principal, rate and bonus clock.
| Field | Meaning |
|---|---|
principal | The basis rewards are computed on. Not a withdrawable balance. |
pending | Accrued and not yet claimed |
rateBps | Stored daily rate — base plus compound steps, 1000 (10%) to 2000 (20%). The commit boost is not stored here; it is applied live. |
origin | 0 = Sell, 1 = Commit. Permanent — it survives everything. |
ownedSince | When the position last changed hands |
boostDead | Sticky: once the boost is forfeited it never returns for that bond |
Entrypoints
openBond(amount)— voluntary, 20%..100% of the caller's balance, 15%/day effective at birth (the 10% base plus the +5 boost). Mints a new position.openBondFrom(owner, amount)— the sell-side retention, entry rate 10%/day, callable only by the wired retention sourcecompound(tokenId)— rollspendingintoprincipal; adds +0.25 point at most once per 6h. What a bond earns never exceeds 20%/day; a rate grant and a rate floor are both applied on top of that.claim(tokenId)— pays out to the owner; the rate is untouchedmerge(tokenIds)— consolidates your positions into the first one; every bond merged must share the same origin and the same boost state. Present on the contract and callable directly, but the app does not offer ittokensOf(address)— lists a holder's positions, so the app needs no indexer
Views worth knowing
rateOf(tokenId)— the stored rate: base plus compound stepseffectiveRateOf(tokenId)— the stored rate, plus the live boost, plus any rate grant, then lifted to the rate floor if one is set. The first two are capped at 20%/day; the grant and the floor both sit on top of that cap, so this can exceed it. The number a holder actually earnsglobalBoostBps()— the rate grant currently in force, in basis points per day. Zero means the plain schedule; it is set by the deploying key and can changerateFloorBps()— the floor under every bond's daily rate. Zero means no floorexemptAllowanceOf(address)— retention-free selling volume left:exemptGrantedOfminusexemptUsedOf, floored at zero. The figure that prices a sale: the hook waives the retention only while it covers the whole amountexemptGrantedOf(address)— the total ever granted: 5x the opening principal of every bond this wallet was the first to hold, sell-side and commit alike. Written once per bond, at its opening, and never again. Compounding does not grow it, and a position that reaches a wallet by any other means grants that wallet nothing, because the grant was struck for whoever first held itcommitPrincipalOf(address)— sum of the wallet's commit-origin principals. Display only since the grant-at-opening rule; it no longer prices anythingexemptUsedOf(address)— exempt volume consumed, lifetime. The hook adds to it throughconsumeExemption(seller, amount), which only the wired retention source may calldebitedThisTx(address)— how much C4 the wallet has sent out so far in the current transaction. Zero at the start of every transaction, and spent byconsumeExemption, so it proves a seller is really selling on a route the hook cannot otherwise vouch forhasCommitBond(address)— true while the wallet owns at least one commit-origin bond (display-level; the allowance is what decides)commitBondCountOf(address)— how many commit-origin bonds the wallet holdslastStripAt(address)— the instant the wallet last moved tokens out
EXEMPT_CAP_MULTIPLE is the constant behind the allowance: 5.
The token contract reports every outbound transfer to CovenantNotes — the wallet and
the amount (onTokenDebit, wired once via initBonds), which is what strips the boost
and what feeds the same-transaction tally; zero-amount transfers and self-transfers are
ignored, so nobody can strip a stranger with a 0-amount transferFrom. tokenURI is fully on-chain
and lists each position's principal, origin, whether its boost is active, and the
effective daily rate.