decodeInput method
Decodes the input parameters of the function from the encoded input bytes.
Implementation
List<dynamic> decodeInput(List<int> encodedParams) {
List<int> encodeBytes = List.from(encodedParams);
if (encodeBytes.length > ABIConst.selectorLength) {
final encodeSelector = encodeBytes.sublist(0, ABIConst.selectorLength);
if (BytesUtils.bytesEqual(encodeSelector, selector)) {
encodeBytes = encodeBytes.sublist(ABIConst.selectorLength);
}
}
final abi =
AbiParameter(name: "", type: "tuple", components: List.from(inputs))
.decode(encodeBytes);
return abi.result;
}