becrypto/init_scripts/update_timelock.js
2022-08-12 16:42:05 +08:00

43 lines
2.2 KiB
JavaScript

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