DeFiHardhatFoundry
250,000 USDC
View results
Submission Details
Severity: low
Invalid

Dust amount can be left in Market after partial order fulfillment

Summary

Order creator specifies minFillAmount when creates order. On partial fulfillment it decreases remaining size of current order. It means order can have size less than minFillAmount after such partial execution.

Here you can see it sets remaining amount:
https://github.com/Cyfrin/2024-05-beanstalk-the-finale/blob/df2dd129a878d16d4adc75049179ac0029d9a96b/protocol/contracts/beanstalk/market/MarketplaceFacet/Order.sol#L105

Impact

After partial order execution it will leaves unexecutable order in Market. That's because order size is less than min fillable amount, which is contrary to minFillAmount user specified in order creation.

Tools Used

Manual Review

Recommendations

function _fillPodOrder(
PodOrder calldata podOrder,
address filler,
uint256 index,
uint256 start,
uint256 podAmount,
LibTransfer.To mode
) internal {
...
- if (s.sys.podOrders[id] == 0) {
- delete s.sys.podOrders[id];
- }
+ if (s.sys.podOrders[id] < podOrder.minFillAmount) _cancelPodOrder(podOrder, LibTransfer.To.INTERNAL);
emit PodOrderFilled(...);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Lack of Validation for minFillAmount Less Than or Equal to podAmount in pod listing

Appeal created

T1MOH Submitter
12 months ago
inallhonesty Lead Judge
12 months ago
inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Lack of Validation for minFillAmount Less Than or Equal to podAmount in pod listing

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.