Skip to content
Discussion options

You must be logged in to vote

The easiest way to do this would be with an object.

  1. Create an object. Learn more here.
  2. Create an account alongside that object. Learn more here.
  3. Send coins from the object (assuming you have sent coins to it already).

Overall your code to create the object + account would look like this:

entry fun create(caller: &signer) {
  // Create an object.
  let caller_address = signer::address_of(caller);
  let constructor_ref = object::create_object(caller_address);
  let object_address = object::address_from_constructor_ref(&constructor_ref);

  // Create an account alongside the object.
  aptos_account::create_account(object_address);

  // Store an ExtendRef alongside the object.
  let object…

Replies: 1 comment

Comment options

banool
Mar 7, 2024
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by banool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant