Skip to content

Removed selfdestruct from BreakInvariantBounty#1385

Merged
nventuro merged 21 commits into
OpenZeppelin:masterfrom
Aniket-Engg:fix/#1384
Oct 8, 2018
Merged

Removed selfdestruct from BreakInvariantBounty#1385
nventuro merged 21 commits into
OpenZeppelin:masterfrom
Aniket-Engg:fix/#1384

Conversation

@Aniket-Engg

Copy link
Copy Markdown
Contributor

Fixes #1384

Removed selfdestruct from BreakInvariantBounty and related test cases

@nventuro

nventuro commented Oct 5, 2018

Copy link
Copy Markdown
Contributor

Hi @Aniket-Engg, thanks for promptly tackling this! However, we should just remove the function - we should have a function with the same functionality: transferring all balance to the owner, and not letting the bounty continue to be used.

@Aniket-Engg

Aniket-Engg commented Oct 5, 2018

Copy link
Copy Markdown
Contributor Author
function abortBounty() public onlyOwner {
     _asyncTransfer(owner(), address(this).balance);
    _claimed = true;
  }

Should it be something like this? @nventuro

@nventuro

nventuro commented Oct 5, 2018

Copy link
Copy Markdown
Contributor

That's a good starting point. A couple ideas:

  • Let's rename _claimed to ongoing, now that a bounty may not be claimable due to the owner canceling it.
  • I think cancel is a better verb choice than abort in this context, since there's no ongoing process to abort. We should also emit a Canceled event.
  • We should add a require in cancelBounty so that it can only be canceled once.

Let me know what you think!

@Aniket-Engg

Aniket-Engg commented Oct 5, 2018

Copy link
Copy Markdown
Contributor Author

what are your thoughts behind choosing ongoing when bounty is getting cancelled? @nventuro

@nventuro

nventuro commented Oct 5, 2018

Copy link
Copy Markdown
Contributor

Currently, a bounty may be not claimed, claimed, or destroyed. A cancelled bounty is obviously not claimed, so we need a better word. I suggested 'ongoing', but 'claimable' may be better (a canceled bounty is not claimable).

@Aniket-Engg

Aniket-Engg commented Oct 5, 2018

Copy link
Copy Markdown
Contributor Author

claimable looks fine.
should we also add an event emission in claim function too? @nventuro

@Aniket-Engg

Copy link
Copy Markdown
Contributor Author

@nventuro Please check the changes and let me know your views. I will add tests for cancelBounty once it is final.

Comment thread contracts/bounties/BreakInvariantBounty.sol Outdated

@nventuro nventuro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @Aniket-Engg! I only have two minor suggestions, feel free to add tests so we can merge this :)

Comment thread contracts/bounties/BreakInvariantBounty.sol Outdated

@nventuro nventuro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this @Aniket-Engg, love how fast you're closing issues! 🙌

@Aniket-Engg

Copy link
Copy Markdown
Contributor Author

I am also loving being a part of it. Thanks for your appreciation. 😊

nventuro pushed a commit to nventuro/openzeppelin-contracts that referenced this pull request Oct 18, 2018
* signing prefix added

* Minor improvement

* Tests changed

* Successfully tested

* Minor improvements

* Minor improvements

* Revert "Dangling commas are now required. (OpenZeppelin#1359)"

This reverts commit a688977.

* updates

* fixes OpenZeppelin#1384

* introduced claimable and cancelBounty

* cancelBounty tests

* Update BreakInvariantBounty.test.js

(cherry picked from commit 41f84f8)
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

Successfully merging this pull request may close these issues.

2 participants