solang icon indicating copy to clipboard operation
solang copied to clipboard

Improving Solana account management

Open LucasSte opened this issue 2 years ago • 0 comments

  • [x] https://github.com/hyperledger/solang/pull/1254
  • [x] It should be possible to pass AccountMetas to constructors. This entails refactoring Instr::Constructor for Solana and maybe unify it with Instr::ExternalCall. #1271
  • [x] @payer must not support literals.
  • [x] When we have information about the accounts, create a new AccountMeta vector (using the proper order!) and pass it to the call, using sol_invoke_signed.
  • [x] The account declared in @payer must be accessible via tx.accounts
  • [x] If the parameter of an annotation is a constructor argument, the annotation should appear before the argument declaration so we do not confuse this with an account declaration, which has nothing to do with arguments.
  • [ ] All accounts declared must be validated (check if signer and/or mutable bits are properly set and ensure we have all the accounts needed).
  • [x] Provide @signer, @reader, @mutable and @mutableSigner so that developers can specify the accounts they need. These accounts must be accessible via tx.accounts.
  • [x] Account declaration can happen in external functions that have a body.

LucasSte avatar Apr 04 '23 19:04 LucasSte