📜 [專欄新文章] 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.
👏 歡迎轉載分享鼓掌
wget安裝 在 蜜蜂先生的遊戲人間 Facebook 八卦
#科技 #Mac
介紹Mac專用的套件系統(就是像ubuntu的apt-get):
http://brew.sh/index_zh-tw.html
可以用來裝一些系統沒有的元件~(啥joe或是wget之類的)
http://caskroom.io
然後再裝這個cask擴充套件,就可以用來安裝GUI的App…
之後就只要用指令就能裝應用程式了~完全不用自己去下載安裝檔跟點安裝~
入手新Mac,安裝完新系統後,重新建立工作環境中,順便記錄一下自己裝了哪些套件:
- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- brew install caskroom/cask/brew-cask
- brew install joe
- brew install wget
- brew cask install firefox
- brew cask install google-chrome
- brew cask install flash-player
- brew cask install dropbox
- brew cask install 1password
- brew cask install xtrafinder
- brew cask install sublime-text
- brew cask install iterm2
- brew cask install google-drive
- brew cask install xmind
- brew cask install nally
- brew cask install synology-cloud-station
- brew cask install filezilla
- brew cask install microsoft-office
- brew cask install adobe-photoshop-cc adobe-illustrator-cc
- brew cask install diskmaker-x
wget安裝 在 Windows 10 Anaconda install wget (Windows 10 ... - YouTube 的八卦
... <看更多>