add deploy script of claim activity
This commit is contained in:
parent
5a6347478e
commit
b1a9b25d9a
41
migrations/8_deploy_claim_activity.js
Normal file
41
migrations/8_deploy_claim_activity.js
Normal file
@ -0,0 +1,41 @@
|
||||
const Factory = artifacts.require("activity/ClaimBoxFactory");
|
||||
const Box = artifacts.require("tokens/erc721/NFTSbt");
|
||||
const base = require("../scripts/base");
|
||||
|
||||
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: "NFTSbt",
|
||||
type: "erc721",
|
||||
json: "assets/contracts/NFTSbt.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: "ClaimBoxFactory",
|
||||
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}`);
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user