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

pkgPath

untyped string

// must match gnomod.toml

Value

"gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/vesting"

day

int64

Value

86400

GNOT

untyped string

Value

"ugnot"

BUBBLE

untyped string

Value

"gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubble"

MaxDays

int64

// a term, and a cliff, of at most a hundred years: the arithmetic below counts on it

Value

36500

maxNote

untyped bigint

Value

(120 <untyped> bigint)

listMax

untyped bigint

// grants the front page lists

Value

(50 <untyped> bigint)

kind

type

Value

vesting.kind

kindNative

vesting.kind

Value

<zero>

kindBubble

vesting.kind

Value

<zero>

kindRegistry

vesting.kind

Value

<zero>

Grant

type

Grant is one schedule. The fields are read through Get; only this realm writes them.

Value

vesting.Grant

last

int64

Value

1

Get

func(id int64) vesting.Grant

Get is a copy of the grant.

Open
OID
01efb8…95f9:10
Get details

Inspect func

Address

func(id int64) .uverse.address
Open
OID
01efb8…95f9:11
Address details

Inspect func

Balance

func(id int64) int64

Balance is what the grant's address holds of its token.

Open
OID
01efb8…95f9:12
Balance details

Inspect func

Vested

func(id int64) int64

Vested is what the schedule has released by now — or by the revoke, if there was one. Never above Total.

Open
OID
01efb8…95f9:13
Vested details

Inspect func

Claimable

func(id int64) int64

Claimable is what Claim would pay now: the vested part not yet paid, as far as the balance goes.

Open
OID
01efb8…95f9:14
Claimable details

Inspect func

balance

func(g *vesting.Grant) int64
Open
OID
01efb8…95f9:18
balance details

Inspect func

vested

func(g *vesting.Grant) int64
Open
OID
01efb8…95f9:19
vested details

Inspect func

vestedAt

func(g *vesting.Grant, t int64) int64

vestedAt is the schedule itself. The split of rest\*d/Days into a quotient and a remainder part keeps every intermediate inside int64 for any Total and a term under MaxDays, and equals the exact floor.

Open
OID
01efb8…95f9:20
vestedAt details

Inspect func

claimable

func(g *vesting.Grant) int64
Open
OID
01efb8…95f9:21
claimable details

Inspect func

kindOf

func(token string) vesting.kind
Open
OID
01efb8…95f9:22
kindOf details

Inspect func

canon

func(token string) string

canon names the token as the realm stores it: GNOT and BUBBLE by their constants, anything else by its registry key, which must resolve.

Open
OID
01efb8…95f9:23
canon details

Inspect func

mustBeOwner

func(g *vesting.Grant)
Open
OID
01efb8…95f9:25
mustBeOwner details

Inspect func

Create

func(owner .uverse.address, beneficiary .uverse.address, token string, total int64, upfront int64, start int64, cliffDays int64, days int64, note string) int64

Create opens a grant and returns its id. owner may revoke it ("" makes it irrevocable); the tokens are sent to Address(id) afterwards, by anyone. token: "gnot", "bubble" or a registry key. start 0 is now; a past start is allowed, a future one up to a hundred years out. days 0 vests everything at start. note is a label of up to 120 plain characters (no markup: the pages render it).

Open
OID
01efb8…95f9:26
Create details

Inspect func

Claim

func(id int64) int64

Claim pays the beneficiary everything claimable and returns the amount. Anyone may call it.

Open
OID
01efb8…95f9:27
Claim details

Inspect func

Revoke

func(id int64) int64

Revoke ends the schedule where it stands (the first time) and returns to the owner everything the grant holds beyond what has vested and is still the beneficiary's to claim. Before the up-front share has arrived, counting what was already paid out as arrived, it voids the grant instead: nothing vests, ever — so a unit of dust sent ahead of the owner's revoke, claimed or not, cannot turn a void into a freeze that keeps the up-front share. (A grant with no up-front share measures against what the schedule had released by the revoke.) Returns what went back; 0 when nothing did.

Open
OID
01efb8…95f9:28
Revoke details

Inspect func

Sweep

func(id int64) int64

