Skip to content

Commit

Permalink
feat: scripts for new owner
Browse files Browse the repository at this point in the history
  • Loading branch information
sogipec committed Feb 14, 2024
1 parent e51cc67 commit 9f3e045
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_, __, runSuper
return paths.filter((p: string) => !p.includes('/test/foundry/'));
});

const accountsPkey: HardhatNetworkAccountsUserConfig = [
{ privateKey: process.env.DEPLOYER_PRIVATE_KEY!, balance: parseEther('1000').toString() },
];

const accountsOldDeployer: HardhatNetworkAccountsUserConfig = accounts('old_deployer');
const accountsMerklDeployer: HardhatNetworkAccountsUserConfig = accounts('merkl_deployer');
const accountsGovernorSidechain: HardhatNetworkAccountsUserConfig = accounts('governor_sidechain');

const argv = yargs
.env('')
.boolean('enableGasReport')
Expand Down
5 changes: 4 additions & 1 deletion scripts/upgradeContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ async function main() {

const distributionAddress = registry(ChainId.MAINNET)?.Merkl?.DistributionCreator!;
const distributorAddress = registry(ChainId.MAINNET)?.Merkl?.Distributor!;
console.log(deployer.address);

manager = new ethers.Contract(
distributionAddress,
Expand All @@ -27,16 +28,18 @@ async function main() {
) as Distributor;

const newImplementation = await deployments.get('DistributionCreator_Implementation_V2_0');
console.log('1st upgrade');
await manager.connect(deployer).upgradeTo(newImplementation.address);
const newDistribImplementation = await deployments.get('Distributor_Implementation_V2_0');
console.log('2nd upgrade');
await distributor.connect(deployer).upgradeTo(newDistribImplementation.address);

console.log(await manager.core());
console.log(await manager.distributor());
console.log(await manager.feeRecipient());
console.log((await manager.defaultFees()).toString());
console.log(await manager.message());
console.log(await manager.distributionList(10));
console.log(await manager.distributionList(1));
console.log((await manager.feeRebate(deployer.address)).toString());
console.log((await manager.isWhitelistedToken(registry(ChainId.MAINNET)?.agEUR?.AgToken!)).toString());
console.log((await manager._nonces('0xfda462548ce04282f4b6d6619823a7c64fdc0185')).toString());
Expand Down

0 comments on commit 9f3e045

Please sign in to comment.