Created
August 1, 2022 17:49
-
-
Save codeWhizperer/a9631c1617401ff694c69e358153d39b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity ^0.8.4; | |
| /// ogbeni | |
| error Unauthorized(); | |
| /// @custom:experimental This is an experimental contract. | |
| contract VendingMachine { | |
| address payable owner = payable(msg.sender); | |
| function withdraw() public { | |
| if (msg.sender != owner) | |
| revert Unauthorized(); | |
| owner.transfer(address(this).balance); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment