Created
September 2, 2022 21:24
-
-
Save cyborgdennett/4b1fe2e4348c8f46f55596249e0886ef to your computer and use it in GitHub Desktop.
Sample Greeter contract
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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