Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
create tasks for testing; add goerli deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesondh committed Dec 6, 2021
1 parent 2a54ae7 commit 1b1504e
Show file tree
Hide file tree
Showing 16 changed files with 3,743 additions and 201 deletions.
36 changes: 11 additions & 25 deletions deploy/full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ import { BigNumber } from "@ethersproject/bignumber";
import { constants, utils } from "ethers";
import { read } from "fs";

// MAINNET
const FLX = "0x3ea8ea4237344c9931214796d9417af1a1180770"; // mainnet FLX token
const LP = "0xd6Ef070951d008f1e6426ad9ca1C4FcF7220eE4D"; // uniswap v2 FLX-USDC
// const multisig = "0xCAa58677fa6a5437B0eDD37659f94DdBEa575945";

// GOERLI
// const FLX = "0x23FF74Af1a1e8Ef4433d761943Eb164F927bA2e2"; // faucet token
// const LP = "0x23FF74Af1a1e8Ef4433d761943Eb164F927bA2e2"; // faucet token

const ONE_YEAR = 60 * 60 * 24 * 365;

const deployFunction: DeployFunction = async function ({ ethers, deployments, getNamedAccounts, getChainId }: HardhatRuntimeEnvironment) {
Expand Down Expand Up @@ -65,17 +70,15 @@ const deployFunction: DeployFunction = async function ({ ethers, deployments, ge
// const liquidityMiningManager = (await get("LiquidityMiningManager"));
// const flxUsdcPool = (await get("FLXUSDCPool"));
// const view = (await get("View"));
// assign gov role to deployer

// assign roles
const GOV_ROLE = await read("LiquidityMiningManager", {}, "GOV_ROLE");
const REWARD_DISTRIBUTOR_ROLE = await read("LiquidityMiningManager", {}, "REWARD_DISTRIBUTOR_ROLE");
const DEFAULT_ADMIN_ROLE = await read("LiquidityMiningManager", {}, "DEFAULT_ADMIN_ROLE");

console.log("Assigning GOV_ROLE");
await execute("LiquidityMiningManager", {from: deployer}, "grantRole", GOV_ROLE, deployer);
await execute("LiquidityMiningManager", {from: deployer}, "grantRole", GOV_ROLE, multisig);
console.log("Assigning REWARD_DISTRIBUTOR_ROLE");
await execute("LiquidityMiningManager", {from: deployer}, "grantRole", REWARD_DISTRIBUTOR_ROLE, deployer);

await execute("LiquidityMiningManager", {from: deployer}, "grantRole", REWARD_DISTRIBUTOR_ROLE, multisig);
// add pools
console.log("Adding FLX LP Pool");
const addPool = await execute("LiquidityMiningManager",
Expand All @@ -86,23 +89,6 @@ const deployFunction: DeployFunction = async function ({ ethers, deployments, ge
);
console.log(`Tx: ${addPool.transactionHash}`);


// Assign GOV, DISTRIBUTOR and DEFAULT_ADMIN roles to multisig
console.log("setting lmm roles");
// renounce gov role from deployer
await execute("LiquidityMiningManager", {from: deployer}, "renounceRole", GOV_ROLE, deployer);
console.log("renouncing distributor role");
await execute("LiquidityMiningManager", {from: deployer}, "renounceRole", REWARD_DISTRIBUTOR_ROLE, deployer);
console.log("Assigning GOV_ROLE");
await execute("LiquidityMiningManager", {from: deployer}, "grantRole", GOV_ROLE, multisig);
console.log("Assigning REWARD_DISTRIBUTOR_ROLE");
await execute("LiquidityMiningManager", {from: deployer}, "grantRole", REWARD_DISTRIBUTOR_ROLE, multisig);
console.log("Assigning DEFAULT_ADMIN_ROLE");
await execute("LiquidityMiningManager", {from: deployer}, "grantRole", DEFAULT_ADMIN_ROLE, multisig);

console.log("Assigning DEFAULT_ADMIN roles on pools");
await execute("FLXUSDCPool", {from: deployer}, "grantRole", DEFAULT_ADMIN_ROLE, multisig);

console.log('done');
};

Expand Down
1 change: 1 addition & 0 deletions deployments/goerli/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5
Loading

0 comments on commit 1b1504e

Please sign in to comment.