nascarsid / Boolien-Smart-Contracts

0 stars 1 forks source link

Recommend `Checks-Effects-Interactions Pattern` over use of `nonReentrant` function #3

Closed mudgen closed 2 years ago

mudgen commented 2 years ago

These functions:

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.