-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Transfer replacement #1962
Transfer replacement #1962
Conversation
This should go into the 2.4 release, but I started the branch from |
Cherry-picking aftewards is the "protocol". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
4e57636
to
f5e354a
Compare
@@ -10,6 +10,7 @@ | |||
### New features: | |||
* `Address.toPayable`: added a helper to convert between address types without having to resort to low-level casting. ([#1773](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1773)) | |||
* Facilities to make metatransaction-enabled contracts through the Gas Station Network. ([#1844](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1844)) | |||
* `Address.sendValue`: added a replacement to Solidity's `transfer`, removing the fixed gas stipend. ([#1961](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1961)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nventuro should it be 1962?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good catch. I'll fix it on master
.
* Add Address.sendEther * Add documentation to sendEther * Add changelog entry * Rename sendEther to sendValue (cherry picked from commit 8d166f3)
This PR adds a replacement for Solidity's
transfer
, which imposes a fixed gas limit of 2300. While useful to prevent reentrancy issues, this has proved to be an issue due to gas repricings, like the one EIP1884 will introduce on the Instanbul hardfork.Given that the code to imitate
transfer
is tricky and cryptic, having a helper method to do it is a good idea.