Closed reasje closed 4 months ago
I was able to solve the problem by passing solidity structs with []
in Flutter side, So the final params looks like this, And in my case some properties like proofs array required one more []
too.
final params = [
BigInt.parse(miner.mep1004TokenId!),
proofsArray
.map(
(e) => [e.proofs.map((e) => MXCType.hexToUint8List(e)).toList()],
)
.toList(),
epochIds,
rewardInfoArray.map((e) => [e.token, e.amount]).toList(),
];
Hello, I am trying to encode one of contracts functions with It's all parameters, Unfortunatly I have faced below Issue
Claim reward function after code generation with web3dart from json ABI :
Encoding function : (I am sure below code logic is correct) The error is being thrown in
return function.encodeCall(params);
and that happens when trying to encode the proofsArray variable :contract ABI :
proofsArray :
rewardInfoArray :
TS code that is working!
Error Message :