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

/staking package

Overview

Package staking is a simplified, accounting-only port of Synthetix StakingRewards to gno.land. Users stake a fungible amount; rewards accrue every block, proportional to each staker's share of the total staked, at a fixed rewardPerBlock. There is no real coin transfer — balances and rewards are plain uint64 accounting (a demonstration of the classic "reward-per-token" accumulator pattern).

Function

Earned

func Earned(addr address) uint64

Earned reports the rewards currently owed to `addr` (accrued but unminted), projected to the current block without mutating any state.

Param

Command

gnokey query vm/qeval -remote "https://rpc.topaz.testnets.gno.land" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/staking.Earned()"

Result