Is only modifier nonReentrant enought to protect against reetrancy or we still need to check success inside function
function withdraw() external nonReentrant {
5 uint256 amount = balanceOf[msg.sender];
6 balanceOf[msg.sender] = 0;
7 (bool success, ) = msg.sender.call.value(amount)("");
8 require(success, "Transfer failed.");
9 }
or this is enough?:
function withdraw() external nonReentrant {
5 uint256 amount = balanceOf[msg.sender];
6 balanceOf[msg.sender] = 0;
7
9 }