Activity - francescamartinucci - Algorand

Error Reading String Return Value in Smart Contract - Java

Posted by: Francesca Martinucci
Category: General
Date: Aug 4, 2023

EDIT: I "solved" the problem in the way as follows:
In my custom AtomicTransactionComposer class, I add a condition on ABI method parsed return type and simply instantiate a new String from abiEncoded return value:

ABIType methodRetType = this.methodMap.get(i).returns.parsedType;
if(methodRetType instanceof StringType) {
    String result = new String(abiEncodedReturnValue);
}

This approach helped me overcome the issues I encountered.