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/v0 package

Overview

Realm vesting answers one question for a gno.land account: of the coins it holds, how many can actually move right now.

Read this before you trust a number here

A realm CANNOT read an account's vesting schedule. The VM's whole view of an account is banker.GetCoins, which returns the TOTAL balance with the locked part included, and no native exposes std.VestingSchedule. So this realm reads two things from the chain and is told the third:

Example
1balance     read from the chain, banker.GetCoins   always true
2now         read from the chain, block time        always true
3schedule    supplied, see below                    only as good as its source

Every rendered figure says which of the two it rests on. Nothing here is presented as verified when it is not.

Where a schedule comes from

Either the query string, for a one-off calculation that stores nothing, or the registry. Declare writes a schedule for the CALLER'S OWN address and no other, which is the whole trust model: an address can only misdescribe itself, and a wrong entry misleads nobody but its author.

Anyone can read their real schedule in one command and declare it:

Example
1gnokey query auth/accounts/g1youraddress -remote https://rpc.gno.land:443

Why the schedule can be cached at all

Because it can never change. std.SetVesting has exactly one caller in the monorepo, gno.land/pkg/gnoland/app.go, during genesis balance loading, and no message type creates or modifies a schedule. A schedule declared once is correct forever, which is what makes a registry honest rather than stale.

Function

ScheduleOf

func ScheduleOf(addr address) (original, start, end int64, delayed, ok bool)

ScheduleOf returns the declared schedule for addr, and whether there is one.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/vesting/v0.ScheduleOf()"

Result