一小時內發行你的加密貨幣(加密廢紙?)

JrRj

14 回覆
5 Like 1 Dislike
JrRj 2018-11-19 15:30:56
前言: 缺乏有效生態支撐的加密貨幣可視為廢紙,但固中原理和技術有無限的可能性。

目標: 單純在技術上,發行一種前所未見的加密貨幣。
功能: 此加密貨幣在每次交易後都會自動增加一定供應量,即公開透明地印銀紙。
工具:
1. 增加 MetaMask browser extension https://metamask.io/
2. 前往 remix IDE https://remix.ethereum.org

文字步驟(英文):
1. Create an account on MetaMask
2. Switch to Ropsten test network for test purpose
3. Get test ether($0) from faucet for free
4. Go to remix IDE
5. Paste smart contract source code to remix IDE from https://gist.github.com/escohk/93f983ff2f4abe01fe9ba9dedb698b0d
6. Go through key functions of the smart contract
7. Deploy smart contract
8. Check etherscan
9. Test smart contract by transferring coins
ps. 圖文步驟後加

成果: 發行了經編程和公開透明的加密貨幣。

思考:
1. 貨幣只是 smart contract 的其中一種有效應用?
2. 下n個殺手級的區塊鏈應用是?去中心化儲存?去中心化交易?去中心化資產?
3. 區塊鏈潛在的無限可能性與互聯網曾經的無限可能性是同級的嗎?

我而家專注開發 smart contract 和 dapp(decentralized application),由其投入於 hybrid dapp(blockchain + cloud) 之中。如果你係技術上或商業上想詳細交流,可以加入以下既 tg groups:
商業: https://t.me/joinchat/CE_VKRL-wBG39XZQ1nRWlA
技術: https://t.me/joinchat/CE_VKREQ4dntIA7dAbxGVQ
,或者係到討論。

後記: Smart Contract 中文名現為智能合約,但我認為並不準確。 Smart 與 Intelligent(智能) 並非同義, Smart Contract 本質上亦不是智能的。機靈合約會係一個更準確和有意義既名稱。
JrRj 2018-11-19 15:44:30
圖文步驟(英文):
1. Create an account on MetaMask


2. Switch to Ropsten test network for test purpose


3. Get test ether($0) from faucet for free
- Click "DEPOSIT"

- Click "GET ETHER"

- Request ether on the faucet website and wait for transaction to appear


4. Go to remix IDE


5. Paste smart contract source code to remix IDE from https://gist.github.com/escohk/93f983ff2f4abe01fe9ba9dedb698b0d

6. Go through key functions
- Users can call this function publicly. After transfer, increase total supply.
    function transfer(address _to, uint256 _value) public returns (bool success) {
        _transfer(msg.sender, _to, _value);
        _increaseTotalSupply(_value);
        return true;
    }

- Implement the function for increasing total supply
    function _increaseTotalSupply(uint _value) internal {
        // Check for overflows
        require(totalSupply + _value >= totalSupply);
        require(balanceOf[owner] + _value >= balanceOf[owner]);
        // Increase total supply
        totalSupply += _value;
        // Add to the owner
        balanceOf[owner] += _value;        
    }


7. Deploy smart contract
- Click "Deploy"

- Confirm the transaction on MetaMask


8. Check etherscan
- Click the etherscan link to view the transaction

- Check the transaction status


9. Test smart contract by transferring coins
- Check initial state of the smart contract on remix IDE

- Transfer some coins to another address

- Check the transaction details and confirm it

- Notice the increased total supply


Wohoo. Done.
JrRj 2018-11-19 16:24:58
其實除左印銀紙,仲可以燒銀紙。如果有巴打想試下,可以發行完後 share 出黎。
JrRj 2018-11-19 19:35:11
可能講得太長,太 technical
有冇 ethereum believer 係到?
中睹美加 2018-11-19 19:47:02
宜家d ERC20 token 炒唔撚起
JrRj 2018-11-19 20:08:02
係呀,FOMO階段已過,炒高預期無埋。
要回歸產品既本質,創造價值,而唔係製造暴升既預期。
中睹美加 2018-11-19 20:09:51
我自己都有ico 市場好冷淡
Btw樓主你好有心機
JrRj 2018-11-19 20:19:06
你係持有ico?
多謝你
成日睇人地d 教學文章,所以自己都想出下
不過個題目可能對大家唔太實用,下次出d 大家都想學既野
中睹美加 2018-11-19 20:27:23
有持有
實用啊係外國好多人都學
Metamask我都有用過
K2-155d 2018-11-19 20:45:06
做完以上即係會有咩結果?
JrRj 2018-11-19 21:02:04
好眼光

有冇玩dapps?
JrRj 2018-11-19 21:05:01
正常人做完應該會更了解區塊鏈未來既可能性同局限性
基斯文去左邊 2018-11-19 22:04:03
都唔明你up咩
JrRj 2018-11-19 23:31:44
邊part?定全部?
吹水台自選台熱 門最 新手機台時事台政事台World體育台娛樂台動漫台Apps台遊戲台影視台講故台健康台感情台家庭台潮流台美容台上班台財經台房屋台飲食台旅遊台學術台校園台汽車台音樂台創意台硬件台電器台攝影台玩具台寵物台軟件台活動台電訊台直播台站務台黑 洞