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 whitelist/blacklist tests #56

Open
wants to merge 108 commits into
base: master
Choose a base branch
from
Open

Add whitelist/blacklist tests #56

wants to merge 108 commits into from

Conversation

brudaswen
Copy link

Fix invalid calculation of byStage.returnedETH that lead to delivery of too many tokens.

mickys and others added 30 commits November 18, 2019 10:58
…, participant avaliable actions, participant commit and validation, whitelister
* Added latest ganache-core and ganache-cli to project

* Added nvm instructions and upgraded to node 8.17.0

* Added websocket into dependencies to fix install
* Refacator init()

* Addresses Fabian's comments

* Fix stages' start/end blocks as discussed

* Rename 'newStageEndBlock' to 'lastStageEndBlock'

* Make test initialization consistent with the rICO

* Fix bug stageId return bug in getStageAtBlock() and update tests

* Modify init so stageCount is indicating the precise number of stages

* Use  safeMath and minor fixes

* Rename lastStageEndBlock to previousStageEndBlock as per Micky's suggestion

* Fix compiler error and warning
* Refacator init()

* Use  safeMath and minor fixes

* Turn msg.sender/value into parameters in commit() + minor fixes

* Fix compiler error and warning

* Fix test (now 1st participant has id 0)

* Make recordNewContribution() internal for making it extenndable

* Make commit() public
mickys and others added 30 commits February 14, 2020 12:36
…t-state-after-cancellation

Fix: Inconsistent contract state after cancellation
Cancellation adds the returned amount to the global `returnedETH`.

However, for the `aggregatedState` and the `byStageState` the amount is added to `withdrawnETH`. This leads to an inconcistent state and miscalculations during accept.
Accepting tokens calculations wrong pending ETH amount (`newAcceptedValue`). The `returnedETH` amount is not taken into account which leads to delivery of too many tokens.
… whitelisted, is accepted automatically.`

Test case used old array key names.
…(value), account has 2 contributions`

Test used old old `ParticipantStageDetails` name.
…tract`

Calculation of `tokensInStage` in helpers.utils.getAvailableEthAndTokensForWithdraw() was wrong
Cleanup comments and fix some typos
…contract-state-after-cancellation

Check global state after cancelled contribution
…vered

Cancelling before white-listing should not deliver too many tokens later
Fix test `new contribution from the TestAcceptParticipant that is now whitelisted, is accepted automatically.`
Fix cancellation test `value < rico.minContribution results in cancel(value), account has 2 contributions`
Fix Flow test `participant can withdraw by sending tokens back to contract`
…ter-cancel

Fix `returnedETH` calculation on cancel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants