Skip to content

Instantly share code, notes, and snippets.

@manhtuan1712
Created September 3, 2022 07:40
Show Gist options
  • Save manhtuan1712/5508f5fe27a0234846925880257fa596 to your computer and use it in GitHub Desktop.
Save manhtuan1712/5508f5fe27a0234846925880257fa596 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.16+commit.07a7930e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "./Allowance.sol";
contract FundWallet is Allowance {
event SendMoney(address indexed _to, uint _amount);
event ReciveMoney(address indexed _from, uint _amount);
function widthdrawMoney(address payable _to, uint _amount) public ownerOrWhoIsAllowance(_amount){
if (!isOwner()) {
reduceAllowance(msg.sender, _amount);
}
emit SendMoney(_to, _amount);
_to.transfer(_amount);
}
receive() external payable {
emit ReciveMoney(msg.sender, msg.value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment