view

A function can read the state (storage variables), but cannot modify it.

Usage:

pure

A function cannot read or write to the blockchain state. It is entirely self-contained, like a mathematical function.

Usage

function add(uint a, uint b) public pure returns (uint) {
    return a + b; // uses only inputs, not state
}

override

A function overrides a parent contract’s virtual function.

contract A {
    function greet() public virtual returns (string memory) {
        return "Hello from A";
    }
}

contract B is A {
    function greet() public override returns (string memory) {
        return "Hello from B";
    }
}

virtual