Skip to content

Commit abf6574

Browse files
arr00Amxx
authored andcommitted
Bubble up revert data on failed Address.sendValue (OpenZeppelin#5379)
Signed-off-by: Hadrien Croubois <[email protected]>
1 parent 8d57151 commit abf6574

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/cyan-taxis-travel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'openzeppelin-solidity': minor
3+
---
4+
5+
`Address`: bubble up revert data on `sendValue` failed call

contracts/utils/Address.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ library Address {
3535
revert Errors.InsufficientBalance(address(this).balance, amount);
3636
}
3737

38-
(bool success, ) = recipient.call{value: amount}("");
38+
(bool success, bytes memory returndata) = recipient.call{value: amount}("");
3939
if (!success) {
40-
revert Errors.FailedCall();
40+
_revert(returndata);
4141
}
4242
}
4343

0 commit comments

Comments
 (0)