Skip to content

Instantly share code, notes, and snippets.

@JimLynchCodes
Created July 9, 2021 03:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JimLynchCodes/aef39d2c3b8301a408cfe3f82767c8e5 to your computer and use it in GitHub Desktop.
Save JimLynchCodes/aef39d2c3b8301a408cfe3f82767c8e5 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract EthMover is Ownable {
uint public totalDonations;
function donateEtherToContract() public payable {
totalDonations += msg.value;
}
function flushFunds() public payable onlyOwner {
payable(msg.sender).transfer(address(this).balance);
}
function fundsCurrentlyInContract() public view returns(uint) {
return address(this).balance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment