Option buys do not refund or reject over-payments #51
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2022-05-cally/blob/1849f9ee12434038aa80753266ce6a2f2b082c59/contracts/src/Cally.sol#L224
Vulnerability details
Impact
Buyers are over-charged if they send too much in order to try to make the payment not revert due to the dutch auction's price decrease schedule
Proof of Concept
The
buyOption()
function uses>=
rather than==
, and does not refund excess:https://github.com/code-423n4/2022-05-cally/blob/1849f9ee12434038aa80753266ce6a2f2b082c59/contracts/src/Cally.sol#L224
Incorrect amounts are rejected when payments are made for exercises, so at the very least things are inconsistent:
https://github.com/code-423n4/2022-05-cally/blob/1849f9ee12434038aa80753266ce6a2f2b082c59/contracts/src/Cally.sol#L271-L272
Tools Used
Code inspection
Recommended Mitigation Steps
Reject amounts over the actual price, or refund the excess
The text was updated successfully, but these errors were encountered: