Skip to content

Commit 1fb25a5

Browse files
author
Stavros
committed
test amount in presale + block fallback where it is irrelevant
1 parent db5e03c commit 1fb25a5

File tree

5 files changed

+33
-6
lines changed

5 files changed

+33
-6
lines changed

contracts/GetFinalizeAgent.sol

+4
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,8 @@ contract GetFinalizeAgent is FinalizeAgent {
6464
// Make token transferable
6565
token.releaseTokenTransfer();
6666
}
67+
68+
function() payable {
69+
revert();
70+
}
6771
}

contracts/GetPreFinalizeAgent.sol

+4
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,8 @@ contract GetPreFinalizeAgent is FinalizeAgent, Ownable {
4040
revert();
4141
}
4242
}
43+
44+
function() payable {
45+
revert();
46+
}
4347
}

contracts/GetPricingStrategy.sol

+4
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,8 @@ contract GetPricingStrategy is EthTranchePricing {
6161
return value.times(multiplier) / tranches[trancheIndex].price;
6262
}
6363

64+
function() payable {
65+
revert();
66+
}
67+
6468
}

contracts/GetWhitelist.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,6 @@ contract GetWhitelist is Ownable {
120120
}
121121

122122
function() payable {
123-
throw;
123+
revert();
124124
}
125125
}

test/2_precrowdsale.js

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
var GetWhitelist = artifacts.require("./GetWhitelist.sol");
2-
var GetPreCrowdsale = artifacts.require("./GetPreCrowdsale.sol");
3-
var GetCrowdsale = artifacts.require("./GetCrowdsale.sol");
4-
var GetToken = artifacts.require("./GetToken.sol");
5-
var constants = require('../constants.js');
1+
const GetWhitelist = artifacts.require("./GetWhitelist.sol");
2+
const GetPreCrowdsale = artifacts.require("./GetPreCrowdsale.sol");
3+
const GetCrowdsale = artifacts.require("./GetCrowdsale.sol");
4+
const GetToken = artifacts.require("./GetToken.sol");
5+
const constants = require('../constants.js');
6+
const testUtils = require('../util/tests.js');
67
const fullAmount = constants.precrowdsale.PRESALE_TOKEN_CAP / 10**18 * constants.pricingStrategy.PRESALE_PRICE_WEI;
78

89

@@ -104,4 +105,18 @@ contract('GetPreCrowdsale', function(accounts) {
104105

105106
});
106107

108+
it("correct amount in main multisig", async function() {
109+
const precrowdsale = await GetPreCrowdsale.deployed();
110+
let weiRaised = await precrowdsale.weiRaised();
111+
weiRaised = parseFloat(weiRaised.valueOf());
112+
113+
// accounts already have 100 ether in testrpc
114+
assert.equal(
115+
await testUtils.balanceOf(constants.multisig.MAINADDRESS),
116+
weiRaised + 100 * 10**18,
117+
"incorrect amount in multisig"
118+
);
119+
120+
});
121+
107122
});

0 commit comments

Comments
 (0)