README.md 1.33 KB
Newer Older
XFT's avatar
.  
XFT committed
1 2 3 4 5 6 7 8 9 10 11 12
# 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.
offshiftXFT's avatar
offshiftXFT committed
13

XFT's avatar
.  
XFT committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
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/