Bubble up revert data on failed Address.sendValue (#5379)

This commit is contained in:
Arr00
2024-12-17 06:48:40 -05:00
committed by GitHub
parent fad2b6e16b
commit 73b46e3bd1
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`Address`: bubble up revert data on `sendValue` failed call

View File

@ -35,9 +35,9 @@ library Address {
revert Errors.InsufficientBalance(address(this).balance, amount); revert Errors.InsufficientBalance(address(this).balance, amount);
} }
(bool success, ) = recipient.call{value: amount}(""); (bool success, bytes memory returndata) = recipient.call{value: amount}("");
if (!success) { if (!success) {
revert Errors.FailedCall(); _revert(returndata);
} }
} }