diff --git a/test/invariants/handlers/BaseHandler.t.sol b/test/invariants/handlers/BaseHandler.t.sol index 0b4c4da..19f0de0 100644 --- a/test/invariants/handlers/BaseHandler.t.sol +++ b/test/invariants/handlers/BaseHandler.t.sol @@ -35,6 +35,16 @@ contract BaseHandler is Setup, Actors { mapping(address _pledger => mapping(bytes32 _disputeId => uint256 _pledgedAmount)) internal _ghost_pledgesFor; mapping(address _pledger => mapping(bytes32 _disputeId => uint256 _pledgedAmount)) internal _ghost_pledgesAgainst; + function _stakeGRT(uint256 _amount) internal { + GRT.transfer(msg.sender, _amount); + + vm.prank(msg.sender); + GRT.approve(address(horizonStaking), _amount); + + vm.prank(msg.sender); + horizonStaking.stake(_amount); + } + // Helper functions function _getRandomChainId(uint256 _seed) internal view returns (string memory) { bytes32[] memory chainIds = eboRequestCreator.getAllowedChainIds(); diff --git a/test/invariants/properties/PropertyParent.t.sol b/test/invariants/properties/PropertyParent.t.sol index c6fa092..317bd7b 100644 --- a/test/invariants/properties/PropertyParent.t.sol +++ b/test/invariants/properties/PropertyParent.t.sol @@ -4,8 +4,9 @@ pragma solidity 0.8.26; import {PropertyDispute} from './PropertyDispute.t.sol'; import {PropertyFinalize} from './PropertyFinalize.t.sol'; +import {PropertyPropose} from './PropertyPropose.t.sol'; import {PropertyRequester} from './PropertyRequester.t.sol'; -contract PropertyParent is PropertyRequester, PropertyDispute, PropertyFinalize { +contract PropertyParent is PropertyRequester, PropertyPropose, PropertyDispute, PropertyFinalize { // | 11 | bonded token can never be used on behalf of someone else, unless allowed by the Horizon staking contract | | [ ] | } diff --git a/test/invariants/properties/PropertyPropose.t.sol b/test/invariants/properties/PropertyPropose.t.sol new file mode 100644 index 0000000..b5f9a27 --- /dev/null +++ b/test/invariants/properties/PropertyPropose.t.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.26; + +import {IEBORequestModule, IOracle} from '../Setup.t.sol'; +import {HandlerParent} from '../handlers/HandlerParent.t.sol'; + +contract PropertyPropose is HandlerParent { + /// @custom:property-id + /// @custom:property + function property_proposeBeforeDeadlineAndNoAnswer(uint256 _requestIdSeed, uint256 _responseIdSeed) public { + // Pick random Response + bytes32 _requestId = _getRandomRequestId(_requestIdSeed); + IOracle.Request memory _requestData = _ghost_requestData[_requestId]; + + // Stake some GRT in Horizon + _stakeGRT(DISPUTE_BOND_SIZE); + } +}