Giter Site home page Giter Site logo

Comments (8)

Tunji17 avatar Tunji17 commented on September 3, 2024 1

I was trying to run these tests against a basic solmate implementation of the 4626 vault, I kept getting this error

Running 26 tests for test/Vault.t.sol:ERC4626StdTest
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] testFail_redeem((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] testFail_withdraw((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_deposit_redeem((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_deposit_withdraw((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_mint_redeem((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_mint_withdraw((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_redeem_deposit((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_redeem_mint((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_withdraw_deposit((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_withdraw_mint((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_asset((address[4],uint256[4],uint256[4],int256)) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_convertToAssets((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_convertToShares((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_deposit((address[4],uint256[4],uint256[4],int256),uint256,uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_maxDeposit((address[4],uint256[4],uint256[4],int256)) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_maxMint((address[4],uint256[4],uint256[4],int256)) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_maxRedeem((address[4],uint256[4],uint256[4],int256)) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_maxWithdraw((address[4],uint256[4],uint256[4],int256)) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_mint((address[4],uint256[4],uint256[4],int256),uint256,uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_previewDeposit((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_previewMint((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_previewRedeem((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_previewWithdraw((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_redeem((address[4],uint256[4],uint256[4],int256),uint256,uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_totalAssets((address[4],uint256[4],uint256[4],int256)) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_withdraw((address[4],uint256[4],uint256[4],int256),uint256,uint256) (runs: 0, μ: 0, ~: 0)
Test result: FAILED. 0 passed; 26 failed; finished in 11.18s

All the tests are failing out of the box, i have tried increasing FOUNDRY_FUZZ_MAX_TEST_REJECTS like you suggested, tried reducing FOUNDRY_FUZZ_RUNS which also didn’t work, I tried overiding some of the tests and limiting the assets value using the clamp function like you suggested still didn’t pass those tests and lastly i tried overriding the setUpVault and limiting the asset value also with the clamp function that didn’t work also

from erc4626-tests.

0xmonsoon avatar 0xmonsoon commented on September 3, 2024 1

I was trying to run these tests against a basic solmate implementation of the 4626 vault, I kept getting this error

Running 26 tests for test/Vault.t.sol:ERC4626StdTest
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] testFail_redeem((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] testFail_withdraw((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_deposit_redeem((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_deposit_withdraw((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_mint_redeem((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_mint_withdraw((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_redeem_deposit((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_redeem_mint((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_withdraw_deposit((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_RT_withdraw_mint((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_asset((address[4],uint256[4],uint256[4],int256)) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_convertToAssets((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_convertToShares((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_deposit((address[4],uint256[4],uint256[4],int256),uint256,uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_maxDeposit((address[4],uint256[4],uint256[4],int256)) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_maxMint((address[4],uint256[4],uint256[4],int256)) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_maxRedeem((address[4],uint256[4],uint256[4],int256)) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_maxWithdraw((address[4],uint256[4],uint256[4],int256)) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_mint((address[4],uint256[4],uint256[4],int256),uint256,uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_previewDeposit((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_previewMint((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_previewRedeem((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_previewWithdraw((address[4],uint256[4],uint256[4],int256),uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_redeem((address[4],uint256[4],uint256[4],int256),uint256,uint256) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_totalAssets((address[4],uint256[4],uint256[4],int256)) (runs: 0, μ: 0, ~: 0)
[FAIL. Reason: The `vm.assume` cheatcode rejected too many inputs (65536 allowed)] test_withdraw((address[4],uint256[4],uint256[4],int256),uint256,uint256) (runs: 0, μ: 0, ~: 0)
Test result: FAILED. 0 passed; 26 failed; finished in 11.18s

All the tests are failing out of the box, i have tried increasing FOUNDRY_FUZZ_MAX_TEST_REJECTS like you suggested, tried reducing FOUNDRY_FUZZ_RUNS which also didn’t work, I tried overiding some of the tests and limiting the assets value using the clamp function like you suggested still didn’t pass those tests and lastly i tried overriding the setUpVault and limiting the asset value also with the clamp function that didn’t work also

@Tunji17 Were you able to find a solution to the problem? I am facing the same issue. All tests fail due to vm.assume cheatcode rejected too many inputs

from erc4626-tests.

daejunpark avatar daejunpark commented on September 3, 2024

There are multiple options.

  1. You can simply increase the max_test_rejects value, like FOUNDRY_FUZZ_MAX_TEST_REJECTS=1000000 forge test. But this may increase the testing time.

  2. If only the maxDeposit test fails, you can override the test_maxDeposit() function to limit the assets value. For example, this shows how to clamp the fuzz inputs for test_maxWithdraw().

  3. If multiple tests fail due to the similar reason, and you don't want to test the scenarios with large asset balances, then you can override the setUpVault() function to limit the fuzz inputs similarly to the above. But this may exclude some edge case inputs, missing some bugs if any.

from erc4626-tests.

Tunji17 avatar Tunji17 commented on September 3, 2024

@daejunpark I have tried all the suggested options none of them seem to work

from erc4626-tests.

daejunpark avatar daejunpark commented on September 3, 2024

@Tunji17 would you mind providing reproduction examples for that?

from erc4626-tests.

Tunji17 avatar Tunji17 commented on September 3, 2024

@0xmonsoon No, i gave up and just used the tests provided by solmate, then converted the ones with input to fuzzy tests

from erc4626-tests.

0xdcota avatar 0xdcota commented on September 3, 2024

I am having the same problem as @Tunji17 and @0xmonsoon.

> forge --version
forge 0.2.0 (08a629a 2023-06-03T00:04:22.625130135Z)

from erc4626-tests.

Namaskar-1F64F avatar Namaskar-1F64F commented on September 3, 2024

SAME ISSUE

from erc4626-tests.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.