Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions contracts/core/Core.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ contract Core is ICore, Permissions {

constructor() public {
_setupGovernor(msg.sender);
}

function init() external onlyGovernor {
Fei _fei = new Fei(address(this));
fei = IFei(address(_fei));

Expand Down
12 changes: 9 additions & 3 deletions contracts/orchestration/CoreOrchestrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@ contract CoreOrchestrator is Ownable {
address _admin
) public {
core = new Core();
tribe = address(core.tribe());
fei = address(core.fei());

core.grantRevoker(_admin);

Expand All @@ -229,12 +227,20 @@ contract CoreOrchestrator is Ownable {
routerOrchestrator = IRouterOrchestrator(_routerOrchestrator);

admin = _admin;
tribeSupply = IERC20(tribe).totalSupply();
if (TEST_MODE) {
core.grantGovernor(_admin);
}
}

function initCore() public onlyOwner {
core.init();

tribe = address(core.tribe());
fei = address(core.fei());
tribeSupply = IERC20(tribe).totalSupply();
}


function initPairs() public onlyOwner {
ethFeiPair = UNISWAP_FACTORY.createPair(fei, WETH);
tribeFeiPair = UNISWAP_FACTORY.createPair(tribe, fei);
Expand Down
5 changes: 4 additions & 1 deletion migrations/2_deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ module.exports = function(deployer, network, accounts) {
genesis.address,
gov.address,
routerOrchestrator.address,
accounts[0]
accounts[0],
{gas: 8000000}
);
}).then(function(instance) {
core = instance;
Expand All @@ -65,6 +66,8 @@ module.exports = function(deployer, network, accounts) {
return pcvo.transferOwnership(core.address);
}).then(function(instance) {
return routerOrchestrator.transferOwnership(core.address);
}).then(function(instance) {
return core.initCore();
}).then(function(instance) {
return core.initPairs();
}).then(function(instance) {
Expand Down
3 changes: 3 additions & 0 deletions test/bondingcurve/EthBondingCurve.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ const {
describe('EthBondingCurve', function () {

beforeEach(async function () {

this.core = await getCore(true);
await this.core.init({from: governorAddress});

this.fei = await Fei.at(await this.core.fei());

this.oracle = await MockOracle.new(500); // 500 USD per ETH exchange rate
Expand Down
2 changes: 2 additions & 0 deletions test/core/Core.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ describe('Core', function () {

beforeEach(async function () {
this.core = await getCore(false);
await this.core.init({from: governorAddress});

this.tribe = await Tribe.at(await this.core.tribe());
this.coreRef = await MockCoreRef.new(this.core.address);

Expand Down
2 changes: 2 additions & 0 deletions test/genesis/GenesisGroup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ describe('GenesisGroup', function () {

beforeEach(async function () {
this.core = await getCore(false);
await this.core.init({from: governorAddress});

this.fei = await Fei.at(await this.core.fei());
this.tribe = await Tribe.at(await this.core.tribe());
this.bc = await MockBondingCurve.new(false, 10);
Expand Down
7 changes: 5 additions & 2 deletions test/genesis/IDO.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ describe('IDO', function () {
const LIQUIDITY_INCREMENT = 10000; // amount of liquidity created by mock for each deposit

beforeEach(async function () {
this.core = await getCore();
await this.core.setGenesisGroup(genesisGroup, {from: governorAddress});

this.core = await getCore(true);
await this.core.init({from: governorAddress});


this.fei = await Fei.at(await this.core.fei());
this.tribe = await Tribe.at(await this.core.tribe());

Expand Down
2 changes: 2 additions & 0 deletions test/pcv/EthUniswapPCVController.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ describe('EthUniswapPCVController', function () {

beforeEach(async function () {
this.core = await Core.new({from: governorAddress});
await this.core.init({from: governorAddress});

await this.core.setGenesisGroup(genesisGroup, {from: governorAddress});
await this.core.completeGenesisGroup({from: genesisGroup});

Expand Down
2 changes: 2 additions & 0 deletions test/pcv/EthUniswapPCVDeposit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ describe('EthUniswapPCVDeposit', function () {

beforeEach(async function () {
this.core = await Core.new({from: governorAddress});
await this.core.init({from: governorAddress});

await this.core.setGenesisGroup(genesisGroup, {from: governorAddress});
await this.core.completeGenesisGroup({from: genesisGroup});

Expand Down
2 changes: 2 additions & 0 deletions test/pool/FeiPool.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ describe('Pool', function () {

beforeEach(async function () {
this.core = await Core.new({from: governorAddress});
await this.core.init({from: governorAddress});

this.window = new BN(2 * 365 * 24 * 60 * 60);
this.tribe = await Tribe.at(await this.core.tribe());
this.fei = await Fei.at(await this.core.fei());
Expand Down
2 changes: 2 additions & 0 deletions test/router/FeiRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ describe('FeiRouter', function () {

beforeEach(async function () {
this.core = await Core.new();
await this.core.init();

this.fei = await Fei.at(await this.core.fei());
await this.core.grantMinter(minterAddress);

Expand Down
2 changes: 2 additions & 0 deletions test/token/Fei.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ describe('Fei', function () {

beforeEach(async function () {
this.core = await MockCore.new();
await this.core.init();

this.fei = await Fei.at(await this.core.fei());
await this.core.grantMinter(minterAddress);
await this.core.grantBurner(burnerAddress);
Expand Down
2 changes: 2 additions & 0 deletions test/token/UniswapIncentive.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ describe('UniswapIncentive', function () {
beforeEach(async function () {

this.core = await Core.new({from: governorAddress});
await this.core.init({from: governorAddress});

this.fei = await Fei.at(await this.core.fei());
this.oracle = await MockOracle.new(500); // 500:1 USD/ETH exchange rate

Expand Down