The _matcho()
is not implemented properly
#1243
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
M-06
primary issue
Highest quality submission among a set of duplicates
selected for report
This submission will be included/highlighted in the audit report
Lines of code
https://github.com/code-423n4/2023-04-rubicon/blob/511636d889742296a54392875a35e4c0c4727bb7/contracts/RubiconMarket.sol#L1313
Vulnerability details
Impact
The
_matcho()
function is not implemented properly, it might revert while the taking amount is greater than the best offer's amount, leads to order matching failure.Proof of Concept
The following test script shows how to trigger the issue.
And the log details
Let's take a look at this line, we find the actual
take_amt
is0.9999e18 RUBI
rather than the expected1e18
, the difference is exact the 0.01% of fee.Back to source code, we can see the issue arises on L1313 of
_matcho()
, wherem_pay_amt
should be some thing likem_pay_amt + fee
.Tools Used
Manually review
Recommended Mitigation Steps
See PoC
The text was updated successfully, but these errors were encountered: