Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

vesting state

Back to all declarations

Denom

untyped string

Denom is the only asset this realm escrows.

Value

"ugnot"

MaxFeeBps

int64

MaxFeeBps is the hard protocol-fee cap: 1000 bps = 10%.

Value

1000

StatusPending

untyped string

Tranche status values. A tranche is created pending and reaches exactly one terminal state; both terminals are frozen.

Value

"pending"

StatusReleased

untyped string

Tranche status values. A tranche is created pending and reaches exactly one terminal state; both terminals are frozen.

Value

"released"

StatusRevoked

untyped string

Tranche status values. A tranche is created pending and reaches exactly one terminal state; both terminals are frozen.

Value

"revoked"

MinDelayBlocks

int64

Bounds. 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

int64

Bounds. 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 bigint

Bounds. 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 bigint

Bounds. 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 bigint

Bounds. 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 bigint

Bounds. 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 bigint

Bounds. 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 bigint

Bounds. 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 bigint

Bounds. 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

type

tranche 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

type

schedule 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

int64

Value

0

escrowTotal

int64

// == Σ amount over pending tranches (the E term)

Value

0

schedules

*v0.Tree

// padID(scheduleID) -> \*schedule

Open
OID
0d55bf…6423:11
schedules details

Inspect pointer

tranches

*v0.Tree

// padU(deferralID) -> \*tranche

Open
OID
0d55bf…6423:14
tranches details

Inspect pointer

openByFunder

*v0.Tree

// funder.String() -> int64

Open
OID
0d55bf…6423:17
openByFunder details

Inspect pointer

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.

Open
OID
0d55bf…6423:31
rejectStraySend details

Inspect func

Fund

func(beneficiary .uverse.address, title string, memo string, spec string, revocable bool, maxFeeBps int64) int64

Fund 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.

Open
OID
0d55bf…6423:32
Fund details

Inspect func

Release

func(trancheID int64) string

Release 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.

Open
OID
0d55bf…6423:33
Release details

Inspect func

Revoke

func(trancheID int64) string

Revoke 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.

Open
OID
0d55bf…6423:34
Revoke details

Inspect func

RevokeAll

func(scheduleID int64) string

RevokeAll 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.

Open
OID
0d55bf…6423:35
RevokeAll details

Inspect func

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.

Open
OID
0d55bf…6423:36
revokeOne details

Inspect func

Withdraw

func(amount int64) string

Withdraw sends amount ugnot of the caller's claimable balance (released tranches for a beneficiary, revocations for a funder) to the caller.

Open
OID
0d55bf…6423:37
Withdraw details

Inspect func

WithdrawAll

func() string

WithdrawAll sends the caller's entire claimable balance to the caller. Aborts if there is nothing to withdraw.

Open
OID
0d55bf…6423:38
WithdrawAll details

Inspect func

WithdrawFees

func() string

WithdrawFees sends the accrued fee pot to the fee recipient. Only the fee recipient may call it.

Open
OID
0d55bf…6423:39
WithdrawFees details

Inspect func

SweepDenom

func(denom string) string

SweepDenom 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.

Open
OID
0d55bf…6423:40
SweepDenom details

Inspect func

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.

Open
OID
0d55bf…6423:41
SetFeeBps details

Inspect func

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.

Open
OID
0d55bf…6423:42
SetFeeRecipient details

Inspect func

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.

Open
OID
0d55bf…6423:43
ProposeAdmin details

Inspect func

AcceptAdmin

func()

AcceptAdmin completes a handover. Only the proposed account may call it.

Open
OID
0d55bf…6423:44
AcceptAdmin details

Inspect func

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)
Open
OID
0d55bf…6423:45
ScheduleInfo details

Inspect func

Memo

func(id int64) string

Memo returns a schedule's raw memo text.

Open
OID
0d55bf…6423:46
Memo details

Inspect func

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.

Open
OID
0d55bf…6423:47
TrancheInfo details

Inspect func

TranchesOf

func(id int64) string

TranchesOf lists a schedule's tranches, newline-separated, one per line as "id seq amount dueAt status".

Open
OID
0d55bf…6423:48
TranchesOf details

Inspect func

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.

Open
OID
0d55bf…6423:49
VestedOf details

Inspect func

ReleasableNow

func() string

ReleasableNow lists tranche ids that are due and still pending, up to MaxListed, newline-separated. Anyone may Release each of them.

Open
OID
0d55bf…6423:50
ReleasableNow details

Inspect func

PendingAdmin

func() .uverse.address
Open
OID
0d55bf…6423:52
PendingAdmin details

