aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/migrations/5_transfer_ownership.ts
blob: ee879e2b665a34b65380e2e45d43929382f24066 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import {Artifacts} from '../util/artifacts';
import {ContractInstance} from '../util/types';
const {
  TokenTransferProxy,
  MultiSigWalletWithTimeLock,
  TokenRegistry,
} = new Artifacts(artifacts);

let tokenRegistry: ContractInstance;
module.exports = (deployer: any, network: string) => {
  if (network !== 'development') {
    deployer.then(async () => {
      return Promise.all([
        TokenTransferProxy.deployed(),
        TokenRegistry.deployed(),
      ]).then((instances: ContractInstance[]) => {
        let tokenTransferProxy: ContractInstance;
        [tokenTransferProxy, tokenRegistry] = instances;
        return tokenTransferProxy.transferOwnership(MultiSigWalletWithTimeLock.address);
      }).then(() => {
        return tokenRegistry.transferOwnership(MultiSigWalletWithTimeLock.address);
      });
    });
  }
};