Skip to content

Commit c87433e

Browse files
Aniket-Enggnventuro
authored andcommitted
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 a688977. * updates * fixes #1356 * Removed extra semicolon.
1 parent f3888bb commit c87433e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

contracts/bounties/BreakInvariantBounty.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ contract BreakInvariantBounty is PullPayment, Ownable {
4545
* @param target contract
4646
*/
4747
function claim(Target target) public {
48+
require(!_claimed);
4849
address researcher = _researchers[target];
4950
require(researcher != address(0));
5051
// Check Target contract invariants

test/BreakInvariantBounty.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ contract('BreakInvariantBounty', function ([_, owner, researcher, anyone, nonTar
9090
it('no longer accepts rewards', async function () {
9191
await assertRevert(ethSendTransaction({ from: owner, to: this.bounty.address, value: reward }));
9292
});
93+
94+
it('reverts when reclaimed', async function () {
95+
await assertRevert(this.bounty.claim(this.target.address, { from: researcher }));
96+
});
9397
});
9498
});
9599
});

0 commit comments

Comments
 (0)