83 lines
2.5 KiB
JavaScript
83 lines
2.5 KiB
JavaScript
const Box = artifacts.require("tokens/erc721/NFTSbt");
|
|
const Metadata = artifacts.require("core/JSONMetadata");
|
|
const base = require("../scripts/base");
|
|
const config = require("../config/config");
|
|
|
|
module.exports = async function (deployer, network, accounts) {
|
|
const dpaddr = accounts[0]
|
|
console.log('[deployer address]', dpaddr)
|
|
|
|
let cfgs = base.loadData({ network });
|
|
const metadataInstance = await Metadata.at(
|
|
cfgs.find((c) => c.name === "JSONMetadata").address
|
|
);
|
|
|
|
if (metadataInstance) {
|
|
console.log("[metadataInstance]", metadataInstance.address);
|
|
}else{
|
|
return
|
|
}
|
|
|
|
const name = "Explorer";
|
|
const symbol = "EXPLORER";
|
|
await deployer.deploy(Box, name, symbol, 0);
|
|
const gachaInstance = await Box.deployed();
|
|
if (gachaInstance) {
|
|
console.log("Explorer successfully deployed.");
|
|
}
|
|
base.updateArray({
|
|
name: "Explorer",
|
|
type: "erc721",
|
|
json: "assets/contracts/NFTSbt.json",
|
|
address: gachaInstance.address,
|
|
network,
|
|
});
|
|
|
|
let metaaddr = ''
|
|
|
|
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 = "Explorer badge as a special recognition and gratitude to our dedicated early CounterFire testers. It's an SBT (Special Badge Token) and will play a pivotal role in forthcoming reward distributions."
|
|
const mtimg = "https://gateway.pinata.cloud/ipfs/QmRtJ6MpKm58KV8wBZcNwcVRRZDFCnqqCbqFspKZYQNGb5"
|
|
const mtex = ',"animation_url": "https://gateway.pinata.cloud/ipfs/QmR5dbEN95SBdaDp72Pc9aA4wU5DcyDXXWSihxkNUMHUbF"'
|
|
|
|
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}`);
|
|
|
|
|
|
await gachaInstance.setMintRole(config.admins.executors[0])
|
|
await gachaInstance.setMintRole(dpaddr)
|
|
|
|
await gachaInstance.batchMint(dpaddr, 1)
|
|
|
|
console.log('deploy and mint complete')
|
|
|
|
};
|