Skip to content

Commit 73b46e3

Browse files
authored
Bubble up revert data on failed Address.sendValue (#5379)
1 parent fad2b6e commit 73b46e3

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)