Skip to content

Commit

Permalink
refine deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
d10r committed Jan 23, 2024
1 parent 7231c13 commit c9ce6f4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/ethereum-contracts/ops-scripts/deploy-framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
}
}

const deployGDAv1 = async () => {
const deployGDAv1 = async (superfluidPoolBeaconAddr) => {
// TODO: why do we want to allow this to fail? Do we really?
//try {
// deploy and link SuperfluidPoolDeployerLibrary
Expand All @@ -588,10 +588,13 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
/*} catch (err) {
console.error(err);
}*/
const GDAv1 = await GeneralDistributionAgreementV1.at(
await superfluid.getAgreementClass.call(GDAv1_TYPE)
);
const superfluidPoolBeaconAddr = await GDAv1.superfluidPoolBeacon.call();
if (superfluidPoolBeaconAddr === undefined) {
// update case, we cat get from previous deployment
const GDAv1 = await GeneralDistributionAgreementV1.at(
await superfluid.getAgreementClass.call(GDAv1_TYPE)
);
superfluidPoolBeaconAddr = await GDAv1.superfluidPoolBeacon.call();
}

const agreement = await web3tx(
GeneralDistributionAgreementV1.new,
Expand Down Expand Up @@ -653,16 +656,15 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
(gov) => gov.registerAgreementClass(superfluid.address, gda.address)
);

console.log("##### STEP1 of GDA DEPLOYMENT DONE #####");
console.log("Now go execute the gov action, then run this script again");

// assumption: testnets don't require async gov action execution, so can continue
// while for mainnets with async gov action, we need to exit here.
if (!config.isTestnet) {
if (outputFile !== undefined) {
console.log("info for verification:");
console.log(output);
}
console.log("##### STEP1 of GDA DEPLOYMENT DONE #####");
console.log("Now go execute the gov action, then run this script again");
process.exit();
}
} else {
Expand Down

0 comments on commit c9ce6f4

Please sign in to comment.