Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sakulstra/forge-bug-repro
repo for forge issue reproductions
https://github.com/sakulstra/forge-bug-repro
Last synced: 26 days ago
JSON representation
repo for forge issue reproductions
- Host: GitHub
- URL: https://github.com/sakulstra/forge-bug-repro
- Owner: sakulstra
- License: mit
- Created: 2023-03-13T14:17:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-03-26T11:31:09.000Z (over 1 year ago)
- Last Synced: 2024-05-29T17:25:21.757Z (5 months ago)
- Language: Solidity
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BGD forge template
Basic template with prettier and rest configuration
To create a new project using this template run
```shell
$ forge init --template bgd-labs/bgd-forge-template my_new_project
```## Recommended modules
[bgd-labs/solidity-utils](https://github.com/bgd-labs/solidity-utils) - common contracts we use everywhere, ie transparent proxy and around
[bgd-labs/aave-address-book](https://github.com/bgd-labs/aave-address-book) - the best and only source about all deployed Aave ecosystem related contracts across all the chains
[bgd-labs/aave-helpers](https://github.com/bgd-labs/aave-helpers) - useful utils for integration, and not only testing related to Aave ecosystem contracts
[Rari-Capital/solmate](https://github.com/Rari-Capital/solmate) - one of the best sources of base contracts for ERC20, ERC21, which will work with transparent proxy pattern out of the box
[OpenZeppelin/openzeppelin-contracts](https://github.com/OpenZeppelin/openzeppelin-contracts) - another very reputable and well organized source of base contracts for tokens, access control and many others
## Development
This project uses [Foundry](https://getfoundry.sh). See the [book](https://book.getfoundry.sh/getting-started/installation.html) for detailed instructions on how to install and use Foundry.
The template ships with sensible default so you can use default `foundry` commands without resorting to `MakeFile`.### Setup
```sh
cp .env.example .env
forge install
```### Test
```sh
forge test
```## Advanced features
### Diffing
For contracts upgrading implementations it's quite important to diff the implementation code to spot potential issues and ensure only the intended changes are included.
Therefore the `Makefile` includes some commands to streamline the diffing process.#### Download
You can `download` the current contract code of a deployed contract via `make download chain=polygon address=0x00`. This will download the contract source for specified address to `src/etherscan/chain_address`. This command works for all chains with a etherscan compatible block explorer.
#### Git diff
You can `git-diff` a downloaded contract against your src via `make git-diff before=./etherscan/chain_address after=./src out=filename`. This command will diff the two folders via git patience algorithm and write the output to `diffs/filename.md`.
**Caveat**: If the onchain implementation was verified using flatten, for generating the diff you need to flatten the new contract via `forge flatten` and supply the flattened file instead fo the whole `./src` folder.