-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathsetControllerToFactory.js
32 lines (24 loc) · 1.09 KB
/
setControllerToFactory.js
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
26
27
28
29
30
31
32
const NEST3PriceOracleMock = artifacts.require("NEST3PriceOracleConstMock");
const CoFiXController = artifacts.require("CoFiXController");
const CoFiXFactory = artifacts.require("CoFiXFactory");
const CoFiXKTable = artifacts.require("CoFiXKTable");
const ERC20 = artifacts.require("TestERC20");
const { BN } = require('@openzeppelin/test-helpers');
const { web3 } = require('@openzeppelin/test-environment');
const Decimal = require('decimal.js');
const argv = require('yargs').argv;
module.exports = async function (callback) {
try {
console.log(`argv> nest=${argv.nest}, factory=${argv.factory}, table=${argv.controller}`);
const Factory = await CoFiXFactory.at(argv.factory);
const Controller = await CoFiXController.at(argv.controller);
let controller = await Factory.getController();
console.log("before> controller:", controller);
await Factory.setController(Controller.address);
controller = await Factory.getController();
console.log("after> controller:", controller);
callback();
} catch (e) {
callback(e);
}
}