deploy mysterybox

This commit is contained in:
owen05
2021-04-15 10:38:19 +08:00
parent fd22aea378
commit b4d9351552
2 changed files with 49 additions and 0 deletions

View File

@@ -74,5 +74,15 @@ module.exports = {
DODONFTRegistry: "0xF405372b7808363DCfbb5Eb81204889B7a69Aa3e",
DODONFTProxy: "0x0727dEd495E35f4bA4F5D64794145152301Db23f",
//================= MysteryBox =================
MysteryBoxV1: "",
RandomGenerator: "",
RandomPool: [
"0xa2e0ef85618732d80e5ef362773da1c92e8b1c57",
"0xaCfc959e0E85726d09A36E6DFdD56FB2e5dB8F77",
"0x7A733869CB210393f3c02B740c58498EB1f8815C"
]
}
}

View File

@@ -17,6 +17,9 @@ const InitializableERC721 = artifacts.require("InitializableERC721");
const InitializableERC1155 = artifacts.require("InitializableERC1155");
const NFTTokenFactory = artifacts.require("NFTTokenFactory");
const MysteryBoxV1 = artifacts.require("MysteryBoxV1");
const RandomGenerator = artifacts.require("RandomGenerator");
module.exports = async (deployer, network, accounts) => {
let CONFIG = GetConfig(network, accounts)
if (CONFIG == null) return;
@@ -41,9 +44,45 @@ module.exports = async (deployer, network, accounts) => {
let ERC1155Address = CONFIG.InitializableERC1155;
let NFTTokenFactoryAddress = CONFIG.NFTTokenFactory;
let MysteryBoxV1Address = CONFIG.MysteryBoxV1;
let RandomGeneratorAddress = CONFIG.RandomGenerator;
let RandomPool = CONFIG.RandomPool;
let multiSigAddress = CONFIG.multiSigAddress;
let defaultMaintainer = CONFIG.defaultMaintainer;
if (deploySwitch.MYSTERYBOX_V1) {
logger.log("====================================================");
logger.log("network type: " + network);
logger.log("Deploy time: " + new Date().toLocaleString());
logger.log("Deploy type: MysteryBoxV1");
if (RandomGeneratorAddress == "") {
await deployer.deploy(RandomGenerator,[
RandomPool[0],
RandomPool[1],
RandomPool[2],
]);
RandomGeneratorAddress = RandomGenerator.address;
logger.log("RandomGeneratorAddress: ", RandomGeneratorAddress);
}
if (MysteryBoxV1Address == "") {
await deployer.deploy(MysteryBoxV1);
MysteryBoxV1Address = MysteryBoxV1.address;
logger.log("MysteryBoxV1Address: ", MysteryBoxV1Address);
const MysteryBoxV1Instance = await MysteryBoxV1.at(MysteryBoxV1Address);
var tx = await MysteryBoxV1Instance.init(
"DODOMysteryBox",
"DODOBox",
"",
multiSigAddress,
RandomGeneratorAddress
);
logger.log("Init MysteryBoxV1 Tx:", tx.tx);
}
}
if (deploySwitch.DEPLOY_NFT) {
logger.log("====================================================");
logger.log("network type: " + network);