Friends, it’s time to learn blockchain technology again 😄. Today, I will share with you what solidity function modifiers are.

1. Payable function modifier

A payable function indicates that a function can be called with ether and can be used for normal functions, constructors, and fallback functions.

2. Function modifier view

view means that a function cannot modify the state and does not consume gas when executed locally.

In what cases is the status considered changed?

1. Write state variables

2. Trigger contract events

3. Create other contracts

4. The call is attached with Ether

5. Calling tasks and functions without view or pure modifiers

6. Using low-level calls

3. Function modifier pure

Pure means that a function does not read or modify the state, and local execution does not consume gas.

The following situations are considered to be read status:

1. Read state variables

2. Accessing the .balance property

3. Accessed block, tx, msg members (except msg.sig and msg.data)

4. Calling any function without pure modification

4. Code Practice

Function modifier payable

Function modifiers view and pure