You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write configuration instructions - by convention we store it on account called Registrar,
Note: the token configured as governing token in Realm doesn't have to be the same as the one which will be used for governance power and which deposits wold be accepted. In fact we could accept several governance tokens (the same way as VSR does) and combine their governance power
Write instructions to create and populate VoterWeightRecord and MaxVoterWeightRecord accounts
When you do the Withdraw logic please make sure it's not possible to Deposit and Withdraw in the same slot to prevent flash loan style governance attacks
Some comments for the existing code, that should be addressed for the plugin implementation:
Revoke is not needed - it was done as a workaround to support revokable and none transferable spl-tokens but token2022 supports it natively through extensions
We can avoid some of the is_token_2022 params because this can be inferred from the token_program_id instead
For the deposits we should not subtract the fee, we should attempt to deposit the amount as is and if there is not enough remaining for fees then it should fail. The UI should adjust the amounts to allow for the fee
Instead of checking for the extra and optional account expected_mint_info we should check if the program is token_2022 and then fetch the mint because it’s required in such a case
The tests code probably could be made more compact with less duplication
This is a continuation of Add Token Extensions Support on Governance Program logic should be extracted and reimplemented as a plugin
Note: the token configured as governing token in Realm doesn't have to be the same as the one which will be used for governance power and which deposits wold be accepted. In fact we could accept several governance tokens (the same way as VSR does) and combine their governance power
Some comments for the existing code, that should be addressed for the plugin implementation:
https://app.gib.work/i/IAesrPp7/token2022-support-as-a-governance-plugin
The text was updated successfully, but these errors were encountered: