Solidity Beginner Terms
12 flashcards · Programming Languages · by riversporper
external
tells Solidity that this function can only be called from outside this contract.
pure
tells Solidity that this function does not write anything to the blockchain.
state variable
State variables are stored on the blockchain. So you can save some data into a state variable, come back a week later and the data will still be there.
view
"view" tells Solidity that this is a read-only function. It does not make any updates to the blockchain
global variables
Global variables provide information about the blockchain
constant variables
constant variables must be set before compilation and it cannot be modified after the contract is compiled.
require
require is used to validate inputs and check conditions before and after execution.
revert
revert is like require but more handy when the condition to check is nested in several if statements.
assert
assert is used to check invariants, code that should never be false. Failing assertion probably means that there is a bug.
storage
storage - variable is a state variable (store on blockchain)
memory
memory - variable is in memory and it exists temporary during a function call
calldata
calldata - special data location that contains function arguments