In Solidity, modifiers can be used to modify functions, state variables, or events. The following table gives an overview of all modifiers.
modifier |
used on |
description |
pure |
functions |
disallows modification or access of state |
view |
functions |
disallows modification of state |
payable |
functions |
allows to receive Ether with a call |
constant |
state variables |
disallows assignment |
immutable |
state variables |
allows one assignment at construction time |
anonymous |
events |
does not store event signature as topic |
indexed |
event parameters |
stores the parameter as topic |
virtual |
functions or modifiers |
allows function or modifiers behaviour to be changed |
overwrite |
function, modifier or public state variable |
changes the behaviour of a function or modifier in base contract |