Denom
untyped stringDenom is the only asset this realm escrows.
Value
"ugnot"
MaxFeeBps
int64MaxFeeBps is the hard protocol-fee cap: 1000 bps = 10%.
Value
1000
StatusPending
untyped stringTranche status values. A tranche is created pending and reaches exactly one terminal state; both terminals are frozen.
Value
"pending"
StatusReleased
untyped stringTranche status values. A tranche is created pending and reaches exactly one terminal state; both terminals are frozen.
Value
"released"
StatusRevoked
untyped stringTranche status values. A tranche is created pending and reaches exactly one terminal state; both terminals are frozen.
Value
"revoked"
MinDelayBlocks
int64Bounds. All are compile-time constants: none is admin-mutable, so a schedule's shape cannot be changed under its funder or beneficiary.
Value
1
MaxDelayBlocks
int64Bounds. All are compile-time constants: none is admin-mutable, so a schedule's shape cannot be changed under its funder or beneficiary.
Value
100000000
MaxTranches
untyped bigintBounds. All are compile-time constants: none is admin-mutable, so a schedule's shape cannot be changed under its funder or beneficiary.
Value
(64 <untyped> bigint)
MaxOpenTranches
untyped bigintBounds. All are compile-time constants: none is admin-mutable, so a schedule's shape cannot be changed under its funder or beneficiary.
Value
(5000 <untyped> bigint)
MaxOpenPerFunder
untyped bigintBounds. All are compile-time constants: none is admin-mutable, so a schedule's shape cannot be changed under its funder or beneficiary.
Value
(256 <untyped> bigint)
MaxTitleLen
untyped bigintBounds. All are compile-time constants: none is admin-mutable, so a schedule's shape cannot be changed under its funder or beneficiary.
Value
(80 <untyped> bigint)
MaxMemoLen
untyped bigintBounds. All are compile-time constants: none is admin-mutable, so a schedule's shape cannot be changed under its funder or beneficiary.
Value
(1000 <untyped> bigint)
MaxSpecLen
untyped bigintBounds. All are compile-time constants: none is admin-mutable, so a schedule's shape cannot be changed under its funder or beneficiary.
Value
(1400 <untyped> bigint)
MaxListed
untyped bigintBounds. All are compile-time constants: none is admin-mutable, so a schedule's shape cannot be changed under its funder or beneficiary.
Value
(50 <untyped> bigint)
tranche
typetranche is one dated payment. It is this realm's authoritative record; the matching duebook deferral carries only the due height and a label. Records are kept after they terminate, so history remains answerable once duebook has consumed the deferral.
Value
vesting.tranche
schedule
typeschedule is one funded vesting agreement.
Value
vesting.schedule
admin
.uverse.address// may set fee, fee recipient, and propose a successor
Value
<gnolang.StringValue>
pendingAdmin
.uverse.address// must accept before the handover takes effect
Value
<zero>
feeRecipient
.uverse.address// may withdraw fees and sweep surplus
Value
<gnolang.StringValue>
feeBps
int64// fee snapshotted into NEW schedules
Value
0
self
.uverse.address// this realm's address, captured at deploy
Value
<gnolang.StringValue>
nextScheduleID
int64Value
0
escrowTotal
int64// == Σ amount over pending tranches (the E term)
Value
0
schedules
*v0.Tree// padID(scheduleID) -> \*schedule
- OID
- 0d55bf…6423:11
schedules details
tranches
*v0.Tree// padU(deferralID) -> \*tranche
- OID
- 0d55bf…6423:14
tranches details
openByFunder
*v0.Tree// funder.String() -> int64
- OID
- 0d55bf…6423:17
openByFunder details
ledger
*feeledger.Ledger- OID
- 0d55bf…6423:20
ledger details
book
*duebook.Book- OID
- 0d55bf…6423:25
book details
init.28
func()- OID
- 0d55bf…6423:29
init.28 details
rejectStraySend
func()rejectStraySend aborts if an EOA attached coins to an entrypoint that has no use for them. Only Fund accepts value; without this guard a mistyped send would be silently absorbed into surplus.
- OID
- 0d55bf…6423:31
rejectStraySend details
Fund
func(beneficiary .uverse.address, title string, memo string, spec string, revocable bool, maxFeeBps int64) int64Fund creates a vesting schedule in a single transaction: it escrows the attached GNOT, registers every tranche with duebook, and returns the new schedule id. Only direct EOA calls with -send are accepted. spec lists the tranches as "delay:amount" pairs separated by commas, for example "100:500,200:500,300:1000". Delays are in BLOCKS FROM NOW and must be STRICTLY INCREASING — two payments at the same height are one tranche with the amounts added. Every amount must be positive, and the amounts must sum to EXACTLY the attached send: this realm will not silently absorb a surplus or create an underfunded schedule. revocable decides, permanently, whether the funder may reclaim not-yet-due tranches. There is no setter; an irrevocable schedule stays irrevocable. maxFeeBps is the ceiling the caller signs for. Funding is rejected if the live fee exceeds it, which closes the race where an admin sequences a fee raise ahead of this transaction. Pass MaxFeeBps to accept any legal fee.
- OID
- 0d55bf…6423:32
Fund details
Release
func(trancheID int64) stringRelease pays out a due tranche. ANYONE may call it: the value is credited to the schedule's RECORDED BENEFICIARY, never to the caller, so a stranger calling this gains nothing and the beneficiary needs no liveness of their own. The protocol fee snapshotted at funding is charged here. Aborts if the tranche does not exist, is not due yet, or has already been released or revoked — the last of those is duebook's guarantee, not a check written here.
- OID
- 0d55bf…6423:33
Release details
Revoke
func(trancheID int64) stringRevoke returns a NOT-YET-DUE tranche to the funder's claimable balance, fee-free. Only the funder may call it, and only on a schedule created revocable. A tranche whose due height has arrived can never be revoked, even though duebook's Cancel would consume it: that refusal is this realm's, and it is what stops a funder front-running the beneficiary's Release to claw back value already vested.
- OID
- 0d55bf…6423:34
Revoke details
RevokeAll
func(scheduleID int64) stringRevokeAll returns every not-yet-due tranche of a schedule to the funder's claimable balance in one transaction, and returns how many were revoked. Already-due and already-settled tranches are skipped, not an error. Funder only, revocable schedules only. Aborts if nothing was revocable, so a no-op cannot be mistaken for success.
- OID
- 0d55bf…6423:35
RevokeAll details
revokeOne
func(s *vesting.schedule, t *vesting.tranche, now int64)revokeOne cancels one pending, not-yet-due tranche and credits the funder fee-free. Callers have already verified authorization, revocability and the due-height refusal.
- OID
- 0d55bf…6423:36
revokeOne details
Withdraw
func(amount int64) stringWithdraw sends amount ugnot of the caller's claimable balance (released tranches for a beneficiary, revocations for a funder) to the caller.
- OID
- 0d55bf…6423:37
Withdraw details
WithdrawAll
func() stringWithdrawAll sends the caller's entire claimable balance to the caller. Aborts if there is nothing to withdraw.
- OID
- 0d55bf…6423:38
WithdrawAll details
WithdrawFees
func() stringWithdrawFees sends the accrued fee pot to the fee recipient. Only the fee recipient may call it.
- OID
- 0d55bf…6423:39
WithdrawFees details
SweepDenom
func(denom string) stringSweepDenom sends the surplus of a single denomination to the fee recipient. For ugnot only the excess over Liabilities() moves — escrowed tranches and claimable balances are untouchable by construction. Other denominations move wholly. Only the fee recipient may call it.
- OID
- 0d55bf…6423:40
SweepDenom details
SetFeeBps
func(bps int64)SetFeeBps sets the protocol fee snapshotted into FUTURE schedules at funding. Existing schedules keep the fee they were funded under, so an in-flight schedule's economics cannot be changed. Admin only.
- OID
- 0d55bf…6423:41
SetFeeBps details
SetFeeRecipient
func(next .uverse.address)SetFeeRecipient re-points the fee/surplus role. The pot accrued under the OUTGOING recipient is settled to that recipient's own claimable balance first, so the successor inherits the role and not the earnings. Admin only; the zero address is rejected.
- OID
- 0d55bf…6423:42
SetFeeRecipient details
ProposeAdmin
func(next .uverse.address)ProposeAdmin nominates a successor admin. The handover takes effect only when that account calls AcceptAdmin, so a typo cannot strand the role. Admin only; the zero address clears a pending proposal.
- OID
- 0d55bf…6423:43
ProposeAdmin details
AcceptAdmin
func()AcceptAdmin completes a handover. Only the proposed account may call it.
- OID
- 0d55bf…6423:44
AcceptAdmin details
ScheduleInfo
func(id int64) (funder .uverse.address, beneficiary .uverse.address, title string, total int64, feeBps int64, revocable bool, createdAt int64, numTranches int64, pending int64, releasedGross int64, revokedTotal int64)- OID
- 0d55bf…6423:45
ScheduleInfo details
Memo
func(id int64) stringMemo returns a schedule's raw memo text.
- OID
- 0d55bf…6423:46
Memo details
TrancheInfo
func(trancheID int64) (scheduleID int64, seq int64, amount int64, dueAt int64, status string, settledAt int64)TrancheInfo returns one tranche's fields by value. It answers for settled tranches too, after duebook has consumed the deferral.
- OID
- 0d55bf…6423:47
TrancheInfo details
TranchesOf
func(id int64) stringTranchesOf lists a schedule's tranches, newline-separated, one per line as "id seq amount dueAt status".
- OID
- 0d55bf…6423:48
TranchesOf details
VestedOf
func(id int64) (vested int64, unvested int64)VestedOf returns, for a schedule, the amount whose due height has arrived and which is therefore no longer revocable — whether or not it has been released yet — alongside the amount still revocable by the funder.
- OID
- 0d55bf…6423:49
VestedOf details
ReleasableNow
func() stringReleasableNow lists tranche ids that are due and still pending, up to MaxListed, newline-separated. Anyone may Release each of them.
- OID
- 0d55bf…6423:50
ReleasableNow details
Admin
func() .uverse.address- OID
- 0d55bf…6423:51
Admin details
PendingAdmin
func() .uverse.address- OID
- 0d55bf…6423:52
PendingAdmin details
FeeRecipient
func() .uverse.address- OID
- 0d55bf…6423:53
FeeRecipient details
FeeBps
func() int64FeeBps returns the fee that will be snapshotted into newly funded schedules. Existing schedules keep their own snapshot.
- OID
- 0d55bf…6423:54
FeeBps details
FeeOn
func(amount int64) (fee int64, credited int64)FeeOn previews the fee and net credit for a tranche of amount at the CURRENT FeeBps.
- OID
- 0d55bf…6423:55
FeeOn details
NumSchedules
func() int64NumSchedules returns how many schedules have ever been funded.
- OID
- 0d55bf…6423:56
NumSchedules details
OpenTrancheCount
func() intOpenTrancheCount returns how many tranches are pending across the whole realm, against the MaxOpenTranches cap.
- OID
- 0d55bf…6423:57
OpenTrancheCount details
OpenTranchesOfFunder
func(funder .uverse.address) int64OpenTranchesOfFunder returns how many tranches funder currently holds pending, against the MaxOpenPerFunder cap. A funder can read this before funding to see the headroom they have left.
- OID
- 0d55bf…6423:58
OpenTranchesOfFunder details
FundersWithOpenTranches
func() intFundersWithOpenTranches returns how many distinct funders hold at least one pending tranche. It is the width of the per-funder cap: exhausting MaxOpenTranches requires this to reach ceil(MaxOpenTranches/MaxOpenPerFunder).
- OID
- 0d55bf…6423:59
FundersWithOpenTranches details
EscrowTotal
func() int64EscrowTotal returns the escrow held by pending tranches (the E term).
- OID
- 0d55bf…6423:60
EscrowTotal details
BalanceOf
func(addr .uverse.address) int64BalanceOf returns addr's claimable balance (released tranches for a beneficiary, revocations for a funder).
- OID
- 0d55bf…6423:61
BalanceOf details
UsersTotal
func() int64UsersTotal returns the sum of all claimable balances (the U term).
- OID
- 0d55bf…6423:62
UsersTotal details
FeesAccrued
func() int64FeesAccrued returns the fee pot (the F term).
- OID
- 0d55bf…6423:63
FeesAccrued details
Liabilities
func() int64Liabilities returns everything this realm owes: EscrowTotal + UsersTotal + FeesAccrued.
- OID
- 0d55bf…6423:64
Liabilities details
Held
func() int64Held returns the ugnot actually held at this realm's address (H).
- OID
- 0d55bf…6423:65
Held details
Surplus
func() int64Surplus returns Held() - Liabilities() (the S term).
- OID
- 0d55bf…6423:66
Surplus details
Address
func() .uverse.address- OID
- 0d55bf…6423:67
Address details
Height
func() int64Height returns the current chain height. Delays in Fund's spec are relative to the height at which Fund executes, so this is an aid for composing a spec, not an input to one.
- OID
- 0d55bf…6423:68
Height details
Render
func(path string) stringRender shows the realm at "" and a schedule detail at "\<id>". Free text (titles are charset-restricted; memos are not) passes through the ecosystem sanitizer before it reaches markdown.
- OID
- 0d55bf…6423:69
Render details
renderSchedule
func(path string) string- OID
- 0d55bf…6423:70
renderSchedule details
assertAdmin
func(caller .uverse.address)- OID
- 0d55bf…6423:71
assertAdmin details
assertRevocableBy
func(s *vesting.schedule, caller .uverse.address)assertRevocableBy checks both halves of the revocation authority: the schedule must have been funded revocable, and the caller must be its funder.
- OID
- 0d55bf…6423:72
assertRevocableBy details
mustSchedule
func(id int64) *vesting.schedule- OID
- 0d55bf…6423:73
mustSchedule details
mustTranche
func(did uint64) *vesting.tranche- OID
- 0d55bf…6423:74
mustTranche details
openOf
func(funder .uverse.address) int64openOf reports how many tranches funder currently holds pending. A missing key means zero, which is the same thing: addOpen removes the entry when the count reaches zero.
- OID
- 0d55bf…6423:75
openOf details
addOpen
func(funder .uverse.address, delta int64)addOpen adjusts funder's pending-tranche count by delta, which may be negative. Every increment happens in Fund and every decrement is paired with a pending -> terminal transition, so the count tracks exactly the tranches openOf claims.
- OID
- 0d55bf…6423:76
addOpen details
mustID
func(id int64) uint64mustID converts an entrypoint's int64 tranche id to duebook's uint64, rejecting the non-positive values duebook never issues.
- OID
- 0d55bf…6423:77
mustID details
parseSpec
func(spec string) (delays []int64, amounts []int64)parseSpec parses "delay:amount,delay:amount,…" into parallel slices, enforcing every bound before any state is touched. Delays must be strictly increasing; amounts must be positive. Nothing here consults or mutates realm state, so a malformed spec is rejected with the escrow still untouched (the whole transaction aborts regardless).
- OID
- 0d55bf…6423:78
parseSpec details
assertValidTitle
func(title string)assertValidTitle bounds length and restricts the charset so titles are list-safe in Render without escaping.
- OID
- 0d55bf…6423:79
assertValidTitle details
padID
func(id int64) stringpadID renders a schedule id as a fixed-width key so avl iteration order is numeric order.
- OID
- 0d55bf…6423:80
padID details
padU
func(id uint64) stringpadU renders a deferral id as a fixed-width key. 20 digits covers the whole uint64 range, so tranche iteration is numeric order too.
- OID
- 0d55bf…6423:81
padU details
itoa
func(n int64) string- OID
- 0d55bf…6423:82
itoa details
utoa
func(n uint64) string- OID
- 0d55bf…6423:83
utoa details
btoa
func(b bool) string- OID
- 0d55bf…6423:84
btoa details
checkedAdd
func(a int64, b int64) (int64, bool)- OID
- 0d55bf…6423:85