Lecture 5 - Homework & Resources

1 Videos


01 - Example: CourseCoin (25:56)
02 - Example: TimeLockedTransfer (15:53)

total duration: 41:49

2 Resources


Conflux Studio Project (unzip, then import into Conflux Studio)
github.com/Thegaram/cfx-uma-resources/raw/master/cfx-lecture-5.zip

Submit bugs and feature requests to Conflux Studio

Official Solidity 7.1 documentation
solidity.readthedocs.io/en/v0.7.1

OpenZeppelin ERC-20 interface

OpenZeppelin ERC-20 implementation

ERC-20 (Bitcoin Wiki)

3 Homeworks


3.1 Undertanding the lecture

1.a) Describe some advantages of conforming to a token standard like ERC-20 or IStandardToken in a few sentences.
1.b) Describe the purpose of the TimeLockedTransfer contract in a few sentences.

3.2 Trying the lecture code

Download the project (github.com/Thegaram/cfx-uma-resources/raw/master/cfx-lecture-5.zip) and import it into Conflux Studio.

In this problem, you will have to deploy three smart contracts on your local development network.

First, deploy a fixed-supply standard coin with the name “CoinA”. Then, deploy a second instance with the name “CoinB”.

Next, deploy an instance of the TimeLockedTransfer contract. Set the unlock time to something greater than 5 minutes.

Send 17 CFX, 22 CoinA, and 12 CoinB to the transfer contract.

After the deadline, withdraw all these tokens from the transfer contract.

Document the process using screenshots and a short description of each step.

+1. Transfer Factory [OPTIONAL]

Look at the file TransferFactory.sol. Try to understand what it does and explain it using your own words.

Show us how to deploy and use this contract.

+1. Cancel transfer [OPTIONAL]

Modify TimeLockedTransfer.sol in a way that allows the sender to cancel the transfer before the specified deadline.

Provide a way for the sender to re-aquire all their tokens from the transfer contract after cancelling it.