Skip to content

Commit

Permalink
ci: use tags from hardhat deploy plugin to simplify deploy + verify…
Browse files Browse the repository at this point in the history
… workflow
  • Loading branch information
CJ42 committed Jul 24, 2024
1 parent 26af8c8 commit f068e6e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
21 changes: 5 additions & 16 deletions .github/workflows/deploy-verify.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 }}
1 change: 0 additions & 1 deletion deploy/007_deploy_base_key_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const deployBaseKeyManagerDeterministic: DeployFunction = async ({
await deploy('LSP6KeyManagerInit', {
from: deployer,
log: true,
gasLimit: 5_000_000,
deterministicDeployment: SALT,
});
};
Expand Down
7 changes: 7 additions & 0 deletions packages/lsp-smart-contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit f068e6e

Please sign in to comment.