Skip to content

Instantly share code, notes, and snippets.

@nathan-websculpt
Created September 16, 2021 12:17
Show Gist options
  • Save nathan-websculpt/9d89d60a8efd09c1fcaaee719e5d6385 to your computer and use it in GitHub Desktop.
Save nathan-websculpt/9d89d60a8efd09c1fcaaee719e5d6385 to your computer and use it in GitHub Desktop.
Send Ether via call method
function sendViaCall(address payable _to) public payable {
(bool sent, bytes memory data) = _to.call{value:msg.value}("");
require(sent, "Failed to send Ether");
}
@nathan-websculpt
Copy link
Author

Used as an example in This Blog Post

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment