Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alephao/solidity-template

Opinionated solidity starter template with too many tools
https://github.com/alephao/solidity-template

contracts ethereum evm forge foundry smart-contract smart-contracts solidity

Last synced: 9 days ago
JSON representation

Opinionated solidity starter template with too many tools

Awesome Lists containing this project

README

        

### Solidity Starter Template

Opinionated solidity template with too many tools.

```bash
git clone --recurse-submodules https://github.com/alephao/solidity-template.git

# Install python dependencies
pip install -r requirements.txt -r scripts/solcery/requirements.txt

# Install javascript dependencies
yarn
```

**Configuration**

- Compile using solidity `0.8.23`
- Imports relative to the root folder using `$` e.g.: `import "$/src/Contract.sol";`
- Imports relative to lib fodler using `@` e.g.: `import "@ds-test/test.sol";`

**Tooling**

- **[foundry](https://github.com/foundry-rs/foundry)'s `forge`** for building, testing, and gas snapshots
- **[solhint](https://github.com/protofire/solhint)** for linting
- **[slither](https://github.com/crytic/slither)** for static analysis and linting
- **[solcery](https://github.com/alephao/solcery)** for code-generating type-safe errors for tests and error signature comments
- GitHub Actions CI with three workflows: test, lint, and analyze.
- Makefile with common commands
- Deployment script using typescript, ethersjs and typechain

**Support Contracts**

- **[forge-std](https://github.com/foundry-rs/forge-std)**

**CI**

There are three GitHub Actions workflows configured.

- **Test**: Will run `make test`, running the unit-tests with forge.
- **Lint**: Will run `make lint`, running solhint and prettier.
- **Analyze**: Will run `make analyze`, running the slither analyzer.

### Makefile Commands

* **build**: force build with optimization
* **test**: run only test contracts suffixed with `UnitTest`
* **snapshot**: create .gas-snapshot, running only tests suffixed with `BenchmarkTest`
* **codegen**: generate Errors.sol and error's sighash comments
* **format**: format codebase using prettier
* **lint**: lint using solhint
* **analyze**: run analyzer (slither)
* **typechain**: run analyzer (slither)
* **deploy**: re-build, re-run typechain, and run deployment script `scripts/deploy.ts`

### Tests

* Unit test contracts should be suffixed with UnitTest
* Gas/Benchmark test contracts should be suffixed with BenchmarkTest