Cyfrin / 2023-07-escrow

17 stars 12 forks source link

Price invariants may break with negative rebasing tokena #867

Open codehawks-bot opened 11 months ago

codehawks-bot commented 11 months ago

Price invariants may break with negative rebasing tokena

Severity

Medium Risk

Summary

When the Escrow contract is used with a negative rebasing token it cannot send the desired amount.

Vulnerability Details

A negative rebasing token is decreasing the Token holders balance without a transfer. The Escrow contract is checking if the given price is transferred to the contract beforehand. However, it only does this in the constructor. Therefore if the balance decreases afterwards it will not hold true. This will result in the seller receiving less tokens. In worst case, on a dispute and a too high arbiterFee, all the tokens might get locked.

Impact

Seller receives wrong amount of tokens.

Tools Used

Manual Review

Recommendations

N/a