Merge pull request #105 from BlockchainLabsNZ/bugfix/uint_and_linear_formula

Change in the order of execution of the formula
This commit is contained in:
Jarrad 2017-06-16 14:24:21 +08:00 committed by GitHub
commit 29f65d0f9b
2 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ contract DevTokensHolder is Owned {
require(finalizedTime > 0 && getTime() > finalizedTime.add(months(6)));
uint256 canExtract = total.mul(getTime().sub(finalizedTime).div(months(24)));
uint256 canExtract = total.mul(getTime().sub(finalizedTime)).div(months(24));
canExtract = canExtract.sub(collectedTokens);

View File

@ -334,7 +334,7 @@ contract("StatusContribution", (accounts) => {
});
it("Devs Should be able to extract 1/2 after a year", async () => {
const t = Math.floor(new Date().getTime() / 1000) + (86400 * 360);
const t = (await statusContribution.finalizedTime()).toNumber() + (86400 * 360);
await devTokensHolder.setMockedTime(t);
const totalSupply = await snt.totalSupply();
@ -350,7 +350,7 @@ contract("StatusContribution", (accounts) => {
const calcTokens = web3.fromWei(totalSupply.mul(0.20).mul(0.5)).toNumber();
const realTokens = web3.fromWei(balance).toNumber();
assert.isBelow(realTokens - calcTokens, 0.1);
assert.equal(realTokens, calcTokens);
});
it("Devs Should be able to extract every thing after 2 year", async () => {