style: run Prettier over Markdown files
This commit is contained in:
parent
34b65a2622
commit
124aa29492
25
LICENSE.md
25
LICENSE.md
|
@ -2,20 +2,15 @@ MIT License
|
|||
|
||||
Copyright (c) 2022 Paul Razvan Berg
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
||||
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
|
42
README.md
42
README.md
|
@ -13,7 +13,8 @@ A Foundry-based template for developing Solidity smart contracts, with sensible
|
|||
|
||||
## What's Inside
|
||||
|
||||
- [Forge](https://github.com/foundry-rs/foundry/blob/master/forge): compile, test, fuzz, debug and deploy smart contracts
|
||||
- [Forge](https://github.com/foundry-rs/foundry/blob/master/forge): compile, test, fuzz, debug and deploy smart
|
||||
contracts
|
||||
- [PRBTest](https://github.com/paulrberg/prb-test): modern collection of testing assertions and logging utilities
|
||||
- [Forge Std](https://github.com/foundry-rs/forge-std): collection of helpful contracts and cheatcodes for testing
|
||||
- [Solhint](https://github.com/protofire/solhint): code linter
|
||||
|
@ -21,7 +22,8 @@ A Foundry-based template for developing Solidity smart contracts, with sensible
|
|||
|
||||
## Getting Started
|
||||
|
||||
Click the [`Use this template`](https://github.com/paulrberg/foundry-template/generate) button at the top of the page to create a new repository with this repo as the initial state.
|
||||
Click the [`Use this template`](https://github.com/paulrberg/foundry-template/generate) button at the top of the page to
|
||||
create a new repository with this repo as the initial state.
|
||||
|
||||
Or, if you prefer to install the template manually:
|
||||
|
||||
|
@ -31,13 +33,16 @@ cd my-project
|
|||
yarn install # install solhint and prettier and other goodies
|
||||
```
|
||||
|
||||
If this is your first time with Foundry, check out the [installation](https://github.com/foundry-rs/foundry#installation) instructions.
|
||||
If this is your first time with Foundry, check out the
|
||||
[installation](https://github.com/foundry-rs/foundry#installation) instructions.
|
||||
|
||||
## Features
|
||||
|
||||
This template builds upon the frameworks and libraries mentioned above, so for details about their specific features, please consult their respective documentations.
|
||||
This template builds upon the frameworks and libraries mentioned above, so for details about their specific features,
|
||||
please consult their respective documentations.
|
||||
|
||||
For example, for Foundry, you can refer to the [Foundry Book](https://book.getfoundry.sh/). You might be in particular interested in reading the [Writing Tests](https://book.getfoundry.sh/forge/writing-tests.html) guide.
|
||||
For example, for Foundry, you can refer to the [Foundry Book](https://book.getfoundry.sh/). You might be in particular
|
||||
interested in reading the [Writing Tests](https://book.getfoundry.sh/forge/writing-tests.html) guide.
|
||||
|
||||
### Sensible Defaults
|
||||
|
||||
|
@ -65,18 +70,23 @@ You can edit the CI script in [.github/workflows/ci.yml](./.github/workflows/ci.
|
|||
|
||||
### Conventional Commits
|
||||
|
||||
This template enforces the [Conventional Commits](https://www.conventionalcommits.org/) standard for git commit messages.
|
||||
This is a lightweight convention that creates an explicit commit history, which makes it easier to write automated
|
||||
tools on top of.
|
||||
This template enforces the [Conventional Commits](https://www.conventionalcommits.org/) standard for git commit
|
||||
messages. This is a lightweight convention that creates an explicit commit history, which makes it easier to write
|
||||
automated tools on top of.
|
||||
|
||||
### Git Hooks
|
||||
|
||||
This template uses [Husky](https://github.com/typicode/husky) to run automated checks on commit messages, and [Lint Staged](https://github.com/okonet/lint-staged) to automatically format the code with Prettier when making a git commit.
|
||||
This template uses [Husky](https://github.com/typicode/husky) to run automated checks on commit messages, and
|
||||
[Lint Staged](https://github.com/okonet/lint-staged) to automatically format the code with Prettier when making a git
|
||||
commit.
|
||||
|
||||
## Writing Tests
|
||||
|
||||
To write a new test contract, you start by importing [PRBTest](https://github.com/paulrberg/prb-test) and inherit from it in your test contract. PRBTest comes with a
|
||||
pre-instantiated [cheatcodes](https://book.getfoundry.sh/cheatcodes/) environment accessible via the `vm` property. You can also use [console.log](https://book.getfoundry.sh/faq?highlight=console.log#how-do-i-use-consolelog), whose logs you can see in the terminal output by adding the `-vvvv` flag.
|
||||
To write a new test contract, you start by importing [PRBTest](https://github.com/paulrberg/prb-test) and inherit from
|
||||
it in your test contract. PRBTest comes with a pre-instantiated [cheatcodes](https://book.getfoundry.sh/cheatcodes/)
|
||||
environment accessible via the `vm` property. You can also use
|
||||
[console.log](https://book.getfoundry.sh/faq?highlight=console.log#how-do-i-use-consolelog), whose logs you can see in
|
||||
the terminal output by adding the `-vvvv` flag.
|
||||
|
||||
This template comes with an example test contract [Foo.t.sol](./test/Foo.t.sol).
|
||||
|
||||
|
@ -117,7 +127,8 @@ $ forge script script/Foo.s.sol:FooScript --fork-url http://localhost:8545 \
|
|||
--broadcast --private-key $PRIVATE_KEY
|
||||
```
|
||||
|
||||
For instructions on how to deploy to a testnet or mainnet, check out the [Solidity Scripting tutorial](https://book.getfoundry.sh/tutorials/solidity-scripting.html).
|
||||
For instructions on how to deploy to a testnet or mainnet, check out the
|
||||
[Solidity Scripting tutorial](https://book.getfoundry.sh/tutorials/solidity-scripting.html).
|
||||
|
||||
### Format
|
||||
|
||||
|
@ -153,8 +164,11 @@ $ forge test
|
|||
|
||||
## Notes
|
||||
|
||||
1. Foundry piggybacks off [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to manage dependencies. There's a [guide](https://book.getfoundry.sh/projects/dependencies.html) about how to work with dependencies in the book.
|
||||
2. You don't have to create a `.env` file, but filling in the environment variables may be useful when debugging and testing against a mainnet fork.
|
||||
1. Foundry piggybacks off [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to manage dependencies.
|
||||
There's a [guide](https://book.getfoundry.sh/projects/dependencies.html) about how to work with dependencies in the
|
||||
book.
|
||||
2. You don't have to create a `.env` file, but filling in the environment variables may be useful when debugging and
|
||||
testing against a mainnet fork.
|
||||
|
||||
## Related Efforts
|
||||
|
||||
|
|
Loading…
Reference in New Issue