Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: ensure results are 0.1% from each other #187

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

0xteddybear
Copy link

No description provided.

Comment on lines +20 to +23
uint256 constant MIN_BALANCE = 100e18;
uint256 constant MIN_AMOUNT = 1e12;
uint256 constant TOLERANCE_PRECISION = 1e18;
uint256 constant MAX_TOLERANCE = 1e18 + 1e15; //0.1%
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what this whole thing means is 'ensure results are 0.1% from each other in every case where the amount to be traded is at most 8 orders of magnitude away from the pool's balance' which I think is pretty reasonable

used the same MIN_BALANCE as in bconst

@0xteddybear 0xteddybear requested a review from wei3erHase August 1, 2024 17:49
Copy link
Member

@wei3erHase wei3erHase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@0xteddybear 0xteddybear merged commit f80282e into feat/bmath-fuzz Aug 1, 2024
4 checks passed
@0xteddybear 0xteddybear deleted the feat/bmath-fuzz-coverage branch August 1, 2024 19:51
wei3erHase added a commit that referenced this pull request Aug 1, 2024
* feat: improving bmath fuzz test

* chore: updating Properties file

* feat: adding min amount to test environment

* test: ensure results are 0.1% from each other (#187)

---------

Co-authored-by: teddy <[email protected]>
wei3erHase added a commit that referenced this pull request Aug 2, 2024
* feat: echidna and halmos bmath bnum protocol

* fix: remove tests halmos cannot handle

* fix: setup cow pool

* chore(wip): echidna

* feat: clamp util

* feat(echidna): prop and tob erc20

* test(echidna): protocol prop (part)

* test(echidna): swap/join prop (part)

* test(echidna): all properties

* test(halmos): part

* feat: summary prop md and last tests

* chore: reorg

* feat: more bnum pain

* chore: format

Co-authored-by: Weißer Hase <[email protected]>

* chore: format

Co-authored-by: Weißer Hase <[email protected]>

* chore: typo

Co-authored-by: Weißer Hase <[email protected]>

* chore: typo

Co-authored-by: Weißer Hase <[email protected]>

* test(echidna): more bnum tests

* chore: unused import

* chore: more assert in protocol

* feat: evm version

* chore: summary

* fix: direct transfer then swapExactOut case

* chore: fmt

* feat: shanghai in summary

* fix: typo

* chore: typo

* chore: revert consistency

* chore: summary fmt

* chore: fmt

* Fix/fuzz tests improvements (#178)

* chore: fix linter setup

* chore: update smocked files

* chore: add missing spdx identifier

* chore: add an npm script to run echidna tests

* test: ensure SpotPriceAfterBelowSpotPriceBefore is never thrown

* chore: fix natspec issues

* test: ensure fuzz_joinExitPool body is runnable

* chore: cleaning up fuzz (#179)

* feat: creating BCoWPoolForTest to avoid modifying core contracts

* fix: test:echidna script

* fix: safeTransfer issue with echidna

* chore: update test contract licenses

* test: document property 25

* chore: remove unimplemented function

---------

Co-authored-by: Weißer Hase <[email protected]>

* chore: update forge snapshots

* chore: update gas snapshots

* chore: updating Properties document after merge

* dev: improving bmath fuzz test (#184)

* feat: improving bmath fuzz test

* chore: updating Properties file

* feat: adding min amount to test environment

* test: ensure results are 0.1% from each other (#187)

---------

Co-authored-by: teddy <[email protected]>

* docs: update test summary (#189)

* chore: fuzz sym fixes (#190)

* test: deal with previously commented code

* chore: pass name and symbol to ForTest contracts

* fix: work around hevm not supporting mcopy

* fix: remove unprovable property and replace it with two provable ones

---------

Co-authored-by: Weißer Hase <[email protected]>
Co-authored-by: teddy <[email protected]>
Co-authored-by: Weißer Hase <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants