Skip to content

Instantly share code, notes, and snippets.

@codeWhizperer
Created August 1, 2022 17:49
Show Gist options
  • Select an option

  • Save codeWhizperer/a9631c1617401ff694c69e358153d39b to your computer and use it in GitHub Desktop.

Select an option

Save codeWhizperer/a9631c1617401ff694c69e358153d39b to your computer and use it in GitHub Desktop.
// 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