curl -L https://foundry.paradigm.xyz | bash
foundryup
brew install libusb
-
Test all files
forge test
-
Test all files with traces
forge test -vvvv
-
Test for individual file
forge test --match-path test/Arithmetic.t.sol
-
Test for individual files with traces
forge test --match-path test/Arithmetic.t.sol -vvvv
Title | Guide | Contract | Proof of Concept |
---|---|---|---|
Arithmetic & Bitwise Operators | Guide | Contract | PoC |
Public vs External | Guide | Contract | PoC |
Default Initialization (x) | Guide | Contract | PoC |
Revert Strings | Guide | Contract | PoC |
Redundant Checks | Guide | Contract | PoC |
Nested If Statements | Guide | Contract | PoC |
State Variable vs Local Variable | Guide | Contract | PoC |
Packing Variables | Guide | Contract | PoC |
Data Types | Guide | Contract | PoC |
Addition | Guide | Contract | PoC |
Garbage Collection | Guide | Contract | PoC |
Swap | Guide | Contract | PoC |
Call Data vs Memory | Guide | Contract | PoC |
Immutable | Guide | Contract | PoC |
Solidity Version | Guide | ||
Unsigned Integer Comparision | Guide | Contract | PoC |
Boolean | Guide | ||
Custom Errors | Guide | Contract | PoC |
Optimization | Guide | ||
Use of Library | Guide | ||
String vs Bytes32 | Guide | Contract | PoC |
Multiple Require | Guide | Contract | PoC |
Loop Post Condition | Guide | Contract | PoC |
Dead Code | Guide | ||
Short Circuiting | Guide |
- https://betterprogramming.pub/how-to-write-smart-contracts-that-optimize-gas-spent-on-ethereum-30b5e9c5db85?gi=227bef2ca134
- https://mudit.blog/solidity-gas-optimization-tips/
- https://blog.polymath.network/solidity-tips-and-tricks-to-save-gas-and-reduce-bytecode-size-c44580b218e6
- https://gist.github.com/hrkrshnn/ee8fabd532058307229d65dcd5836ddc
- https://medium.com/coinmonks/8-ways-of-reducing-the-gas-consumption-of-your-smart-contracts-9a506b339c0a
- https://ethereum.stackexchange.com/questions/28813/how-to-write-an-optimized-gas-cost-smart-contract
- https://forum.openzeppelin.com/t/a-collection-of-gas-optimisation-tricks/19966
- https://medium.com/coinmonks/8-ways-of-reducing-the-gas-consumption-of-your-smart-contracts-9a506b339c0a