Skip to content

Commit 397f6fd

Browse files
authored
feat(protocol-contracts): add confidential wrapper contracts (#1602)
1 parent 216249d commit 397f6fd

File tree

83 files changed

+32139
-1
lines changed

Some content is hidden

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

83 files changed

+32139
-1
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Run tests
2+
name: protocol-contracts-confidential-wrapper-tests
3+
4+
on:
5+
pull_request:
6+
7+
push:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
permissions: {}
13+
14+
concurrency:
15+
group: ci-protocol-contracts-confidential-wrapper-tests-${{ github.ref }}
16+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
17+
18+
jobs:
19+
check-changes:
20+
name: protocol-contracts-confidential-wrapper-tests/check-changes
21+
permissions:
22+
actions: 'read' # Required to read workflow run information
23+
contents: 'read' # Required to checkout repository code
24+
pull-requests: 'read' # Required to read pull request information
25+
runs-on: ubuntu-latest
26+
outputs:
27+
changes-protocol-contracts-confidential-wrapper: ${{ steps.filter.outputs.protocol-contracts-confidential-wrapper }}
28+
steps:
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
with:
31+
persist-credentials: 'false'
32+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
33+
id: filter
34+
with:
35+
filters: |
36+
protocol-contracts-confidential-wrapper:
37+
- .github/workflows/protocol-contracts-confidential-wrapper-tests.yml
38+
- protocol-contracts/staking/**
39+
tests:
40+
name: protocol-contracts-confidential-wrapper-tests/tests (bpr)
41+
needs: check-changes
42+
# if: ${{ needs.check-changes.outputs.changes-protocol-contracts-confidential-wrapper == 'true' }}
43+
# TODO: Re-enable this once the tests are fixed
44+
# See https://github.com/zama-ai/fhevm-internal/issues/796
45+
if: false
46+
runs-on: ubuntu-latest
47+
permissions:
48+
contents: 'read' # Required to checkout repository code
49+
steps:
50+
- name: Checkout project
51+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
52+
with:
53+
persist-credentials: 'false'
54+
55+
- name: Install dependencies
56+
working-directory: protocol-contracts/confidential-wrapper
57+
run: npm ci
58+
59+
- name: Run lint
60+
working-directory: protocol-contracts/confidential-wrapper
61+
run: npm run lint
62+
63+
- name: Run compile
64+
working-directory: protocol-contracts/confidential-wrapper
65+
run: npm run compile
66+
67+
- name: Run build:ts
68+
working-directory: protocol-contracts/confidential-wrapper
69+
run: npm run build:ts
70+
71+
- name: Run unit tests
72+
working-directory: protocol-contracts/confidential-wrapper
73+
run: make test
74+
75+
- name: Run coverage
76+
working-directory: protocol-contracts/confidential-wrapper
77+
run: make run coverage

.github/workflows/protocol-contracts-staking-hardhat-tests.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ on:
77
push:
88
branches:
99
- main
10+
workflow_dispatch:
1011

1112
permissions: {}
1213

1314
concurrency:
14-
group: ci-tests-${{ github.ref }}
15+
group: ci-protocol-contracts-staking-tests-${{ github.ref }}
1516
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1617

1718
jobs:
@@ -52,6 +53,14 @@ jobs:
5253
working-directory: protocol-contracts/staking
5354
run: npm ci
5455

56+
- name: Run lint
57+
working-directory: protocol-contracts/staking
58+
run: npm run lint
59+
60+
- name: Run compile
61+
working-directory: protocol-contracts/staking
62+
run: npm run compile
63+
5564
- name: Run unit tests
5665
working-directory: protocol-contracts/staking
5766
run: make test
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# fhevm
2+
fhevmTemp
3+
tmp
4+
5+
# directories
6+
.coverage_artifacts
7+
.coverage_cache
8+
.coverage_contracts
9+
artifacts
10+
build
11+
cache
12+
coverage
13+
dist
14+
node_modules
15+
types
16+
17+
# files
18+
*.env
19+
*.log
20+
.DS_Store
21+
.pnp.*
22+
bun.lockb
23+
coverage.json
24+
package-lock.json
25+
pnpm-lock.yaml
26+
yarn.lock
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
extends:
2+
- "eslint:recommended"
3+
- "plugin:@typescript-eslint/eslint-recommended"
4+
- "plugin:@typescript-eslint/recommended"
5+
- "prettier"
6+
parser: "@typescript-eslint/parser"
7+
parserOptions:
8+
project: "tsconfig.json"
9+
plugins:
10+
- "@typescript-eslint"
11+
root: true
12+
rules:
13+
"@typescript-eslint/no-floating-promises":
14+
- error
15+
- ignoreIIFE: true
16+
ignoreVoid: true
17+
"@typescript-eslint/no-inferrable-types": "off"
18+
"@typescript-eslint/no-unused-vars":
19+
- error
20+
- argsIgnorePattern: "_"
21+
varsIgnorePattern: "_"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# fhevm
2+
fhevmTemp
3+
4+
# directories
5+
.coverage_artifacts
6+
.coverage_cache
7+
.coverage_contracts
8+
artifacts
9+
build
10+
cache
11+
coverage
12+
dist
13+
node_modules
14+
types
15+
deployments
16+
tmp
17+
18+
# files
19+
*.env
20+
*.log
21+
.DS_Store
22+
.pnp.*
23+
coverage.json
24+
pnpm-lock.yaml
25+
yarn.lock
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# fhevm
2+
fhevmTemp
3+
4+
# directories
5+
.coverage_artifacts
6+
.coverage_cache
7+
.coverage_contracts
8+
artifacts
9+
build
10+
cache
11+
coverage
12+
dist
13+
node_modules
14+
types
15+
16+
# files
17+
*.env
18+
*.log
19+
.DS_Store
20+
.pnp.*
21+
bun.lockb
22+
coverage.json
23+
package-lock.json
24+
pnpm-lock.yaml
25+
yarn.lock
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
plugins:
2+
- "prettier-plugin-solidity"
3+
printWidth: 120
4+
trailingComma: "all"
5+
6+
overrides:
7+
- files: "*.md"
8+
options:
9+
proseWrap: "always"
10+
- files: "*.sol"
11+
options:
12+
compiler: "0.8.24"
13+
parser: "solidity-parse"
14+
tabWidth: 4
15+
- files: "*.ts"
16+
options:
17+
importOrder: ["<THIRD_PARTY_MODULES>", "^[./]"]
18+
importOrderParserPlugins: ["typescript"]
19+
importOrderSeparation: true
20+
importOrderSortSpecifiers: true
21+
parser: "typescript"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
istanbulReporter: ["html", "lcov"],
3+
skipFiles: ["test"],
4+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"extends": "solhint:recommended",
3+
"plugins": ["prettier"],
4+
"rules": {
5+
"code-complexity": ["error", 8],
6+
"compiler-version": ["error", ">=0.8.4"],
7+
"func-visibility": ["error", { "ignoreConstructors": true }],
8+
"max-line-length": ["error", 120],
9+
"named-parameters-mapping": "warn",
10+
"no-console": "off",
11+
"not-rely-on-time": "off",
12+
"prettier/prettier": [
13+
"error",
14+
{
15+
"endOfLine": "auto"
16+
}
17+
]
18+
}
19+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# directories
2+
**/artifacts
3+
**/node_modules

0 commit comments

Comments
 (0)