Skip to content

Commit

Permalink
Up to date template
Browse files Browse the repository at this point in the history
  • Loading branch information
exp-table committed May 24, 2023
1 parent 8a8339b commit 2189f8e
Show file tree
Hide file tree
Showing 19 changed files with 2,656 additions and 23,903 deletions.
108 changes: 2 additions & 106 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,109 +1,5 @@
out/
cache/
circuits/build/
artifacts/
circuits/proofs/
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
typechain-types/
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
circuits/build/
circuits/target/
31 changes: 11 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,39 @@ Click [`use this template`](https://github.com/whitenois3/nplate/generate) to cr

## Development

Both hardhat and foundry are supported.
With the help of the `ffi`, you can write complex JS/TS scripts, feed them inputs FROM the foundry test contract and use the output in the test contract.

**Setup**
```bash
npm install
```

You need both `nargo` and `foundry` installed.

Regarding the installation of `nargo`, please refer to its repo [here](https://github.com/noir-lang/noir).

**Building**

```bash
cd circuits
nargo build
nargo compile BUILD_NAME
# generates the Solidity contract
nargo nargo codegen-verifier
# generates a file "p.proof" in circuits/proofs
nargo prove p
```

**Testing**
```bash
npx hardhat test
```
```bash
forge test --ffi
```

We have provided two bash scripts in `utils/` to make your life easier when it comes to generating the Verifier contract and a proof.
Before testing, be sure you have generated the updated Solidity verifier contract as well as a valid proof!

```
./utils/safeGenerateContract.sh
./utils/safeGenerateProof.sh
```bash
forge test --ffi
```

## License

[AGPL-3.0-only](https://github.com/abigger87/femplate/blob/master/LICENSE)


## Acknowledgements

- [femplate](https://github.com/abigger87/femplate)
- [basic_mul_noir_example](https://github.com/vezenovm/basic_mul_noir_example)


## Disclaimer

_These smart contracts are being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the user interface or the smart contracts. They have not been audited and as such there can be no assurance they will work as intended, and users may experience delays, failures, errors, omissions, loss of transmitted information or loss of funds. The creators are not liable for any of the foregoing. Users should proceed with caution and use at their own risk._
7 changes: 3 additions & 4 deletions circuits/Verifier.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
setpub = []
x = "1"
y = "2"
return = "3"
return = "0x0000000000000000000000000000000000000000000000000000000000000003"
x = "0x0000000000000000000000000000000000000000000000000000000000000001"
y = "0x0000000000000000000000000000000000000000000000000000000000000002"
Loading

0 comments on commit 2189f8e

Please sign in to comment.