-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Implement partial refunds in CappedCrowdsale. #499
Implement partial refunds in CappedCrowdsale. #499
Conversation
Make purchases valid if the cap hasn't been reach, despite its value.
It was moved to an internal method that also receives the amount of wei to be spent on the purchase.
A parameter was added in order to have way to control how much is forwarded to the wallet.
This changes the behaviour when a transaction's value plus the previous raised amount of wei exceeds the cap. We now accept just enough wei to reach de cap, and refund the rest.
9c9563e
to
cc74368
Compare
@alcuadrado Interesting! What about a sender who only wants the exact amount that she intended to buy? |
@alcuadrado ping? |
@martriay The semantic of this operation is changed to "buy tokens up-to X wei". There are multiple reasons why I think this change is a good thing:
|
@alcuadrado I love the idea but I don't like the implementation very much =/ |
@ajsantander I don't like this implementation either. I think it would be better to close this PR and reimplement it after #744 gets merged, as that PR it's pretty much an overhaul of everything crowdsale. |
Closing as stale. It is however still true that the last purchasers will need to not go over the cap to prevent triggering a revert. |
This PR modifies the behaviour of CappedCrowdsale when a transaction whose value is larger than the amount needed to reach the cap. Now CappedCrowdsale accepts just enough to reach the cap, and refunds the rest.