@dydxfoundation/governance
Version:
dYdX governance smart contracts
31 lines (30 loc) • 1.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.deployStarkProxyV2 = void 0;
const types_1 = require("../../types");
const get_deployer_address_1 = require("../deploy-config/get-deployer-address");
const logging_1 = require("../lib/logging");
const util_1 = require("../lib/util");
async function deployStarkProxyV2({ startStep = 0, liquidityStakingAddress, merkleDistributorAddress, starkPerpetualAddress, dydxCollateralTokenAddress, starkProxyNewImplAddress, }) {
(0, logging_1.log)('Beginning stark proxy implementation deployment\n');
const deployer = await (0, get_deployer_address_1.getDeployerSigner)();
const deployerAddress = deployer.address;
(0, logging_1.log)(`Beginning deployment with deployer ${deployerAddress}\n`);
let starkProxyNewImpl;
if (startStep <= 1) {
(0, logging_1.log)('Step 1. Deploy new stark proxy implementation contract.');
starkProxyNewImpl = await new types_1.StarkProxyV2__factory(deployer).deploy(liquidityStakingAddress, starkPerpetualAddress, dydxCollateralTokenAddress, merkleDistributorAddress);
await (0, util_1.waitForTx)(starkProxyNewImpl.deployTransaction);
}
else {
if (!starkProxyNewImplAddress) {
throw new Error('Expected parameter starkProxyNewImplAddress to be specified.');
}
starkProxyNewImpl = new types_1.StarkProxyV2__factory(deployer).attach(starkProxyNewImplAddress);
}
(0, logging_1.log)('\n=== NEW STARK PROXY IMPLEMENTATION DEPLOYMENT COMPLETE ===\n');
return {
starkProxyNewImpl,
};
}
exports.deployStarkProxyV2 = deployStarkProxyV2;