-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsharedWallet.sol
33 lines (27 loc) · 937 Bytes
/
sharedWallet.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//SPDX-License-Identifier: MIT
pragma solidity 0.8.1;
import "./Allowance.sol";
contract SharedWallet is Allowance {
event MoneySent(address indexed _beneficiary, uint256 _amount);
event MoneyReceived(address indexed _from, uint256 _amount);
function withdrawMoney(address payable _to, uint256 _amount)
public
ownerOrAllowed(_amount)
{
require(
_amount <= address(this).balance,
"Contract doesn't own enough money"
);
if (!isOwner()) {
reduceAllowance(msg.sender, _amount);
}
emit MoneySent(_to, _amount);
_to.transfer(_amount);
}
function renounceOwnership() public override onlyOwner {
revert("can't renounceOwnership here"); //not possible with this smart contract
}
receive() external payable {
emit MoneyReceived(msg.sender, msg.value);
}
}