Functions

sCrypt enables developers to define their own functions as exemplified below:

function sum(int a, int b): int {
    return a + b;
}

They are only visible within the contract, similar to private functions in Solidity.

Every function must end with a return statement. Recursion is disallowed. A function cannot call itself in its body, either directly or indirectly.