HW02: Family wealth management

Problem statement

Implement a smart contract for shared wealth management for families.

Example scenario

Alice and Bob create a contract with 10 ether initial balance, giving access to their daughter, Claire. Every time they receive their salary, they transfer it to the contract.

Every time they need money, these three members of the family can withdraw money from the contract, knowing that Alice and Bob can only withdraw 1 ether, while Claire can only withdraw 0.1 ether at a time.

Contract interface

Contract skeleton

pragma solidity ^0.4.21;

contract WealthManager {

    // <contract_variables>

    // </contract_variables>

    function WealthManager(address parent2, address child) public payable {
        // TODO
    }

    function withdraw(uint256 amount) public {
        // TODO
    }

    function () public payable {
        // TODO
    }

}