Sophon Testnet

Contract Diff Checker

Contract Name:
Greeter

Contract Source Code:

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.9;

contract Greeter {

    string greeting;
    error Greeting();   
    uint256 x;
    
    constructor(string memory _greeting) {
        greeting = _greeting;
    }

    function setGreeting(string memory _greeting) public {
        greeting = _greeting;
    }

    function greet() public view returns (string memory) {
        return greeting;
    }

    function revertWithMesage() public pure {
        require(
            false,
            "Revert with a payable error message string"
        );
    }

    function revertWithEvent() public pure {
        revert Greeting();
    }

    function succeeds() public {
        x++; // just to avoid compiler warnings
    }
}

Please enter a contract address above to load the contract details and source code.

Context size (optional):