Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bubble up revert data on failed Address.sendValue #5379

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

arr00
Copy link
Contributor

@arr00 arr00 commented Dec 16, 2024

Fixes #5184

PR Checklist

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

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 ernestognw and Amxx 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
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