Ethereum 2.0: A Complete Guide. Ewasm. by Colin Schwarz ...

First contract to contain swarm hash to its metadata and source

I love it when technology finally comes together!
I just fired up the geth light client (I did not do a full sync beyond the attack blocks yet), it was up to date faster than I could find my correct account. Then I deployed the contract at 0x45D779c6696fdB1eECFBbaf5E3F8b4Af9861291f which was compiled with an experimental Solidity feature that automatically generates a metadata file and inserts the swarm hash of that file into the bytecode of the contract (before the file is uploaded to swarm, that's the nice thing!).
If you take a close look, the bytecode starts with
which decodes to
PUSH32 0xe886dc769ec7d83a00b8647920917cf4b932fbb8c6fd59bf6da7d18ee84d2447 POP 
If you interpret the pushed constant as a swarm hash and download the corresponding file, you will get
{ "compilationTarget": "HelloSwarm.sol:HelloSwarm", "compiler": { "version": "0.4.5-develop.2016.11.15+commit.744d81f7.mod.Linux.g++" }, "language": "Solidity", "output": { "abi": "[{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"greeters\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_greeting\",\"type\":\"string\"}],\"name\":\"greet\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"\",\"type\":\"string\"}],\"name\":\"Greeted\",\"type\":\"event\"}]", "natspec": "{\n \"methods\" : {\n \"greet(string)\" : {\n \"notice\" : \"Send your personal greeting to the contract. Will permanently store your address inside this contract.\"\n }\n }\n}\n" }, "settings": { "optimizer": { "enabled": false, "runs": 200 } }, "sources": { "HelloSwarm.sol": { "swarm": "0x10a421d906cd976536e5980b53a73e2d3ce6528b2df1e93b4f3358b1e2c6acb5" } }, "version": 1 } 
Which contains all you need for basic interaction and source-code verification of the contract! No need to copy-paste the stupid ABI Json string anymore!
Oh and uploading the file using "bzzup" was instant, the file was immediately retrievable from the gateway.
My next steps will be bringing browser-solidity and all the compiler versions into swarm -- bye-bye, github!
submitted by chriseth to ethereum [link] [comments] ethereum work study 2017-05-20 = natspec, parity browser, etc Luis - Radspec: A Safe Alternative to Ethereum's Natspec to Make Transactions Human-readable

NatSpec Format¶ Solidity contracts can use a special form of comments to provide rich documentation for functions, return variables and more. This special form is named the Ethereum Natural Language Specification Format (NatSpec). This documentation is segmented into developer-focused messages and end-user-facing messages. Ethereum Frontier Guide. NatSpec. This section will further elaborate what you can do with contracts and transactions building on a protocol NatSpec. Solidity implements smart comments doxigen style which then can be used to generate various facades meta documents of the code. One such use case is to generate custom messages for transaction ... In articles one, two and three of this series, I explored various features of the anticipated Ethereum update Eth 2.0. Article one gave an introduction to the update and offered general information… Allow NatSpec comments for state variables #8532 Merged chriseth merged 3 commits into ethereum : develop from aarlt : structured-docs-variables-aarlt May 19, 2020 Check out NatSpec documentation for additional information. Importing external code into your Ethereum smart contract. The import section is optional but can be powerful when used correctly in your Ethereum smart contract. If your smart contract needs to refer to code in other files, you’ll have to import those other files first.

[index] [5213] [2658] [1998] [7105] [2981] [5707] [2144] [6062] [3713] [7211] ethereum work study 2017-05-20 = natspec, parity browser, etc

Luis - Radspec: A Safe Alternative to Ethereum's Natspec to Make Transactions Human-readable - Duration: 19 minutes. ... Universal Logins for Ethereum - Duration: 13 minutes, 45 seconds. With Jeff Anthony. This video is unavailable. Watch Queue Queue The next video is starting stop. Loading... Watch Queue