readContract method
- required String contractAddress,
- required LocalContractFunctionWithValues function,
Implementation
Future<String> readContract({
required String contractAddress,
required LocalContractFunctionWithValues function,
}) async {
assert(
function.stateMutability == StateMutability.view ||
function.stateMutability == StateMutability.pure,
"Invalid function",
);
final data = function.buildDataField();
return await call(
contractAddress: contractAddress,
data: data,
);
}