From f00a65d79a63b8e385ad8f3e09fc222159bacb1e Mon Sep 17 00:00:00 2001 From: CJ42 Date: Wed, 24 Jul 2024 17:13:31 +0100 Subject: [PATCH] ci: use `tags` from hardhat deploy plugin to simplify deploy + verify workflow --- .github/workflows/deploy-verify.yml | 21 +++++-------------- deploy/007_deploy_base_key_manager.ts | 1 - .../lsp-smart-contracts/hardhat.config.ts | 7 +++++++ 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/deploy-verify.yml b/.github/workflows/deploy-verify.yml index b8c067c4d..410b78a52 100644 --- a/.github/workflows/deploy-verify.yml +++ b/.github/workflows/deploy-verify.yml @@ -1,5 +1,5 @@ -# This workflow deploys and verify the lsp-smart-contracts and verify them on LUKSO Testnet. -name: Deploy + Verify Contracts on Testnet +# This workflow deploys and verify the lsp-smart-contracts and verify them on LUKSO Mainnet & Testnet. +name: Deploy + Verify Contracts env: # 0x983aBC616f2442bAB7a917E6bb8660Df8b01F3bF @@ -38,21 +38,10 @@ jobs: - name: Verify Deployer Balance run: npx hardhat verify-balance --network ${{ matrix.network }} - # We do not deploy the standard contracts on mainnet for the following reasons: - # 1) standard contracts are expensive to deploy on mainnet - # 2) user's universal profiles use the minimal proxy pattern, - # - # therefore we only need the base contracts to be deployed on mainnet. - - name: Select tags based on network to deploy - run: | - TAGS="base" - if [[ ${{ matrix.network }} == "luksoTestnet"]]; then - TAGS+=",standard" - fi - - - name: Deploy contracts on network + # The array of `tags` under each network in `hardhat.config.ts` specify which contracts to deploy + - name: Deploy contracts on ${{ matrix.network }} run: npx hardhat deploy --network ${{ matrix.network }} --tags $TAGS --write true # Loop through deployment files and recover address of deployed contracts to verify - - name: Verify deployed contracts on mainnet + - name: Verify deployed contracts on ${{ matrix.network }} run: npx hardhat verify-all --network ${{ matrix.network }} diff --git a/deploy/007_deploy_base_key_manager.ts b/deploy/007_deploy_base_key_manager.ts index f314be008..5c2e9d380 100644 --- a/deploy/007_deploy_base_key_manager.ts +++ b/deploy/007_deploy_base_key_manager.ts @@ -12,7 +12,6 @@ const deployBaseKeyManagerDeterministic: DeployFunction = async ({ await deploy('LSP6KeyManagerInit', { from: deployer, log: true, - gasLimit: 5_000_000, deterministicDeployment: SALT, }); }; diff --git a/packages/lsp-smart-contracts/hardhat.config.ts b/packages/lsp-smart-contracts/hardhat.config.ts index 1a29755de..ae8b99485 100644 --- a/packages/lsp-smart-contracts/hardhat.config.ts +++ b/packages/lsp-smart-contracts/hardhat.config.ts @@ -42,6 +42,7 @@ function getTestnetChainConfig(): NetworkUserConfig { url: 'https://rpc.testnet.lukso.network', chainId: 4201, saveDeployments: true, + tags: ['standard', 'base'], }; if (process.env.CONTRACT_VERIFICATION_TESTNET_PK !== undefined) { @@ -57,6 +58,12 @@ function getMainnetChainConfig(): NetworkUserConfig { url: 'https://rpc.lukso.gateway.fm', chainId: 42, saveDeployments: true, + // We do not deploy the standard contracts on mainnet for the following reasons: + // 1) standard contracts are expensive to deploy on mainnet + // 2) user's universal profiles use the minimal proxy pattern, + // + // therefore we only need the base contracts to be deployed on mainnet. + tags: ['base'], }; if (process.env.CONTRACT_VERIFICATION_MAINNET_PK !== undefined) {