Skip to content

Commit 4c487a0

Browse files
authored
release/v1.0.7 (#14)
1 parent c4cc862 commit 4c487a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+11112
-101
lines changed

.circleci/config.yml

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
11
version: 2.1
22

3+
setup: true
4+
5+
orbs:
6+
continuation: circleci/continuation@1
7+
38
jobs:
4-
audit_build_lint_test:
9+
choose-config:
510
docker:
6-
- image: cimg/node:22.14.0
11+
- image: cimg/base:stable
712
steps:
813
- checkout
914
- run:
10-
name: Install dependencies
11-
command: npm install
12-
- run:
13-
name: Security audit
14-
command: npm audit
15-
- run:
16-
name: Check format
17-
command: npm run check-format
18-
- run:
19-
name: Build packages
20-
command: npm run build
21-
- run:
22-
name: Check exports
23-
command: npm run check-exports
24-
- run:
25-
name: Check lint
26-
command: npm run lint
27-
- run:
28-
name: Test packages
29-
command: npm run test
15+
name: Pick config
16+
command: |
17+
if [ -f .circleci/private-config.yml ]; then
18+
echo "export CONFIG_PATH=.circleci/private-config.yml" >> "$BASH_ENV"
19+
echo "Using private-config.yml"
20+
else
21+
echo "export CONFIG_PATH=.circleci/public-config.yml" >> "$BASH_ENV"
22+
echo "Using public-config.yml"
23+
fi
24+
- continuation/continue:
25+
configuration_path: '$CONFIG_PATH'
3026

3127
workflows:
32-
audit_build_lint_test:
28+
setup:
3329
jobs:
34-
- audit_build_lint_test
30+
- choose-config

.circleci/public-config.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2.1
2+
3+
jobs:
4+
audit_build_lint_test:
5+
docker:
6+
- image: cimg/node:22.19.0
7+
steps:
8+
- checkout
9+
- run:
10+
name: Install dependencies
11+
command: npm install
12+
- run:
13+
name: Security audit
14+
command: npm audit
15+
- run:
16+
name: Check format
17+
command: npm run check-format
18+
- run:
19+
name: Build packages
20+
command: npm run build
21+
- run:
22+
name: Check exports
23+
command: npm run check-exports
24+
- run:
25+
name: Check lint
26+
command: npm run lint
27+
- run:
28+
name: Test packages
29+
command: npm run test
30+
31+
workflows:
32+
audit_build_lint_test:
33+
jobs:
34+
- audit_build_lint_test

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.14.0
1+
22.19.0

examples/hardhat-plugin-fireblocks/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
},
66
"dependencies": {
77
"@appliedblockchain/silentdatarollup-hardhat-plugin-fireblocks": "*",
8-
"@nomicfoundation/hardhat-ignition-ethers": "0.15.7",
8+
"@nomicfoundation/hardhat-ignition-ethers": "0.15.9",
99
"@nomicfoundation/hardhat-toolbox": "5.0.0",
1010
"@openzeppelin/contracts": "5.1.0",
1111
"dotenv": "16.4.5",
12-
"hardhat": "2.22.10"
12+
"hardhat": "^2.18.0"
1313
},
1414
"devDependencies": {
1515
"ts-node": "10.9.2",

examples/hardhat-plugin/README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,29 @@ The project uses Hardhat Ignition for deployments. The deployment module is conf
6363
To deploy the contract:
6464

6565
```bash
66-
npm run deploy
66+
npm run deploy:private-token
6767
```
6868

6969
This will:
7070

7171
1. Compile the PrivateToken contract
7272
2. Deploy it to the Silent Data [Rollup] network
7373

74+
## Deployment - PrivateEvents
75+
76+
The project uses Hardhat Ignition for deployments. The deployment module is configured in `ignition/modules/PrivateEvents.ts`.
77+
78+
To deploy the contract:
79+
80+
```bash
81+
npm run deploy:private-events
82+
```
83+
84+
This will:
85+
86+
1. Compile the PrivateEvents contract
87+
2. Deploy it to the Silent Data [Rollup] network
88+
7489
## Deployment - SimpleContract
7590

7691
The project uses Hardhat Ignition for deployments. The deployment module is configured in `ignition/modules/SimpleContract.ts`.
@@ -91,7 +106,8 @@ This will:
91106
### Available Scripts
92107

93108
- `npm run compile` - Compile all contracts
94-
- `npm run deploy` - Deploy the PrivateToken contract using Hardhat Ignition
109+
- `npm run deploy:private-token` - Deploy the PrivateToken contract using Hardhat Ignition
110+
- `npm run deploy:private-events` - Deploy the PrivateEvents contract using Hardhat Ignition
95111
- `npm run deploy:simple-contract` - Deploy the SimpleContract contract using Hardhat Ignition
96112

97113
### Project Dependencies
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.22;
3+
4+
contract PrivateEvents {
5+
// Public events with string parameters
6+
event PublicEvent1(string message);
7+
event PublicEvent2(string data);
8+
9+
// Private events (these will be wrapped in PrivateEvent by the Silent Data rollup)
10+
event PrivateEvent1(string secretMessage);
11+
event PrivateEvent2(string privateData);
12+
13+
// The PrivateEvent wrapper that Silent Data uses
14+
event PrivateEvent(
15+
address[] allowedViewers,
16+
bytes32 indexed eventType,
17+
bytes payload
18+
);
19+
20+
// Event type constants for private events
21+
bytes32 public constant EVENT_TYPE_PRIVATE_1 = keccak256("PrivateEvent1(string)");
22+
bytes32 public constant EVENT_TYPE_PRIVATE_2 = keccak256("PrivateEvent2(string)");
23+
24+
// Function to trigger all events in one transaction
25+
function triggerEvents(
26+
string memory publicMessage1,
27+
string memory publicMessage2,
28+
string memory privateMessage1,
29+
string memory privateMessage2,
30+
address[] memory allowedViewers
31+
) external {
32+
// Emit public events
33+
emit PublicEvent1(publicMessage1);
34+
emit PublicEvent2(publicMessage2);
35+
36+
// Emit private events wrapped in PrivateEvent
37+
emit PrivateEvent(
38+
allowedViewers,
39+
EVENT_TYPE_PRIVATE_1,
40+
abi.encode(privateMessage1)
41+
);
42+
43+
emit PrivateEvent(
44+
allowedViewers,
45+
EVENT_TYPE_PRIVATE_2,
46+
abi.encode(privateMessage2)
47+
);
48+
}
49+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { buildModule } from '@nomicfoundation/hardhat-ignition/modules'
2+
3+
const PrivateEvents = buildModule('PrivateEvents', (m) => {
4+
const privateEvents = m.contract('PrivateEvents')
5+
6+
return { privateEvents }
7+
})
8+
9+
export default PrivateEvents

examples/hardhat-plugin/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
"version": "0.0.1",
44
"scripts": {
55
"compile": "npx hardhat compile",
6-
"deploy": "npx hardhat compile && npx hardhat ignition deploy ignition/modules/PrivateToken.ts",
6+
"deploy:private-token": "npx hardhat compile && npx hardhat ignition deploy ignition/modules/PrivateToken.ts",
7+
"deploy:private-events": "npx hardhat compile && npx hardhat ignition deploy ignition/modules/PrivateEvents.ts",
78
"deploy:simple-contract": "npx hardhat compile && npx hardhat ignition deploy ignition/modules/SimpleContract.ts"
89
},
910
"dependencies": {
1011
"@appliedblockchain/silentdatarollup-hardhat-plugin": "*",
11-
"@nomicfoundation/hardhat-ignition-ethers": "0.15.7",
12+
"@nomicfoundation/hardhat-ignition-ethers": "0.15.9",
1213
"@nomicfoundation/hardhat-toolbox": "5.0.0",
1314
"@openzeppelin/contracts": "5.1.0",
1415
"dotenv": "16.4.5",
15-
"hardhat": "2.22.10"
16+
"hardhat": "^2.18.0"
1617
},
1718
"devDependencies": {
1819
"ts-node": "10.9.2",

0 commit comments

Comments
 (0)