85 lines
2.6 KiB
JavaScript
85 lines
2.6 KiB
JavaScript
const Badge = artifacts.require("tokens/erc721/BEBadge");
|
|
const Coin = artifacts.require("tokens/erc20/BEUSDT");
|
|
const Wallet = artifacts.require("core/BEMultiSigWallet");
|
|
const Distributor = artifacts.require("logic/NftDistributor");
|
|
const base = require("../scripts/base");
|
|
|
|
module.exports = async function (deployer, network, accounts) {
|
|
const config = require(`../config/config_${network}`);
|
|
await deployer.deploy(Badge, "BE Badge", "Badge", "4000");
|
|
const badgeInstance = await Badge.deployed();
|
|
if (badgeInstance) {
|
|
console.log("BEBadge successfully deployed. ");
|
|
console.log("address: " + badgeInstance.address);
|
|
}
|
|
base.updateArray({
|
|
name: "BEBadge",
|
|
type: "erc721",
|
|
json: "assets/contracts/BEBadge.json",
|
|
address: badgeInstance.address,
|
|
network,
|
|
});
|
|
|
|
await deployer.deploy(Coin, "BE test USDT", "USDT");
|
|
const coinInstance = await Coin.deployed();
|
|
if (coinInstance) {
|
|
console.log("BEUSDT successfully deployed. ");
|
|
console.log("address: " + coinInstance.address);
|
|
}
|
|
base.updateArray({
|
|
name: "BEUSDT",
|
|
type: "erc20",
|
|
json: "assets/contracts/BEUSDT.json",
|
|
address: coinInstance.address,
|
|
network,
|
|
});
|
|
await deployer.deploy(
|
|
Wallet,
|
|
60,
|
|
1,
|
|
config.admins.proposers,
|
|
config.admins.confirmers,
|
|
config.admins.executors
|
|
);
|
|
const walletInstance = await Wallet.deployed();
|
|
if (walletInstance) {
|
|
console.log("BEMultiSigWallet successfully deployed.");
|
|
console.log("address: " + walletInstance.address);
|
|
}
|
|
base.updateArray({
|
|
name: "BEMultiSigWallet",
|
|
type: "logic",
|
|
json: "assets/contracts/BEMultiSigWallet.json",
|
|
address: walletInstance.address,
|
|
network,
|
|
});
|
|
await badgeInstance.setMintRole(walletInstance.address);
|
|
console.log("success add wallet to badge's mint role");
|
|
await coinInstance.setMintRole(walletInstance.address);
|
|
console.log("success add wallet to usdt's mint role");
|
|
|
|
await deployer.deploy(
|
|
Distributor,
|
|
badgeInstance.address,
|
|
config.admins.executors
|
|
);
|
|
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 badgeInstance.setMintRole(distributorInstance.address);
|
|
await distributorInstance.grantRole(
|
|
"0xa076a07f65bcd51bcb15a0f01a65bc18f2d922acb81bcfd8af4caf5adb557091",
|
|
walletInstance.address
|
|
);
|
|
console.log("success add distributor to badge's mint role");
|
|
};
|