@crisp-e3/contracts 0.12.0 → 0.14.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.
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crisp-e3/contracts",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "contracts",
@@ -34,6 +34,7 @@
34
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.12.0",
56
- "@crisp-e3/sdk": "^0.12.0"
56
+ "@crisp-e3/zk-inputs": "^0.14.0",
57
+ "@crisp-e3/sdk": "^0.14.0"
57
58
  },
58
59
  "scripts": {
59
60
  "compile": "hardhat compile",