{"componentChunkName":"component---src-templates-post-template-js","path":"/posts/crypto/solidity-notes","result":{"data":{"markdownRemark":{"id":"8fd8dcb8-d9b3-512c-b2bd-09894d782585","html":"<h1 id=\"solidity-101-notes\" style=\"position:relative;\"><a href=\"#solidity-101-notes\" aria-label=\"solidity 101 notes permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><a href=\"https://secureum.substack.com/p/solidity-101\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Solidity 101 Notes</a></h1>\n<ol>\n<li>A ‘^’ symbol prefixed to x.y.z in the pragma indicates that the source file may be compiled only from versions starting with x.y.z until x.(y+1).z. For e.g., “pragma solidity ^0.8.3;” indicates that source file may be compiled with compiler version starting from 0.8.3 until any 0.8.z but not 0.9.z. This is known as a “floating pragma.”</li>\n<li>NatSpec Comments: NatSpec stands for “Ethereum Natural Language Specification Format.” These are written with a triple slash (///) or a double asterisk block(/** … */) directly above function declarations or statements to generate documentation in JSON format for developers and end-users. It is recommended that Solidity contracts are fully annotated using NatSpec for all public interfaces (everything in the ABI). These comments contain different types of tags:</li>\n</ol>\n<p>@title: A title that should describe the contract/interface</p>\n<p>@author: The name of the author (for contract, interface)</p>\n<p>@notice: Explain to an end user what this does (for contract, interface, function, public state variable, event)</p>\n<p>@dev: Explain to a developer any extra details (for contract, interface, function, state variable, event)</p>\n<p>@param: Documents a parameter (just like in doxygen) and must be followed by parameter name (for function, event)</p>\n<p>@return: Documents the return variables of a contract’s function (function, public state variable)</p>\n<p>@inheritdoc: Copies all missing tags from the base function and must be followed by the contract name (for function, public state variable)</p>\n<p>@custom…: Custom tag, semantics is application-defined (for everywhere)</p>","fields":{"slug":"/posts/crypto/solidity-notes","tagSlugs":["/tag/notes/","/tag/solidity/"]},"frontmatter":{"date":"2021-12-30T23:46:37.121Z","description":"Things I didn't know","tags":["Notes","Solidity"],"title":"Random Solidity Notes"}}},"pageContext":{"slug":"/posts/crypto/solidity-notes"}},"staticQueryHashes":["251939775","401334301","825871152"]}