Skip to content

@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

@giveth:unstakable(account?)
NameTypeDescription
[account]addressAccount to inspect (defaults to the connected account)
# Print how much GIV you could unstake right now
print "Unstakable GIV:" @giveth:unstakable()

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 sim
sim: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.