Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

create

Prepare all prerequisites for account deployment.

Account information will be saved to the file specified by --accounts-file argument, which is ~/.starknet_accounts/starknet_open_zeppelin_accounts.json by default.

--name, -n <ACCOUNT_NAME>

Optional.

Account name under which account information is going to be saved.

If --name is not provided, it will be generated automatically.

--url, -u <RPC_URL>

Optional.

Starknet RPC node url address.

Overrides url from snfoundry.toml.

--network <NETWORK>

Optional.

Use predefined network with a public provider

Possible values: mainnet, sepolia, devnet.

Overrides network from snfoundry.toml.

--type, -t <ACCOUNT_TYPE>

Optional. Required if --class-hash is passed.

Type of the account. Possible values: oz, ready, braavos. Defaults to oz.

Versions of the account contracts:

--salt, -s <SALT>

Optional.

Salt for the account address. If omitted random one will be generated.

--add-profile <NAME>

Optional.

If passed, a profile with corresponding name will be added to the local snfoundry.toml.

--class-hash, -c

Optional.

Class hash of a custom openzeppelin account contract declared to the network. It can be either:

  • Felt in hex (prefixed with 0x) or decimal representation.
  • @alias defined in [sncast.<profile>.aliases] in snfoundry.toml. See aliases.

--private-key <PRIVATE_KEY>

Optional. If neither --private-key nor --private-key-file is passed, a random private key will be generated.

Account private key. It must be a valid STARK curve secret scalar, i.e. a non-zero value smaller than the curve order 0x800000000000010ffffffffffffffffb781126dcae7b2321e66a241adc64d2f.

Conflicts with: --private-key-file, --ledger-path, --ledger-account-id

⚠️ Security Warning

  1. Passing the key via --private-key exposes it in your shell history and in the process list. Prefer --private-key-file for keys you want to keep secret.
  2. sncast only checks that the value is a valid curve scalar, it does not assess how secure it is. A supplied key that is small, guessable, or otherwise low-entropy results in an account anyone can take over. Only pass keys you trust, and for anything other than development omit the flag so a cryptographically random key is generated for you.

--private-key-file <PRIVATE_KEY_FILE_PATH>

Optional. If neither --private-key nor --private-key-file is passed, a random private key will be generated.

Path to the file holding account private key. The key must satisfy the same constraints as --private-key.

Conflicts with: --private-key, --ledger-path, --ledger-account-id

--ledger-path <HD_PATH>

Optional.

EIP-2645 derivation path of the Ledger key that will control this account (e.g., m//starknet'/sncast'/0'/1'/0).

When provided, the public key is read from the Ledger device.

Conflicts with: --private-key, --private-key-file, --ledger-account-id

See Ledger Hardware Wallet for details.

--ledger-account-id <ACCOUNT_ID>

Optional.

Shorthand for --ledger-path. The account ID is used to derive the path m//starknet'/sncast'/0'/<account-id>'/0.

Conflicts with: --ledger-path, --private-key, --private-key-file

See Ledger Hardware Wallet for details.