software-mansion / starknet.py

✨ 🐍 Python SDK for Starknet.
https://starknetpy.rtfd.io/
MIT License
259 stars 75 forks source link

Rename contract names from fee to l2 #1266

Open ddoktorski opened 7 months ago

ddoktorski commented 7 months ago

Investigate how to verify that there is enough STRK tokens on an account to be deployed using DeployAccountV3.

Discussed here

ddoktorski commented 7 months ago

Both L1_GAS and L2_GAS in the resource_bounds are specified in FRI, hence we can simply call STRK contract to check a balance. We need to decide whether we should perform this check on the starknet.py side at all, since RPC will throw an error if balance is not sufficient anyway. The current error doesn't include token name, it only provides the information Account balance is smaller than the transaction's max_fee..

github-actions[bot] commented 6 months ago

This issue is stale because it has not received any activity in the last 30 days. Remove stale label or add a comment, otherwise it will be closed in 5 days.

tkumor3 commented 5 months ago

Current RPC response in the case of having insufficient balance is:

Client failed with code 55. Message: Account validation failed. Data: perform_validations call failed; failure reason: TransactionFailureReason(code='native_blockifier.PyTransactionExecutionError', error_message='TransactionPreValidationError(TransactionFeeError(L1GasBoundsExceedBalance { max_amount: 1109, max_price: 48000000000000, balance_low: StarkFelt("0x0000000000000000000000000000000000000000000000000000000001ad7180"), balance_high: StarkFelt("0x0000000000000000000000000000000000000000000000000000000000000000") }))').