Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/alephao/solidity-template
- Owner: alephao
- License: mit
- Created: 2022-04-14T20:02:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-03T02:12:49.000Z (11 months ago)
- Last Synced: 2024-01-03T03:46:22.034Z (11 months ago)
- Topics: contracts, ethereum, evm, forge, foundry, smart-contract, smart-contracts, solidity
- Language: TypeScript
- Homepage:
- Size: 77.1 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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