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

Echidna testing and flat fee introduction #312

Merged
merged 13 commits into from
Sep 5, 2020
Merged

Echidna testing and flat fee introduction #312

merged 13 commits into from
Sep 5, 2020

Conversation

alcueca
Copy link
Collaborator

@alcueca alcueca commented Sep 2, 2020

After echidna testing on trade and trade reversals, a precision of 64 bits for iterative arithmetic and a flat fee of 10**12 wei Dai on trades were imposed.

contracts/echidna/YieldMathEchidna.sol Outdated Show resolved Hide resolved
contracts/echidna/YieldMathEchidna.sol Outdated Show resolved Hide resolved
contracts/echidna/YieldMathEchidna.sol Outdated Show resolved Hide resolved
contracts/echidna/YieldMathEchidna.sol Outdated Show resolved Hide resolved
contracts/echidna/YieldMathEchidna.sol Outdated Show resolved Hide resolved
contracts/mocks/YieldMath64.sol Show resolved Hide resolved
contracts/mocks/YieldMath64.sol Show resolved Hide resolved
contracts/pool/YieldMath.sol Outdated Show resolved Hide resolved
test/echidna/601_liquidity_invariant.ts Outdated Show resolved Hide resolved
test/pool/206_yield_math.ts Show resolved Hide resolved
Copy link
Contributor

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

LGTM - 2 minor comments, thanks for this. Super useful.

assert(daiOut <= daiIn);
}

function testLiquidityDaiOutForYDaiIn(uint128 daiReserves, uint128 yDAIReserves, uint128 yDaiIn, uint128 timeTillMaturity)
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait, even with the fee the invariant doesn't always grow?

contracts/echidna/YieldMathEchidna.sol Outdated Show resolved Hide resolved
@alcueca alcueca merged commit 439fa64 into master Sep 5, 2020
@gakonst gakonst deleted the new/echidna branch September 23, 2020 11:23
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.

None yet

4 participants