【KryptoCamp】Office Hour
  • Season 2 2022/2-4
    • Outline
      • 晚間學習班課綱
      • 助教課課綱、直播 & 回放連結
    • OH Week1 Overview
      • MetaMask & Other Wallets
      • NFT Website Development
      • 實作區塊 0 的產生
      • Reference, Resources & AMA
    • OH Week3 Overview
      • 設計多人管理的智能合約保管箱 (Optional)
      • 架設私有區塊鏈發送第一筆交易(Optional)
      • 發行代幣 Token (Optional)
      • Reference, Resources & AMA
    • OH Week4 Overview
      • Supply Chain Management System(Optional)
      • 荷蘭拍(Optional)
      • Reference, Resources & AMA
    • OH Week5 Overview
      • DAPP
      • Reference, Resources & AMA
    • OH Week6 Overview
      • NFT - Layers Random Blending
      • NFT - Smart Contract
      • KYC Whitelisting 白名單設計(Optional)
      • Reference, Resources & AMA
    • OH Week7 Overview
      • DAPP - Minting Functionality
      • NFT 稀有度與持有人排行榜(Optional)
      • Reference, Resources & AMA
  • Season 1 2022/1
    • Outline
    • OH Week1 Overview
    • OH Week2 Overview
    • OH Week3 & Week4 Overview
Powered by GitBook
On this page
  • Solidity 全解析
  • Homework
  • Reference and Some Resources
  1. Season 1 2022/1

OH Week2 Overview

PreviousOH Week1 OverviewNextOH Week3 & Week4 Overview

Last updated 3 years ago

Solidity 全解析

這邊使用的教材是我自己整理的 ,內容極多今天應該講不完!

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

Homework

2022/1/10

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

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

All In One Solidity