Skip to content

Commit

Permalink
fix: renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
Picodes committed Jun 20, 2024
1 parent c6d67c0 commit dc22628
Show file tree
Hide file tree
Showing 30 changed files with 66 additions and 22 deletions.
44 changes: 22 additions & 22 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 @@ -39,33 +39,33 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
console.log('Now deploying Distributor');
console.log('Starting with the implementation');

await deploy('Distributor_Implementation_V2_1', {
await deploy('Distributor_Implementation_V2_2', {
contract: 'Distributor',
from: deployer.address,
log: !argv.ci,
});

const implementationAddress = (await ethers.getContract('Distributor_Implementation_V2_1')).address;
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
44 changes: 44 additions & 0 deletions deploy/mtw.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { DistributionCreator__factory } from '@angleprotocol/sdk';
import { DeployFunction } from 'hardhat-deploy/types';
import yargs from 'yargs';
import { Distributor__factory } from '../typechain';

const argv = yargs.env('').boolean('ci').parseSync();

const func: DeployFunction = async ({ deployments, ethers, network }) => {
const { deploy } = deployments;
const { deployer } = await ethers.getNamedSigners();

const couponName = 'RadiantMerklTokenWrapper';
const distributionCreator = DistributionCreator__factory.connect('0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd', deployer)
const core = await distributionCreator.core()

console.log(`Deploying Coupon`);
console.log('Starting with the implementation');

await deploy(`${couponName}_Implementation`, {
contract: couponName,
from: deployer.address,
args: [],
log: !argv.ci,
});

const implementationAddress = (await ethers.getContract(`${couponName}_Implementation`)).address;

console.log('Starting with the implementation');

const distributorInterface = Distributor__factory.createInterface();

await deploy(`${couponName}_Proxy`, {
contract: 'ERC1967Proxy',
from: deployer.address,
args: [implementationAddress, distributorInterface.encodeFunctionData('initialize', [core])],
log: !argv.ci,
});

console.log(`Successfully deployed the contract ${couponName} at ${implementationAddress}`);
console.log('');
};

func.tags = ['mtw'];
export default func;
File renamed without changes.
File renamed without changes.

0 comments on commit dc22628

Please sign in to comment.