Playground exploring solidity patterns, gas optimizations and compilations of notes.
Doing this for fun, but also to build a personal resource, and share it with others.
- State Variable Notes
- Gas benchmark of EIP1167 Clones vs. Clones with immutable Args
- Basic Gas Optimizations
- CREATE3 Factory (WIP)
- EIP1167 Clones
- Clones with Immutable Args
- ERC721 Merkle Drop
- Minimal Multisig with EIP712
- Utility Contract for Type Conversions (for solidity tests etc)
- Generic User - Use in tests to execute virtually any operation as a user
- Create3 Factory
You will need a copy of Foundry installed before proceeding. See the installation guide for details.
git clone https://github.com/transmissions11/foundry-template.git
cd foundry-template
forge install
forge test
# Run a specific test
forge test --match-contract "ContractName"
forge snapshot
Run make repl
Example:
➜ uint256 a = 200;
➜ a
Type: uint
├ Hex: 0xc8
└ Decimal: 20
➜ abi.encode(100,100,100)
Type: dynamic bytes
├ Hex (Memory):
├─ Length ([0x00:0x20]): 0x0000000000000000000000000000000000000000000000000000000000000060
├─ Contents ([0x20:..]): 0x000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064
├ Hex (Tuple Encoded):
├─ Pointer ([0x00:0x20]): 0x0000000000000000000000000000000000000000000000000000000000000020
├─ Length ([0x20:0x40]): 0x0000000000000000000000000000000000000000000000000000000000000060
└─ Contents ([0x40:..]): 0x000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064