Closed sherlock-admin3 closed 6 months ago
Escalate
This is a valid issue, duplicate of #269
Escalate
This is a valid issue, duplicate of #269
You've created a valid escalation!
To remove the escalation from consideration: Delete your comment.
You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.
Agree with the escalation, planning to accept and duplicate with #269
Result: High Duplicate of #269
fugazzi
medium
Edition minting is supposed to refund unused fees to caller but forwards all value to FeeManager
Summary
The different variants of mint in the Edition are supposed to refund the caller with the unused amount of ETH. However, since all ETH is forwarded to the FeeManager, no refunds are issued as the Edition contract is always empty.
Vulnerability Detail
All of the different variants of the mint function in the Edition contract expect to refund the caller about unused ETH via the
_refundExcess()
internal function. For example, this is the implementation one of themint()
functions:The implementation of
_refundExcess()
correctly transfers ETH back to the caller. However, all ETH is transferred in the call tocollectMintFee()
, and the FeeManager doesn't issue any refund.This means that all mint variants of mint (
mint()
,mintWithComment()
,mintBatch()
) will transfer all ETH to the FeeManager, breaking refunds as the Edition contract will have null balance, even if there was an actual excess in fees.Proof of concept
Impact
Any unused fee won't be refunded to the caller and will be left in the FeeManager contract.
Code Snippet
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/editions/Edition.sol#L241
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/editions/Edition.sol#L267
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/editions/Edition.sol#L296
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/editions/Edition.sol#L319
Tool used
Manual Review
Recommendation
FeeManager should refund unused ETH to the caller (the Edition in this case) so that the Edition contract can refund the original caller.
Duplicate of #269