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

Create CLI Foundry template #185

Closed
cedoor opened this issue Dec 12, 2022 · 7 comments · Fixed by #905
Closed

Create CLI Foundry template #185

cedoor opened this issue Dec 12, 2022 · 7 comments · Fixed by #905
Assignees
Labels
feature 🚀 This is enhancing something existing or creating something new good first issue Good for newcomers

Comments

@cedoor
Copy link
Member

cedoor commented Dec 12, 2022

Description

There is a CLI Hardhat template called cli-template-contracts-hardhat with a sample contract and tests for that contract.

The idea is to recreate that same template using Foundry instead of Hardhat. The template will be called cli-template-contracts-foundry.

Previous work

https://github.com/vplasencia/semaphore-foundry

https://github.com/vplasencia/semaphore-foundry-hardhat

https://github.com/vplasencia/semaphore-hardhat-foundry

@cedoor cedoor converted this from a draft issue Dec 12, 2022
@cedoor cedoor added this to the Semaphore CLI templates milestone Dec 12, 2022
@cedoor cedoor added the feature 🚀 This is enhancing something existing or creating something new label Dec 12, 2022
@cedoor cedoor removed this from the CLI milestone Jan 18, 2023
@cedoor cedoor added this to the Semaphore CLI templates milestone Jan 31, 2023
@cedoor cedoor moved this from 📋 Backlog to 🗒 Tasks in Semaphore Board Jan 31, 2023
@vplasencia vplasencia moved this from 🗒 Tasks to 🏗 In Progress in Semaphore Board Feb 1, 2023
@vplasencia vplasencia moved this from 🏗 In Progress to ♻️ Grooming in Semaphore Board Feb 21, 2023
@cedoor cedoor moved this from ♻️ Grooming to 🗒 Tasks in Semaphore Board Mar 15, 2023
@vplasencia
Copy link
Member

The challenge here is to deploy the Semaphore contract properly using Foundry in the test environment. The equivalent in Hardhat is: https://github.com/semaphore-protocol/semaphore/blob/main/packages/hardhat/src/tasks/deploy-semaphore.ts

More context:
Getting the poseidon code and linking libraries:

The poseidon function in the PoseidonT3 library is empty by default, to get its code the circomlibjs javascript library is used. Then, it is necessary to link the PoseidonT3 library with the new code, to the IncrementalBinaryTree library.

We didn't change the implementation of the poseidon function because that code is already audited.

@vplasencia vplasencia moved this from 🗒 Tasks to ♻️ Grooming in Semaphore Board Mar 27, 2023
@vplasencia vplasencia moved this from ♻️ Grooming to 📋 Backlog in Semaphore Board Mar 27, 2023
@cedoor cedoor moved this from 📋 Backlog to ✔️ Done in Semaphore Board Mar 27, 2023
@cedoor cedoor closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 2023
@cedoor cedoor reopened this Jan 8, 2024
@cedoor cedoor added this to the Semaphore V4 milestone Jan 8, 2024
@cedoor cedoor moved this from ✔️ Done to ♻️ Grooming in Semaphore Board Jan 8, 2024
@cedoor
Copy link
Member Author

cedoor commented Jan 8, 2024

Re-opening this issue as Semaphore V4 will use an actual contract for Poseidon and there shouldn't be any problems with Foundry.

@vplasencia vplasencia self-assigned this Jan 16, 2024
@vplasencia vplasencia moved this from ♻️ Grooming to 🗒 Tasks in Semaphore Board Jan 17, 2024
@cedoor cedoor moved this from 🗒 Tasks to ♻️ Grooming in Semaphore Board Feb 9, 2024
@vplasencia vplasencia moved this from ♻️ Grooming to 🗒 Tasks in Semaphore Board Feb 27, 2024
@vplasencia vplasencia removed their assignment Apr 19, 2024
@vplasencia vplasencia moved this from 🗒 Tasks to ♻️ Grooming in Semaphore Board Apr 19, 2024
@vplasencia vplasencia added the good first issue Good for newcomers label May 3, 2024
@cedoor cedoor removed this from the Semaphore V4 milestone Jul 4, 2024
@csiejimmyliu
Copy link
Contributor

Hi @cedoor, @vplasencia! I'm interested in this issue. Please assign it to me.
Thank you!

@cedoor
Copy link
Member Author

cedoor commented Sep 2, 2024

Hey @csiejimmyliu, assigned :)

@cedoor cedoor moved this from ♻️ Grooming to 🏗 In Progress in Semaphore Board Sep 2, 2024
@csiejimmyliu
Copy link
Contributor

csiejimmyliu commented Sep 7, 2024

Hey @cedoor !
I'm in PSE Core Taiwan, my group mate @timou0911 works with me on this issue. Can you assign him too?

@cedoor
Copy link
Member Author

cedoor commented Sep 9, 2024

Hey @csiejimmyliu, sure! They need to comment here tho.

