Skip to content

Commit

Permalink
test: more assumes
Browse files Browse the repository at this point in the history
  • Loading branch information
xenide committed Dec 7, 2024
1 parent 87c3c48 commit b986d31
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/large/ReservoirPriceOracleLarge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ contract ReservoirPriceOracleLargeTest is ReservoirPriceOracleTest {
aTokenAAddress.code.length == 0 && aTokenBAddress.code.length == 0 && aTokenCAddress.code.length == 0
&& aTokenCAddress.code.length == 0
);
assumeNotPrecompile(aTokenAAddress);
assumeNotPrecompile(aTokenBAddress);
assumeNotPrecompile(aTokenCAddress);
assumeNotPrecompile(aTokenDAddress);
assumeNotZeroAddress(aTokenAAddress);
assumeNotZeroAddress(aTokenBAddress);
assumeNotZeroAddress(aTokenCAddress);
assumeNotZeroAddress(aTokenDAddress);
uint256 lPrice1 = bound(aPrice1, 1e12, 1e24);
uint256 lPrice2 = bound(aPrice2, 1e12, 1e24);
uint256 lPrice3 = bound(aPrice3, 1e12, 1e24);
Expand Down
10 changes: 10 additions & 0 deletions test/unit/ReservoirPriceOracle.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ contract ReservoirPriceOracleTest is BaseTest {
) external {
// assume
vm.assume(aTokenAAddress.code.length == 0 && aTokenBAddress.code.length == 0);
assumeNotPrecompile(aTokenAAddress);
assumeNotPrecompile(aTokenBAddress);
assumeNotZeroAddress(aTokenAAddress);
assumeNotZeroAddress(aTokenBAddress);
uint256 lPrice = bound(aPrice, 1, 1e36);
uint256 lAmtIn = bound(aAmtIn, 0, 1_000_000_000);
uint256 lTokenADecimal = bound(aTokenADecimal, 0, 18);
Expand Down Expand Up @@ -306,6 +310,12 @@ contract ReservoirPriceOracleTest is BaseTest {
) external {
// assume
vm.assume(aTokenAAddress.code.length == 0 && aTokenBAddress.code.length == 0 && aTokenCAddress.code.length == 0);
assumeNotPrecompile(aTokenAAddress);
assumeNotPrecompile(aTokenBAddress);
assumeNotPrecompile(aTokenCAddress);
assumeNotZeroAddress(aTokenAAddress);
assumeNotZeroAddress(aTokenBAddress);
assumeNotZeroAddress(aTokenCAddress);
uint256 lPrice1 = bound(aPrice1, 1e9, 1e25); // need to bound price within this range as a price below this will go to zero as during the mul and div of prices
uint256 lPrice2 = bound(aPrice2, 1e9, 1e25);
uint256 lAmtIn = bound(aAmtIn, 0, 1_000_000_000);
Expand Down

0 comments on commit b986d31

Please sign in to comment.