becrypto/config/20_deploy_luckybox1155.js
2022-04-18 21:15:00 +08:00

43 lines
1.3 KiB
JavaScript

const LuckyBox = artifacts.require('luckybox/BELuckyBox');
const BoxProxy = artifacts.require('luckybox/LuckyBoxProxy');
const Hero = artifacts.require('BEHero');
const Equip = artifacts.require('BEEquipment');
const Chip = artifacts.require('BEChip');
const config = require("./config");
module.exports = async function (deployer, network, accounts) {
await deployer.deploy(
LuckyBox
);
const luckyBoxInstance = await LuckyBox.deployed();
if(luckyBoxInstance) {
console.log("BELuckyBox successfully deployed.")
}
await deployer.deploy(
BoxProxy
);
const boxProxyInstance = await BoxProxy.deployed();
if(boxProxyInstance) {
console.log("LuckyBoxProxy successfully deployed.")
}
const heroInstance = await Hero.deployed();
const equipInstance = await Equip.deployed();
const chipInstance = await Chip.deployed();
await boxProxyInstance.init(
luckyBoxInstance.address,
[
heroInstance.address,
equipInstance.address,
chipInstance.address
]
)
await boxProxyInstance.updateExecutor('0x834c5C0EC1D94584026fC419E29e89A4D040605a');
await heroInstance.setMintFactory(boxProxyInstance.address);
await equipInstance.setMintFactory(boxProxyInstance.address);
await chipInstance.setMintFactory(boxProxyInstance.address);
await luckyBoxInstance.setMintFactory(boxProxyInstance.address);
}