Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use tags from hardhat deploy plugin to simplify deploy + verify workflow #963

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading