Greeter.sol 773 B

12345678910111213141516171819202122232425262728293031
  1. // SPDX-License-Identifier: UNLICENSED
  2. pragma solidity >=0.8.4;
  3. import { console } from "hardhat/console.sol";
  4. import { IERC721 } from "@sablier/v2-core/src/types/Tokens.sol";
  5. error GreeterError();
  6. contract Greeter {
  7. string public greeting;
  8. IERC721 public nft;
  9. constructor(string memory _greeting) {
  10. console.log("Deploying a Greeter with greeting:", _greeting);
  11. greeting = _greeting;
  12. }
  13. function greet() public view returns (string memory) {
  14. return greeting;
  15. }
  16. function setGreeting(string memory _greeting) public {
  17. console.log("Changing greeting from '%s' to '%s'", greeting, _greeting);
  18. greeting = _greeting;
  19. }
  20. function throwError() external pure {
  21. revert GreeterError();
  22. }
  23. }