---
# System prepended metadata

title: To buy

---

# Decentralized Finance Hw3
## Part I
### Guideline
- [Homework3 Contract Link](https://github.com/spockwall/Defi_HW3)
- Following are four challenges to solve in HW3
    - Greeter
    - Gate
    - Delegation
    - Reentrance
- You have to use "netcat" to connect to the server.
``` shellscript=
//Windows
// I don't know. Maybe use wsl. Good luck.

// MacOs
$ brew install netcat
$ netcat -c <server_address> <port>
$ nc -c <server_address> <port>

// Linux
$ netcat -c <server_address> <port>
$ nc -c <server_address> <port>

// Try this
$ nc -c 34.80.51.78 80
$ nc -c 34.125.66.1 80 	
```
- You have to enter your wallet address when you use "netcat" to start the challenges (see below). 
- Each contract is locked at the begining. To solve a challenge is to unlock the challenge (locked == false).
- You may have to write attack contracts in order to unlock the challenges.
- In grading session, TAs (佳誠大大跟Adrian大佬) will examine if the student wallet in the challenge contract is identical to yours. If not, you won't get any score. Also, TAs will check if the contract you list in write-up is deployed by us.
- Don't deploy challenge contracts by yourself maunally. If you are caught submitting contracts deployed by yourself, Dr. Liao will flunk you.
- If you are not able to unlock the challenges, you still can write down your ideas in the write-up session. You may get full points depending on your idea is correct or not.
- Write-up must be concise, or you will get penalized. You can put some screenshots for explaination
- Contracts will be  deployed on Sepolia. Make sure if Sepolia is added in your wallet.
- You can simulate the challenges in remix vm or local node first.
- Don't DDos. Our server is vulnerable.

### Write-Up Form
- **Metamask Wallet Address**
    - <your wallet address>
- **Greeter**
    - Address: <your greeter contract address>
    - Is locked: True/Flase.
    - Solution
        - How you solve the challenge.
- **Gate**
    - Address: <your gate contract address>
    - Is locked: True/Flase.
    - Solution
        - How you solve the challenge.
- **Delegation**
    - Address: <your delegation contract address, no delegate address>
    - Is locked: True/Flase.
    - Solution
        - How you solve the challenge.
- **Reentrance**
    - Address: <your reentrance contract address>
    - Is locked: True/Flase.
    - Solution
        - How you solve the challenge.
    
- **Addresses in array form (convenient for TAs)**
    - [wallet, greeter, gate, delegation, reentrance]
    
### Submit Form
- <student id>_hw3_writeup.pdf
- Example:
    - b09902200_hw3_writeup.pdf

### Tools
- Remix
- Remix-ide offline(Recommended)
- Node.js and web3.js (Recommended)
- Hardhat
- Truffle

### Others
- How to install remix-ide offline ?
``` shellscript=
// Using docker to install remix offline.
$ docker pull remixproject/remix-ide:latest
$ docker run -p 8080:80 remixproject/remix-ide:latest
```
## Part II
-https://forms.gle/3TK3DNkdhqL63NAJ6
## Grading 
- ### Part I (55%)
    - **Greeter (10%)**
        - valid challenge contract address(2%)
        - `0x7D26c19c18247507872329FFE82Dbb8F34b82308`
        - unlock challenge contract (4%)
        - writeup (4%)
    - **Gate(15%)**
        - valid challenge contract address(3%)
        - unlock challenge contract (6%)
        - writeup (6%)
    - **Delegation(15%)**
        - valid challenge contract address(3%)
        - unlock challenge contract (6%)
        - writeup (6%)
    - **Reentrance(15%)**
        - valid challenge contract address(3%)
        - unlock challenge contract (6%)
        - writeup (6%)
- ### Part II (45 %)
    - **True or False (15%)**
    - **Multiple Choice (30%)**
- ### TA
    - b09902127@ntu.edu.tw
    - b09902099@ntu.edu.tw
    
