Dry Run
sncast supports dry-running transaction commands before submitting them to the network. Use --dry-run to validate transaction logic and estimate fees without broadcasting the transaction.
Dry run is available for transaction commands such as:
Example
$ sncast \
--account my_account \
invoke \
--network sepolia \
--contract-address 0x522dc7cbe288037382a02569af5a4169531053d284193623948eac8dd051716 \
--function "add" \
--arguments 'pokemons::model::PokemonData {'\
'name: "Magmar",'\
'element: pokemons::model::Element::Fire'\
'}' \
--dry-run
Output:
Success: Dry run completed
Overall Fee: [..] Fri (~[..] STRK)
To include a detailed fee breakdown, add --detailed:
$ sncast invoke \
--network sepolia \
--contract-address 0x522dc7cbe288037382a02569af5a4169531053d284193623948eac8dd051716 \
--function "add" \
--arguments 'pokemons::model::PokemonData {'\
'name: "Magmar",'\
'element: pokemons::model::Element::Fire'\
'}' \
--dry-run \
--detailed
Output:
Success: Dry run completed
Overall Fee: [..] Fri (~[..] STRK)
L1 Gas Consumed: [..]
L1 Gas Price: [..]
L2 Gas Consumed: [..]
L2 Gas Price: [..]
L1 Data Gas Consumed: [..]
L1 Data Gas Price: [..]