Skip to content

Instantly share code, notes, and snippets.

@KenMan79
Forked from JimLynchCodes/EthMover.sol
Created July 9, 2021 22:49
Show Gist options
  • Save KenMan79/1b4f6868615d6bb3753f905b01e51727 to your computer and use it in GitHub Desktop.
Save KenMan79/1b4f6868615d6bb3753f905b01e51727 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