📜 [專欄新文章] Solidity Weekly #14
✍️ mingderwang
📥 歡迎投稿: https://medium.com/taipei-ethereum-meetup #徵技術分享文 #使用心得 #教學文 #medium
如何使用 ZeppelinOS 產生 ERC20 tokens
本期不寫 Code
讓我們在 Ropsten Test net 上測試,用 ZeppelinOS 直接產生 ERC20 tokens。
先安裝與架設好 zos for Rosten network deployment:
cd /tmp && mkdir my-app && cd my-appnpm install yarn zoszos init my-app 1.0.0zos link openzeppelin-zos
rm truffle-config.js && wget https://gist.githubusercontent.com/…/1be8…/truffle-config.js
yarn add openzeppelin-zos truffle-hdwallet-providerzos push --network ropsten
然後執行以下指令,假設你在 Ropsten 有一個帳號 ,例如這裡的 0x66ee73086134f147745be72335153bf780499e2e,當成這 tokens 合約的所有人,您可更改 muzha 成你要的 token 名稱,以及改 MUZA 成你要的 token 符號。
只要一行指令, 就可以生成 tokens:
在 /tmp/my-app 目錄下
OWNER=0x66ee73086134f147745be72335153bf780499e2e zos create DetailedPremintedToken --init initialize --args $OWNER,muzha,MUZA,8,100000000000000000000 --network ropsten
結果如下,就可以產生一兆個 ERC20 tokens,合約位址在 0xc634d06c9d0fac3c6b341dc6238a15f253caecf9
Creating DetailedPremintedToken proxy and calling initialize with: - _sender (address): "0x66ee73086134f147745be72335153bf780499e2e" - _name (string): "muzha" - _symbol (string): "MUZA" - _decimals (uint8): "8" - _initialBalance (uint256): "100000000000000000000" TX receipt received: 0x6aa11e9a8465092ee17642703aeec1272e1dda452a028da1f460bbcd75dac6d8 DetailedPremintedToken proxy: 0xc634d06c9d0fac3c6b341dc6238a15f253caecf9Successfully written zos.ropsten.json
可以利用 Ropsten 的 Etherscan 做驗證如下:
https://ropsten.etherscan.io/tokens…
LT;DR
安裝 zos 與 truffle 這麼麻煩,乾脆用 docker,結果是一樣的:
docker run mingder78/create-erc20-token 0x66ee73086134f147745be72335153bf780499e2e,TaiwanNewToken,TNT,8,100000000000000000000
$ docker run mingder78/create-erc20-token 0x66ee73086134f147745be72335153bf780499e2e,TaiwanNewToken,TNT,8,100000000000000000000Creating DetailedPremintedToken proxy and calling initialize with: — _sender (address): “0x66ee73086134f147745be72335153bf780499e2e” — _name (string): “TaiwanNewToken” — _symbol (string): “TNT” — _decimals (uint8): “8” — _initialBalance (uint256): “100000000000000000000” TX receipt received: 0xfa424db886ea3bcdfa79bed262c41b82b2a028dfdc240bfb47e067ae34ae4aa6 DetailedPremintedToken proxy: 0x5e19e1830d452e64157c3a49978607f02d79bbf8Successfully written zos.ropsten.json0x5e19e1830d452e64157c3a49978607f02d79bbf8
https://ropsten.etherscan.io/tokens…
參考資料
Docker Hub for mingder78/create-erc20-token
計畫來源: https://github.com/EtherTW/tokensandbox.io
Solidity Weekly #14 was originally published in Taipei Ethereum Meetup on Medium, where people are continuing the conversation by highlighting and responding to this story.
👏 歡迎轉載分享鼓掌
同時也有1部Youtube影片,追蹤數超過42萬的網紅けーてぃーじー KTG本部,也在其Youtube影片中提到,ゲームチャンネル ◆KTG Games◆ https://goo.gl/wfQMEY ◆Twitter◆ ウォカ https://twitter.com/KTG_oka_san 志威蕾 https://twitter.com/KTG_si_rai1 音楽:魔王魂...
「uint8」的推薦目錄:
- 關於uint8 在 Taipei Ethereum Meetup Facebook 的最佳解答
- 關於uint8 在 けーてぃーじー KTG本部 Youtube 的最讚貼文
- 關於uint8 在 Data vs [UInt8] - Stack Overflow 的評價
- 關於uint8 在 uint8 (FSharp.Core) 的評價
- 關於uint8 在 https://github.com/ros2/common_interfaces/tree/fox... 的評價
- 關於uint8 在 Uint8 | Uint16 | Uint32 | Uint64 | Data Types - YouTube 的評價
- 關於uint8 在 Gdal2Tiles getting tif with dtype = uint8 but want int16 - GIS ... 的評價
uint8 在 けーてぃーじー KTG本部 Youtube 的最讚貼文
ゲームチャンネル
◆KTG Games◆
https://goo.gl/wfQMEY
◆Twitter◆
ウォカ
https://twitter.com/KTG_oka_san
志威蕾
https://twitter.com/KTG_si_rai1
音楽:魔王魂
![post-title](https://i.ytimg.com/vi/-ugZB-uinT8/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLAlDuJ0J4Z-RoAMVT5JUjSh7-cu4A)
uint8 在 uint8 (FSharp.Core) 的推薦與評價
uint8 Type. Namespace: FSharp.Core; Assembly: FSharp.Core.dll; Abbreviation For: Byte; Base Type: ValueType; All Interfaces: IComparable , IComparable<byte> ... ... <看更多>
uint8 在 Data vs [UInt8] - Stack Overflow 的推薦與評價
... <看更多>