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

Function Visibility

Define the visibility of your function to determine how it can be called:

  • Public: Can be called both from inside the contract and from the outside world.

  • External: Similar to public but intended to be called from outside the contract.

  • Internal: Can only be called from within the contract and by derived contracts.

  • Private: Can only be called from within the contract and not inherited by derived contracts.

This setup allows you to control the accessibility and behavior of your functions, ensuring they operate as intended within your smart contract.

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.

Cross-Contract Function

Define whether this function is Cross-Contract, meaning whether other contracts within this project should be able to use this function as if it were defined as their own. Enabling Cross-Contract functionality allows for greater modularity and reusability across different contracts in the project.

Function Modifiers

Define whether this function will be utilizing any Modifiers. Function modifiers are used to alter a function's behavior by, for example, specifying prerequisites that must be checked before the function is executed. Modifiers can enhance functionality, such as ensuring certain conditions are met or adding additional security checks.

By specifying these attributes, you can control the accessibility and behavior of your functions, making them more versatile and secure within your smart contract.

Last updated