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

Maximum acceptable price #239

Closed
valiafetisov opened this issue Nov 11, 2021 · 1 comment
Closed

Maximum acceptable price #239

valiafetisov opened this issue Nov 11, 2021 · 1 comment

Comments

@valiafetisov
Copy link

During testing of liquidation auction bidding (using clipper contract), I got several Clipper/too-expensive errors. According to the name of the variable and the comment, max argument of the take function is Maximum acceptable price (DAI / collateral) [ray], but later in the code it is checked to be smaller than the price:

require(max >= price, "Clipper/too-expensive");

The Problem

To my understanding, maximum acceptable price argument suppose to prevent bidding on an auction that is too expensive, right? So, for example, if maximum acceptable price is 10 and auction price is 20, it should revert the transaction. But currently it's the opposite: it prevents the transactions which are cheaper then expected (which should be totally fine for the end user). Moreover it is even exclusive of the current auction price, so sending current price as maximum acceptable price will also revert the transaction. Or maybe I misunderstood the meaning of this argument?

The Solution

To change the validation to be:

require(price > max, "Clipper/too-expensive");
@valiafetisov
Copy link
Author

Never mind, I guess I misunderstood the meaning of require in solidity 😞

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

No branches or pull requests

1 participant