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 package

Overview

Package vesting holds grants of GNOT, BUBBLE or any registered GRC20 and pays each out on its own schedule: a share at the start, the rest by the day over a term, to one beneficiary, for as long as the grant's owner does not revoke it. Anyone may open a grant for anyone; nothing here is a setting but each grant's owner.

Every grant has its OWN address — the realm's sub-realm `grant-<id>` (chain.DerivePkgSubAddr) — and that is how it is funded: send the tokens there (a bank send for GNOT, Transfer for a GRC20, a holders' vote that mints BUBBLE to it). The realm moves tokens out of a grant's address and never between grants; what sits at the realm's main address belongs to nobody and stays there, so send only to a grant's address.

The schedule. Nothing before start, or before start + cliff; at start the up-front share is vested; each full day after start vests an equal share of the rest, until day Days, when all of Total has vested (Days 0: all of it at start). Claim pays the beneficiary what has vested and not yet been paid, as far as the grant's balance goes; anyone may call it, since the money has one destination. Revoke, by the owner, freezes the schedule where it stands and returns everything above what has vested to the owner; what had vested stays the beneficiary's to claim. A revoke before the up-front share has arrived (what was already paid counts as arrived) VOIDS the grant: nothing vests, and whatever lands later is the owner's to sweep. Sweep, by the owner, returns what the schedule can never owe (a gift, a double funding) without ending anything. A grant opened with no owner is irrevocable, and its excess is the beneficiary's to sweep.

Votes. BUBBLE held by a grant is self-delegated, inside the token's ledger, to the grant's own address, and this realm never delegates it or votes with it; the beneficiary's weight grows as they claim.

Immutable, not private (gnomod.toml).

Function

Count

func Count() int64

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/vesting.Count()"

Result