# Offshift Anon 
## Initial Setup
This repository requires [NodeJS](https://nodejs.org/) 16.15 or higher. [Node Version Manager](https://github.com/nvm-sh/nvm) is recommended for easy installation and version management. Once NodeJS is running, install dependencies
```
npm install
```
## Proving Circuit Setup
To load the proving/verification keys
```
npm run download
```
This will create the `build/circuits` folder and copy the files `withdraw_proving_key.bin`, `withdraw_proving_key.json`, `withdraw_verification_key.json`, `withdraw.json`, and `Verifier.sol` into it.

To build the circuit and proving key from source
```
npm run build
```
You will need the files `withdraw_proving_key.json` and `withdraw_verification_key.json` inside the `build/circuits` folder

## Migrations and Testing
To run an Ethereum mainnet fork (in a separate terminal window)
```
npm run fork
```
(Note: You will need a mainnet RPC endpoint to fork, a list of providers can be found here: https://www.alchemy.com/list-of/rpc-node-providers-on-ethereum)

To run a contract migration
```
npm run migrate:dev
```
To run unit tests. (Note: for note encryption testing, NodeJS version 19 is required. Run `nvm install 19` if not already installed.)
```
nvm use 19
npm run test
```

## Audit
Smart contract audit by Paladin Blockchain Security: https://paladinsec.co/projects/offshift/