72 lines
2.6 KiB
JavaScript
72 lines
2.6 KiB
JavaScript
const Factory = artifacts.require("activity/ClaimBoxFactory");
|
|
const Box = artifacts.require("tokens/erc721/BEBadge");
|
|
const Metadata = artifacts.require("core/JSONMetadata");
|
|
const base = require("../scripts/base");
|
|
|
|
module.exports = async function (deployer, network, accounts) {
|
|
const config = require(`../config/config_${network}`);
|
|
const name = "Gacha";
|
|
const symbol = "GACHA";
|
|
await deployer.deploy(Box, name, symbol, 0);
|
|
const gachaInstance = await Box.deployed();
|
|
if (gachaInstance) {
|
|
console.log("claim box successfully deployed.");
|
|
}
|
|
base.updateArray({
|
|
name: "Gacha",
|
|
type: "erc721",
|
|
json: "assets/contracts/BEBadge.json",
|
|
address: gachaInstance.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 deployer.deploy(Metadata);
|
|
const metadataInstance = await Metadata.deployed();
|
|
if (metadataInstance) {
|
|
console.log("metadataInstance successfully deployed.");
|
|
}
|
|
base.updateArray({
|
|
name: "JSONMetadata",
|
|
type: "logic",
|
|
json: "assets/contracts/JSONMetadata.json",
|
|
address: metadataInstance.address,
|
|
network,
|
|
});
|
|
|
|
await gachaInstance.setMintRole(factoryInstance.address);
|
|
console.log(
|
|
`success set mint role to: ${factoryInstance.address} claim box `
|
|
);
|
|
|
|
await factoryInstance.addTokenSupport(gachaInstance.address);
|
|
console.log(`success add token support to: ${gachaInstance.address}`);
|
|
|
|
await factoryInstance.updateExecutor(config.admins.admin);
|
|
console.log(`success update executor to: ${config.admins.admin}`);
|
|
|
|
await gachaInstance.updateMetaAddress(metadataInstance.address);
|
|
console.log(`success update meta address for: ${gachaInstance.address}`);
|
|
await metadataInstance.setMetaData(
|
|
gachaInstance.address,
|
|
"Gacha",
|
|
"The Gacha featuring the character 'Hill' from the game, as rewards for Quest missions before CounterFire's official launch.\\nCan get it by participating in the Quest, and it will have multiple benefits.\\nCounterFire is the highly-anticipated first blockchain-based game to offer a unique combination of MOBA and Battle Royale gameplay.Available on Google Play.\\n official website:CounterFire.games",
|
|
"https://gateway.pinata.cloud/ipfs/Qmdbki45yWsdCvWJmLkTDb2TRPM1Kxe3gDFr6q3xaBHxeF",
|
|
""
|
|
);
|
|
|
|
console.log(`success update metadata for: ${gachaInstance.address}`);
|
|
};
|