In this assignment, you will further put your Solidity skills to the test. Feel free to reference the numerous contracts we’ve been through in lectures. A template is given to you that contains starter code upon assignment creation. Grading is automated through GitHub Actions - what you see is what you will get.

As with all assignments, don’t hesitate to Google, but do not copy verbatim or directly from your peers. Your code must compile and run to receive any credit

Submission guidelines: Modify contracts/HW4.sol in the given template repository.

GitHub Classroom invite for HW4: https://classroom.github.com/a/VE3j8tGE

Deadline: Oct 20, 2022, 16:00 PDT


1) Contract Structure

(These are all already done for you in the template)

  1. Set open-source license to UNLICENSED.
  2. Enforce compiler version 0.8.0 or above.
  3. Contract should be named HW4

2) Building a Splitter (4%)

Overview

You will build a payment splitter that splits an incoming payment evenly between each recipient. As opposed to sending the split funds immediately, you should keep track of the balance for each receiving party and enable them to withdraw at a later date.

Events are given in the interface and should be emitted at the appropriate time, per description.

Ownable

The Ownable interface enables access control for our smart contract, adding the ability to restrict function calls to only the owner of the contract. This is accomplished through various variables, functions, and modifiers, which you will have to implement.

The functions and events are already given to you in the interface.

Pausable

The Pausable interface enables access control for our contract, adding the ability to “pause” the contract. In reality, it’s just a boolean value that the owner can toggle. For example, we can define a modifier onlyNotPaused so that certain functions can only execute if the boolean value is true.