Skip to content

Conversation

@arr00
Copy link
Contributor

@arr00 arr00 commented Dec 16, 2024

Fixes #5184

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

@changeset-bot
Copy link

changeset-bot bot commented Dec 16, 2024

🦋 Changeset detected

Latest commit: 6583803

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@arr00 arr00 changed the title Revert with data on call failure from Address.sendValue Bubble up revert data on failed Address.sendValue Dec 16, 2024
@CodeSandwich
Copy link
Contributor

CodeSandwich commented Dec 16, 2024

Would the solution below be inferior? It seems that it should be exactly equivalent while deduplicating code.

function sendValue(address payable recipient, uint256 amount) internal {
    functionCallWithValue(address(recipient), "", amount);
}

@arr00
Copy link
Contributor Author

arr00 commented Dec 16, 2024

Would the solution below be inferior? It seems that it should be exactly equivalent while deduplicating code.

function sendValue(address payable recipient, uint256 amount) internal {
    functionCallWithValue(address(recipient), "", amount);
}

functioncallWithValue in turn calls verifyCallResultFromTarget which doesn't allow calling EOAs.

@CodeSandwich
Copy link
Contributor

Ahh, good point, I missed that detail 👍

@arr00 arr00 requested review from Amxx and ernestognw December 16, 2024 20:51
@Amxx Amxx merged commit 73b46e3 into OpenZeppelin:master Dec 17, 2024
17 checks passed
@Amxx Amxx added this to the 5.3 milestone Dec 17, 2024
@arr00 arr00 deleted the chore/revert-with-data-sendValue branch December 17, 2024 16:51
Amxx pushed a commit to Amxx/openzeppelin-contracts that referenced this pull request Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Address.sendValue doesn't bubble errors

3 participants