rent.sol 755 B

123456789101112131415161718192021
  1. import "./system_instruction.sol";
  2. @program_id("F1ipperKF9EfD821ZbbYjS319LXYiBmjhzkkf5a26rC")
  3. contract rent {
  4. @payer(payer) // The "payer" pays for the data account creation
  5. constructor(address payer) {}
  6. function createSystemAccount(address payer, address newAccount, uint64 lamports, uint64 space) public view {
  7. SystemInstruction.create_account(
  8. payer, // lamports sent from this account (payer)
  9. newAccount, // lamports sent to this account (account to be created)
  10. lamports, // lamport amount (minimum lamports required)
  11. space, // space required for the account
  12. SystemInstruction.systemAddress // program owner (system program)
  13. );
  14. }
  15. }