Closed sherlock-admin2 closed 10 months ago
1 comment(s) were left on this issue during the judging contest.
auditsea commented:
No facet functions require native value
1 comment(s) were left on this issue during the judging contest.
auditsea commented:
No facet functions require native value
Invalid, native eth is not supported as a collateral type
Bauchibred
medium
Diamond.sol's
fallback()
seems to be erroneously implementedProof of Concept
Take a look at Diamond.sol#L42-L65
As seen thiks function is used toi find a faceet for any fnunction that is called abd theb it later on executes the function after finding the facet while returning the value from the function.
Issue as has been hinted by the @audit tag is that while this function is caling anyfact, being payable some of the function are going to need the msg.value to be passed, but while delegate calling the function msg.value is not passed and as such any function that needs value ends up reverting
Impact
Asides what's been explained in the Proof of Concept, functions that need value passed to them in order to execute are being wrongly queried and protocol can't rightly access this, i.e since no value are forwarded breaks protocol's core functionality
Code Snippet
https://github.com/sherlock-audit/2023-12-ubiquity/blob/d9c39e8dfd5601e7e8db2e4b3390e7d8dff42a8e/ubiquity-dollar/packages/contracts/src/dollar/Diamond.sol#L42-L65
Recommended Mitigation Steps
While delegate calling, pass the
msg.value
provided