果然再次遇到问题。在4:20启动了Mist后,这家伙又一次Stuck了。
按照昨晚的经验,此时应该是耐心等待,所以先来写一下记录。
已经经过了多次转载,作者也在注释中声明:没有任何限制权利,转载、复制请随意。
复制如下:
/*This creates a public tradeable fungible token in the Ethereum Blockchain.
https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs (实际上这个网址没有太大作用)
Unmodified this will create a cryptoasset with a fixed market cap
wholly owned by the contract creator. You can create any function
to change this contract, like allowing specific rules for the issuance,
destruction and freezing of any assets. This contract is intended for
educational purposes, you are fully responsible for compliance with
present or future regulations of finance, communications and the
universal rights of digital beings.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to http://unlicense.org /
pragma solidity ^0.4.21;
contract MyToken {
/ Public variables of the token代币的公共变量 */
string public name;
string public symbol;
uint8 public decimals;
/* This creates an array with all balances创建所有账户的数组 */
mapping (address => uint256) public balanceOf;
/* This generates a public event on the blockchain that will notify clients 在区块链上产生一个通知客户的公共事件*/
event Transfer(address indexed from, address indexed to, uint256 value);
/* Initializes contract with initial supply tokens to the creator of the contract /
function MyToken(uint256 _supply, string _name, string _symbol, uint8 _decimals) public {
/ if supply not given then generate 1 million of the smallest unit of the token */
if (_supply == 0) _supply = 1000000;
/* Unless you add other functions these variables will never change */
balanceOf[msg.sender] = _supply;
name = _name;
symbol = _symbol;
/* If you want a divisible token then add the amount of decimals the base unit has */
decimals = _decimals;
}
/* Send coins /
function transfer(address _to, uint256 _value) public {
/ if the sender doenst have enough balance then stop */
if (balanceOf[msg.sender] < value) return;
if (balanceOf[_to] + _value < balanceOf[to]) return;
/* Add and subtract new balances */
balanceOf[msg.sender] -= value;
balanceOf[to] += _value;
emit Transfer(msg.sender, _to, _value);
}
}
写到这儿,Mist还在stuck :(
那只能再接着等待了。






网友评论