-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
914e8ff
commit 38f7d57
Showing
7 changed files
with
129 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
const { constants } = require("ethers"); | ||
const { getSushiGirlsAddress, getLingerieGirlsAddress, getRNGAddress, multiSigWallet } = require("../scripts/utils"); | ||
|
||
module.exports = async ({ getNamedAccounts, deployments }) => { | ||
const { deployer } = await getNamedAccounts(); | ||
const { deploy, get } = deployments; | ||
const { deploy, get, read, execute } = deployments; | ||
|
||
const maidCoin = (await get("MaidCoin")).address; | ||
const maidCafe = (await get("MaidCafe")).address; | ||
const nursePart = (await get("NursePart")).address; | ||
const rng = constants.AddressZero; // TODO: replace with the real address | ||
const nurses = (await get("CloneNurses")).address; | ||
const maids = (await get("Maids")).address; | ||
|
||
const chainId = await getChainId(); | ||
const rng = getRNGAddress(chainId); | ||
const sgirls = getSushiGirlsAddress(chainId); | ||
const lgirls = getLingerieGirlsAddress(chainId); | ||
|
||
await deploy("NurseRaid", { | ||
const raid = await deploy("NurseRaid", { | ||
from: deployer, | ||
args: [maidCoin, maidCafe, nursePart, rng], | ||
args: [maidCoin, maidCafe, nursePart, nurses, rng, sgirls, lgirls], | ||
log: true, | ||
}); | ||
|
||
if ((await read("NursePart", { log: true }, "owner")) !== raid.address) { | ||
console.log("Transfer NursePart Ownership to the NurseRaid"); | ||
await execute("NursePart", { from: deployer }, "transferOwnership", raid.address); | ||
} | ||
|
||
if (raid.newlyDeployed) { | ||
console.log("Approve Maids to NurseRaid"); | ||
await execute("NurseRaid", { from: deployer }, "approveMaids", [maids, lgirls, sgirls]); | ||
} | ||
|
||
if ((await read("NurseRaid", { log: true }, "owner")) !== multiSigWallet) { | ||
console.log("Transfer NurseRaid Ownership to the multi-sig wallet"); | ||
await execute("NurseRaid", { from: deployer }, "transferOwnership", multiSigWallet); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,35 @@ | ||
module.exports = async ({ getNamedAccounts, deployments }) => { | ||
require("dotenv").config(); | ||
const { getPairAddress, getWethAddress } = require("../scripts/utils"); | ||
|
||
module.exports = async ({ ethers, getNamedAccounts, deployments }) => { | ||
const { deployer } = await getNamedAccounts(); | ||
const { deploy } = deployments; | ||
const { deploy, get, execute } = deployments; | ||
|
||
await deploy("MasterCoin", { | ||
const result = await deploy("MasterCoin", { | ||
from: deployer, | ||
args: [], | ||
log: true, | ||
}); | ||
|
||
{ | ||
console.log("Transfer MasterCoin to the devs"); | ||
await execute("MasterCoin", { from: deployer }, "transfer", process.env.DEV0, ethers.utils.parseEther("27.3")); | ||
await execute("MasterCoin", { from: deployer }, "transfer", process.env.DEV1, ethers.utils.parseEther("27.3")); | ||
await execute("MasterCoin", { from: deployer }, "transfer", process.env.DEV2, ethers.utils.parseEther("27.3")); | ||
await execute("MasterCoin", { from: deployer }, "transfer", process.env.DEV3, ethers.utils.parseEther("15.1")); | ||
} | ||
|
||
if (result.newlyDeployed) { | ||
const chainId = await getChainId(); | ||
const pair = getPairAddress(chainId, maidCoin, getWethAddress(chainId)); | ||
const nurses = (await get("CloneNurses")).address; | ||
const masterCoin = result.address; | ||
|
||
console.log("Add initial pools to TheMaster"); | ||
|
||
await execute("TheMaster", { from: deployer }, "add", masterCoin, false, false, ethers.constants.AddressZero, 0, 100); | ||
await execute("TheMaster", { from: deployer }, "add", pair, false, false, ethers.constants.AddressZero, 0, 600); | ||
await execute("TheMaster", { from: deployer }, "add", nurses, true, true, ethers.constants.AddressZero, 0, 300); | ||
await execute("TheMaster", { from: deployer }, "add", pair, false, false, nurses, 30, 0); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters