Skip to content

Commit

Permalink
import changes from deploy-zora-sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
oveddan committed Nov 1, 2023
1 parent 9f741c3 commit c17db90
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ abis/
# /broadcast/**/dry-run/

# Remove broadcast logs
/broadcast/
**/*/broadcast

# Docs
docs/
Expand Down
32 changes: 28 additions & 4 deletions packages/protocol-deployments/script/signDeploymentTransactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,15 @@ async function signAndSaveSignatures({
);
}

async function signAndSaveGenericSignatures({
async function signAndSaveUpgradeGate({
turnkeyAccount,
chainConfigs,
proxyName,
}: {
turnkeyAccount: LocalAccount;
chainConfigs: ChainConfig[];
chainConfigs: {
chainId: number; owner: Address
}[];
proxyName: "upgradeGate";
}) {
const configFolder = path.resolve(
Expand Down Expand Up @@ -148,6 +150,28 @@ async function signAndSaveGenericSignatures({
);
}

const getChainConfigs = async () => {
const chainConfigsFiles = await glob(
path.resolve(__dirname, "../chainConfigs/*.json")
);

const chainConfigs = await Promise.all(
chainConfigsFiles.map(async (chainConfigFile) => {
const chainId = parseInt(path.basename(chainConfigFile).split(".")[0]!);

// read file and process JSON contents:
const fileContents = await import(chainConfigFile);

return {
chainId,
owner: fileContents["FACTORY_OWNER"]! as Address,
};
})
);

return chainConfigs;
};

const getFactoryImplConfigs = async () => {
const addresseFiles = await glob(
path.resolve(__dirname, "../addresses/*.json")
Expand Down Expand Up @@ -239,9 +263,9 @@ async function main() {
proxyName: "premintExecutorProxy",
});

await signAndSaveGenericSignatures({
await signAndSaveUpgradeGate({
turnkeyAccount,
chainConfigs: await getFactoryImplConfigs(),
chainConfigs: await getChainConfigs(),
proxyName: "upgradeGate",
});
}
Expand Down

0 comments on commit c17db90

Please sign in to comment.