|
|
|
@ -33,11 +33,11 @@ module.exports = async function main(callback) {
|
|
|
|
|
config.market.paymentTokens.push(goldInstance.address);
|
|
|
|
|
config.market.paymentTokens.push(usdtInstance.address);
|
|
|
|
|
|
|
|
|
|
// await heroInstance.updateBaseURI(config.token.baseTokenURI);
|
|
|
|
|
// console.log("BEHero baseURI update success.");
|
|
|
|
|
await heroInstance.updateBaseURI(config.token.baseTokenURI);
|
|
|
|
|
console.log("BEHero baseURI update success.");
|
|
|
|
|
|
|
|
|
|
// await equipInstance.updateBaseURI(config.token.baseTokenURI);
|
|
|
|
|
// console.log("Equip baseURI update success.");
|
|
|
|
|
await equipInstance.updateBaseURI(config.token.baseTokenURI);
|
|
|
|
|
console.log("Equip baseURI update success.");
|
|
|
|
|
|
|
|
|
|
const marketInstance = await MarketPlace.deployed();
|
|
|
|
|
const ROUND = 1000000;
|
|
|
|
@ -88,6 +88,7 @@ module.exports = async function main(callback) {
|
|
|
|
|
);
|
|
|
|
|
for (let token of config.market.paymentTokens) {
|
|
|
|
|
await marketInstance.addERC20Support(token);
|
|
|
|
|
console.log(`add token for market payment: ${token}`)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(`finish update market config`);
|
|
|
|
@ -102,110 +103,110 @@ module.exports = async function main(callback) {
|
|
|
|
|
// await chipInstance.setApprovalForAll(marketInstance.address, true);
|
|
|
|
|
// console.log("finish chipInstance.addApprovalWhitelist");
|
|
|
|
|
|
|
|
|
|
// await heroInstance.grantLockRole(config.admins.admin);
|
|
|
|
|
// await equipInstance.grantLockRole(config.admins.admin);
|
|
|
|
|
// await chipInstance.grantLockRole(config.admins.admin);
|
|
|
|
|
// await shardInstance.grantLockRole(config.admins.admin);
|
|
|
|
|
// console.log(
|
|
|
|
|
// `Allow operation ${marketInstance.address} to reduce gas fee`
|
|
|
|
|
// );
|
|
|
|
|
await heroInstance.grantLockRole(config.admins.admin);
|
|
|
|
|
await equipInstance.grantLockRole(config.admins.admin);
|
|
|
|
|
await chipInstance.grantLockRole(config.admins.admin);
|
|
|
|
|
await shardInstance.grantLockRole(config.admins.admin);
|
|
|
|
|
console.log(
|
|
|
|
|
`Allow operation ${marketInstance.address} to reduce gas fee`
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// const factoryInstance = await MinterFactory.deployed();
|
|
|
|
|
// if (!factoryInstance) {
|
|
|
|
|
// console.error("no factoryInstance");
|
|
|
|
|
const factoryInstance = await MinterFactory.deployed();
|
|
|
|
|
if (!factoryInstance) {
|
|
|
|
|
console.error("no factoryInstance");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await factoryInstance.init([
|
|
|
|
|
heroInstance.address,
|
|
|
|
|
equipInstance.address,
|
|
|
|
|
chipInstance.address,
|
|
|
|
|
shardInstance.address,
|
|
|
|
|
]);
|
|
|
|
|
await factoryInstance.setFeeToAddress(config.market.feeToAddress);
|
|
|
|
|
await factoryInstance.updateExecutor(config.admins.admin);
|
|
|
|
|
await heroInstance.setMintFactory(factoryInstance.address);
|
|
|
|
|
await equipInstance.setMintFactory(factoryInstance.address);
|
|
|
|
|
await chipInstance.setMintFactory(factoryInstance.address);
|
|
|
|
|
await shardInstance.setMintFactory(factoryInstance.address);
|
|
|
|
|
|
|
|
|
|
console.log(
|
|
|
|
|
`Allow factory ${factoryInstance.address} to mint contract \n hero: ${heroInstance.address}, \n equip: ${equipInstance.address}, \n chip: ${chipInstance.address}`
|
|
|
|
|
);
|
|
|
|
|
await heroInstance.grantBurnRole(factoryInstance.address);
|
|
|
|
|
await equipInstance.grantBurnRole(factoryInstance.address);
|
|
|
|
|
await chipInstance.grantBurnRole(factoryInstance.address);
|
|
|
|
|
await shardInstance.grantBurnRole(factoryInstance.address);
|
|
|
|
|
|
|
|
|
|
console.log(
|
|
|
|
|
`Allow factory ${factoryInstance.address} to burn contract \n hero: ${heroInstance.address}, \n equip: ${equipInstance.address}, \n chip: ${chipInstance.address}`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const userFactoryInstance = await UserMinterFactory.deployed();
|
|
|
|
|
if (!userFactoryInstance) {
|
|
|
|
|
console.error("no userFactoryInstance");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await factoryInstance.addApprovalList(userFactoryInstance.address);
|
|
|
|
|
await userFactoryInstance.init([
|
|
|
|
|
heroInstance.address,
|
|
|
|
|
equipInstance.address,
|
|
|
|
|
chipInstance.address,
|
|
|
|
|
shardInstance.address,
|
|
|
|
|
factoryInstance.address,
|
|
|
|
|
]);
|
|
|
|
|
const proxyInstance = await EvolveFactory.deployed();
|
|
|
|
|
if (!proxyInstance) {
|
|
|
|
|
console.error("no proxyInstance");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await proxyInstance.init(chipInstance.address);
|
|
|
|
|
await proxyInstance.addNFTTokenSupport(heroInstance.address);
|
|
|
|
|
await proxyInstance.addNFTTokenSupport(equipInstance.address);
|
|
|
|
|
await proxyInstance.updateExecutor(config.admins.admin);
|
|
|
|
|
await heroInstance.grantBurnRole(proxyInstance.address);
|
|
|
|
|
await equipInstance.grantBurnRole(proxyInstance.address);
|
|
|
|
|
await chipInstance.grantBurnRole(proxyInstance.address);
|
|
|
|
|
console.log(
|
|
|
|
|
`Allow proxy ${proxyInstance.address} to burn contract \n hero: ${heroInstance.address}, \n equip: ${equipInstance.address}, \n chip: ${chipInstance.address}`
|
|
|
|
|
);
|
|
|
|
|
const userProxyInstance = await UserEvolveFactory.deployed();
|
|
|
|
|
if (!userProxyInstance) {
|
|
|
|
|
console.error("no userProxyInstance");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await proxyInstance.addApprovalList(userProxyInstance.address);
|
|
|
|
|
await userProxyInstance.init(proxyInstance.address);
|
|
|
|
|
|
|
|
|
|
// const boxInstance = await BEBoxMall.deployed();
|
|
|
|
|
// if (!boxInstance) {
|
|
|
|
|
// console.error("no boxInstance");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// await factoryInstance.init([
|
|
|
|
|
// heroInstance.address,
|
|
|
|
|
// equipInstance.address,
|
|
|
|
|
// chipInstance.address,
|
|
|
|
|
// shardInstance.address,
|
|
|
|
|
// ]);
|
|
|
|
|
// await factoryInstance.setFeeToAddress(config.market.feeToAddress);
|
|
|
|
|
// await factoryInstance.updateExecutor(config.admins.admin);
|
|
|
|
|
// await heroInstance.setMintFactory(factoryInstance.address);
|
|
|
|
|
// await equipInstance.setMintFactory(factoryInstance.address);
|
|
|
|
|
// await chipInstance.setMintFactory(factoryInstance.address);
|
|
|
|
|
// await shardInstance.setMintFactory(factoryInstance.address);
|
|
|
|
|
|
|
|
|
|
// await boxInstance.setPaymentReceivedAddress(config.market.mallFeeAddress);
|
|
|
|
|
// console.log(
|
|
|
|
|
// `Allow factory ${factoryInstance.address} to mint contract \n hero: ${heroInstance.address}, \n equip: ${equipInstance.address}, \n chip: ${chipInstance.address}`
|
|
|
|
|
// );
|
|
|
|
|
// await heroInstance.grantBurnRole(factoryInstance.address);
|
|
|
|
|
// await equipInstance.grantBurnRole(factoryInstance.address);
|
|
|
|
|
// await chipInstance.grantBurnRole(factoryInstance.address);
|
|
|
|
|
// await shardInstance.grantBurnRole(factoryInstance.address);
|
|
|
|
|
|
|
|
|
|
// console.log(
|
|
|
|
|
// `Allow factory ${factoryInstance.address} to burn contract \n hero: ${heroInstance.address}, \n equip: ${equipInstance.address}, \n chip: ${chipInstance.address}`
|
|
|
|
|
// `update payment received address: ${config.market.mallFeeAddress}`
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
// const userFactoryInstance = await UserMinterFactory.deployed();
|
|
|
|
|
// if (!userFactoryInstance) {
|
|
|
|
|
// console.error("no userFactoryInstance");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// await factoryInstance.addApprovalList(userFactoryInstance.address);
|
|
|
|
|
// await userFactoryInstance.init([
|
|
|
|
|
// heroInstance.address,
|
|
|
|
|
// equipInstance.address,
|
|
|
|
|
// chipInstance.address,
|
|
|
|
|
// shardInstance.address,
|
|
|
|
|
// factoryInstance.address,
|
|
|
|
|
// ]);
|
|
|
|
|
// const proxyInstance = await EvolveFactory.deployed();
|
|
|
|
|
// if (!proxyInstance) {
|
|
|
|
|
// console.error("no proxyInstance");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// await proxyInstance.init(chipInstance.address);
|
|
|
|
|
// await proxyInstance.addNFTTokenSupport(heroInstance.address);
|
|
|
|
|
// await proxyInstance.addNFTTokenSupport(equipInstance.address);
|
|
|
|
|
// await proxyInstance.updateExecutor(config.admins.admin);
|
|
|
|
|
// await heroInstance.grantBurnRole(proxyInstance.address);
|
|
|
|
|
// await equipInstance.grantBurnRole(proxyInstance.address);
|
|
|
|
|
// await chipInstance.grantBurnRole(proxyInstance.address);
|
|
|
|
|
// console.log(
|
|
|
|
|
// `Allow proxy ${proxyInstance.address} to burn contract \n hero: ${heroInstance.address}, \n equip: ${equipInstance.address}, \n chip: ${chipInstance.address}`
|
|
|
|
|
// );
|
|
|
|
|
// const userProxyInstance = await UserEvolveFactory.deployed();
|
|
|
|
|
// if (!userProxyInstance) {
|
|
|
|
|
// console.error("no userProxyInstance");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// await proxyInstance.addApprovalList(userProxyInstance.address);
|
|
|
|
|
// await userProxyInstance.init(proxyInstance.address);
|
|
|
|
|
|
|
|
|
|
// // const boxInstance = await BEBoxMall.deployed();
|
|
|
|
|
// // if (!boxInstance) {
|
|
|
|
|
// // console.error("no boxInstance");
|
|
|
|
|
// // return;
|
|
|
|
|
// // }
|
|
|
|
|
// // await boxInstance.setPaymentReceivedAddress(config.market.mallFeeAddress);
|
|
|
|
|
// // console.log(
|
|
|
|
|
// // `update payment received address: ${config.market.mallFeeAddress}`
|
|
|
|
|
// // );
|
|
|
|
|
|
|
|
|
|
// const nftMallInstance = await BENftMall.deployed();
|
|
|
|
|
// if (nftMallInstance) {
|
|
|
|
|
// await nftMallInstance.setFeeToAddress(config.market.feeToAddress);
|
|
|
|
|
// await nftMallInstance.setPaymentTokens(config.market.paymentTokens);
|
|
|
|
|
// await nftMallInstance.addNFTTokenSupport(heroInstance.address);
|
|
|
|
|
// await nftMallInstance.addNFTTokenSupport(equipInstance.address);
|
|
|
|
|
// await nftMallInstance.addNFTTokenSupport(chipInstance.address);
|
|
|
|
|
// await heroInstance.setMintFactory(nftMallInstance.address);
|
|
|
|
|
// await equipInstance.setMintFactory(nftMallInstance.address);
|
|
|
|
|
// await chipInstance.setMintFactory(nftMallInstance.address);
|
|
|
|
|
// console.log("update nftMallInstance settings success");
|
|
|
|
|
// }
|
|
|
|
|
// const lockerInstance = await NftChipLocker.deployed();
|
|
|
|
|
// if (lockerInstance) {
|
|
|
|
|
// await lockerInstance.addNFTTokenSupport(heroInstance.address);
|
|
|
|
|
// await lockerInstance.addNFTTokenSupport(equipInstance.address);
|
|
|
|
|
// await lockerInstance.addNFTTokenSupport(chipInstance.address);
|
|
|
|
|
// console.log("update NftChipLocker addNFTTokenSupport success");
|
|
|
|
|
// }
|
|
|
|
|
const nftMallInstance = await BENftMall.deployed();
|
|
|
|
|
if (nftMallInstance) {
|
|
|
|
|
await nftMallInstance.setFeeToAddress(config.market.feeToAddress);
|
|
|
|
|
await nftMallInstance.setPaymentTokens(config.market.paymentTokens);
|
|
|
|
|
await nftMallInstance.addNFTTokenSupport(heroInstance.address);
|
|
|
|
|
await nftMallInstance.addNFTTokenSupport(equipInstance.address);
|
|
|
|
|
await nftMallInstance.addNFTTokenSupport(chipInstance.address);
|
|
|
|
|
await heroInstance.setMintFactory(nftMallInstance.address);
|
|
|
|
|
await equipInstance.setMintFactory(nftMallInstance.address);
|
|
|
|
|
await chipInstance.setMintFactory(nftMallInstance.address);
|
|
|
|
|
console.log("update nftMallInstance settings success");
|
|
|
|
|
}
|
|
|
|
|
const lockerInstance = await NftChipLocker.deployed();
|
|
|
|
|
if (lockerInstance) {
|
|
|
|
|
await lockerInstance.addNFTTokenSupport(heroInstance.address);
|
|
|
|
|
await lockerInstance.addNFTTokenSupport(equipInstance.address);
|
|
|
|
|
await lockerInstance.addNFTTokenSupport(chipInstance.address);
|
|
|
|
|
console.log("update NftChipLocker addNFTTokenSupport success");
|
|
|
|
|
}
|
|
|
|
|
callback(0);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error(error);
|
|
|
|
|