Skip to content

Instantly share code, notes, and snippets.

@wissalHaji
Last active October 26, 2020 19:56
Show Gist options
  • Save wissalHaji/507404a4b6f260667288bbc26c55f32f to your computer and use it in GitHub Desktop.
Save wissalHaji/507404a4b6f260667288bbc26c55f32f to your computer and use it in GitHub Desktop.
State and local variables in solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.7.0;
contract HelloWorldContract {
address owner; // state variable
function helloWorld() external pure returns(string memory){
string memory greeting ="hello world"; // local variable
return greeting;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment