93 lines
2.8 KiB
JavaScript
93 lines
2.8 KiB
JavaScript
const Box = artifacts.require("tokens/erc721/BEBadge");
|
|
const Metadata = artifacts.require("core/JSONMetadata");
|
|
const base = require("../scripts/base");
|
|
const config = require("../config/config");
|
|
const Distributor = artifacts.require("logic/NftDistributor");
|
|
|
|
module.exports = async function (deployer, network, accounts) {
|
|
const name = "Candy";
|
|
const symbol = "CANDY";
|
|
// await deployer.deploy(Box, name, symbol, 0);
|
|
const gachaInstance = await Box.deployed();
|
|
if (gachaInstance) {
|
|
console.log("Candy successfully deployed.");
|
|
}
|
|
// base.updateArray({
|
|
// name: "Candy",
|
|
// type: "erc721",
|
|
// json: "assets/contracts/BEBadge.json",
|
|
// address: gachaInstance.address,
|
|
// network,
|
|
// });
|
|
|
|
let metaaddr = '0xfba1F2861718993B94edd5DCe1D06b3Cbe19353d'
|
|
|
|
if(network == 'arbitrum_one'){
|
|
// 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,
|
|
// });
|
|
|
|
const mtname = name
|
|
const mtdesc = "Candy Badge are exclusive to new friends entering the world of CiunterFire,\\n\
|
|
it will have airdrop attributes and in-game benefits."
|
|
const mtimg = "https://gateway.pinata.cloud/ipfs/QmWuHBFGirZS7uyGDyEJNBnMjGLsP9Ke4QZaoL2MxYWtat"
|
|
const mtex = ',"animation_url": "https://gateway.pinata.cloud/ipfs/QmRJAN58RaFZUeor9VhdiqCziujwvwD98zq7xHUnmbzMXW"'
|
|
|
|
await metadataInstance.setMetaData(
|
|
gachaInstance.address,
|
|
mtname,
|
|
mtdesc,
|
|
mtimg,
|
|
mtex
|
|
);
|
|
console.log(`success update metadata for: ${gachaInstance.address}`);
|
|
|
|
metaaddr = metadataInstance.address
|
|
}
|
|
|
|
console.log('meta addr:', metaaddr)
|
|
|
|
await gachaInstance.updateMetaAddress(metaaddr);
|
|
console.log(`success update meta address for: ${gachaInstance.address}`);
|
|
|
|
const testexec = ['0x1cC73CE74BA0BC080e7C0a37cb3a68f435Ab333A']
|
|
|
|
let exec = network == 'arbitrum_one'? config.admins.executors: testexec
|
|
|
|
console.log('exec addrs:', exec)
|
|
|
|
await deployer.deploy(
|
|
Distributor,
|
|
gachaInstance.address,
|
|
exec
|
|
);
|
|
const distributorInstance = await Distributor.deployed();
|
|
if (distributorInstance) {
|
|
console.log("NftDistributor successfully deployed.");
|
|
console.log("address: " + distributorInstance.address);
|
|
}
|
|
base.updateArray({
|
|
name: "NftDistributor",
|
|
type: "logic",
|
|
json: "assets/contracts/NftDistributor.json",
|
|
address: distributorInstance.address,
|
|
network,
|
|
});
|
|
await gachaInstance.setMintRole(distributorInstance.address);
|
|
|
|
console.log(
|
|
`success set mint role to: ${distributorInstance.address} claim box `
|
|
);
|
|
|
|
|
|
};
|