Deliverables (25 Points)
1. The smart contract code named as a [studentID-codes].txt file.
2. A documentation named as a [studentID-documentation].pdf file, which describes how to run and use
your smart contract. If you think the comments you left on your codes are enough, you do not need to
provide documentation. If you do, please make it concise and no more than 2 pages.
3. A report [studentID-report].pdf on the following discussions (be concise and no more than 3 pages):
(a) advantages of using blockchain in retail transactions (10 points);
(b) (at least) three problems of the current project and gives some potential solutions (15 points).
There is no limitation on the problem types, which means that you can think about malicious users
and explore things from any perspective, such as system/management, security, privacy, etc.
(If you believe your code is “perfect,”
” explain clearly the (three) special mechanisms you introduced.)
2 Basic Requirements (75 Points)
The smart contract is supposed to achieve the following features (10 points for each).
1. Buyer Registration: A user can register by generating the profile with their name, email, and shipping
address. Only one profile can be registered per address. Once registered, the buyer can view their own
profile information.
2. Seller Registration: Only one address can register as the seller by depositing a certain amount of
cryptocurrency (Ethereum coins), and the seller address is not allowed to be a buyer. Once registered,
the seller can add products for sale with a name, price, and inventory. Only the seller address is allowed
to add product information.
3. Product Information: Anyone can input the product id and view the corresponding product information,
including the name, price, and inventory.
4. Transaction Initiation: A user can initiate a new transaction by specifying the product ID and quantity.
The total cost of the transaction is calculated based on the selected product price. The buyer should hold
enough money and transfer it to the smart contract to proceed with the transaction.
5. Transaction Information: A user can only view his/her own transactions, while the seller can view all.
(Note that you need to think about what attributes are needed to achieve the requirements, as they are
not explicitly specified here.)
6. Return Request: A buyer can request a return before completing the transaction. The seller can get the
transaction information to see the transaction status and approve a return upon request. Once a return
is approved, the money contained in the transaction should be transferred back to the buyer.
7. Transaction Completion: The buyer can mark a transaction as completed. Once a transaction is completed,
the total cost of the transaction should be transferred to the seller’s account. Also, no other modifications
or actions can be done except viewing the transaction information.