Functions

Introduction

Define the Name of this Function. A function's name is used to name and differentiate functions. It is advised that the name be specific and descriptive enough to be able to infer the function's purpose and distinguish it from other functions. Furthermore, the name will be utilized in the code as keyword to name the function

Configuration

Define the Visibility for this Function. This will determine whether the function can be called (invoked) both from inside the contract, and from the outside world. Public and External functions can be called both from inside the contract, and from the outside world. Private and Internal functions can only be called from inside the contract; however, private functions are not inherited by derived contracts.

Define the State of this Function. A Pure function is a function that does not read or modify the state variables, i.e. it does not store any value on chain but only returns a result. A View function instead does not modify the state but can read state variables.

Define whether the Function should be Payable, i.e. whether it can receive currency into the contract.

Define the Input for this Function. This definition only pertains to the function's signature, i.e. it is used to establish the type of Data Entities that the function will require as input, if any.

Define the Return for this Function. This definition only pertains to the function's signature, i.e. it is used to establish the type of Data Entity that the function will return, if any.

Custom Functions are custom user-defined functions. After defining a function's properties such as its name and input/return, one will be able to design the function's flow by clicking on the dedicated button.

Define whether this Function is Cross-Contract, i.e. whether the other contracts within this project should be able to use this function as if it was defined as their own.

Define whether this Function will be utilizing any Modifier. Function modifiers are used to modify a function's behavior, for instance by defining a prerequisite to be checked before the function is executed.

Last updated