rln-contract/README.md

79 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2024-01-11 09:29:18 +00:00
# rln-contract [![Github Actions][gha-badge]][gha] [![Foundry][foundry-badge]][foundry] [![License: MIT][license-badge]][license]
2024-01-11 09:29:18 +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
2024-01-11 09:29:18 +00:00
A Foundry-based project for Rate Limiting Nullifiers.
2024-01-11 09:29:18 +00:00
## Getting Started
2022-06-23 13:36:10 +00:00
2024-01-11 09:29:18 +00:00
```sh
pnpm install # install Solhint, Prettier, and other Node.js deps
forge install # install Foundry's dependencies
```
If this is your first time with Foundry, check out the
[installation](https://github.com/foundry-rs/foundry#installation) instructions.
## Usage
2022-06-23 13:36:10 +00:00
2024-01-11 09:29:18 +00:00
### Compilation
```sh
forge build
```
2024-01-11 09:29:18 +00:00
### Format
2023-03-30 12:59:06 +00:00
2024-01-11 09:29:18 +00:00
```sh
forge fmt
2022-06-23 13:36:10 +00:00
```
2024-01-11 09:29:18 +00:00
### Clean
Deletes the build artifacts and cache directories:
2023-03-30 12:59:06 +00:00
2024-01-11 09:29:18 +00:00
```sh
forge clean
2022-09-25 21:49:21 +00:00
```
2022-06-23 13:36:10 +00:00
2024-01-11 09:29:18 +00:00
### Gas Usage
2022-06-23 13:36:10 +00:00
2024-01-11 09:29:18 +00:00
Get a gas report:
2023-03-30 12:59:06 +00:00
2024-01-11 09:29:18 +00:00
```sh
forge test --gas-report
```
### Test
2022-06-23 13:36:10 +00:00
2024-01-11 09:29:18 +00:00
Run the tests:
```sh
forge test
2022-06-23 13:36:10 +00:00
```
2024-01-11 09:29:18 +00:00
### Deployment
2023-03-30 12:59:06 +00:00
2024-01-11 09:29:18 +00:00
Ensure you setup the .env file with the correct values mentioned in the .env.example file.
2022-06-23 13:36:10 +00:00
2024-01-11 09:29:18 +00:00
```sh
./script/deploy.sh rln <network>
2022-06-23 13:36:10 +00:00
```
2023-03-30 12:59:06 +00:00
2024-01-11 09:29:18 +00:00
Where `<network>` is one of -
- `sepolia`
- `polygon-zkevm`
2022-06-23 13:36:10 +00:00
2024-01-11 09:29: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
2024-01-11 09:29:18 +00:00
This project is dual licensed under MIT and APACHE-2.0.