solang
solang copied to clipboard
Improving Solana account management
- [x] https://github.com/hyperledger/solang/pull/1254
- [x] It should be possible to pass AccountMetas to constructors. This entails refactoring
Instr::Constructorfor Solana and maybe unify it withInstr::ExternalCall. #1271 - [x]
@payermust 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
@payermust be accessible viatx.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,@mutableand@mutableSignerso that developers can specify the accounts they need. These accounts must be accessible viatx.accounts. - [x] Account declaration can happen in external functions that have a body.