contract SaveMoney { function withdrawMoney() public payable { require(msg.sender == 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4, "not the first remix address"); msg.sender.call{value: viewBalance()}(""); } function viewBalance() public view returns (uint256) { return address(this).balance; } // anyone can send receive() external payable { } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter