更新设置nft的脚本

This commit is contained in:
cebgcontract 2022-08-11 14:04:09 +08:00
parent 9b79d1d6a5
commit 9219d718ee
3 changed files with 47 additions and 47 deletions

View File

@ -1,30 +1,30 @@
const Hero = artifacts.require('tokens/erc721/BEHero') const BEHero = artifacts.require('tokens/erc721/BEHero')
const Equip = artifacts.require('tokens/erc721/BEEquipment') const BEEquipment = artifacts.require('tokens/erc721/BEEquipment')
const Coin = artifacts.require('tokens/erc20/BECoin') const BECoin = artifacts.require('tokens/erc20/BECoin')
const Gold = artifacts.require('tokens/erc20/BEGold') const BEGold = artifacts.require('tokens/erc20/BEGold')
const Chip = artifacts.require('tokens/erc1155/BEChip') const BEChip = artifacts.require('tokens/erc1155/BEChip')
const Shard = artifacts.require('tokens/erc1155/BEShard') const BEShard = artifacts.require('tokens/erc1155/BEShard')
const MarketPlace = artifacts.require('market/MarketPlace') const MarketPlace = artifacts.require('market/MarketPlace')
// const Box = artifacts.require('market/BEBoxMall') // const BEBoxMall = artifacts.require('market/BEBoxMall')
const Factory = artifacts.require('logic/MinterFactory') const MinterFactory = artifacts.require('logic/MinterFactory')
// const EvolveProxy = artifacts.require('logic/EvolveProxy') // const EvolveProxy = artifacts.require('logic/EvolveProxy')
// const TimelockController = artifacts.require('core/BETimelockController') // const BETimelockController = artifacts.require('core/BETimelockController')
module.exports = async function main(callback) { module.exports = async function main(callback) {
try { try {
const accounts = await web3.eth.getAccounts(); const accounts = await web3.eth.getAccounts();
// const timelockInstance = await TimelockController.deployed(); // const timelockInstance = await BETimelockController.deployed();
const marketInstance = await MarketPlace.deployed(); const marketInstance = await MarketPlace.deployed();
const heroInstance = await Hero.deployed(); const heroInstance = await BEHero.deployed();
const equipInstance = await Equip.deployed(); const equipInstance = await BEEquipment.deployed();
const chipInstance = await Chip.deployed(); const chipInstance = await BEChip.deployed();
const shardInstance = await Shard.deployed(); const shardInstance = await BEShard.deployed();
const factoryInstance = await Factory.deployed() const factoryInstance = await MinterFactory.deployed()
// const boxInstance = await Box.deployed() // const boxInstance = await BEBoxMall.deployed()
// const proxyInstance = await EvolveProxy.deployed() // const proxyInstance = await EvolveProxy.deployed()
const coinInstance = await Coin.deployed(); const coinInstance = await BECoin.deployed();
const goldInstance = await Gold.deployed(); const goldInstance = await BEGold.deployed();
let jsons = [] let jsons = []
jsons.push({name: 'coin', json: 'assets/contracts/BECoin.json', address: coinInstance.address}) jsons.push({name: 'coin', json: 'assets/contracts/BECoin.json', address: coinInstance.address})
jsons.push({name: 'gold', json: 'assets/contracts/BEGold.json', address: goldInstance.address}) jsons.push({name: 'gold', json: 'assets/contracts/BEGold.json', address: goldInstance.address})

View File

@ -1,12 +1,12 @@
const Hero = artifacts.require('tokens/erc721/BEHero') const BEHero = artifacts.require('tokens/erc721/BEHero')
const Equip = artifacts.require('tokens/erc721/BEEquipment') const BEEquipment = artifacts.require('tokens/erc721/BEEquipment')
const Coin = artifacts.require('tokens/erc20/BECoin') const BECoin = artifacts.require('tokens/erc20/BECoin')
const Gold = artifacts.require('tokens/erc20/BEGold') const BEGold = artifacts.require('tokens/erc20/BEGold')
const Chip = artifacts.require('tokens/erc1155/BEChip') const BEChip = artifacts.require('tokens/erc1155/BEChip')
const Shard = artifacts.require('tokens/erc1155/BEShard') const BEShard = artifacts.require('tokens/erc1155/BEShard')
const MarketPlace = artifacts.require('market/MarketPlace') const MarketPlace = artifacts.require('market/MarketPlace')
// const Box = artifacts.require('market/BEBoxMall') // const BEBoxMall = artifacts.require('market/BEBoxMall')
const Factory = artifacts.require('logic/MinterFactory') const MinterFactory = artifacts.require('logic/MinterFactory')
// const EvolveProxy = artifacts.require('logic/EvolveProxy') // const EvolveProxy = artifacts.require('logic/EvolveProxy')
const config = require('../config/config') const config = require('../config/config')
@ -17,10 +17,10 @@ module.exports = async function main(callback) {
const accounts = await web3.eth.getAccounts() const accounts = await web3.eth.getAccounts()
console.log(accounts) console.log(accounts)
const heroInstance = await Hero.deployed() const heroInstance = await BEHero.deployed()
const equipInstance = await Equip.deployed() const equipInstance = await BEEquipment.deployed()
const chipInstance = await Chip.deployed() const chipInstance = await BEChip.deployed()
const shardInstance = await Shard.deployed() const shardInstance = await BEShard.deployed()
await heroInstance.updateBaseURI(config.token.baseTokenURI) await heroInstance.updateBaseURI(config.token.baseTokenURI)
console.log("BEHero baseURI update success.") console.log("BEHero baseURI update success.")
@ -32,7 +32,7 @@ module.exports = async function main(callback) {
console.log("Chip baseURI update success.") console.log("Chip baseURI update success.")
const marketInstance = await MarketPlace.deployed() const marketInstance = await MarketPlace.deployed()
const coinInstance = await Coin.deployed() const coinInstance = await BECoin.deployed()
if (marketInstance) { if (marketInstance) {
await marketInstance.setFeeToAddress(config.market.feeToAddress) await marketInstance.setFeeToAddress(config.market.feeToAddress)
await marketInstance.setTransactionFee(400) await marketInstance.setTransactionFee(400)
@ -57,7 +57,7 @@ module.exports = async function main(callback) {
console.log(`Allow operation ${marketInstance.address} to reduce gas fee`) console.log(`Allow operation ${marketInstance.address} to reduce gas fee`)
} }
const factoryInstance = await Factory.deployed() const factoryInstance = await MinterFactory.deployed()
if (!factoryInstance) { if (!factoryInstance) {
console.error('no factoryInstance') console.error('no factoryInstance')
return return
@ -93,7 +93,7 @@ module.exports = async function main(callback) {
// `Allow proxy ${proxyInstance.address} to burn contract \n hero: ${heroInstance.address}, \n equip: ${equipInstance.address}, \n chip: ${chipInstance.address}`, // `Allow proxy ${proxyInstance.address} to burn contract \n hero: ${heroInstance.address}, \n equip: ${equipInstance.address}, \n chip: ${chipInstance.address}`,
// ) // )
// const boxInstance = await Box.deployed() // const boxInstance = await BEBoxMall.deployed()
// if (!boxInstance) { // if (!boxInstance) {
// console.error('no boxInstance') // console.error('no boxInstance')
// return // return

View File

@ -1,37 +1,37 @@
const Hero = artifacts.require('tokens/erc721/BEHero') const BEHero = artifacts.require('tokens/erc721/BEHero')
const Equip = artifacts.require('tokens/erc721/BEEquipment') const BEEquipment = artifacts.require('tokens/erc721/BEEquipment')
const Coin = artifacts.require('tokens/erc20/BECoin') const BECoin = artifacts.require('tokens/erc20/BECoin')
const Gold = artifacts.require('tokens/erc20/BEGold') const BEGold = artifacts.require('tokens/erc20/BEGold')
const Chip = artifacts.require('tokens/erc1155/BEChip') const BEChip = artifacts.require('tokens/erc1155/BEChip')
const Shard = artifacts.require('tokens/erc1155/BEShard') const BEShard = artifacts.require('tokens/erc1155/BEShard')
const MarketPlace = artifacts.require('market/MarketPlace') const MarketPlace = artifacts.require('market/MarketPlace')
const EvolveProxy = artifacts.require('logic/EvolveProxy') const EvolveProxy = artifacts.require('logic/EvolveProxy')
const TimelockController = artifacts.require('core/BETimelockController') const BETimelockController = artifacts.require('core/BETimelockController')
module.exports = async function main(callback) { module.exports = async function main(callback) {
try { try {
const timelockInstance = await TimelockController.deployed(); const timelockInstance = await BETimelockController.deployed();
const marketInstance = await MarketPlace.deployed(); const marketInstance = await MarketPlace.deployed();
await marketInstance.transferOwnership(timelockInstance.address); await marketInstance.transferOwnership(timelockInstance.address);
console.log('MarketPlace onwer has change to: ', timelockInstance.address); console.log('MarketPlace onwer has change to: ', timelockInstance.address);
const heroInstance = await Hero.deployed(); const heroInstance = await BEHero.deployed();
await heroInstance.transferOwnership(timelockInstance.address); await heroInstance.transferOwnership(timelockInstance.address);
console.log('Hero onwer has change to: ', timelockInstance.address); console.log('Hero onwer has change to: ', timelockInstance.address);
const equipInstance = await Equip.deployed(); const equipInstance = await BEEquipment.deployed();
await equipInstance.transferOwnership(timelockInstance.address); await equipInstance.transferOwnership(timelockInstance.address);
console.log('Equip onwer has change to: ', timelockInstance.address); console.log('Equip onwer has change to: ', timelockInstance.address);
const chipInstance = await Chip.deployed(); const chipInstance = await BEChip.deployed();
await chipInstance.transferOwnership(timelockInstance.address); await chipInstance.transferOwnership(timelockInstance.address);
console.log('Chip onwer has change to: ', timelockInstance.address); console.log('Chip onwer has change to: ', timelockInstance.address);
const shardInstance = await Shard.deployed(); const shardInstance = await BEShard.deployed();
await shardInstance.transferOwnership(timelockInstance.address); await shardInstance.transferOwnership(timelockInstance.address);
console.log('Shard onwer has change to: ', timelockInstance.address); console.log('Shard onwer has change to: ', timelockInstance.address);
const proxyInstance = await EvolveProxy.deployed(); const proxyInstance = await EvolveProxy.deployed();
await proxyInstance.transferOwnership(timelockInstance.address); await proxyInstance.transferOwnership(timelockInstance.address);
console.log('EvolveProxy onwer has change to: ', timelockInstance.address); console.log('EvolveProxy onwer has change to: ', timelockInstance.address);
const coinInstance = await Coin.deployed(); const coinInstance = await BECoin.deployed();
const goldInstance = await Gold.deployed(); const goldInstance = await BEGold.deployed();
await goldInstance.transferOwnership(timelockInstance.address); await goldInstance.transferOwnership(timelockInstance.address);
console.log('BEGold onwer has change to: ', timelockInstance.address); console.log('BEGold onwer has change to: ', timelockInstance.address);
callback(0) callback(0)