> For the complete documentation index, see [llms.txt](https://chihaolu.gitbook.io/kryptocamp-office-hour/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chihaolu.gitbook.io/kryptocamp-office-hour/season-1-2022-1/oh-week2-overview.md).

# OH Week2 Overview

### Solidity 全解析

這邊使用的教材是我自己整理的 [All In One Solidity](https://chihaolu.gitbook.io/all-in-one-solidity/)，內容極多今天應該講不完！

資源幾乎來自我蒐集的各種高手撰寫的智能合約、官方文件，輔以 Kordan 上課講的一些內容，最後加上我的補充見解而編成的。

### Homework

#### 2022/1/10

**HW1 找到這個合約錯誤並且修正它**

```solidity
contract WalletLibrary is WalletEvents {
  ...
  // METHODS
  ...
  // constructor is given number of sigs required to do protected
  // "onlymanyowners" transactions as well as the selection of addresses
  // capable of confirming them
  function initMultiowned(address[] _owners, uint _required) {
    m_numOwners = _owners.length + 1;
    m_owners[1] = uint(msg.sender);
    m_ownerIndex[uint(msg.sender)] = 1;
    for (uint i = 0; i < _owners.length; ++i)
    {
      m_owners[2 + i] = uint(_owners[i]);
      m_ownerIndex[uint(_owners[i])] = 2 + i;
    }
    m_required = _required;
  }
  ...
  // constructor - just pass on the owner array to multiowned and
  // the limit to daylimit
  function initWallet(address[] _owners, uint _required, uint _daylimit) {
    initDaylimit(_daylimit);
    initMultiowned(_owners, _required);
  }
}
```

**HW2 描述智能合約如何更新、凍結、作廢，並且用一段範例程式來說明機制**

**HW3 (Optional) 寫小程式讀取 USDT 交易內容**

**HW4 (Optional) 設計多人管理的智能合約保險箱**

#### 2022/1/12

**HW1 寫出可以更新的智能合約，如：Uniswap v1 -> v2 -> v3**

**HW2 (Optional) 代幣發行 Token Sale**

* 投入 USDT 換得你的代幣

#### 2022/1/14

**HW1使用智能合約設計群眾募資網站**

* 荷蘭式拍賣
* 白名單機制
* 升級到 > v0.8
* 參考：<https://github.com/0xTDF/ERC20-Token-and-Sale>
  * <https://github.com/Krypto-Camp/ERC20-Token-and-Sale>

***

### Reference and Some Resources

論壇、群組或者是學習資源

#### Solidity

* <https://github.com/HashLips/solidity\\_basics>
* <https://github.com/ConsenSys/smart-contract-best-practices>
* <https://github.com/willitscale/learning-solidity>
* <https://consensys.github.io/smart-contract-best-practices/tokens/>
* <https://solidity-by-example.org/>
* <https://www.youtube.com/watch?v=pqxNmdwEHio\\&list=PLS5SEs8ZftgVnWHv2\\_mkvJjn5HBOkde3g>
* <https://cryptozombies.io/en/course/>
* <https://a16z.com/crypto-startup-school/>

#### ERC vs. EIP

* <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md>
* <https://ithelp.ithome.com.tw/articles/10266115>
