rewardPerBlock
uint64Value
100
precision
uint64Value
1000000
account
typeValue
staking.account
accounts
v0.Tree// address string -> \*account
- OID
- 06e47e…ee64:4
accounts details
totalStaked
uint64Value
0
rewardPerTokenAcc
uint64// global accumulator, scaled by precision
Value
0
lastUpdateBlock
uint64Value
0
computeRewardPerToken
func(stored uint64, rate uint64, elapsed uint64, total uint64) uint64computeRewardPerToken advances the accumulator by the rewards earned per staked unit over \`elapsed\` blocks. With no stake, the accumulator is frozen.
- OID
- 06e47e…ee64:8
computeRewardPerToken details
computeEarned
func(balance uint64, rptCurrent uint64, rptPaid uint64, accrued uint64) uint64computeEarned returns total rewards owed to an account given its stake, the current accumulator, the accumulator value already paid, and prior accrual.
- OID
- 06e47e…ee64:10
computeEarned details
currentBlock
func() uint64- OID
- 06e47e…ee64:11
currentBlock details
getOrCreate
func(addr string) *staking.account- OID
- 06e47e…ee64:12
getOrCreate details
accrue
func(addr string) *staking.accountaccrue rolls the global accumulator forward to the current block and folds the caller's freshly-earned rewards into its stored balance. Mirrors the Synthetix \`updateReward(account)\` modifier.
- OID
- 06e47e…ee64:13
accrue details
Stake
func(amount uint64)Stake adds \`amount\` to the caller's staked balance.
- OID
- 06e47e…ee64:14
Stake details
Withdraw
func(amount uint64)Withdraw removes \`amount\` from the caller's staked balance.
- OID
- 06e47e…ee64:15
Withdraw details
GetReward
func() uint64GetReward mints all accrued rewards into the caller's reward balance and resets the accrual counter. Returns the amount minted this call.
- OID
- 06e47e…ee64:16
GetReward details
Earned
func(addr .uverse.address) uint64Earned reports the rewards currently owed to \`addr\` (accrued but unminted), projected to the current block without mutating any state.
- OID
- 06e47e…ee64:17
Earned details
StakedOf
func(addr .uverse.address) uint64StakedOf reports the current staked balance of \`addr\`.
- OID
- 06e47e…ee64:18
StakedOf details
Render
func(path string) stringRender renders pool stats and a stakers table.
- OID
- 06e47e…ee64:19