Contract to handle subscriptions.
This contract handles monthly subscriptions based on calendar months. If your subscription doesn't follow the calendar, you would need to keep track of the day of month on your other systems.
This event is emitted when a payment is made to the contract.
by
is andaddress
containing who made the paymentamount
is auint
formonth
is a uint representing the month of the year(1-12)
The default function when sending value to the contract. This allows a subscriber to pay for the current month.
eth.sendTransaction({from: accounts[0], to: subscriptionContract, value: subscriptionCost, gas: 50000})
Allows a subscriber to make a payment for a specific month.
uint16 year
- The yearuint8 month
- The month of the year
Returning a uint
representing the amount the subscriber has paid for a
specific month.
address who
-address
of the subject accountuint16 year
- The yearuint8 month
- The month of the year
Returns bool
representing whether or not the contract is "alive". A contract
that is not "alive" can not accept payments.
Returning a bool
this function tells us if the user is paid up for the current
month.
who
address
of the subject account
Returns the current manager's address
.
Sets the manager of the contract.
address newManager
-address
of the new managing account
Withdraw the full balance of the contract.
Withdraw the full balance of the contract and disable it.