diff --git a/deploy/0_distributor.ts b/deploy/0_distributor.ts index 66af7f6..9475fb9 100644 --- a/deploy/0_distributor.ts +++ b/deploy/0_distributor.ts @@ -18,11 +18,11 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => { let core: string; // TODO: change the coreMerkl address to that of the desired chain - // core = '0x1746f9bb465d3747fe9C2CfE7759F4B871a06d3C'; - // const coreContract = new ethers.Contract(core, CoreBorrow__factory.createInterface(), deployer) as any; - // if (await coreContract.GOVERNOR_ROLE()!= '0x7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55') throw 'Invalid Core Merkl' + core = '0x1746f9bb465d3747fe9C2CfE7759F4B871a06d3C'; + const coreContract = new ethers.Contract(core, CoreBorrow__factory.createInterface(), deployer) as any; + if (await coreContract.GOVERNOR_ROLE()!= '0x7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55') throw 'Invalid Core Merkl' - // if (deployer.address !== '0x9f76a95AA7535bb0893cf88A146396e00ed21A12') throw `Invalid deployer address: ${deployer.address}`; + if (deployer.address !== '0x9f76a95AA7535bb0893cf88A146396e00ed21A12') throw `Invalid deployer address: ${deployer.address}`; /* if (!network.live) { // If we're in mainnet fork, we're using the `CoreBorrow` address from mainnet @@ -47,25 +47,25 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => { const implementationAddress = (await ethers.getContract('Distributor_Implementation_V2_2')).address; - // console.log(`Successfully deployed the implementation for Distributor at ${implementationAddress}`); - // console.log(''); + console.log(`Successfully deployed the implementation for Distributor at ${implementationAddress}`); + console.log(''); - // console.log('Now deploying the Proxy'); + console.log('Now deploying the Proxy'); - // await deploy('Distributor', { - // contract: 'ERC1967Proxy', - // from: deployer.address, - // args: [implementationAddress, '0x'], - // log: !argv.ci, - // }); + await deploy('Distributor', { + contract: 'ERC1967Proxy', + from: deployer.address, + args: [implementationAddress, '0x'], + log: !argv.ci, + }); - // const distributor = (await deployments.get('Distributor')).address; - // console.log(`Successfully deployed contract at the address ${distributor}`); - // console.log('Initializing the contract'); - // const contract = new ethers.Contract(distributor, Distributor__factory.createInterface(), deployer) as Distributor; - // await (await contract.connect(deployer).initialize(core)).wait(); - // console.log('Contract successfully initialized'); - // console.log(''); + const distributor = (await deployments.get('Distributor')).address; + console.log(`Successfully deployed contract at the address ${distributor}`); + console.log('Initializing the contract'); + const contract = new ethers.Contract(distributor, Distributor__factory.createInterface(), deployer) as Distributor; + await (await contract.connect(deployer).initialize(core)).wait(); + console.log('Contract successfully initialized'); + console.log(''); }; func.tags = ['distributor'];