becrypto/migrations/14_deploy_buner.js
2024-01-10 15:11:59 +08:00

35 lines
1.4 KiB
JavaScript

const base = require("../scripts/base");
const NftBuner = artifacts.require("logic/NftBuner");
const Badge = artifacts.require("tokens/erc721/BEBadge");
const NFTSbt = artifacts.require("tokens/erc721/NFTSbt");
module.exports = async function (deployer, network, accounts) {
await deployer.deploy(NftBuner);
const bunerInstance = await NftBuner.deployed();
if (bunerInstance) {
console.log("NftBuner successfully deployed.");
console.log("address: " + bunerInstance.address);
}
base.updateArray({
name: "NftBuner",
type: "logic",
json: "assets/contracts/NftBuner.json",
address: bunerInstance.address,
network,
});
let cfgs = base.loadData({ network });
const gacha = cfgs.find((c) => c.name === "Gacha").address
const gachaInstance = await Badge.at(gacha);
await gachaInstance.setBurnRole(bunerInstance.address);
console.log("gacha setBurnRole successfully deployed.");
const candy = cfgs.find((c) => c.name === "Candy").address
const candyInstance = await Badge.at(candy);
await candyInstance.setBurnRole(bunerInstance.address);
console.log("candy setBurnRole successfully deployed.");
const explorer = cfgs.find((c) => c.name === "Explorer").address
const explorerInstance = await NFTSbt.at(explorer);
await explorerInstance.setBurnRole(bunerInstance.address);
console.log("explorer setBurnRole successfully deployed.");
};