The transfer member exposed by payable address types has been deprecated as it does not reliably execute and can fail in future updates of the EVM as it forwards a fixed gas stipend which is not compatible with gas cost EIP upgrades such as EIP-2929.
Example:
payable(recipient).transfer(royaltyAmount);
Recommendation:
We advise a safe wrapper library to be utilized instead such as the sendValue function of the Address library by OpenZeppelin which is guaranteed to execute under all circumstances.
MHB-01M: Deprecated Native Asset Transfer
Description:
The
transfer
member exposed bypayable
address types has been deprecated as it does not reliably execute and can fail in future updates of the EVM as it forwards a fixed gas stipend which is not compatible with gas cost EIP upgrades such as EIP-2929.Example:
Recommendation:
We advise a safe wrapper library to be utilized instead such as the
sendValue
function of theAddress
library by OpenZeppelin which is guaranteed to execute under all circumstances.