Skip to content

Commit 1a68736

Browse files
authored
Release/1.0.1 (#77)
2 parents ef4b1cb + 059858f commit 1a68736

32 files changed

+4590
-638
lines changed

.env.template

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# The mnemonic phrase used to derive the wallet's private keys
2+
MNEMONIC=
3+
4+
# Index of the account generated from the mnemonic to be used as the Voucher Manager
5+
IEXEC_VOUCHER_MANAGER_ACCOUNT_INDEX=
6+
7+
# Index of the account generated from the mnemonic to be used as the Voucher Minter
8+
IEXEC_VOUCHER_MINTER_ACCOUNT_INDEX=
9+
10+
# The private key for accessing the production account
11+
PROD_PRIVATE_KEY=
12+
13+
# Flag to indicate whether to use a local blockchain fork (set to 'true' for local fork development)
14+
IS_LOCAL_FORK=
15+
16+
# Override the default iExec PoCo (Proof-of-Contribution) contract address
17+
IEXEC_POCO_ADDRESS=
18+
19+
# Override the default iExec Voucher Hub contract address
20+
IEXEC_VOUCHER_HUB_ADDRESS=
21+
22+
# Indicates whether the deployment involves a factory contract
23+
USE_FACTORY=
24+
25+
# enable to display hardhat report on gas usage
26+
REPORT_GAS=

.github/workflows/main.yml

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,68 @@
1+
name: Voucher Smart Contract CI
2+
13
on:
24
push:
35
branches:
46
- feature/*
57
- bugfix/*
6-
- develop
78
- release/*
89
- hotfix/*
10+
- develop
911
- main
1012

13+
concurrency:
14+
group: ci-${{ github.head_ref }}
15+
cancel-in-progress: true
16+
1117
jobs:
1218
coverage:
1319
runs-on: ubuntu-latest
1420
steps:
1521
- name: Checkout
1622
uses: actions/checkout@v4
17-
- name: Init
23+
- name: Setup Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 20
27+
cache: 'npm'
28+
- name: Install Dependencies
1829
run: npm ci
19-
- name: Run coverage
20-
run: npm run coverage
30+
- name: Check Format
31+
run: npm run check-format
32+
- name: Check Lint
33+
run: npm run check-lint
34+
- name: Build
35+
run: npm run build
36+
- name: Check Types
37+
run: npm run check-types
38+
- name: Generate UML
39+
run: npm run uml
40+
- name: Run partial upgrade tests on fork
41+
env:
42+
IS_LOCAL_FORK: true
43+
run: npm run test test/NextVersionUpgrade.test.ts
44+
- name: Simulate upgrade on fork
45+
env:
46+
USE_FACTORY: false
47+
IS_LOCAL_FORK: true
48+
run: npm run upgrade
49+
- name: Run Tests
50+
run: npm run test -- --bail
51+
- name: Run Coverage
52+
run: npm run coverage #coverage only works on a non-fork hardhat node
2153
- name: Upload coverage reports to Codecov
2254
uses: codecov/codecov-action@v4.0.1
2355
with:
2456
token: ${{ secrets.CODECOV_TOKEN }}
2557
slug: iExecBlockchainComputing/iexec-voucher-contracts
2658
- name: Run static analysis with slither
2759
uses: crytic/slither-action@v0.4.0
28-
id: slither
2960
with:
3061
target: "contracts/"
3162
slither-args: --checklist --markdown-root ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/
32-
node-version: "20"
3363
fail-on: none # TODO set this to high or other
3464
sarif: results.sarif
3565
- name: Upload SARIF file
3666
uses: github/codeql-action/upload-sarif@v3
3767
with:
38-
sarif_file: ${{ steps.slither.outputs.sarif }}
68+
sarif_file: results.sarif

.github/workflows/upgrade.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Upgrade
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
environment:
6+
description: 'Github environnment (mainnets or testnets)'
7+
required: true
8+
type: choice
9+
options:
10+
- mainnets
11+
- testnets
12+
network:
13+
description: 'Network'
14+
required: true
15+
type: choice
16+
options:
17+
- hardhat
18+
- bellecour
19+
jobs:
20+
upgrade:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: write # required by git-auto-commit-action
24+
environment: ${{ inputs.environment }} # Secrets for an environment are already limited to deployments on specific branches
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 22
32+
cache: 'npm'
33+
- name: Install dependencies
34+
run: npm ci
35+
- name: Set private key based on network
36+
id: set-private-key
37+
run: |
38+
case "${{ inputs.network }}" in
39+
"bellecour")
40+
echo "PROD_PRIVATE_KEY=${{ secrets.BELLECOUR_PRIVATE_KEY }}" >> $GITHUB_ENV
41+
;;
42+
*)
43+
echo "PROD_PRIVATE_KEY=''" >> $GITHUB_ENV
44+
;;
45+
esac
46+
- name: Upgrade
47+
env:
48+
NETWORK: ${{ inputs.network }}
49+
IS_LOCAL_FORK: ${{ inputs.network == 'hardhat'}}
50+
run: |
51+
echo "Network: $NETWORK"
52+
echo "Local fork: $IS_LOCAL_FORK"
53+
npm run upgrade -- --network $NETWORK
54+
- uses: stefanzweifel/git-auto-commit-action@v5
55+
with:
56+
commit_message: Save files changed during upgrade

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ node_modules
1313
/coverage
1414
/coverage.json
1515

16+
# deployments files
1617
/deployments/hardhat
1718
/deployments/external-hardhat
1819
/deployments/localhost

0 commit comments

Comments
 (0)