Solidity Beginner Terms

12 flashcards · Programming Languages · by riversporper

  1. external

    tells Solidity that this function can only be called from outside this contract.

  2. pure

    tells Solidity that this function does not write anything to the blockchain.

  3. 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.

  4. view

    "view" tells Solidity that this is a read-only function. It does not make any updates to the blockchain

  5. global variables

    Global variables provide information about the blockchain

  6. constant variables

    constant variables must be set before compilation and it cannot be modified after the contract is compiled.

  7. require

    require is used to validate inputs and check conditions before and after execution.

  8. revert

    revert is like require but more handy when the condition to check is nested in several if statements.

  9. assert

    assert is used to check invariants, code that should never be false. Failing assertion probably means that there is a bug.

  10. storage

    storage - variable is a state variable (store on blockchain)

  11. memory

    memory - variable is in memory and it exists temporary during a function call

  12. calldata

    calldata - special data location that contains function arguments