rln-contract/README.md

79 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2023-12-04 11:06:18 +00:00
# rln-contract [![Github Actions][gha-badge]][gha] [![Foundry][foundry-badge]][foundry] [![License: MIT][license-badge]][license]
2023-12-04 09:44:24 +00:00
[gha]: https://github.com/vacp2p/foundry-template/actions
[gha-badge]: https://github.com/vacp2p/foundry-template/actions/workflows/ci.yml/badge.svg
[foundry]: https://getfoundry.sh/
[foundry-badge]: https://img.shields.io/badge/Built%20with-Foundry-FFDB1C.svg
[license]: https://opensource.org/licenses/MIT
[license-badge]: https://img.shields.io/badge/License-MIT-blue.svg
2023-12-04 11:06:18 +00:00
A Foundry-based project for Rate Limiting Nullifiers.
2023-12-04 09:44:24 +00:00
## Getting Started
```sh
2023-12-04 11:06:18 +00:00
pnpm install # install Solhint, Prettier, and other Node.js deps
forge install # install Foundry's dependencies
```
2023-12-04 09:44:24 +00:00
If this is your first time with Foundry, check out the
[installation](https://github.com/foundry-rs/foundry#installation) instructions.
2023-12-04 12:18:15 +00:00
## Usage
2023-12-04 09:44:24 +00:00
2023-12-04 11:06:18 +00:00
### Compilation
2023-12-04 09:44:24 +00:00
```sh
2023-12-04 11:06:18 +00:00
forge build
2023-12-04 12:18:15 +00:00
```
2023-12-04 09:44:24 +00:00
2023-12-04 11:06:18 +00:00
### Format
2023-12-04 09:44:24 +00:00
```sh
2023-12-04 11:06:18 +00:00
forge fmt
2023-12-04 09:44:24 +00:00
```
2023-12-04 11:06:18 +00:00
### Clean
2023-12-04 09:44:24 +00:00
2023-12-04 11:06:18 +00:00
Deletes the build artifacts and cache directories:
2023-12-04 09:44:24 +00:00
```sh
2023-12-04 11:06:18 +00:00
forge clean
2023-12-04 09:44:24 +00:00
```
### Gas Usage
Get a gas report:
```sh
2023-12-04 11:06:18 +00:00
forge test --gas-report
2023-12-04 09:44:24 +00:00
```
2023-12-04 11:06:18 +00:00
### Test
2023-12-04 09:44:24 +00:00
2023-12-04 11:06:18 +00:00
Run the tests:
2023-12-04 09:44:24 +00:00
```sh
2023-12-04 11:06:18 +00:00
forge test
2023-12-04 09:44:24 +00:00
```
2023-12-04 11:06:18 +00:00
### Deployment
2023-12-04 09:44:24 +00:00
2023-12-04 11:06:18 +00:00
Ensure you setup the .env file with the correct values mentioned in the .env.example file.
2023-12-04 09:44:24 +00:00
```sh
2023-12-04 12:18:15 +00:00
./script/deploy.sh rln <network>
2023-12-04 09:44:24 +00:00
```
2023-12-04 12:18:15 +00:00
Where `<network>` is one of -
- `sepolia`
- `polygon-zkevm`
2023-12-04 11:06:18 +00:00
This will deploy the RLN contract, with its associated libraries to the specified network.
If forge supports the network, it will also verify the contract on the block explorer.
## License
2023-12-04 11:06:18 +00:00
This project is dual licensed under MIT and APACHE-2.0.