payer_access.sol 926 B

1234567891011121314151617181920212223
  1. // RUN: --target solana --emit cfg
  2. @program_id("Seed23VDZ9HFCfKvFwmemB6dpi25n5XjZdP52B2RUmh")
  3. contract Seed2 {
  4. @payer(payer)
  5. @seed("sunflower")
  6. @space(23)
  7. // BEGIN-CHECK: Seed2::Seed2::constructor
  8. constructor(@seed bytes ss) {
  9. // CHECK: ty:struct AccountInfo %temp.1 = (subscript struct AccountInfo[] (builtin Accounts ())[uint32 1])
  10. // CHECK: (load (load (struct %temp.1 field 0)))
  11. assert(tx.accounts.payer.key == address(this));
  12. // CHECK: AccountInfo %temp.2 = (subscript struct AccountInfo[] (builtin Accounts ())[uint32 1])
  13. // CHECK: (load (struct %temp.2 field 5))
  14. assert(tx.accounts.payer.is_signer);
  15. // CHECK: AccountInfo %temp.3 = (subscript struct AccountInfo[] (builtin Accounts ())[uint32 1])
  16. // CHECK: (load (struct %temp.3 field 6))
  17. assert(tx.accounts.payer.is_writable);
  18. print("In Seed2 constructor");
  19. }
  20. }