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

gnomic_airdrop state

Back to all declarations

Ownable

*v0.Ownable

Ownable holds the administrative authority over the campaign.

Open
OID
080ccf…0f65:85
Ownable details

Inspect pointer

tokenKey

string

tokenKey is the key of the distributed token. It is a variable rather than a constant only so that tests can register one of their own; in production it keeps the config.gno value for the realm's whole life.

Value

"gno.land/r/nym-thegnomic001/gnomic.GNOMIC"

claimWindowSeconds

int64

claimWindowSeconds is a variable for the same reason: tests shrink or widen it. In production it keeps the config.gno value for the realm's whole life.

Value

31536000

withdrawCooldownSeconds

int64

withdrawCooldownSeconds likewise: tests switch it off, production keeps it.

Value

86400

leafCount

int

// total number of leaves (needed to verify)

Value

12107

endHeight

int64

// block past which no one can claim (0 = no limit)

Value

0

epoch

int

// bumped on every new campaign

Value

1

campaignStart

int64

Value

1789851184

outstanding

int64

Value

130530166807

sealed

bool

Value

true

totalClaimed

int64

// total actually paid out

Value

20180660450

totalGranted

int64

// total granted (including what has not vested yet)

Value

163422948346

totalBurned

int64

// total destroyed: instant exits, renunciations, settlement

Value

6356060541

settledBurned

int64

// burned by SettleUnclaimed

Value

0

settledToFund

int64

// sent to the ecosystem fund by SettleUnclaimed

Value

0

totalToFund

int64

// sent to the ecosystem fund by voluntary forfeits

Value

6356060548

claimCount

int

Value

94

realmAddr

.uverse.address

Value

<gnolang.StringValue>

grant

type

grant is the entitlement a beneficiary obtained in a campaign. It always holds that total == withdrawn + burned + toFund + (not yet released). Grants are keyed by address ALONE, not by "epoch:address": tying the key to the epoch made the previous campaign's grants unreachable as soon as a new one opened — the beneficiary could no longer withdraw and the tokens stayed counted in outstanding, so not even Sweep could recover them.

Value

gnomic_airdrop.grant

SealEvent

untyped string

Value

"AirdropSeal"

SettleEvent

untyped string

Value

"AirdropSettleUnclaimed"

ClaimEvent

untyped string

Value

"AirdropClaim"

WithdrawEvent

untyped string

Value

"AirdropWithdraw"

ForfeitEvent

untyped string

Value

"AirdropForfeit"

CampaignEvent

untyped string

Value

"AirdropCampaign"

bpsDenominator

untyped bigint

Value

(10000 <untyped> bigint)

SetCampaign

func(rootHex string, total int, end int64)

SetCampaign publishes a new campaign: rootHex is the Merkle root in hex (32 bytes), total the number of leaves in the tree, end the deadline block (0 = no deadline). Publishing a new campaign resets the claim history: whoever appears on both lists can claim again. That is deliberate — it allows recurring airdrops on the same realm without a redeploy.

Open
OID
080ccf…0f65:26
SetCampaign details

Inspect func

CloseCampaign

func()

CloseCampaign stops claims immediately.

Open
OID
080ccf…0f65:27
CloseCampaign details

Inspect func

SealCampaign

func()

SealCampaign closes off the possibility of opening new campaigns forever. Irreversible: no code path sets sealed back to false. Call it once the published root is the final one. Until then the owner can fix a mistake by republishing the root; afterwards the airdrop is provably one-off and anyone can check with IsSealed().

Open
OID
080ccf…0f65:28
SealCampaign details

Inspect func

SettleUnclaimed

func()

SettleUnclaimed disposes of whatever was never claimed, once the claim window has elapsed: half is burned, the other half goes to the team fund. The rule is enforced here rather than promised: there is no Sweep and no BurnRemaining, so the owner cannot pocket the residue nor destroy all of it. Settlement waits for the window even if CloseCampaign stopped claims earlier, and grants already made stay untouchable — only the free part (balance minus outstanding) is settled. Anyone may call it: it is a public service, not a privilege.

Open
OID
080ccf…0f65:29
SettleUnclaimed details

Inspect func

TransferOwnership

func(newOwner .uverse.address)

TransferOwnership hands administration of the campaign over.

