@giveth:unstakable
GIV an account can unstake at the current chain time: staked GIV minus the locks whose GIVpower round hasn't finished yet. Locks whose round has ended count as unstakable — unlocking is permissionless — but still need a giveth:unlock before giveth:unstake accepts them. Time-aware inside sim:fork: after a wait, ended locks drop out of the locked amount. Counts pending stake/unstake/lock actions earlier in the script.
Returns: number
Syntax
Section titled “Syntax”@giveth:unstakable(account?)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
[account] | address | Account to inspect (defaults to the connected account) |
Examples
Section titled “Examples”# Print how much GIV you could unstake right nowprint "Unstakable GIV:" @giveth:unstakable()Reading the future from a fork
Section titled “Reading the future from a fork”The GIVpower contract doesn't expose per-round lock amounts through any
view, so the helper reads them straight from contract storage and compares
each lock's end round against currentRound(). Because currentRound()
follows the block timestamp, warping time on a fork moves the answer:
load simsim:fork ( wait 2419200 print "Unstakable in 4 weeks:" @giveth:unstakable())Locks that ended but were never unlocked count as unstakable because anyone can unlock them; to actually withdraw, run giveth:unlock for the finished round before giveth:unstake.