Skip to content

Commit

Permalink
feat: structure, comments, bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
arthcp committed Jun 6, 2024
1 parent 5311f63 commit 9bf1aef
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import {
getAllAddresses,
isMainnet,
isTestnet,
} from "../../src";
import { mode, overrides } from "../deploy/config";
import OwnableArtifact from "../../out/Ownable.sol/Ownable.json";
import { getProviderFromChainSlug } from "../constants";
} from "../../../src";
import { mode, overrides } from "../../deploy/config";
import OwnableArtifact from "../../../out/Ownable.sol/Ownable.json";
import { getProviderFromChainSlug } from "../../constants";
import { Signer, Wallet, ethers } from "ethers";
import { Ownable } from "../../typechain-types/utils/Ownable";
import { Ownable } from "../../../typechain-types/utils/Ownable";

dotenvConfig();

Expand All @@ -21,15 +21,15 @@ dotenvConfig();
*
* --newowner Specify the new owner to be nominated.
* This flag is required.
* Eg. npx --newowner=0x5f34 ts-node scripts/admin/nominateOwner.ts
* Eg. npx --newowner=0x5f34 ts-node scripts/admin/rotate-owner/1-nominate.ts
*
* --sendtx Send nominate tx along with ownership check.
* Default is only check owner, nominee.
* Eg. npx --newowner=0x5f34 --sendtx ts-node scripts/admin/nominateOwner.ts
* Eg. npx --newowner=0x5f34 --sendtx ts-node scripts/admin/rotate-owner/1-nominate.ts
*
* --chains Run only for specified chains.
* Default is all chains.
* Eg. npx --newowner=0x5f34 --chains=10,2999 ts-node scripts/admin/nominateOwner.ts
* Eg. npx --newowner=0x5f34 --chains=10,2999 ts-node scripts/admin/rotate-owner/1-nominate.ts
*
* --testnets Run for testnets.
* Default is false.
Expand Down Expand Up @@ -83,7 +83,7 @@ export const main = async () => {
// startBlock field ignored since it is not contract
// integrations iterated later since it is an object
const contractList = Object.keys(chainAddresses).filter(
(key) => !["startBlock", "integrations"].includes(key)
(key) => !["startBlock", "integrations", "Counter"].includes(key)
);
for (const contractName of contractList) {
const contractAddress = chainAddresses[contractName];
Expand Down Expand Up @@ -111,6 +111,15 @@ export const main = async () => {
const label = `${chainSlug}-${it}-${sibling}, Decap`;
await checkAndNominate(decapAddress, signer, chainSlug, label);
}

if (it === IntegrationTypes.native) {
const sbAddress =
chainAddresses.integrations[sibling][it]?.switchboard;
if (sbAddress) {
const label = `${chainSlug}-${it}-${sibling}, Switchboard`;
await checkAndNominate(sbAddress, signer, chainSlug, label);
}
}
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import {
getAllAddresses,
isMainnet,
isTestnet,
} from "../../src";
import { mode, overrides } from "../deploy/config";
import OwnableArtifact from "../../out/Ownable.sol/Ownable.json";
import { getProviderFromChainSlug } from "../constants";
} from "../../../src";
import { mode, overrides } from "../../deploy/config";
import OwnableArtifact from "../../../out/Ownable.sol/Ownable.json";
import { getProviderFromChainSlug } from "../../constants";
import { Signer, Wallet, ethers } from "ethers";
import { Ownable } from "../../typechain-types/utils/Ownable";
import { Ownable } from "../../../typechain-types/utils/Ownable";

dotenvConfig();

Expand All @@ -21,11 +21,11 @@ dotenvConfig();
*
* --sendtx Send claim tx along with ownership check.
* Default is only check owner, nominee.
* Eg. npx --sendtx ts-node scripts/admin/nominateOwner.ts
* Eg. npx --sendtx ts-node scripts/admin/rotate-owner/claim.ts
*
* --chains Run only for specified chains.
* Default is all chains.
* Eg. npx --chains=10,2999 ts-node scripts/admin/nominateOwner.ts
* Eg. npx --chains=10,2999 ts-node scripts/admin/rotate-owner/claim.ts
*
* --testnets Run for testnets.
* Default is false.
Expand Down Expand Up @@ -72,7 +72,7 @@ export const main = async () => {
// startBlock field ignored since it is not contract
// integrations iterated later since it is an object
const contractList = Object.keys(chainAddresses).filter(
(key) => !["startBlock", "integrations"].includes(key)
(key) => !["startBlock", "integrations", "Counter"].includes(key)
);
for (const contractName of contractList) {
const contractAddress = chainAddresses[contractName];
Expand Down Expand Up @@ -100,6 +100,15 @@ export const main = async () => {
const label = `${chainSlug}-${it}-${sibling}, Decap`;
await checkAndClaim(decapAddress, signer, chainSlug, label);
}

if (it === IntegrationTypes.native) {
const sbAddress =
chainAddresses.integrations[sibling][it]?.switchboard;
if (sbAddress) {
const label = `${chainSlug}-${it}-${sibling}, Switchboard`;
await checkAndClaim(sbAddress, signer, chainSlug, label);
}
}
}
}
})
Expand Down

0 comments on commit 9bf1aef

Please sign in to comment.