communities-contracts/README.md

91 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2023-09-19 09:51:37 +00:00
# Communities Contracts [![Github Actions][gha-badge]][gha] [![Codecov][codecov-badge]][codecov] [![Foundry][foundry-badge]][foundry]
2023-01-19 11:21:41 +00:00
[gha]: https://github.com/status-im/communities-contracts/actions
2023-09-19 09:46:15 +00:00
[gha-badge]: https://github.com/status-im/communities-contracts/actions/workflows/test.yml/badge.svg
2023-09-19 09:51:37 +00:00
[codecov]: https://codecov.io/gh/status-im/communities-contracts
[codecov-badge]: https://codecov.io/gh/status-im/communities-contracts/graph/badge.svg
[foundry]: https://getfoundry.sh/
[foundry-badge]: https://img.shields.io/badge/Built%20with-Foundry-FFDB1C.svg
2023-01-19 11:21:41 +00:00
## Usage
2023-01-19 11:21:41 +00:00
This is a list of the most frequently needed commands.
### Build
Build the contracts:
```sh
$ forge build
```
### Clean
Delete the build artifacts and cache directories:
```sh
$ forge clean
```
### Compile
Compile the contracts:
```sh
$ forge build
```
### Coverage
Get a test coverage report:
```sh
$ forge coverage
```
### Deploy
Deploy to Anvil:
```sh
$ forge script script/DeployOwnerToken.s.sol --broadcast --fork-url http://localhost:8545
```
For this script to work, you need to have a `MNEMONIC` environment variable set to a valid
[BIP39 mnemonic](https://iancoleman.io/bip39/).
For instructions on how to deploy to a testnet or mainnet, check out the
[Solidity Scripting](https://book.getfoundry.sh/tutorials/solidity-scripting.html) tutorial.
### Format
Format the contracts:
```sh
$ forge fmt
```
### Gas Usage
Get a gas report:
```sh
$ forge test --gas-report
```
### Lint
Lint the contracts:
```sh
$ pnpm lint
```
### Test
Run the tests:
```sh
$ forge test
2023-01-19 11:21:41 +00:00
```