function_call_external_seeds.sol 541 B

123456789101112131415161718
  1. import 'solana';
  2. contract c {
  3. address constant token = address"mv3ekLzLbnVPNxjSKvqBpU3ZeZXPQdEC3bp5MDEBG68";
  4. function test(address addr, address addr2, bytes seed) public {
  5. bytes instr = new bytes(1);
  6. instr[0] = 1;
  7. AccountMeta[2] metas = [
  8. AccountMeta({pubkey: addr, is_writable: true, is_signer: true}),
  9. AccountMeta({pubkey: addr2, is_writable: true, is_signer: true})
  10. ];
  11. token.call{accounts: metas, seeds: [ [ "test", seed ], [ "foo", "bar "] ]}(instr);
  12. }
  13. }