-
Notifications
You must be signed in to change notification settings - Fork 18
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
fix: change from transfer to call value #189
Conversation
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.
Test missing, you can check by sending ETH to a contract that cannot doesnt have the fallback set.
@@ -70,9 +70,10 @@ contract Avatar is Ownable { | |||
* @return bool which represents success | |||
*/ | |||
function sendEther(uint256 _amountInWei, address payable _to) public onlyOwner returns (bool) { | |||
_to.transfer(_amountInWei); | |||
(bool sent, bytes memory data) = _to.call.value(_amountInWei)(""); | |||
require(sent, "Failed to send ethers"); |
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.
Change menssage to "eth transfer failed"
You've written a test for this one already in
|
2c7ba87
to
e4d0e71
Compare
e4d0e71
to
1104139
Compare
Issue: #84
Change from
transfer
to.call.value