Simplified and owner controlled version of create_account
from Linkdrop Contract.
- Build the contract locally
- Login to [YOUR_ACCOUNT_FACTORY_ID] using near-cli
near login
- Deploy the wasm
./res/account_factory.wasm
near deploy [YOUR_ACCOUNT_FACTORY_ID] ./res/account_factory.wasm
// init the contract
near call [YOUR_ACCOUNT_FACTORY_ID] new --accountId=[YOUR_ACCOUNT_FACTORY_ID]
- This account is the
owner
which can addapproved_creators
- Add an approved creator
near call [YOUR_ACCOUNT_FACTORY_ID] add_approved_creator '{"account_id":"[SOME_APPROVED_CREATOR_ACCOUNT_ID]"}' --accountId=[YOUR_ACCOUNT_FACTORY_ID]
- Login to [SOME_APPROVED_CREATOR_ACCOUNT_ID] using near-cli
near login
- Create an account from the approved creator account
near call [YOUR_ACCOUNT_FACTORY_ID] create_account '{"new_account_id":"foo.testnet","new_public_key":"ed25519:BonsbmfRMRNzRwn92827kfGCwkNLjNDritF1LwrbZKn2"}' --deposit=1 --accountId=[SOME_APPROVED_CREATOR_ACCOUNT_ID]