* Added basic Escrow

* PullPayment now uses an Escrow, removing all trust from the contract

* Abstracted the Escrow tests to a behaviour

* Added ConditionalEscrow

* Added RefundableEscrow.

* RefundableCrowdsale now uses a RefundEscrow, removed RefundVault.

* Renaming after code review.

* Added log test helper.

* Now allowing empty deposits and withdrawals.

* Style fixes.

* Minor review comments.

* Add Deposited and Withdrawn events, removed Refunded

* The base Escrow is now Ownable, users of it (owners) must provide methods to access it.
This commit is contained in:
Nicolás Venturo
2018-07-03 18:54:55 -03:00
committed by Francisco Giordano
parent c2ad8c3f57
commit 8fd072cf8e
16 changed files with 490 additions and 207 deletions

View File

@ -14,7 +14,6 @@ require('chai')
const SampleCrowdsale = artifacts.require('SampleCrowdsale');
const SampleCrowdsaleToken = artifacts.require('SampleCrowdsaleToken');
const RefundVault = artifacts.require('RefundVault');
contract('SampleCrowdsale', function ([owner, wallet, investor]) {
const RATE = new BigNumber(10);
@ -32,12 +31,10 @@ contract('SampleCrowdsale', function ([owner, wallet, investor]) {
this.afterClosingTime = this.closingTime + duration.seconds(1);
this.token = await SampleCrowdsaleToken.new({ from: owner });
this.vault = await RefundVault.new(wallet, { from: owner });
this.crowdsale = await SampleCrowdsale.new(
this.openingTime, this.closingTime, RATE, wallet, CAP, this.token.address, GOAL
);
await this.token.transferOwnership(this.crowdsale.address);
await this.vault.transferOwnership(this.crowdsale.address);
});
it('should create crowdsale with correct parameters', async function () {