Skip to content

Commit

Permalink
fix(contract): nonce must be increased for each transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
ptisserand committed Oct 16, 2022
1 parent 6555c8e commit f71d876
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/src/contract/contract.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ class Contract {

Future<InvokeTransaction> execute(
String selector, List<Felt> calldata) async {
final Felt nonce = await getNonce();
final Felt maxFee = Felt.fromInt(16000000000001);
final Felt version = Felt.fromInt(0);
final Felt accountNonce = await getNonce();
final Felt nonce = Felt(accountNonce.toBigInt() + BigInt.from(1));
final Felt maxFee = defaultMaxFee;
final Felt version = defaultVersion;

final trx = await account.execute(
functionCalls: [
Expand Down

0 comments on commit f71d876

Please sign in to comment.