Skip to content

Commit

Permalink
Merge branch 'feat/update-deploy-script' of https://github.com/aragon…
Browse files Browse the repository at this point in the history
…/admin-plugin into feat/update-deploy-script
  • Loading branch information
novaknole committed Jan 27, 2025
2 parents 4d11538 + 4b5dfeb commit 3d7b7d8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/contracts/deploy/10_create_repo/11_create_repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ func.skip = async (hre: HardhatRuntimeEnvironment) => {

// try getting the plugin repo.
const res = await findPluginRepo(hre);
let pluginRepoAddress = res.pluginRepo?.address;
let ensDomain = res.ensDomain;
const pluginRepoAddress = res.pluginRepo?.address;
const ensDomain = res.ensDomain;

if (pluginRepoAddress) {
if (ensDomain != '') {
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/deploy/20_new_version/23_publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
if (latestBuild == 0 && VERSION.build > 1) {
// We are publishing the first version as build > 1.
// So we need to publish placeholders first..
let placeholderSetup =
const placeholderSetup =
process.env.PLACEHOLDER_SETUP ??
getLatestContractAddress('PlaceholderSetup', hre);

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/deploy/30_upgrade_repo/_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function fetchData(

// Get the latest `PluginRepo` implementation as the upgrade target
let latestPluginRepoImplementation;
let pluginRepoFactoryAddress = process.env.PLUGIN_REPO_FACTORY_ADDRESS;
const pluginRepoFactoryAddress = process.env.PLUGIN_REPO_FACTORY_ADDRESS;

if (pluginRepoFactoryAddress) {
if (!ethers.utils.isAddress(pluginRepoFactoryAddress)) {
Expand Down
14 changes: 7 additions & 7 deletions packages/contracts/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ export async function findPluginRepo(
): Promise<{pluginRepo: PluginRepo | null; ensDomain: string}> {
const [deployer] = await hre.ethers.getSigners();

if (
process.env.PLUGIN_REPO_ADDRESS &&
ethers.utils.isAddress(process.env.PLUGIN_REPO_ADDRESS)
) {
if (process.env.PLUGIN_REPO_ADDRESS) {
if (!ethers.utils.isAddress(process.env.PLUGIN_REPO_ADDRESS)) {
throw new Error('Plugin Repo in .env is not of type Address');
}

return {
pluginRepo: PluginRepo__factory.connect(
process.env.PLUGIN_REPO_ADDRESS,
Expand All @@ -86,7 +87,7 @@ export async function findPluginRepo(
}

let subdomainRegistrarAddress;
let pluginRepoFactoryAddress = process.env.PLUGIN_REPO_FACTORY_ADDRESS;
const pluginRepoFactoryAddress = process.env.PLUGIN_REPO_FACTORY_ADDRESS;

if (pluginRepoFactoryAddress) {
if (!ethers.utils.isAddress(pluginRepoFactoryAddress)) {
Expand Down Expand Up @@ -121,13 +122,12 @@ export async function findPluginRepo(
networkDeployments.PluginENSSubdomainRegistrarProxy.address;
}

let registrar;
if (subdomainRegistrarAddress === ethers.constants.AddressZero) {
// the network does not support ENS
return {pluginRepo: null, ensDomain: ''};
}

registrar = ENSSubdomainRegistrar__factory.connect(
const registrar = ENSSubdomainRegistrar__factory.connect(
subdomainRegistrarAddress,
deployer
);
Expand Down

0 comments on commit 3d7b7d8

Please sign in to comment.