Error: type 'int' is not a subtype of type 'BigInt' of 'data' with web3 dart

96 Views Asked by At

I am trying to sign a transanction off chain but it's giving me that error.

var data = contract.function('permit').encodeCall([
      credentialsA.address,
      appOwnerCredentials.address,
      1000,

      deadline,
      0,
      Uint8List(32),
      Uint8List(32),
    ]);

the code above is what is generating the error below

E/flutter ( 6175): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'int' is not a subtype of type 'BigInt' of 'data'
E/flutter ( 6175): #0      UintType.encode (package:web3dart/src/contracts/abi/integers.dart)
E/flutter ( 6175): #1      TupleType.encode (package:web3dart/src/contracts/abi/tuple.dart:71:14)
E/flutter ( 6175): #2      ContractFunction.encodeCall (package:web3dart/src/contracts/abi/abi.dart:267:10)
E/flutter ( 6175): #3      Contract.transferDymeFrom (package:dymer2/models/contract.dart:1161:41)
E/flutter ( 6175): <asynchronous suspension>
E/flutter ( 6175): 

I am trying to use the "permit" function in erc20 token

1

There are 1 best solutions below

2
On

Have you used the 'data' variable anywhere?