Prevents Bounty from being claimed twice (#1374)

* signing prefix added

* Minor improvement

* Tests changed

* Successfully tested

* Minor improvements

* Minor improvements

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

This reverts commit a6889776f4.

* updates

* fixes #1356

* Removed extra semicolon.
pull/1377/head
Aniket 6 years ago committed by Nicolás Venturo
parent f3888bb0b0
commit c87433e0c2
  1. 1
      contracts/bounties/BreakInvariantBounty.sol
  2. 4
      test/BreakInvariantBounty.test.js

@ -45,6 +45,7 @@ contract BreakInvariantBounty is PullPayment, Ownable {
* @param target contract
*/
function claim(Target target) public {
require(!_claimed);
address researcher = _researchers[target];
require(researcher != address(0));
// Check Target contract invariants

@ -90,6 +90,10 @@ contract('BreakInvariantBounty', function ([_, owner, researcher, anyone, nonTar
it('no longer accepts rewards', async function () {
await assertRevert(ethSendTransaction({ from: owner, to: this.bounty.address, value: reward }));
});
it('reverts when reclaimed', async function () {
await assertRevert(this.bounty.claim(this.target.address, { from: researcher }));
});
});
});
});

Loading…
Cancel
Save