BreakInvariantBountyMock.sol 660 B

12345678910111213141516171819202122232425262728
  1. pragma solidity ^0.4.24;
  2. // When this line is split, truffle parsing fails.
  3. // See: https://github.com/ethereum/solidity/issues/4871
  4. // solium-disable-next-line max-len
  5. import {BreakInvariantBounty, Target} from "../bounties/BreakInvariantBounty.sol";
  6. contract TargetMock is Target {
  7. bool private exploited;
  8. function exploitVulnerability() public {
  9. exploited = true;
  10. }
  11. function checkInvariant() public returns (bool) {
  12. if (exploited) {
  13. return false;
  14. }
  15. return true;
  16. }
  17. }
  18. contract BreakInvariantBountyMock is BreakInvariantBounty {
  19. function _deployContract() internal returns (address) {
  20. return new TargetMock();
  21. }
  22. }