sherlock-audit / 2024-05-elfi-protocol-judging

11 stars 7 forks source link

nikhil840096 - Missing Function Signature in Diamond Proxy Contract Deployment #239

Closed sherlock-admin3 closed 3 months ago

sherlock-admin3 commented 3 months ago

nikhil840096

Medium

Missing Function Signature in Diamond Proxy Contract Deployment

Summary

During the deployment of the Diamond Proxy Contract, an issue has been identified where the function present in the facets but not being added correctly. Specifically, the cancelClaimRewards() function from feefaucet.sol is missing from the interface IFEE.sol. This oversight results in the absence of this function's signature in the facet list, potentially leading to unintended disruptions in the protocol's functionality.

Vulnerability Detail

In the Diamond Proxy pattern, facets are used to implement specific functionalities which can be added or removed dynamically. During the deployment, each facet's interface is used to generate function signatures, which are then included in the facet list. These function signatures are crucial for routing calls to the correct facet functions.

However, it has been observed that the cancelClaimRewards() function present in feefaucet.sol is not included in the IFEE.sol interface. This omission leads to the absence of the cancelClaimRewards() function signature during the deployment process.

Impact

Users who will want to cancel there clamReward request they will not be able to cancel it.

Code Snippet

https://github.com/sherlock-audit/2024-05-elfi-protocol/blob/main/elfi-perp-contracts/contracts/facets/FeeFacet.sol#L47 https://github.com/sherlock-audit/2024-05-elfi-protocol/blob/main/elfi-perp-contracts/contracts/interfaces/IFee.sol

Tool used

Manual Review

Recommendation

Update the Interface: Include the cancelClaimRewards() function in the IFEE.sol interface.

nevillehuang commented 3 months ago

Invalid, FeeFacet.sol is OOS of this contest