Open
OID
080ccf…0f65:30
TransferOwnership details

Inspect func

Claim

func(amount int64, index int, auntsHex string)

Claim pays amount tokens to the caller, if the Merkle proof (index, auntsHex) shows that "\<caller>|\<amount>" is a leaf of the published tree. auntsHex is the hex concatenation of the sibling hashes, 32 bytes each, just as produced by tools/merkle.

Open
OID
080ccf…0f65:31
Claim details

Inspect func

claimFor

func(beneficiary .uverse.address, amount int64, index int, auntsHex string)

claimFor is the body of Claim. It is unexported on purpose: a transaction can only reach exported functions, so from outside the realm the only way in is Claim, which always uses the caller's own address. The tests, being in the same package, still exercise the registration logic directly.

Open
OID
080ccf…0f65:32
claimFor details

Inspect func

ClaimInstant

func(amount int64, index int, auntsHex string)

ClaimInstant is the first of the two alternatives to Claim: the instant share (instantBps, 30%) is paid at once and the rest (70%) is given up the same way a forfeit is — half burned, half to the ecosystem fund — whenever it is chosen, even after the whole grant would have vested. The share is larger than Claim's immediate 10% on purpose: it makes the shortcut a real choice rather than a punishment. It cannot be undone and suits someone who prefers a certain fraction today to the whole a year from now. The residue is destroyed, to every holder's benefit. Only the person concerned can choose it: there is no "on behalf of" form.

Open
OID
080ccf…0f65:33
ClaimInstant details

Inspect func

Forfeit

func(amount int64, index int, auntsHex string)

Forfeit is the second alternative to Claim: the beneficiary gives the grant up without taking anything. Half is burned, half goes to the ecosystem fund — the same split SettleUnclaimed applies to whoever never acted at all. The proof is still required and the grant is still recorded: without that, the same address could forfeit and then claim. The record makes it final. Only the person concerned can choose it: there is no "on behalf of" form.

Open
OID
080ccf…0f65:34
Forfeit details

Inspect func

immediateOf

func(total int64) int64

immediateOf is the share Claim unlocks at once: immediateBps/10000 of total.

Open
OID
080ccf…0f65:35
immediateOf details

Inspect func

shareOf

func(total int64, bps int) int64

shareOf is bps/10000 of total, in two steps to stay inside int64.

Open
OID
080ccf…0f65:36
shareOf details

Inspect func

registerGrant

func(beneficiary .uverse.address, amount int64, index int, auntsHex string)

registerGrant checks the proof and records the grant. It transfers nothing.

Open
OID
080ccf…0f65:37
registerGrant details

Inspect func

Withdraw

func()

Withdraw transfers to the caller the vested, not-yet-withdrawn part.

Open
OID
080ccf…0f65:38
Withdraw details

Inspect func

WithdrawFor

func(beneficiary .uverse.address)

WithdrawFor is like Withdraw but on another beneficiary's behalf: the tokens still go to beneficiary, whoever sends the transaction only pays the gas.

Open
OID
080ccf…0f65:39
WithdrawFor details

Inspect func

release

func(beneficiary .uverse.address)

release transfers the vested share. It is the public form: when there is nothing to withdraw it says so, instead of silently letting through a transaction that did nothing.

Open
OID
080ccf…0f65:40
release details

Inspect func

releaseIfAny

func(beneficiary .uverse.address) int64

releaseIfAny is the internal form: it transfers whatever has vested and returns the amount, or 0 if nothing has vested yet. It serves the paths where "nothing to withdraw" is normal rather than an error: a claim whose immediate share is zero, and a forfeit, whose point is to burn the residue rather than to collect. Payouts are rate-limited: one every withdrawCooldownSeconds per grant, the claim itself counting as the first. The very first payout is never delayed.

Open
OID
080ccf…0f65:41
releaseIfAny details

Inspect func

vestedOf

func(g *gnomic_airdrop.grant) int64

vestedOf computes how much of a grant has vested: vested = immediate + rest * elapsed / duration where immediate is immediateBps/10000 of the total. The division is done in two steps (quotient and remainder) because rest\*elapsed would overflow int64 for large amounts: 1e13 \* 3.15e7 exceeds 9.2e18.

Open
OID
080ccf…0f65:42
vestedOf details

Inspect func

addSat

func(a int64, b int64) int64

addSat adds without ever wrapping. These counters only grow, across every campaign, and nothing bounds them to the supply: a statistic that turns negative would be bad, one that blocks a withdrawal would be worse.

Open
OID
080ccf…0f65:43
addSat details

Inspect func

grantOf

func(addr .uverse.address) *gnomic_airdrop.grant
Open
OID
080ccf…0f65:44
grantOf details

Inspect func

Leaf

func(addr .uverse.address, amount int64) string

Leaf returns the canonical Merkle-leaf encoding for the (address, amount) pair. It must match byte for byte the one used by the off-chain generator.

Open
OID
080ccf…0f65:45
Leaf details

Inspect func

RealmAddress

func() .uverse.address
Open
OID
080ccf…0f65:46
RealmAddress details

Inspect func

Balance

func() int64

Balance is the token balance the realm currently holds.

Open
OID
080ccf…0f65:47
Balance details

Inspect func

Root

func() string

Root returns the current Merkle root in hex.

Open
OID
080ccf…0f65:48
Root details

Inspect func

Epoch

func() int

Epoch is the number of the current campaign.

Open
OID
080ccf…0f65:49
Epoch details

Inspect func

IsSealed

func() bool

IsSealed reports whether the campaign has been sealed: if true, no new campaign can ever be opened.

Open
OID
080ccf…0f65:50
IsSealed details

Inspect func

LeafCount

func() int

LeafCount is the number of leaves in the published tree.

Open
OID
080ccf…0f65:51
LeafCount details

Inspect func

EndHeight

func() int64

EndHeight is the deadline block (0 = no deadline).

Open
OID
080ccf…0f65:52
EndHeight details

Inspect func

IsOpen

func() bool

IsOpen reports whether claims are currently accepted.

Open
OID
080ccf…0f65:53
IsOpen details

Inspect func

HasClaimed

func(addr .uverse.address) bool

HasClaimed reports whether addr has already claimed in the current campaign.

Open
OID
080ccf…0f65:54
HasClaimed details

Inspect func

HasGrant

func(addr .uverse.address) bool

HasGrant reports whether addr holds a grant, from this campaign or an earlier one.

Open
OID
080ccf…0f65:55
HasGrant details

Inspect func

GrantEpoch

func(addr .uverse.address) int

GrantEpoch returns the campaign in which addr obtained its grant.

Open
OID
080ccf…0f65:56
GrantEpoch details

Inspect func

VestingStartOf

func(addr .uverse.address) int64

VestingStartOf returns when vesting starts for addr's grant.

Open
OID
080ccf…0f65:57
VestingStartOf details

Inspect func

ClaimedAmount

func(addr .uverse.address) int64

ClaimedAmount returns addr's total grant, vested or not.

Open
OID
080ccf…0f65:58
ClaimedAmount details

Inspect func

Vested

func(addr .uverse.address) int64

Vested returns how much of addr's grant has vested so far. A closed grant (instant exit or forfeit) will never vest anything more: it reports what was paid, not where the curve would be.

Open
OID
080ccf…0f65:59
Vested details

Inspect func

InstantBps

func() int

InstantBps is the share ClaimInstant pays at once, in hundredths of a percent.

Open
OID
080ccf…0f65:60
InstantBps details

Inspect func

Withdrawn

func(addr .uverse.address) int64

Withdrawn returns how much addr has already withdrawn.

Open
OID
080ccf…0f65:61
Withdrawn details

Inspect func

Withdrawable

func(addr .uverse.address) int64

Withdrawable returns how much addr can withdraw right now.

Open
OID
080ccf…0f65:62
Withdrawable details

Inspect func

NextWithdrawAt

func(addr .uverse.address) int64

NextWithdrawAt returns the unix time from which addr may withdraw again (0 when there is no grant, the grant is closed, or no cooldown is running).

Open
OID
080ccf…0f65:63
NextWithdrawAt details

Inspect func

WithdrawCooldown

func() int64

WithdrawCooldown is the minimum interval between two payouts, in seconds.

Open
OID
080ccf…0f65:64
WithdrawCooldown details

Inspect func

BurnedOf

func(addr .uverse.address) int64

BurnedOf returns how much of addr's grant was destroyed.

Open
OID
080ccf…0f65:65
BurnedOf details

Inspect func

FundOf

func(addr .uverse.address) int64

FundOf returns how much of addr's grant went to the ecosystem fund.

Open
OID
080ccf…0f65:66
FundOf details

Inspect func

TotalToFund

func() int64

TotalToFund is what voluntary forfeits sent to the ecosystem fund.

Open
OID
080ccf…0f65:67
TotalToFund details

Inspect func

TotalBurned

func() int64

TotalBurned is the total destroyed: instant exits, renunciations and the settlement of the unclaimed residue.

Open
OID
080ccf…0f65:68
TotalBurned details

Inspect func

ClaimWindowEnd

func() int64

ClaimWindowEnd is the moment (unix) claims stop being accepted for the current campaign; SettleUnclaimed becomes callable from then on.

Open
OID
080ccf…0f65:69
ClaimWindowEnd details

Inspect func

EcosystemFund

func() .uverse.address
Open
OID
080ccf…0f65:70
EcosystemFund details

Inspect func

SettledBurned

func() int64

SettledBurned and SettledToFund report what SettleUnclaimed did.

Open
OID
080ccf…0f65:71
SettledBurned details

Inspect func

Outstanding

func() int64

Outstanding is the total granted and not yet withdrawn: the part of the realm's balance that Sweep cannot touch.

Open
OID
080ccf…0f65:73
Outstanding details

Inspect func

TotalGranted

func() int64

TotalGranted is the total of all grants made, vested or not.

Open
OID
080ccf…0f65:74
TotalGranted details

Inspect func

VestingStart

func() int64

VestingStart is the moment (unix) the CURRENT campaign's linear release runs from. Grants from earlier campaigns keep their own, readable with VestingStartOf.

Open
OID
080ccf…0f65:75
VestingStart details

Inspect func

VestingEnd

func() int64

VestingEnd is the moment (unix) at which everything granted in the current campaign counts as fully vested.

Open
OID
080ccf…0f65:76
VestingEnd details

Inspect func

ImmediateBps

func() int

ImmediateBps is the share unlocked at once, in hundredths of a percent.

Open
OID
080ccf…0f65:77
ImmediateBps details

Inspect func

TotalClaimed

func() int64

TotalClaimed is the total actually transferred to beneficiaries.

Open
OID
080ccf…0f65:78
TotalClaimed details

Inspect func

ClaimCount

func() int

ClaimCount is the number of successful claims.

Open
OID
080ccf…0f65:79
ClaimCount details

Inspect func

sealLabel

func() string

sealLabel describes in Render whether the airdrop is provably one-off.

Open
OID
080ccf…0f65:82
sealLabel details

Inspect func

defaultTokenKey

untyped string

Value

"gno.land/r/nym-thegnomic001/gnomic.GNOMIC"

campaignName

untyped string

Value

"Gnomic Airdrop"

immediateBps

untyped bigint

Value

(1000 <untyped> bigint)

instantBps

untyped bigint

Value

(3000 <untyped> bigint)

vestingSeconds

int64

Value

31536000

defaultClaimWindowSeconds

int64

Value

31536000

defaultWithdrawCooldownSeconds

int64

Value

86400

ecosystemFundAddress

untyped string

Value

"g14slrjauvzpx578ker2wtt2jzs0c4mzslcpjcqf"

adminAddress

untyped string

Value

