@crisp-e3/contracts 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/contracts/CRISPProgram.sol +26 -0
- package/contracts/Mocks/MockInterfold.sol +2 -2
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -25,8 +25,7 @@ pnpm test
|
|
|
25
25
|
Local deploy is driven by **`../../crisp.dev.env`** (see
|
|
26
26
|
**[../../docs/PROOF_AGGREGATION_AND_ZK.md](../../docs/PROOF_AGGREGATION_AND_ZK.md)**):
|
|
27
27
|
|
|
28
|
-
- `pnpm dev:setup` — applies profile, builds DKG circuits when
|
|
29
|
-
`CRISP_PROOF_AGGREGATION_ENABLED=true`
|
|
28
|
+
- `pnpm dev:setup` — applies profile, builds DKG circuits when `CRISP_SKIP_PROOF_AGGREGATION=false`
|
|
30
29
|
- `pnpm dev:up` → `scripts/crisp_deploy.sh` — sets `ENABLE_ZK_VERIFICATION` from the same file
|
|
31
30
|
|
|
32
31
|
### CRISP-only deploy (Interfold already deployed)
|
|
@@ -117,6 +117,32 @@ contract CRISPProgram is IE3Program, Ownable {
|
|
|
117
117
|
return e3Data[e3Id].paramsHash;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
/// @notice Get the details about an E3 such as the merkle root of the census
|
|
121
|
+
/// @dev RoundData cannot be returned directly as it contains nested mappings
|
|
122
|
+
/// @param e3Id The E3 program ID
|
|
123
|
+
/// @return merkleRoot The census merkle root
|
|
124
|
+
/// @return paramsHash The hash of the E3 program params
|
|
125
|
+
/// @return numOptions The number of vote options
|
|
126
|
+
/// @return creditMode The credit mode for the round
|
|
127
|
+
/// @return inputRoot The current root of the input (votes) merkle tree
|
|
128
|
+
/// @return numberOfVotes The number of leaves in the input merkle tree
|
|
129
|
+
function getRoundData(
|
|
130
|
+
uint256 e3Id
|
|
131
|
+
)
|
|
132
|
+
public
|
|
133
|
+
view
|
|
134
|
+
returns (uint256 merkleRoot, bytes32 paramsHash, uint256 numOptions, CreditMode creditMode, uint256 inputRoot, uint40 numberOfVotes)
|
|
135
|
+
{
|
|
136
|
+
RoundData storage round = e3Data[e3Id];
|
|
137
|
+
|
|
138
|
+
merkleRoot = round.merkleRoot;
|
|
139
|
+
paramsHash = round.paramsHash;
|
|
140
|
+
numOptions = round.numOptions;
|
|
141
|
+
creditMode = round.creditMode;
|
|
142
|
+
inputRoot = round.votes._root(TREE_DEPTH);
|
|
143
|
+
numberOfVotes = round.votes.numberOfLeaves;
|
|
144
|
+
}
|
|
145
|
+
|
|
120
146
|
/// @inheritdoc IE3Program
|
|
121
147
|
function validate(
|
|
122
148
|
uint256 e3Id,
|
|
@@ -35,7 +35,7 @@ contract MockInterfold {
|
|
|
35
35
|
ciphertextOutput: bytes32(0),
|
|
36
36
|
plaintextOutput: plaintextOutput,
|
|
37
37
|
requester: address(0),
|
|
38
|
-
|
|
38
|
+
ciphertextCommitment: bytes32(0)
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
IE3Program(program).validate(nextE3Id, 0, bytes(""), bytes(""), abi.encode(address(0), nextE3Id, 2, 0, 0));
|
|
@@ -72,7 +72,7 @@ contract MockInterfold {
|
|
|
72
72
|
ciphertextOutput: bytes32(0),
|
|
73
73
|
plaintextOutput: plaintextOutput,
|
|
74
74
|
requester: address(0),
|
|
75
|
-
|
|
75
|
+
ciphertextCommitment: bytes32(0)
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crisp-e3/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"contracts",
|
|
@@ -31,9 +31,10 @@
|
|
|
31
31
|
"@zk-kit/lazy-imt.sol": "2.0.0-beta.12",
|
|
32
32
|
"poseidon-solidity": "^0.0.5",
|
|
33
33
|
"solady": "^0.1.13",
|
|
34
|
-
"@interfold/contracts": "0.
|
|
34
|
+
"@interfold/contracts": "0.4.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
+
"@nomicfoundation/hardhat-keystore": "3.0.3",
|
|
37
38
|
"@nomicfoundation/hardhat-toolbox-mocha-ethers": "3.0.0",
|
|
38
39
|
"@openzeppelin/contracts": "^5.0.2",
|
|
39
40
|
"@typechain/ethers-v6": "^0.5.0",
|
|
@@ -52,8 +53,8 @@
|
|
|
52
53
|
"typechain": "^8.3.0",
|
|
53
54
|
"typescript": "5.8.3",
|
|
54
55
|
"viem": "2.30.6",
|
|
55
|
-
"@crisp-e3/zk-inputs": "^0.
|
|
56
|
-
"@crisp-e3/sdk": "^0.
|
|
56
|
+
"@crisp-e3/zk-inputs": "^0.13.0",
|
|
57
|
+
"@crisp-e3/sdk": "^0.13.0"
|
|
57
58
|
},
|
|
58
59
|
"scripts": {
|
|
59
60
|
"compile": "hardhat compile",
|