The Solidity example code :
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
contract Test {
uint256 testvalue;
function testFunc(uint amount) public returns(uint) {
testvalue = testvalue + amount;
return testvalue; // read return data
}
}
etherjs example code :
const TEST = await ethers.getContractAt("Test",address)
const tx = await TEST.testFunc(5);
const result_tx = await tx.wait()
The testFunc function has a return. But there is no value for return on successfully completed transaction with ethers. Is it like that?