Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pragma solidity ^0.4.23;
- contract TimeBasedWill {
- address private _beneficiaries;
- uint private _startTime;
- uint private _expiryTime;
- address private owner;
- modifier onlyOwner {
- require(msg.sender == owner);
- _;
- }
- modifier checkExpiry {
- require(now >= _expiryTime);
- _;
- }
- function TimeBasedWill() public payable
- {
- owner = msg.sender;
- }
- function approveAddresses(address beneficiaries, uint expiryTime) onlyOwner public
- {
- _startTime = now;
- _expiryTime = now + expiryTime;
- _beneficiaries = beneficiaries;
- }
- function getBalanceOf() public view returns (uint) {
- return _beneficiaries.balance;
- }
- function sendMoney() public payable
- {
- require(now >= _expiryTime);
- _beneficiaries.send(msg.value);
- // uint numberOfBeneficiaries = _beneficiaries.length;
- // uint shareOfBalance = owner.balance/numberOfBeneficiaries;
- // for (uint i = 0; i < numberOfBeneficiaries; i++) {
- // address beneficiary = _beneficiaries[i];
- // beneficiary.send(shareOfBalance);
- // }
- }
- }
Add Comment
Please, Sign In to add comment