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

Improve encapsulation on BreakInvariantBounty #1267

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions contracts/bounties/BreakInvariantBounty.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,24 @@ import "../payment/PullPayment.sol";
* @dev This bounty will pay out to a researcher if they break invariant logic of the contract.
*/
contract BreakInvariantBounty is PullPayment, Ownable {
bool public claimed;
mapping(address => address) public researchers;
bool private claimed_;
mapping(address => address) private researchers;

event TargetCreated(address createdAddress);

/**
* @dev Fallback function allowing the contract to receive funds, if they haven't already been claimed.
*/
function() external payable {
require(!claimed);
require(!claimed_);
}

/**
* @dev Determine if the bounty was claimed.
* @return true if the bounty was claimed, false otherwise.
*/
function claimed() public view returns(bool) {
return claimed_;
}

/**
Expand All @@ -43,7 +51,7 @@ contract BreakInvariantBounty is PullPayment, Ownable {
// Check Target contract invariants
require(!_target.checkInvariant());
_asyncTransfer(researcher, address(this).balance);
claimed = true;
claimed_ = true;
}

/**
Expand Down