Skip to content

Commit

Permalink
Merge pull request #5 from lucas-manuel/master
Browse files Browse the repository at this point in the history
feat: Start outlines for testing and deployments
  • Loading branch information
gakonst authored Dec 23, 2021
2 parents c47ef40 + abda281 commit 99e6df5
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 10 deletions.
15 changes: 15 additions & 0 deletions src/deployments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Deployments

* How to deploy smart contracts
* How to verify contracts on etherscan
* How to interpret transactions on etherscan
* How to interpret and debug transactions on tenderly
* How to monitor smart contracts using Tenderly
* How to integrate with PagerDuty and Discord
* How to set up appropriate incident response procedures
* How to call smart contracts from the command line (cast)
* How to interact with smart contracts generally
* Outline of what an ethereum transaction actually is
* Outline purpose of ABIs and how they are used
* Outline structure of transaction
* Nonces, gasLimit, gasPrice etc
24 changes: 16 additions & 8 deletions src/gas.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# Gas Optimization

* why is this important
* intuition around what assembly is generated in store/load ops
* learning to optimize for low hanging fruit first
* tradeoff readability for performance (asm / inline code instead of fn calls)
* don't do useless gas optimizations
* tradeoff UX for performance (e.g. off-chain indexers for on-chain minimalism)
* immutables
* uniswap snapshot testing pattern / hardhat gas table
* Why is this important
* Intuition around what assembly is generated in store/load ops
* Learning to optimize for low hanging fruit first
* Tradeoff readability for performance (assembly/inline code instead of function calls)
* Don't do useless gas optimizations
* Auditability is crucial for security
* Tradeoff UX for performance (e.g. off-chain indexers for on-chain minimalism)
* Immutables and constants
* Uniswap snapshot testing pattern / hardhat gas table
* Outlining opcodes https://www.evm.codes/,
* Explaining MLOAD/MSTORE/SLOAD/SSTORE,
* Caching variables to memory
* Common patterns to save gas
* (https://github.com/Rari-Capital/golf-course/tree/some-tips-to-start) plus more
* Deployment costs
* When to use proxy patterns (user deployments)
6 changes: 4 additions & 2 deletions src/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Instead of re-hashing content which has been written about before, we instead provide a curated list of topics that we'll assume familiarty with from the reader.

<!-- Should probably trim down the links to only the absolute necessary to not overwhelm
the reader-->
the reader, maybe could add indications as to what is required/optional reading?-->

1. How does Ethereum work?
1. [Ethereum Development Documentation](https://ethereum.org/en/developers/docs/)
Expand All @@ -21,6 +21,8 @@ the reader-->
1. [Solidity Cheatsheet](https://github.com/manojpramesh/solidity-cheatsheet)
A cheatsheet.

<!-- Should move to Foundry -->

1. Hardhat & Typescript (to develop and test locally):
1. [Hardhat Documentation](https://hardhat.org/getting-started/): Hardhat is a smart contract development framework providing utilities
for compiling, testing and deploying smart contracts written in Solidity with Javascript (JS) and Typescript (TS).
Expand All @@ -34,7 +36,7 @@ the reader-->
1. Smart contract patterns (to learn about the fundamental smart contract building blocks):
1. [Solidity Patterns](https://fravoll.github.io/solidity-patterns/) ([code](https://github.com/fravoll/solidity-patterns)):
A curated list of patterns which you will encounter in the wild.
1. [OpenZeppelin](https://docs.openzeppelin.com/contracts/4.x/) ([code](https://github.com/openzeppelin/openzeppelin-contracts)):
1. [OpenZeppelin](https://docs.openzeppelin.com/contracts/1.x/) ([code](https://github.com/openzeppelin/openzeppelin-contracts)):
A library of secure smart contracts ranging from access control, tokens, governance, proxies and more.

1. Smart contract security (to learn about the mistakes others before you made): We *emphasize* the need to
Expand Down
13 changes: 13 additions & 0 deletions src/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Smart Contract Testing

* How to write tests in Foundry
* How to set up test files (describe/it block analogies)
* How to set up actors
* How to do assertions
* How to use cheatcodes
* How to debug using the logs/event output
* How to fork mainnet and interact with deployed contracts
* How to use https://www.4byte.directory/ to look up function signatures when source maps are unavailable
* How to use https://adibas03.github.io/online-ethereum-abi-encoder-decoder/#/encode to decode calldata when source maps are unavailable
* How to write fuzz tests effectively
* How to write invariant tests

0 comments on commit 99e6df5

Please sign in to comment.