Solidity
Examples
- kalidao - programmable structures for web3 companies and funds
- https://github.com/edendao/protocol
- https://github.com/GiupiDeLuca/Solidity-Samples/blob/main/MultiSig.sol
- https://github.com/mangrovedao/mangrove
- https://github.com/optionality/clone-factory
- https://github.com/trufflesuite/solidity-test-cases/tree/master/library-collision-test
Core language concepts...
- Contracts
- Delegates
- Enums
- Events
- Functions
- Interfaces
- Mappings
- Modifiers
Data Types
- uint
- string
- boolean
- struct
- address
- mapping
Mappings
- When a mapping has public visibility, a getter function is intrinsically generated for accessing
Patterns
Libraries
Utilities
Units & Global Variables
https://docs.soliditylang.org/en/v0.7.5/units-and-global-variables.html
Inheritance
Errors
Examples
- out-of-gas
- divide by zero
- data type overflow
- array-out-of-index
Error Handing
require
- Note that โRequireโ consumes GAS unless it hits the REVERT opcode and so it is important that โrequireโ statements should generally be placed at the beginning of the functionassert
revert
new keyword
- "Using the new keyword is a design time static creation of a smart contract"
Inline Assembly
Mixing of "both Solidity statements and Assembly code in the same smart contract".
- Memory (MLOAD, MSTORE, etc) slots and storage (SLOAD, SSTORE, etc) slots are both accessible
Storage
Order
- events
- modifiers
- constructor
- external
- external view
- external pure
- public
- public view
- public pure
- internal
- internal view
- internal pure
- private
- private view
- private pure