Solidity notes

Coding

  • license headers

  • pragma version

  • smart contract

    • state variables
    • functions
    • function modifiers
    • events
    • struct types / enum types

Use cases?

  • gaming and blockchain
  • ethereum transactions over web3
  • nft
  • voting system!
  • multi-signature accounts?

Tips / Best practices

  • small uints in structs saves gas!
  • clustered variables (next to each other) saves gas!
  • view and pure doesn’t cost gas if called internally/privately

Resources