This commit is contained in:
yuexin 2023-06-26 11:58:01 +08:00
parent ce77b78706
commit 01c1682df1

View File

@ -1,5 +1,6 @@
const Factory = artifacts.require("activity/ClaimBoxFactory");
const Box = artifacts.require("tokens/erc721/BEBadge");
const Metadata = artifacts.require("core/JSONMetadata");
const base = require("../scripts/base");
const config = require("../config/config");
@ -7,15 +8,15 @@ 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) {
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: boxInstance.address,
address: gachaInstance.address,
network,
});
@ -32,14 +33,39 @@ module.exports = async function (deployer, network, accounts) {
network,
});
await boxInstance.setMintRole(factoryInstance.address);
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(boxInstance.address);
console.log(`success add token support to: ${boxInstance.address}`);
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}`);
};