@timou0911
Copy link
Contributor

timou0911 commented Sep 9, 2024

Hi @cedoor ! Just created a PR of this issue!

@cedoor cedoor mentioned this issue Sep 11, 2024
7 tasks
@cedoor cedoor moved this from 🏗 In Progress to 👀 In review in Semaphore Board Sep 11, 2024
vplasencia pushed a commit that referenced this issue Dec 17, 2024
* Semaphore identity example code bug fix

* Receive suggestion for consistency

* chore: forge init

* forge install: forge-std

v1.9.2

* Foundry CLI First Draft

* modules

* forge install: semaphore

v4.0.3

* forge install: zk-kit.solidity

* forge install: poseidon-solidity

v0.0.5

* forge install: openzeppelin-contracts

v5.0.2

* modules

* forge install: semaphore

v4.0.3

* forge install: zk-kit.solidity

* forge install: poseidon-solidity

v0.0.5

* forge install: openzeppelin-contracts

v5.0.2

* modules

* forge install: semaphore

v4.0.3

* forge install: zk-kit.solidity

* forge install: poseidon-solidity

v0.0.5

* forge install: openzeppelin-contracts

v5.0.2

* modules

* forge install: semaphore

v4.0.3

* forge install: zk-kit.solidity

* forge install: poseidon-solidity

v0.0.5

* forge install: openzeppelin-contracts

v5.0.2

* modules

* forge install: semaphore

v4.0.3

* forge install: zk-kit.solidity

* forge install: poseidon-solidity

v0.0.5

* forge install: openzeppelin-contracts

v5.0.2

* modules

* forge install: semaphore

v4.0.3

* forge install: zk-kit.solidity

* forge install: poseidon-solidity

v0.0.5

* forge install: openzeppelin-contracts

v5.0.2

* forge install: forge-std

v1.9.2

* modules

* forge install: semaphore

v4.0.3

* forge install: zk-kit.solidity

* forge install: poseidon-solidity

v0.0.5

* forge install: openzeppelin-contracts

v5.0.2

* modules

* forge install: semaphore

v4.0.3

* forge install: zk-kit.solidity

* forge install: poseidon-solidity

v0.0.5

* forge install: openzeppelin-contracts

v5.0.2

* forge install: forge-std

v1.9.2

* modules

* forge install: semaphore

v4.0.3

* forge install: zk-kit.solidity

* forge install: poseidon-solidity

v0.0.5

* forge install: openzeppelin-contracts

v5.0.2

* forge install: forge-std

v1.9.2

* modules

* forge install: semaphore

v4.0.3

* forge install: zk-kit.solidity

* forge install: poseidon-solidity

v0.0.5

* forge install: openzeppelin-contracts

v5.0.2

* modules

* forge install: semaphore

v4.0.3

* forge install: zk-kit.solidity

* forge install: poseidon-solidity

v0.0.5

* forge install: openzeppelin-contracts

v5.0.2

* forge install: forge-std

v1.9.2

* modules

* forge install: semaphore

v4.0.3

* forge install: zk-kit.solidity

* forge install: poseidon-solidity

v0.0.5

* forge install: openzeppelin-contracts

v5.0.2

* forge install: forge-std

v1.9.2

* change test name

* modify declaration of semaphore and verifier

* Modify Test Function Name

* Add Test Chain Target

* forge std install

* refactor(cli-template-contracts-foundry): change default Anvil address and private key

* chore(cli-template-contracts-foundry): add comments

* refactor(cli-template-contracts-foundry): add Semaphore & SemaphoreVerifier addresses for test chain

* chore(cli-template-contracts-foundry): add forge coverage for Makefile

* chore(cli-template-contracts-foundry): add env.example

* docs(cli-template-contracts-foundry): add command instructions

* updated

* forge build works

* Fixed for linting

* chore(cli-template-contracts-foundry): make the lint, prettier, and lint-staged pass

* chore(cli-template-contracts-foundry): replace Makefile(removed) with package.json

* chore(cli-template-contracts-foundry): passing the ci test

* updated test

* feat(cli-template-contracts-foundry): complete cli-template-contracts-foundry

re #854, #185

* Update dependencies

* Add explanation on `yarn dev`

* fix(cli-template-contracts-foundry): fix `yarn dev` command and add docs on integrate w/ boilerplate

* Added yarnrc

* updated version

* Added Foundry in template option

---------

Co-authored-by: weipooppys93030 <55434365+weipooppys93030@users.noreply.github.com>
Co-authored-by: timou0911 <x0928048316@gmail.com>
Co-authored-by: csiejimmyliu <91661606+csiejimmyliu@users.noreply.github.com>
@github-project-automation github-project-automation bot moved this from 👀 In review to ✔️ Done in Semaphore Board Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🚀 This is enhancing something existing or creating something new good first issue Good for newcomers
Projects
Status: ✔️ Done
4 participants