diff --git a/CHANGELOG.md b/CHANGELOG.md index 018d0670e4..b74b04d6b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Debug logging for `sncast` commands that can be enabled by setting `CAST_LOG` env variable. - `sncast declare` command now outputs a ready-to-use deployment command after successful declaration. +- Possibility to use [`starknet-devnet`](https://github.com/0xSpaceShard/starknet-devnet) predeployed accounts directly in `sncast` without needing to import them. They are available under specific names - `devnet-1`, `devnet-2`, ..., `devnet-`. Read more [here](https://foundry-rs.github.io/starknet-foundry/starknet/integration_with_devnet.html#predeployed-accounts) ## [0.50.0] - 2025-09-29 diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 58f202abae..50089f36e0 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -59,6 +59,7 @@ * [Verifying Contracts](starknet/verify.md) * [Calldata Transformation](starknet/calldata-transformation.md) * [Block Explorers](starknet/block_explorer.md) +* [Integration With Devnet](starknet/integration_with_devnet.md) * [Developer Functionalites](starknet/developer.md) --- diff --git a/docs/src/starknet/integration_with_devnet.md b/docs/src/starknet/integration_with_devnet.md new file mode 100644 index 0000000000..4289be8014 --- /dev/null +++ b/docs/src/starknet/integration_with_devnet.md @@ -0,0 +1,42 @@ +# Integration With Devnet + +[`starknet-devnet`](https://0xspaceshard.github.io/starknet-devnet/) is a local Starknet node used for development and testing. `sncast` provides inbuilt support for some of its features, making it easier to work with it. + +## Predeployed Accounts + +When you start `starknet-devnet`, it automatically predeploys some contracts, including set of accounts with known details (read more about them [here](https://0xspaceshard.github.io/starknet-devnet/docs/predeployed)). + +You can use these accounts directly in `sncast` without needing to import them. +They are available under specific names - `devnet-1`, `devnet-2`, ..., `devnet-` (where N is the number of predeployed accounts, by default it's 10). + +> 📝 **Note** +> +> Devnet accounts can't be used together with `sepolia` and `mainnet` values for `--network` flag. + + +### Example + +Let's invoke a contract using `devnet-1` account. + +```shell +$ sncast --account devnet-1 invoke \ + --contract-address 0x0589a8b8bf819b7820cb699ea1f6c409bc012c9b9160106ddc3dacd6a89653cf \ + --function "get_balance" +``` + +
+Output: + +```shell +Success: Invoke completed + +Transaction Hash: [..] + +To see invocation details, visit: +transaction: https://sepolia.starkscan.co/tx/[..] +``` +
+ +> 📝 **Note** +> +> If you have an account named `devnet-1` (or any other predeployed account name) in your accounts file, `sncast` will prioritize using that one instead of the inbuilt devnet account.