Currently I am getting the transaction receipt instead of return value from a contract function using web3. Is there anyway to get the actual return value from a contract function call using web3
example code
Solidity
pragma solidity ^0.4.22;
contract Testing {
string name;
function setName(string name) public returns(string) {
name =name;
return name;
}
function getName() public returns(string) {
return name;
}
}
JavaScript
myContract.methods.setName(Hello).send({
from: 0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db,
gas: 470000,
})
.then((receipt) => {
console.log(receipt) ==> not getting the result
}
})