diff --git a/contracts/drafts/BreakInvariantBounty.sol b/contracts/drafts/BreakInvariantBounty.sol index 58d725980..8b039dedc 100644 --- a/contracts/drafts/BreakInvariantBounty.sol +++ b/contracts/drafts/BreakInvariantBounty.sol @@ -1,6 +1,7 @@ pragma solidity ^0.4.24; +import "../Initializable.sol"; import "../payment/PullPayment.sol"; import "../ownership/Ownable.sol"; @@ -9,12 +10,17 @@ import "../ownership/Ownable.sol"; * @title BreakInvariantBounty * @dev This bounty will pay out to a researcher if they break invariant logic of the contract. */ -contract BreakInvariantBounty is PullPayment, Ownable { +contract BreakInvariantBounty is Initializable, PullPayment, Ownable { bool private _claimed; mapping(address => address) private _researchers; event TargetCreated(address createdAddress); + function initialize() public initializer { + PullPayment.initialize(); + Ownable.initialize(); + } + /** * @dev Fallback function allowing the contract to receive funds, if they haven't already been claimed. */ diff --git a/contracts/mocks/BreakInvariantBountyMock.sol b/contracts/mocks/BreakInvariantBountyMock.sol index af3e60c57..e1848abb8 100644 --- a/contracts/mocks/BreakInvariantBountyMock.sol +++ b/contracts/mocks/BreakInvariantBountyMock.sol @@ -4,9 +4,10 @@ pragma solidity ^0.4.24; // See: https://github.com/ethereum/solidity/issues/4871 // solium-disable-next-line max-len import {BreakInvariantBounty, Target} from "../drafts/BreakInvariantBounty.sol"; +import "../Initializable.sol"; -contract TargetMock is Target { +contract TargetMock is Initializable, Target { bool private exploited; function exploitVulnerability() public { @@ -22,7 +23,11 @@ contract TargetMock is Target { } } -contract BreakInvariantBountyMock is BreakInvariantBounty { +contract BreakInvariantBountyMock is Initializable, BreakInvariantBounty { + constructor() public { + BreakInvariantBounty.initialize(); + } + function _deployContract() internal returns (address) { return new TargetMock(); }