Use the nonReentrant modifier. But they could use the Checks-Effects-Interactions Pattern instead. Put all transfers/external function calls at the end of a function.
I recommend using the Checks-Effects-Interactions Pattern instead of the nonReentrant modifier because it a secure way to write Solidity in general and because it costs less gas. The nonReentrant modifier adds gas cost to function execution.
These functions:
withdraw(uint256 amount)
buyItem
finalizeBid
Use the
nonReentrant
modifier. But they could use the Checks-Effects-Interactions Pattern instead. Put all transfers/external function calls at the end of a function.I recommend using the Checks-Effects-Interactions Pattern instead of the
nonReentrant
modifier because it a secure way to write Solidity in general and because it costs less gas. ThenonReentrant
modifier adds gas cost to function execution.