Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

foundry voting example<updated> #37

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 36 additions & 14 deletions .github/workflows/foundry-voting.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# a github workflow that runs curl -L https://foundry.paradigm.xyz | bash then nargo codegen-verifier then nargo prove p
name: Run Foundry-Voting Tests

name: Run fourndry-voting Tests on PR
on:
pull_request:
paths:
- 'foundry-voting/**'
workflow_dispatch:

jobs:
test:
Expand All @@ -14,26 +14,48 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: stable

- name: Install BB
uses: AztecProtocol/aztec-packages/tree/master/barretenberg/bbup
with:
toolchain: stable

- name: Install Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install Dependencies
run: bun install

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Circuit Tests
run: bun run circuits:test

- name: Execute Circuits
run: bun run circuits:execute

- name: Generate UltraPlonk Proof
run: bun run circuits:ultraplonk:generate-proof

- name: Generate Verification Key
run: bun run circuits:ultraplonk:generate-vk

- name: Generate verifier contract
run: |
nargo codegen-verifier
working-directory: foundry-voting/circuits
- name: Generate Circuit Contract
run: bun run circuits:contract

- name: Generate proof
run: |
nargo prove
working-directory: foundry-voting/circuits
- name: Clean UltraPlonk Proof
run: bun run ultraplonk:clean-proof

- name: Test with Foundry
run: |
forge test --optimize --optimizer-runs 5000 --evm-version london
- name: Run Forge Tests
run: forge test
185 changes: 171 additions & 14 deletions foundry-voting/.gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,177 @@
# Compiler files
cache/
out/
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/
# Logs

# Docs
docs/
logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

circuits/target
# Caches

cache
.cache

# 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/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# 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 variable files

# Dotenv file
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

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

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

# 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

# vuepress v2.x temp and cache directory

.temp

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

node_modules
crs
# IntelliJ based IDEs
.idea

circuits/contract
circuits/proofs
# Finder (MacOS) folder config
.DS_Store
3 changes: 0 additions & 3 deletions foundry-voting/.gitmodules

This file was deleted.

Loading