Clean Hemp Barracuda
High
looking at the Manager _raiseKeeper
Fee function, it uses controller. chargeFee to pull fees from the user's account. If chargeFee fails (e.g., insufficient funds), the entire transaction reverts. But the order is already marked as spent, so the user can't retry. This could lock funds permanently, which is a critical problem.
If _raiseKeeperFee
fails (e.g., due to insufficient user funds), the order is marked as isSpent = true
, but the fee is not charged. This permanently locks the order, preventing retries.
Code Reference:
function executeOrder(...) external {
// ... marks order as spent BEFORE fee handling ...
order.isSpent = true; // ❌ State changed before fee transfer
_handleKeeperFee(...); // May revert due to insufficient funds
}
No response
No response
Scenario:
- User Action: Alice places an order with
maxFee = 5 DSU
. - Keeper Execution: Bob spends gas to execute the order.
- Failure: Alice’s account has only
3 DSU
, causing_raiseKeeperFee
to revert. - Result: Order is marked
isSpent
, but Alice cannot retry.
- Funds Locked: Users cannot retry failed orders, losing access to their collateral.
- Denial-of-Service: Attackers can exploit this to lock legitimate users’ orders.
No response
- Mark orders as spent after successful fee handling.
- Use a temporary state to track execution progress.