Challenge 2
Solidity function bug
LowSolidity basics
Challenge
Can you solve this Solidity function bug? Check whether the declared return type matches the returned value.
Starter code
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
contract Storage {
string s_name;
function changeName(string memory _name) public {
s_name = _name;
}
function getName() public view returns (bool) {
return s_name;
}
}Show hint
A function's return type must match the value it returns.