"g1z0c0wrmwpzpd0gq4q67hl9508dtgv4epr0z5ml"
Ownable : *v0.Ownable Inspect
tokenKey : string ="gno.land/r/nym-thegnomic001/gnomic.GNOMIC"
claimWindowSeconds : int64 =31536000
withdrawCooldownSeconds : int64 =86400
root : []uint8 (len=32) Inspect
leafCount : int =12107
endHeight : int64 =0
epoch : int =1
claimed : v0.Tree Inspect
campaignStart : int64 =1789851184
outstanding : int64 =130530166807
sealed : bool =true
totalClaimed : int64 =20180660450
totalGranted : int64 =163422948346
totalBurned : int64 =6356060541
settledBurned : int64 =0
settledToFund : int64 =0
totalToFund : int64 =6356060548
claimCount : int =94
realmAddr : .uverse.address =<gnolang.StringValue>
grant : type =gnomic_airdrop.grant
SealEvent : untyped string ="AirdropSeal"
SettleEvent : untyped string ="AirdropSettleUnclaimed"
ClaimEvent : untyped string ="AirdropClaim"
WithdrawEvent : untyped string ="AirdropWithdraw"
ForfeitEvent : untyped string ="AirdropForfeit"
CampaignEvent : untyped string ="AirdropCampaign"
bpsDenominator : untyped bigint =(10000 <untyped> bigint)
init.28 : func() Inspect
SetCampaign : func(rootHex string, total int, end int64) Inspect
CloseCampaign : func() Inspect
SealCampaign : func() Inspect
SettleUnclaimed : func() Inspect
TransferOwnership : func(newOwner .uverse.address) Inspect
Claim : func(amount int64, index int, auntsHex string) Inspect
claimFor : func(beneficiary .uverse.address, amount int64, index int, auntsHex string) Inspect
ClaimInstant : func(amount int64, index int, auntsHex string) Inspect
Forfeit : func(amount int64, index int, auntsHex string) Inspect
immediateOf : func(total int64) int64 Inspect
shareOf : func(total int64, bps int) int64 Inspect
registerGrant : func(beneficiary .uverse.address, amount int64, index int, auntsHex string) Inspect
Withdraw : func() Inspect
WithdrawFor : func(beneficiary .uverse.address) Inspect
release : func(beneficiary .uverse.address) Inspect
releaseIfAny : func(beneficiary .uverse.address) int64 Inspect
vestedOf : func(g *gnomic_airdrop.grant) int64 Inspect
addSat : func(a int64, b int64) int64 Inspect
grantOf : func(addr .uverse.address) *gnomic_airdrop.grant Inspect
Leaf : func(addr .uverse.address, amount int64) string Inspect
RealmAddress : func() .uverse.address Inspect
Balance : func() int64 Inspect
Root : func() string Inspect
Epoch : func() int Inspect
IsSealed : func() bool Inspect
LeafCount : func() int Inspect
EndHeight : func() int64 Inspect
IsOpen : func() bool Inspect
HasClaimed : func(addr .uverse.address) bool Inspect
HasGrant : func(addr .uverse.address) bool Inspect
GrantEpoch : func(addr .uverse.address) int Inspect
VestingStartOf : func(addr .uverse.address) int64 Inspect
ClaimedAmount : func(addr .uverse.address) int64 Inspect
Vested : func(addr .uverse.address) int64 Inspect
InstantBps : func() int Inspect
Withdrawn : func(addr .uverse.address) int64 Inspect
Withdrawable : func(addr .uverse.address) int64 Inspect
NextWithdrawAt : func(addr .uverse.address) int64 Inspect
WithdrawCooldown : func() int64 Inspect
BurnedOf : func(addr .uverse.address) int64 Inspect
FundOf : func(addr .uverse.address) int64 Inspect
TotalToFund : func() int64 Inspect
TotalBurned : func() int64 Inspect
ClaimWindowEnd : func() int64 Inspect
EcosystemFund : func() .uverse.address Inspect
SettledBurned : func() int64 Inspect
SettledToFund : func() int64 Inspect
Outstanding : func() int64 Inspect
TotalGranted : func() int64 Inspect
VestingStart : func() int64 Inspect
VestingEnd : func() int64 Inspect
ImmediateBps : func() int Inspect
TotalClaimed : func() int64 Inspect
ClaimCount : func() int Inspect
isOpen : func() bool Inspect
Render : func(path string) string Inspect
sealLabel : func() string Inspect
statusLabel : func() string Inspect
defaultTokenKey : untyped string ="gno.land/r/nym-thegnomic001/gnomic.GNOMIC"
campaignName : untyped string ="Gnomic Airdrop"
immediateBps : untyped bigint =(1000 <untyped> bigint)
instantBps : untyped bigint =(3000 <untyped> bigint)
vestingSeconds : int64 =31536000
defaultClaimWindowSeconds : int64 =31536000
defaultWithdrawCooldownSeconds : int64 =86400
ecosystemFundAddress : untyped string ="g14slrjauvzpx578ker2wtt2jzs0c4mzslcpjcqf"
adminAddress : untyped string ="g1z0c0wrmwpzpd0gq4q67hl9508dtgv4epr0z5ml"