5.3 Read-only functions

Read-only functions can be called by the contract itself or from outside. They may return any type, similar to private functions.

As the name suggests, read-only functions are limited to read operations. Data variables and maps can be read, but not written. Read-only functions can also be purely functional, meaning they calculate a result based on input and return it.

Last updated