Skip to content

Commit

Permalink
test(halmos): part
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-something committed Jul 15, 2024
1 parent d12abd4 commit 8cde0c0
Show file tree
Hide file tree
Showing 9 changed files with 478 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/invariants/fuzz/external/BToken.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pragma solidity 0.8.23;

import {EchidnaTest} from '../../AdvancedTestsUtils.sol';
import {EchidnaTest} from '../../helpers/AdvancedTestsUtils.sol';
import {CryticERC20ExternalBasicProperties} from
'@crytic/properties/contracts/ERC20/external/properties/ERC20ExternalBasicProperties.sol';
import {ITokenMock} from '@crytic/properties/contracts/ERC20/external/util/ITokenMock.sol';
Expand Down
2 changes: 1 addition & 1 deletion test/invariants/fuzz/external/Protocol.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;

import {EchidnaTest, FuzzERC20} from '../../AdvancedTestsUtils.sol';
import {EchidnaTest, FuzzERC20} from '../../helpers/AdvancedTestsUtils.sol';

import {MockSettler} from './MockSettler.sol';
import {BCoWFactory, BCoWPool, IBPool} from 'contracts/BCoWFactory.sol';
Expand Down
2 changes: 1 addition & 1 deletion test/invariants/fuzz/internal/BMath.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;

import {EchidnaTest} from '../../AdvancedTestsUtils.sol';
import {EchidnaTest} from '../../helpers/AdvancedTestsUtils.sol';

import {BMath} from 'contracts/BMath.sol';

Expand Down
2 changes: 1 addition & 1 deletion test/invariants/fuzz/internal/BNum.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;

import {EchidnaTest} from '../../AdvancedTestsUtils.sol';
import {EchidnaTest} from '../../helpers/AdvancedTestsUtils.sol';

import {BNum} from 'contracts/BNum.sol';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;

import {Test} from 'forge-std/Test.sol';
import {MockERC20} from 'forge-std/mocks/MockERC20.sol';
import {SymTest} from 'halmos-cheatcodes/src/SymTest.sol';

Expand Down Expand Up @@ -60,4 +61,4 @@ contract EchidnaTest is AgentsHandler {
}
}

contract HalmosTest is SymTest {}
contract HalmosTest is SymTest, Test {}
21 changes: 21 additions & 0 deletions test/invariants/helpers/MockSettler.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;

import {GPv2Interaction, GPv2Trade, IERC20, ISettlement} from 'interfaces/ISettlement.sol';

contract MockSettler is ISettlement {
function domainSeparator() external view override returns (bytes32) {
return bytes32(hex'1234');
}

function vaultRelayer() external view override returns (address) {
return address(123);
}

function settle(
IERC20[] calldata tokens,
uint256[] calldata clearingPrices,
GPv2Trade.Data[] calldata trades,
GPv2Interaction.Data[][3] calldata interactions
) external {}
}
2 changes: 1 addition & 1 deletion test/invariants/symbolic/BMath.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;

import {HalmosTest} from '../AdvancedTestsUtils.sol';
import {HalmosTest} from '../helpers/AdvancedTestsUtils.sol';
import {BMath} from 'contracts/BMath.sol';

contract SymbolicBMath is BMath, HalmosTest {
Expand Down
5 changes: 2 additions & 3 deletions test/invariants/symbolic/BNum.t.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;

import {HalmosTest} from '../AdvancedTestsUtils.sol';
import {HalmosTest} from '../helpers/AdvancedTestsUtils.sol';
import {BNum} from 'contracts/BNum.sol';
import {Test} from 'forge-std/Test.sol';

contract SymbolicBNum is BNum, Test, HalmosTest {
contract SymbolicBNum is BNum, HalmosTest {
/////////////////////////////////////////////////////////////////////
// Bnum::btoi //
/////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit 8cde0c0

Please sign in to comment.