A necessary part of a put option is the receipt of the assets 'put' to the put-option seller, when the put buyer exercises the option. If the seller is unable to get the assets put to them, they lose their capital.
Proof of Concept
If order.baseAsset is a token that reverts if the amount transferred is zero, and the fee ends up being zero, all attempts to withdraw assets will fail:
Lines of code
https://github.com/code-423n4/2022-06-putty/blob/3b6b844bc39e897bd0bbb69897f2deff12dc3893/contracts/src/PuttyV2.sol#L499-L500
Vulnerability details
Impact
A necessary part of a put option is the receipt of the assets 'put' to the put-option seller, when the put buyer exercises the option. If the seller is unable to get the assets put to them, they lose their capital.
Proof of Concept
If
order.baseAsset
is a token that reverts if the amount transferred is zero, and the fee ends up being zero, all attempts to withdraw assets will fail:https://github.com/code-423n4/2022-06-putty/blob/3b6b844bc39e897bd0bbb69897f2deff12dc3893/contracts/src/PuttyV2.sol#L499-L500
LEND is a specific example of an extant token that has this behavior, and will cause assets to be locked.
Tools Used
Code inspection
Recommended Mitigation Steps
Do not call
safeTransfer()
iffeeAmount
is zero