forked from powswap/powswap-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMasterChef.js
30 lines (24 loc) · 1.01 KB
/
MasterChef.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module.exports = async function ({ ethers, deployments, getNamedAccounts }) {
const { deploy } = deployments
const { deployer, dev } = await getNamedAccounts()
const sushi = await ethers.getContract("SushiToken")
const { address } = await deploy("MasterChef", {
from: deployer,
args: [sushi.address, dev, "1000000000000000000000", "0", "1000000000000000000000"],
log: true,
deterministicDeployment: false
})
if (await sushi.owner() !== address) {
// Transfer Sushi Ownership to Chef
console.log("Transfer Sushi Ownership to Chef")
await (await sushi.transferOwnership(address)).wait()
}
const masterChef = await ethers.getContract("MasterChef")
if (await masterChef.owner() !== dev) {
// Transfer ownership of MasterChef to dev
console.log("Transfer ownership of MasterChef to dev")
await (await masterChef.transferOwnership(dev)).wait()
}
}
module.exports.tags = ["MasterChef"]
module.exports.dependencies = ["UniswapV2Factory", "UniswapV2Router02", "SushiToken"]