Inspect func

FeeRecipient

func() .uverse.address
Open
OID
0d55bf…6423:53
FeeRecipient details

Inspect func

FeeBps

func() int64

FeeBps returns the fee that will be snapshotted into newly funded schedules. Existing schedules keep their own snapshot.

Open
OID
0d55bf…6423:54
FeeBps details

Inspect func

FeeOn

func(amount int64) (fee int64, credited int64)

FeeOn previews the fee and net credit for a tranche of amount at the CURRENT FeeBps.

Open
OID
0d55bf…6423:55
FeeOn details

Inspect func

NumSchedules

func() int64

NumSchedules returns how many schedules have ever been funded.

Open
OID
0d55bf…6423:56
NumSchedules details

Inspect func

OpenTrancheCount

func() int

OpenTrancheCount returns how many tranches are pending across the whole realm, against the MaxOpenTranches cap.

Open
OID
0d55bf…6423:57
OpenTrancheCount details

Inspect func

OpenTranchesOfFunder

func(funder .uverse.address) int64

OpenTranchesOfFunder 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.

Open
OID
0d55bf…6423:58
OpenTranchesOfFunder details

Inspect func

FundersWithOpenTranches

func() int

FundersWithOpenTranches 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).

Open
OID
0d55bf…6423:59
FundersWithOpenTranches details

Inspect func

EscrowTotal

func() int64

EscrowTotal returns the escrow held by pending tranches (the E term).

Open
OID
0d55bf…6423:60
EscrowTotal details

Inspect func

BalanceOf

func(addr .uverse.address) int64

BalanceOf returns addr's claimable balance (released tranches for a beneficiary, revocations for a funder).

Open
OID
0d55bf…6423:61
BalanceOf details

Inspect func

UsersTotal

func() int64

UsersTotal returns the sum of all claimable balances (the U term).

Open
OID
0d55bf…6423:62
UsersTotal details

Inspect func

FeesAccrued

func() int64

FeesAccrued returns the fee pot (the F term).

Open
OID
0d55bf…6423:63
FeesAccrued details

Inspect func

Liabilities

func() int64

Liabilities returns everything this realm owes: EscrowTotal + UsersTotal + FeesAccrued.

Open
OID
0d55bf…6423:64
Liabilities details

Inspect func

Held

func() int64

Held returns the ugnot actually held at this realm's address (H).

Open
OID
0d55bf…6423:65
Held details

Inspect func

Surplus

func() int64

Surplus returns Held() - Liabilities() (the S term).

Open
OID
0d55bf…6423:66
Surplus details

Inspect func

Height

func() int64

Height 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.

Open
OID
0d55bf…6423:68
Height details

Inspect func

Render

func(path string) string

Render 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.

Open
OID
0d55bf…6423:69
Render details

Inspect func

renderSchedule

func(path string) string
Open
OID
0d55bf…6423:70
renderSchedule details

Inspect func

assertAdmin

func(caller .uverse.address)
Open
OID
0d55bf…6423:71
assertAdmin details

Inspect func

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.

Open
OID
0d55bf…6423:72
assertRevocableBy details

Inspect func

mustSchedule

func(id int64) *vesting.schedule
Open
OID
0d55bf…6423:73
mustSchedule details

Inspect func

mustTranche

func(did uint64) *vesting.tranche
Open
OID
0d55bf…6423:74
mustTranche details

Inspect func

openOf

func(funder .uverse.address) int64

openOf 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.

Open
OID
0d55bf…6423:75
openOf details

Inspect func

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.

Open
OID
0d55bf…6423:76
addOpen details

Inspect func

mustID

func(id int64) uint64

mustID converts an entrypoint's int64 tranche id to duebook's uint64, rejecting the non-positive values duebook never issues.

Open
OID
0d55bf…6423:77
mustID details

Inspect func

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).

Open
OID
0d55bf…6423:78
parseSpec details

Inspect func

assertValidTitle

func(title string)

assertValidTitle bounds length and restricts the charset so titles are list-safe in Render without escaping.

Open
OID
0d55bf…6423:79
assertValidTitle details

Inspect func

padID

func(id int64) string

padID renders a schedule id as a fixed-width key so avl iteration order is numeric order.

Open
OID
0d55bf…6423:80
padID details

Inspect func

padU

func(id uint64) string

padU renders a deferral id as a fixed-width key. 20 digits covers the whole uint64 range, so tranche iteration is numeric order too.

Open
OID
0d55bf…6423:81
padU details

Inspect func

checkedAdd

func(a int64, b int64) (int64, bool)
Open
OID
0d55bf…6423:85
checkedAdd details

Inspect func
Denom : untyped string ="ugnot"
MaxFeeBps : int64 =1000
StatusPending : untyped string ="pending"
StatusReleased : untyped string ="released"
StatusRevoked : untyped string ="revoked"
MinDelayBlocks : int64 =1
MaxDelayBlocks : int64 =100000000
MaxTranches : untyped bigint =(64 <untyped> bigint)
MaxOpenTranches : untyped bigint =(5000 <untyped> bigint)
MaxOpenPerFunder : untyped bigint =(256 <untyped> bigint)
MaxTitleLen : untyped bigint =(80 <untyped> bigint)
MaxMemoLen : untyped bigint =(1000 <untyped> bigint)
MaxSpecLen : untyped bigint =(1400 <untyped> bigint)
MaxListed : untyped bigint =(50 <untyped> bigint)
tranche : type =vesting.tranche
schedule : type =vesting.schedule
admin : .uverse.address =<gnolang.StringValue>
pendingAdmin : .uverse.address =<zero>
feeRecipient : .uverse.address =<gnolang.StringValue>
feeBps : int64 =0
self : .uverse.address =<gnolang.StringValue>
nextScheduleID : int64 =0
escrowTotal : int64 =0
schedules : *v0.Tree Inspect
tranches : *v0.Tree Inspect
openByFunder : *v0.Tree Inspect
ledger : *feeledger.Ledger Inspect
book : *duebook.Book Inspect
init.28 : func() Inspect
rejectStraySend : func() Inspect
Fund : func(beneficiary .uverse.address, title string, memo string, spec string, revocable bool, maxFeeBps int64) int64 Inspect
Release : func(trancheID int64) string Inspect
Revoke : func(trancheID int64) string Inspect
RevokeAll : func(scheduleID int64) string Inspect
revokeOne : func(s *vesting.schedule, t *vesting.tranche, now int64) Inspect
Withdraw : func(amount int64) string Inspect
WithdrawAll : func() string Inspect
WithdrawFees : func() string Inspect
SweepDenom : func(denom string) string Inspect
SetFeeBps : func(bps int64) Inspect
SetFeeRecipient : func(next .uverse.address) Inspect
ProposeAdmin : func(next .uverse.address) Inspect
AcceptAdmin : func() Inspect
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) Inspect
Memo : func(id int64) string Inspect
TrancheInfo : func(trancheID int64) (scheduleID int64, seq int64, amount int64, dueAt int64, status string, settledAt int64) Inspect
TranchesOf : func(id int64) string Inspect
VestedOf : func(id int64) (vested int64, unvested int64) Inspect
ReleasableNow : func() string Inspect
Admin : func() .uverse.address Inspect
PendingAdmin : func() .uverse.address Inspect
FeeRecipient : func() .uverse.address Inspect
FeeBps : func() int64 Inspect
FeeOn : func(amount int64) (fee int64, credited int64) Inspect
NumSchedules : func() int64 Inspect
OpenTrancheCount : func() int Inspect
OpenTranchesOfFunder : func(funder .uverse.address) int64 Inspect
FundersWithOpenTranches : func() int Inspect
EscrowTotal : func() int64 Inspect
BalanceOf : func(addr .uverse.address) int64 Inspect
UsersTotal : func() int64 Inspect
FeesAccrued : func() int64 Inspect
Liabilities : func() int64 Inspect
Held : func() int64 Inspect
Surplus : func() int64 Inspect
Address : func() .uverse.address Inspect
Height : func() int64 Inspect
Render : func(path string) string Inspect
renderSchedule : func(path string) string Inspect
assertAdmin : func(caller .uverse.address) Inspect
assertRevocableBy : func(s *vesting.schedule, caller .uverse.address) Inspect
mustSchedule : func(id int64) *vesting.schedule Inspect
mustTranche : func(did uint64) *vesting.tranche Inspect
openOf : func(funder .uverse.address) int64 Inspect
addOpen : func(funder .uverse.address, delta int64) Inspect
mustID : func(id int64) uint64 Inspect
parseSpec : func(spec string) (delays []int64, amounts []int64) Inspect
assertValidTitle : func(title string) Inspect
padID : func(id int64) string Inspect
padU : func(id uint64) string Inspect
itoa : func(n int64) string Inspect
utoa : func(n uint64) string Inspect
btoa : func(b bool) string Inspect
checkedAdd : func(a int64, b int64) (int64, bool) Inspect