Skip to content

Commit

Permalink
chore(cli): v3.0.0-beta.5
Browse files Browse the repository at this point in the history
Former-commit-id: 9a2db4b
  • Loading branch information
cedoor committed Jan 4, 2023
1 parent 362b025 commit 578d426
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 26 deletions.
6 changes: 3 additions & 3 deletions packages/cli-template-hardhat/contracts/Greeter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "@semaphore-protocol/contracts/interfaces/ISemaphore.sol";
/// @title Greeter contract.
/// @dev The following code is just a example to show how Semaphore can be used.
contract Greeter {
event NewGreeting(bytes32 greeting);
event NewGreeting(uint256 greeting);
event NewUser(uint256 identityCommitment, bytes32 username);

ISemaphore public semaphore;
Expand All @@ -18,7 +18,7 @@ contract Greeter {
semaphore = ISemaphore(semaphoreAddress);
groupId = _groupId;

semaphore.createGroup(groupId, 20, 0, address(this));
semaphore.createGroup(groupId, 20, address(this));
}

function joinGroup(uint256 identityCommitment, bytes32 username) external {
Expand All @@ -30,7 +30,7 @@ contract Greeter {
}

function greet(
bytes32 greeting,
uint256 greeting,
uint256 merkleTreeRoot,
uint256 nullifierHash,
uint256[8] calldata proof
Expand Down
12 changes: 6 additions & 6 deletions packages/cli-template-hardhat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@semaphore-protocol/cli-template-hardhat",
"version": "0.5.0",
"version": "3.0.0-beta.5",
"description": "Semaphore Hardhat template.",
"license": "Unlicense",
"files": [
Expand Down Expand Up @@ -33,10 +33,10 @@
"@nomicfoundation/hardhat-toolbox": "^2.0.0",
"@nomiclabs/hardhat-ethers": "^2.0.0",
"@nomiclabs/hardhat-etherscan": "^3.0.0",
"@semaphore-protocol/group": "2.6.1",
"@semaphore-protocol/hardhat": "^0.1.0",
"@semaphore-protocol/identity": "2.6.1",
"@semaphore-protocol/proof": "2.6.1",
"@semaphore-protocol/group": "3.0.0-beta.5",
"@semaphore-protocol/hardhat": "3.0.0-beta.5",
"@semaphore-protocol/identity": "3.0.0-beta.5",
"@semaphore-protocol/proof": "3.0.0-beta.5",
"@typechain/ethers-v5": "^10.1.0",
"@typechain/hardhat": "^6.1.2",
"@types/chai": "^4.2.0",
Expand All @@ -55,6 +55,6 @@
"typescript": ">=4.5.0"
},
"dependencies": {
"@semaphore-protocol/contracts": "2.6.1"
"@semaphore-protocol/contracts": "3.0.0-beta.5"
}
}
14 changes: 3 additions & 11 deletions packages/cli-template-hardhat/tasks/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,11 @@ task("deploy", "Deploy a Greeter contract")
.addOptionalParam("logs", "Print the logs", true, types.boolean)
.setAction(async ({ logs, semaphore: semaphoreAddress, group: groupId }, { ethers, run }) => {
if (!semaphoreAddress) {
const { address: verifierAddress } = await run("deploy:verifier", { logs, merkleTreeDepth: 20 })

const { address } = await run("deploy:semaphore", {
logs,
verifiers: [
{
merkleTreeDepth: 20,
contractAddress: verifierAddress
}
]
const { semaphore } = await run("deploy:semaphore", {
logs
})

semaphoreAddress = address
semaphoreAddress = semaphore.address
}

const Greeter = await ethers.getContractFactory("Greeter")
Expand Down
8 changes: 4 additions & 4 deletions packages/cli-template-hardhat/test/Greeter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("Greeter", () => {

const users: any[] = []
const groupId = "42"
const group = new Group()
const group = new Group(groupId)

before(async () => {
if (!existsSync(`${snarkArtifactsPath}/semaphore.wasm`)) {
Expand All @@ -35,8 +35,8 @@ describe("Greeter", () => {
username: ethers.utils.formatBytes32String("anon2")
})

group.addMember(users[0].identity.generateCommitment())
group.addMember(users[1].identity.generateCommitment())
group.addMember(users[0].identity.commitment)
group.addMember(users[1].identity.commitment)
})

describe("# joinGroup", () => {
Expand All @@ -61,7 +61,7 @@ describe("Greeter", () => {

const transaction = greeter.greet(
greeting,
fullProof.publicSignals.merkleRoot,
fullProof.publicSignals.merkleTreeRoot,
fullProof.publicSignals.nullifierHash,
solidityProof
)
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@semaphore-protocol/cli",
"type": "module",
"version": "0.5.0",
"version": "3.0.0-beta.5",
"description": "A command line tool to set up your Semaphore project and get group data.",
"license": "MIT",
"bin": {
Expand Down Expand Up @@ -40,7 +40,7 @@
"typedoc": "^0.22.11"
},
"dependencies": {
"@semaphore-protocol/subgraph": "2.6.1",
"@semaphore-protocol/subgraph": "3.0.0-beta.5",
"chalk": "^5.1.2",
"commander": "^9.4.1",
"download": "^8.0.0",
Expand Down

0 comments on commit 578d426

Please sign in to comment.