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

Add a vault to PostDeliveryCrowdsale. #1721

Merged
merged 7 commits into from
Apr 23, 2019

Conversation

nventuro
Copy link
Contributor

Fixes #1595.

PostDeliveryCrowdsale postpones the moment in which _deliverTokens is called until withdrawal time, which cause validation issues. For example, AllowanceCrowdsale calls transferFrom on _deliverTokens, so there are no guarantees that the tokens will actually be there once the crowdsale ends. Additionally, because the allowance was not being used, the number of tokens remaining was not updated. A similar scenario happens on a MintedCrowdsale with an ERC20Capped token.

This fixes that by calling _deliverTokens at the moment of purchase, transferring them to a contract that will hold them until PostDelivery allows for withdrawal (a mini token escrow).

@nventuro nventuro added bug contracts Smart contract code. labels Apr 17, 2019
@nventuro nventuro added this to the v2.3 milestone Apr 17, 2019
@nventuro nventuro requested a review from frangio April 17, 2019 21:40
@nventuro nventuro merged commit 97a9ca5 into OpenZeppelin:master Apr 23, 2019
@nventuro nventuro deleted the postdelivery-fix branch April 23, 2019 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug contracts Smart contract code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AllowanceCrowsale allows investors to buy more tokens than allowed
2 participants