Sweep returns to the owner what the schedule can never owe the beneficiary — above the unpaid rest of the grant while it runs, above what is still claimable once revoked — without ending anything. Owner only; on a grant with no owner the excess is the beneficiary's, and anyone may send it there.

Open
OID
01efb8…95f9:29
Sweep details

Inspect func

sweepTo

func(g *vesting.Grant, to .uverse.address) int64
Open
OID
01efb8…95f9:31
sweepTo details

Inspect func

send

func(g *vesting.Grant, to .uverse.address, n int64)

send moves n of the grant's token out of the grant's own address: the sub-realm is the sender, so one grant can never pay from another's balance.

Open
OID
01efb8…95f9:32
send details

Inspect func

SetOwner

func(id int64, to .uverse.address)

SetOwner names the next owner; nothing moves until they AcceptOwner. Naming "" withdraws the offer.

Open
OID
01efb8…95f9:33
SetOwner details

Inspect func

AcceptOwner

func(id int64)

AcceptOwner takes the owner role of a grant, by the one named.

Open
OID
01efb8…95f9:34
AcceptOwner details

Inspect func

Render

func(path string) string

Render: "" the newest grants; "\<id>" one grant; "json/\<id>" its figures in base units; "by/\<address>" the grants an address owns or receives.

Open
OID
01efb8…95f9:35
Render details

Inspect func

state

func(g *vesting.Grant) string
Open
OID
01efb8…95f9:40
state details

Inspect func

amount

func(g *vesting.Grant, n int64) string

amount prints base units in the token's own unit, trailing zeros dropped.

Open
OID
01efb8…95f9:42
amount details

Inspect func
pkgPath : untyped string ="gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/vesting"
day : int64 =86400
GNOT : untyped string ="ugnot"
BUBBLE : untyped string ="gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubble"
MaxDays : int64 =36500
maxNote : untyped bigint =(120 <untyped> bigint)
listMax : untyped bigint =(50 <untyped> bigint)
kind : type =vesting.kind
kindNative : vesting.kind =<zero>
kindBubble : vesting.kind =<zero>
kindRegistry : vesting.kind =<zero>
Grant : type =vesting.Grant
grants : *v0.Tree Inspect
last : int64 =1
init.14 : func() Inspect
Count : func() int64 Inspect
Get : func(id int64) vesting.Grant Inspect
Address : func(id int64) .uverse.address Inspect
Balance : func(id int64) int64 Inspect
Vested : func(id int64) int64 Inspect
Claimable : func(id int64) int64 Inspect
subpath : func(id int64) string Inspect
key : func(id int64) string Inspect
get : func(id int64) *vesting.Grant Inspect
balance : func(g *vesting.Grant) int64 Inspect
vested : func(g *vesting.Grant) int64 Inspect
vestedAt : func(g *vesting.Grant, t int64) int64 Inspect
claimable : func(g *vesting.Grant) int64 Inspect
kindOf : func(token string) vesting.kind Inspect
canon : func(token string) string Inspect
caller : func() .uverse.address Inspect
mustBeOwner : func(g *vesting.Grant) Inspect
Create : func(owner .uverse.address, beneficiary .uverse.address, token string, total int64, upfront int64, start int64, cliffDays int64, days int64, note string) int64 Inspect
Claim : func(id int64) int64 Inspect
Revoke : func(id int64) int64 Inspect
Sweep : func(id int64) int64 Inspect
sweep : func(g *vesting.Grant) int64 Inspect
sweepTo : func(g *vesting.Grant, to .uverse.address) int64 Inspect
send : func(g *vesting.Grant, to .uverse.address, n int64) Inspect
SetOwner : func(id int64, to .uverse.address) Inspect
AcceptOwner : func(id int64) Inspect
Render : func(path string) string Inspect
home : func() string Inspect
page : func(g *vesting.Grant) string Inspect
by : func(who .uverse.address) string Inspect
json : func(g *vesting.Grant) string Inspect
state : func(g *vesting.Grant) string Inspect
date : func(unix int64) string Inspect
amount : func(g *vesting.Grant, n int64) string Inspect