You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sncast -a sep_acc_1 invoke -d 0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d -f transfer -c 0x7f3ebe4b3851f8a266dd4fa3dd77bad41aa5c0e18dab00efc505b5ceb96a286 --url https://starknet-sepolia.public.blastapi.io/rpc/v0_7 --fee-token strk --max-fee 9999999999999
Yields an error error: Unexpected RPC error occurred: Transaction must commit to pay a positive amount on fee.
max-fee is a param that should only work with V1 tx (paying ETH), while V3 txs require specifying gas per unit.
In this case it seems the max-fee overrides the selection of strk token, and expects ETH payment. The error should be more informative, or to automatically derive the needed params for the specified max-fee.
In the current implementation --max-fee is treated the same for both tokens: it represents the total maximum gas that can be paid for the transaction. In your example, what really happens under the hood is that sncast first makes an RPC call to get the current gas price in FRI. Then it divides the provided max_fee by this value to calculate the max_gas (referred to as max_amount in the RPC). Here is the link to the implementation for your reference. Following this, it attempts to execute the request.
With the value --max-fee 9999999999999, the current gas price in FRI is higher, and the resulting division is 0, which ultimately causes the above error. The same error can be replicated if you use the following flags: --fee-token strk --max-gas 0 --max-gas-unit-price X.
Which component is your bug related to?
sncast
Foundry Version
0.33.0
What operating system are you using?
Linux
What system architecture are you using?
x86
What happened
Running a command like:
Yields an error
error: Unexpected RPC error occurred: Transaction must commit to pay a positive amount on fee.
max-fee is a param that should only work with V1 tx (paying ETH), while V3 txs require specifying gas per unit.
In this case it seems the max-fee overrides the selection of strk token, and expects ETH payment. The error should be more informative, or to automatically derive the needed params for the specified max-fee.
This is also the way it is presetned in the docs:
https://foundry-rs.github.io/starknet-foundry/starknet/account.html#deploy-account-with-the-sncast-account-deploy-command
The command yields a similar error
Trace
No response
Is there an existing issue for this?
The text was updated successfully, but these errors were encountered: