3 ms·
It would look something like: contract Hello { string greeting; function setName(string name) { greeting="Hello "+name; } } The solidity compil
by drcode 11y ago
It would look something like:
contract Hello {
string greeting;
function setName(string name) {
greeting="Hello "+name;
}
}
The solidity compiler will automatically produce a "getter" function to retrieve the greeting.
- csarva 11y agoIt will only be exposed automatically if you mark it public, i.e., 'string public greeting'