Transaction failure when trying to send ETH from a contract with the "call" function #5249
Unanswered
SmithJohnsonE
asked this question in
Q&A
Replies: 1 comment 6 replies
-
@SmithJohnsonE Could you please tell me about this? address(0x42E4E9bBb3cBAef2E40AD0750c7Ce5A89e4e3982).balance What is the balance of this address? and do you have that much balance in the contract to withdraw? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
according to Lesson 4, one of the ways to send ETH from a contract is with call. As mentioned in the course, this has not a maximum gas cap like the transfer and send functions.
However, when I have the following, for a reason I get a failure.
(bool CallSuccess,)=payable(msg.sender).call{value: address(0x42E4E9bBb3cBAef2E40AD0750c7Ce5A89e4e3982).balance}("");
require(CallSuccess,"Call failed");
Your help would be priceless!!!
P.S. I am working on Sepolia network.
Beta Was this translation helpful? Give feedback.
All reactions