This is a solidity program

blov · · 428 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m very new to this whole programming thing.</p> <p>For instance: this a little program I understand it. I get what it&#39;s supposed to, but my problem is if I were to do it myself I wouldn&#39;t be able to come up with all the words and syntax. How do I learn this? I know this might be a silly question for some programmers, but I&#39;m just being honest and I want to learn.</p> <p>pragma solidity <sup>0.4.0;</sup></p> <p>contract Coin { // The keyword &#34;public&#34; makes those variables // readable from outside. address public minter; mapping (address =&gt; uint) public balances;</p> <pre><code>// Events allow light clients to react on // changes efficiently. event Sent(address from, address to, uint amount); // This is the constructor whose code is // run only when the contract is created. function Coin() { minter = msg.sender; } function mint(address receiver, uint amount) { if (msg.sender != minter) return; balances[receiver] += amount; } function send(address receiver, uint amount) { if (balances[msg.sender] &lt; amount) return; balances[msg.sender] -= amount; balances[receiver] += amount; Sent(msg.sender, receiver, amount); } </code></pre> <p>}</p> <hr/>**评论:**<br/><br/>shazow: <pre><p>This has nothing to do with Go. Solidity&#39;s compiler is not even written in Go, it&#39;s written in C++.</p> <p>You want <a href="https://www.reddit.com/r/ethereum" rel="nofollow">https://www.reddit.com/r/ethereum</a> or <a href="https://solidity.readthedocs.io/en/develop/" rel="nofollow">https://solidity.readthedocs.io/en/develop/</a></p></pre>tmornini: <pre><blockquote> <p>I wouldn&#39;t be able to come up with all the words</p> </blockquote> <p>Naming is one of the two hard problems in programming.</p> <blockquote> <p>and syntax. How do I learn this?</p> </blockquote> <p>One compilation failure at a time.</p></pre>shovelpost: <pre><blockquote> <p>This is a solidity program</p> <p>if I were to do it myself I wouldn&#39;t be able to come up with all the words</p> </blockquote> <p>Use your own words.</p></pre>nhooyr: <pre><p>Come on.</p> <p><a href="https://www.reddit.com/r/golang/comments/6ovb2d/restful_api/dkkr4wq/" rel="nofollow">https://www.reddit.com/r/golang/comments/6ovb2d/restful_api/dkkr4wq/</a></p></pre>Arcticcu: <pre><p>Same guy keeps posting stuff like this all the time.. mods, some sort of warning or or bam might be in order?</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

428 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传