solidstate-network / solidstate-solidity

💠 Upgradeable-first Solidity smart contract development library 💠
https://discord.gg/BnvwfM6bRe
MIT License
437 stars 89 forks source link

replace `safeApprove` with `forceApprove` #239

Closed ItsNickBarry closed 5 months ago

ItsNickBarry commented 7 months ago

The existing safeApprove function is redundant at best (for reasons explained in the @dev natspec tag) and confusing at worst. This branch removes the zero-balance check and renames the function to forceApprove to prevent silent failure for users who update Solidstate. The name may be reverted to safeApprove in a future update, for consistency with the other SafeERC20 functions.

The SafeERC20 library does not have any tests, so thorough review is required.

ItsNickBarry commented 7 months ago

@startswithaj

ItsNickBarry commented 5 months ago

There's really nothing new here to test, so merging directly.