Functions
Function Structure
public
-> visibility declarationview
-> Indicates function behaviorreturns
-> Data type that the function returns (optional)
Function Visibility
A function declarations only impose scope and do nothing for security
Simply put:
public -> functions can be called both internally and externally
external -> only external calls; cannot be accessed internally
internal -> only this contract and contracts deriving from it can access
private -> functions can only be called from within the contract
Cannot create a function with the same name as a storage variable. Will conflict with getter function.
Last updated