- withdrawable -> unlocked
"withdrawable" was a bad name, since these funds - while unlocked -
are not necessarily withdrawable if the voter is currently engaged in
a vote.
- only_deposit -> only_unlocked
Locked funds are technically also deposited. Make it clearer that this
is talking about the unlocked parts of the funds on the account.
The vote power computation was broken for lockups that start very far
in the future.
- Fix the underflow itself
- Disallow lockups that start more than 100 years in the future
- Error if the lockup-scaled voting power is bigger than the maximum
lockup voting power
and can only be called once for each voter_authority.
Now that there's a separate "Grant" instruction, there's no longer a
need for CreateVoter to be idempotent and be callable on foreign
accounts.
Calling create voter manually on a PDA account could have allowed
automation.
Adds LockupKind::Constant, extends the reset_lockup instruction and
adds the internal_transfer instruction to allow working with constant
maturity lockups.
Previously the configure_voting_mint() instruction could only be run
once per index. Now it's allowed to call it again to change a mint's
parameters.
This will directly be useful for Mango, which will likely start out
configuring the MNGO voting mint without lockup vote scaling and then
later enable it, when the ui is ready.
- The vote power decay now has second resolution.
- Monthly and daily vesting behave exactly like multiple cliff locked
deposits.
- In particular, monthly vesting deposits lock-up power decays during
the month, making it smooth over time.
- Gain vote power even if start_ts is in the future (shouldn't happen)
This avoids a security issue where three separate transactions in the
same slot may update the voter weight record, withdraw funds and then
vote with the stale voter weight record.