From 6173528080956b451c01ed7929e9b75cb3ed13d0 Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Fri, 6 Sep 2024 12:27:31 -0400 Subject: [PATCH 1/2] Add compiled contracts to release artifacts Signed-off-by: Jim Zhang --- .github/workflows/release.yaml | 16 +++++++++++++++- solidity/hardhat.config.ts | 10 +++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3d30f66..fb0bea3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -51,12 +51,25 @@ jobs: npm install npm run gen - - name: Create artifacts archives + - name: Build contracts + working-directory: solidity + run: | + npm install + npx hardhat compile + + - name: Create prover archives working-directory: ${{ runner.temp }}/zeto-artifacts run: | tar -czvf zeto-wasm-$ZETO_VER.tar.gz **/*.wasm tar -czvf zeto-test-proving-keys-$ZETO_VER.tar.gz *.zkey *-vkey.json + - name: Create contract archives + working-directory: solidity + env: + ARTIFACTS_ROOT: ${{ runner.temp }}/zeto-artifacts + run: | + tar -czvf $ARTIFACTS_ROOT/zeto-contracts-$ZETO_VER.tar.gz artifacts/contracts/**/*.json + - name: Publish Release Artifact uses: actions/upload-artifact@v4 with: @@ -64,6 +77,7 @@ jobs: path: | ${{ runner.temp }}/zeto-artifacts/zeto-wasm-*.tar.gz ${{ runner.temp }}/zeto-artifacts/zeto-test-proving-keys-*.tar.gz + ${{ runner.temp }}/zeto-artifacts/zeto-contracts-*.tar.gz create-release: name: Create GitHub Release diff --git a/solidity/hardhat.config.ts b/solidity/hardhat.config.ts index 81e7bd1..7c723d9 100644 --- a/solidity/hardhat.config.ts +++ b/solidity/hardhat.config.ts @@ -28,7 +28,15 @@ const keys = [ ]; const config: HardhatUserConfig = { - solidity: "0.8.20", + solidity: { + version: "0.8.20", + settings: { + optimizer: { + enabled: true, + runs: 1000, + }, + }, + }, paths: { sources: "contracts" }, From ef8773df82fddd82563cff616ac21284c569ca54 Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Fri, 6 Sep 2024 13:58:43 -0400 Subject: [PATCH 2/2] disable optimizer to allow proxy deploy Signed-off-by: Jim Zhang --- solidity/hardhat.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solidity/hardhat.config.ts b/solidity/hardhat.config.ts index 7c723d9..277581e 100644 --- a/solidity/hardhat.config.ts +++ b/solidity/hardhat.config.ts @@ -32,7 +32,7 @@ const config: HardhatUserConfig = { version: "0.8.20", settings: { optimizer: { - enabled: true, + enabled: false, runs: 1000, }, },