or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
區塊鏈技術學習part2 –-solidity hello world
tags:
tutorials
blockchain
ethereum
smart contract
solidity
作者:ㄎㄎ笑derDF @dfder
1. 取得錢包
官方之錢包介紹頁面
何謂錢包
目前最多人用的錢包似乎是 MetaMask
google教學最多最方便我使用的是MetaMask的ChromeExtension
2. 測試網路
我用的網路Rinkeby
Explorer:找節點資料?
trivagoGitHub:開源Repo
Token 來源:只能從這個網址(faucet)獲得貨幣
介面炫炮免費貨幣好拿(待會說明)
多個錢包直接支援
在MetaMask錢包中切換至測試網路
3. 取得測試網路之以太幣
複製你的錢包Account address
在twitter或FB發出一篇含有你Account address的公開貼文
複製該貼文的URL (Direct link)
使用此網址 貼上
BANG!
讓子彈飛一會兒讓區塊練計算這筆交易一下Magic!出現啦!
我是有錢人啦4. Remix 簡介
5.在Remix上撰寫solidity 之smart contract
在新版的IDE介面中,有很多功能已經被模組化且預設不載入了,初次使用的開發者需要自己啟用
在這裡說明如何啟用並且推薦三個必裝模組
先點選左側Plugin
選擇欲用的模組
推薦必裝之模組!
開始寫程式啦~
這邊提供兩個範例
6. Smart Contract running 過程cost分析
smart contract 的操作是需要代價的
在區塊鍊上儲存資料 部署smart contract需要代價
讀取 查詢交易記錄則不需要
撰文當下測試的cost
部署合約!
儲存一個uint 5678
儲存一個string "df 666"
儲存一個UUID
儲存一個sha256
cost (unit: ETH)