46 lines
1.4 KiB
JavaScript
46 lines
1.4 KiB
JavaScript
const Factory = artifacts.require("activity/ClaimBoxFactory");
|
|
const Box = artifacts.require("tokens/erc721/BEBadge");
|
|
const base = require("../scripts/base");
|
|
const config = require("../config/config");
|
|
|
|
module.exports = async function (deployer, network, accounts) {
|
|
const name = "Gacha";
|
|
const symbol = "GACHA";
|
|
await deployer.deploy(Box, name, symbol, 0);
|
|
const boxInstance = await Box.deployed();
|
|
if (boxInstance) {
|
|
console.log("claim box successfully deployed.");
|
|
}
|
|
base.updateArray({
|
|
name: "Gacha",
|
|
type: "erc721",
|
|
json: "assets/contracts/BEBadge.json",
|
|
address: boxInstance.address,
|
|
network,
|
|
});
|
|
|
|
await deployer.deploy(Factory);
|
|
const factoryInstance = await Factory.deployed();
|
|
if (factoryInstance) {
|
|
console.log("claim box factory successfully deployed.");
|
|
}
|
|
base.updateArray({
|
|
name: "ClaimGachaFactory",
|
|
type: "logic",
|
|
json: "assets/contracts/ClaimBoxFactory.json",
|
|
address: factoryInstance.address,
|
|
network,
|
|
});
|
|
|
|
await boxInstance.setMintRole(factoryInstance.address);
|
|
console.log(
|
|
`success set mint role to: ${factoryInstance.address} claim box `
|
|
);
|
|
|
|
await factoryInstance.addTokenSupport(boxInstance.address);
|
|
console.log(`success add token support to: ${boxInstance.address}`);
|
|
|
|
await factoryInstance.updateExecutor(config.admins.admin);
|
|
console.log(`success update executor to: ${config.admins.admin}`);
|
|
};
|