Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken hard cap for whitelisted investors #18

Closed
jakub-wojciechowski opened this issue Jul 24, 2017 · 1 comment
Closed

Broken hard cap for whitelisted investors #18

jakub-wojciechowski opened this issue Jul 24, 2017 · 1 comment

Comments

@jakub-wojciechowski
Copy link
Contributor

When a whitelisted investor is making a purchase the cap invariant check is skipped. This will allow a big whale investor to buy much more tokens than intended to be offered and put the whole crowd sale in jeopardy.

Test to demonstrate this bug:

it('whitelisted big whale investor should not exceed the cap', async function () {
    const cap = (await crowdsale.cap());
    const overCap = cap.mul(2);
    await crowdsale.addToWhitelist(investor);
    await crowdsale.buyTokens(investor, {value: overCap, from: investor}).should.be.rejectedWith(EVMThrow);
    const balance = await token.balanceOf(investor);
    const raised = await crowdsale.weiRaised();
    balance.should.be.bignumber.equal(0);
    raised.should.be.bignumber.most(cap);
  })
@maraoz
Copy link
Contributor

maraoz commented Aug 5, 2017

Severity assigned: high

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants