account_meta.sol 458 B

123456789101112131415161718
  1. import "solana" as sol;
  2. contract spl {
  3. function foo() public returns (bool, address) {
  4. sol.AccountMeta meta = sol.AccountMeta(address(this), true, false);
  5. return (meta.is_writable, meta.pubkey);
  6. }
  7. function bar(address x) public returns (bool, address) {
  8. sol.AccountMeta[2] meta = [
  9. sol.AccountMeta(x, true, true),
  10. sol.AccountMeta({pubkey: x, is_writable: false, is_signer: false})
  11. ];
  12. return (meta[1].is_writable, meta[0].pubkey);
  13. }
  14. }