lets say i have a donation smart contract that accepts donations, the code should be the following :
contract Donation{
address payable owner;
construct()
{
owner = msg.sender;
}
function Donate() public payable()
{ }
}
my questions are:
- as far as i understand ether would be transferred to the smart contract address but not the address of the owner of the smart contract, so how do i transfer that ether to the owner?
- if i wanted to restrict the withdraw of that ether from the owner until a certain condition like for example a deadline or some evidence that the work intended of that donation has happened, how i would make that condition?