This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Re-entrancy Vulnerability (Critical) | |
In sellOption function of contract, the code allows a user to reenter into contract before the state is modified. | |
```javascript | |
IERC721(market).safeTransferFrom(msg.sender, order.maker, optionId); | |
IERC20(weth).safeTransferFrom(order.maker, msg.sender, saleProceeds); | |
IERC20(weth).safeTransferFrom(order.maker, feeRecipient, ask - saleProceeds); | |
``` | |
Fix: Update state before doing any transfers. | |
```javascript |