Skip to content

Commit 5e4dc01

Browse files
committed
added transfer ownership after the finalization
1 parent d102abb commit 5e4dc01

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

contracts/foundation/AgiCrowdsale.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ contract AgiCrowdsale is Ownable, ReentrancyGuard {
162162
vault.close();
163163
//Unpause the token
164164
token.unpause();
165+
//give ownership back to deployer
166+
token.transferOwnership(owner);
165167
} else {
166168
//else enable refunds
167169
vault.enableRefunds();

test/TestAgiCrowdsale.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,6 @@ contract('AgiCrowdsale', async ([miner, firstContributor, secondContributor, whi
274274
await increaseTimeTo(latestTime() + duration.weeks(2))
275275

276276
await this.agiCrowdsale.finalize()
277-
await this.agiCrowdsale.transferOwnership(miner)
278-
279277

280278
assert.isTrue(await this.agiCrowdsale.isFinalized.call())
281279

@@ -296,7 +294,6 @@ contract('AgiCrowdsale', async ([miner, firstContributor, secondContributor, whi
296294

297295
await increaseTimeTo(latestTime() + duration.weeks(2))
298296
await this.agiCrowdsale.finalize()
299-
await this.agiCrowdsale.transferOwnership(miner)
300297

301298
const before = web3.fromWei(web3.eth.getBalance(firstContributor), 'ether')
302299

@@ -310,9 +307,7 @@ contract('AgiCrowdsale', async ([miner, firstContributor, secondContributor, whi
310307
await increaseTimeTo(latestTime() + duration.weeks(2))
311308

312309
await this.agiCrowdsale.finalize()
313-
await this.agiCrowdsale.transferOwnership(miner)
314310

315-
316311
const initialSupply = await this.token.balanceOf(this.agiCrowdsale.address)
317312
const balanceBeforeClaim = await this.token.balanceOf(miner)
318313

@@ -334,8 +329,7 @@ contract('AgiCrowdsale', async ([miner, firstContributor, secondContributor, whi
334329

335330
await increaseTimeTo(latestTime() + duration.weeks(2))
336331

337-
await this.agiCrowdsale.finalize()
338-
await this.agiCrowdsale.transferOwnership(miner)
332+
await this.agiCrowdsale.finalize()
339333

340334
assert.isFalse(await this.token.paused.call(), 'token should be unpaused')
341335
})

0 commit comments

Comments
 (0)