HW07: Patreon

Problem statement

Implement a smart contract for supporting an artist.

Example scenario

Alice creates a contract with 52 ether initial balance to support Bob, the artist. For the next 52 weeks, Bob can make a single withdrawal of at most 1 ether every week.

Contract interface

Contract skeleton

pragma solidity ^0.4.21;

contract Patreon {

    // <contract_variables>

    // </contract_variables>

    function Patreon(address artist) public payable {
        // TODO
    }

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

    function () public payable {
        // TODO
    }

}