Skip to content

Instantly share code, notes, and snippets.

@cyborgdennett
Created September 2, 2022 21:24
Show Gist options
  • Save cyborgdennett/4b1fe2e4348c8f46f55596249e0886ef to your computer and use it in GitHub Desktop.
Save cyborgdennett/4b1fe2e4348c8f46f55596249e0886ef to your computer and use it in GitHub Desktop.
Sample Greeter contract
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
// import "hardhat/console.sol";
contract Greeter {
string greeting;
constructor(string memory _greeting) {
// console.log("Deploying a Greeter with greeting:", _greeting);
greeting = _greeting;
}
function greet() public view returns (string memory) {
return greeting;
}
function setGreeting(string memory _greeting) public {
// console.log("Changing greeting from '%s' to '%s'", greeting, _greeting);
greeting = _greeting;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment