diff --git a/.changeset/cyan-taxis-travel.md b/.changeset/cyan-taxis-travel.md new file mode 100644 index 00000000000..bd90e07f3f3 --- /dev/null +++ b/.changeset/cyan-taxis-travel.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`Address`: bubble up revert data on `sendValue` failed call diff --git a/contracts/account/utils/draft-ERC4337Utils.sol b/contracts/account/utils/draft-ERC4337Utils.sol index 8ee917b8d36..2ffdfb3cd8b 100644 --- a/contracts/account/utils/draft-ERC4337Utils.sol +++ b/contracts/account/utils/draft-ERC4337Utils.sol @@ -115,7 +115,7 @@ library ERC4337Utils { return uint128(self.accountGasLimits.extract_32_16(0)); } - /// @dev Returns `accountGasLimits` from the {PackedUserOperation}. + /// @dev Returns `callGasLimit` from the {PackedUserOperation}. function callGasLimit(PackedUserOperation calldata self) internal pure returns (uint256) { return uint128(self.accountGasLimits.extract_32_16(16)); } @@ -155,7 +155,7 @@ library ERC4337Utils { return self.paymasterAndData.length < 52 ? 0 : uint128(bytes16(self.paymasterAndData[36:52])); } - /// @dev Returns the forth section of `paymasterAndData` from the {PackedUserOperation}. + /// @dev Returns the fourth section of `paymasterAndData` from the {PackedUserOperation}. function paymasterData(PackedUserOperation calldata self) internal pure returns (bytes calldata) { return self.paymasterAndData.length < 52 ? _emptyCalldataBytes() : self.paymasterAndData[52:]; } diff --git a/contracts/interfaces/draft-IERC7579.sol b/contracts/interfaces/draft-IERC7579.sol index 8f9ba08dd9c..aa86880c188 100644 --- a/contracts/interfaces/draft-IERC7579.sol +++ b/contracts/interfaces/draft-IERC7579.sol @@ -121,7 +121,7 @@ interface IERC7579Execution { * MUST ensure adequate authorization control: e.g. onlyEntryPointOrSelf if used with ERC-4337 * If a mode is requested that is not supported by the Account, it MUST revert */ - function execute(bytes32 mode, bytes calldata executionCalldata) external; + function execute(bytes32 mode, bytes calldata executionCalldata) external payable; /** * @dev Executes a transaction on behalf of the account. @@ -136,7 +136,7 @@ interface IERC7579Execution { function executeFromExecutor( bytes32 mode, bytes calldata executionCalldata - ) external returns (bytes[] memory returnData); + ) external payable returns (bytes[] memory returnData); } /** diff --git a/contracts/utils/Address.sol b/contracts/utils/Address.sol index a1c8af296ce..d8e88749148 100644 --- a/contracts/utils/Address.sol +++ b/contracts/utils/Address.sol @@ -35,9 +35,9 @@ library Address { revert Errors.InsufficientBalance(address(this).balance, amount); } - (bool success, ) = recipient.call{value: amount}(""); + (bool success, bytes memory returndata) = recipient.call{value: amount}(""); if (!success) { - revert Errors.FailedCall(); + _revert(returndata); } }