Skip to content

Commit

Permalink
fix: revert deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Picodes committed Jun 20, 2024
1 parent dc22628 commit 234ebc4
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions deploy/0_distributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'];
Expand Down

0 comments on commit 234ebc4

Please sign in to comment.