{"id":2209,"date":"2019-12-21T10:01:00","date_gmt":"2019-12-21T09:01:00","guid":{"rendered":"https:\/\/www.codemotion.com\/magazine\/uncategorized\/solidity-hello-world-blockchain\/"},"modified":"2021-12-23T14:15:52","modified_gmt":"2021-12-23T13:15:52","slug":"solidity-hello-world-blockchain","status":"publish","type":"post","link":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/","title":{"rendered":"Solidity: &#8220;Hello World&#8221; with the Blockchain language"},"content":{"rendered":"<p>In a <a href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/blockchain-dev\/what-is-an-erc-20-token-an-overview\/\">previous article<\/a>, we introduced the basic concepts of the <strong>Ethereum Blockchain<\/strong>, including a quick overview of <strong>ERC-20 tokens<\/strong>.<\/p>\n<p>This article dives into <strong>Solidity<\/strong>, the <span id=\"urn:enhancement-5b132bc4\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/rust_programming_language\">programming language<\/span> used to interact with the Ethereum Blockchain. We will learn how it works, how it is translated in the <strong>Ethereum Virtual Machine<\/strong> and then executed, and which <span id=\"urn:enhancement-91267b2c\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/integrated_development_environment\">IDE<\/span> should be used to start writing code.<\/p>\n<p>Don&#8217;t forget to check also <a class=\"ek-link\" href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/blockchain-dev\/simple-contract-solidity-blockchain\/\" data-rich-text-format-boundary=\"true\">part three, pa<\/a><a class=\"ek-link\" href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/blockchain-dev\/smart-contract-create-interface-token-blockchain\/\">rt four<\/a><span> and <\/span><a class=\"ek-link\" href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/blockchain-dev\/web3-js-ethereum-blockchain-javascript-api\/\">part five.<\/a><\/p>\n<h2 id=\"br3ia\"><strong>Solidity<\/strong><\/h2>\n<p>The <span id=\"urn:enhancement-ea1c330\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/entry_point\">principal<\/span> and most widely known language used to write smart contracts in Ethereum is Solidity. Designed in 2014, a few months before the official launch of the Ethereum Blockchain, Solidity is now used for the Ethereum public Blockchain, as well as for private <span id=\"urn:enhancement-c3cffd4a\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/blockchain\">Blockchains<\/span> such as Hyperledger. As discussed in the first article of this series, Solidity is a statically-typed <span id=\"urn:enhancement-f009f6f\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/rust_programming_language\">programming language<\/span> that runs smart contracts on the EVM, <strong>Ethereum Virtual Machine<\/strong>.<\/p>\n<p>Solidity is compiled of <strong>bytecode<\/strong> that is subsequently executed on the EVM. To date, there are a total of 142 valid opcodes that make up the bytecode necessary to compile any Ethereum smart contract.<\/p>\n<p>Another commonly used language is <strong>Vyper<\/strong>, based on <span id=\"urn:enhancement-9269c730\" class=\"textannotation disambiguated wl-creative-work\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/python_programming_language\">Python<\/span>, but the focus of this series does not include the <span id=\"urn:enhancement-f4d280a3\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/economic_development\">development<\/span> of smart contracts with Vyper.<\/p>\n<h2 id=\"18s4d\"><strong>The Ethereum Virtual Machine<\/strong><\/h2>\n<p>On the Ethereum Blockchain, a smart contract is a simple Ethereum address with a special capability &#8211; running EVM bytecode when receiving a <span id=\"urn:enhancement-4e204af\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_transaction\">transaction<\/span>, which allows the performance of calculations and further <span id=\"urn:enhancement-37db469e\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_transaction\">transactions<\/span>.<\/p>\n<p>Transactions can carry a payload of 0 or more bytes of data, used to specify the type of interaction with a contract and any additional information.<\/p>\n<p>The smart contract begins execution on the EVM at the beginning of the bytecode: each opcode is encoded as one byte (except for <strong>PUSH<\/strong> opcodes, which have an immediate value). Every opcode is also associated with a specific gas cost. The sum of all the gas costs of a smart contract is the cost of one execution of the smart contract. Since gas cost is critical in ensuring the viability of a smart contract (an expensive-to-run smart contract is often not feasible for actual use), it\u2019s important to bear in <span id=\"urn:enhancement-42ad3242\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/mind\">mind<\/span> that a smart contract needs to run with the fewest possible instructions. A full list of gas costs per opcode is available <a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1n6mRqkBz3iWcOlRem_mO09GtSKEKrAsfO7Frgx18pNU\/edit?usp=sharing\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">here<\/a>.<\/p>\n<p>Interaction with a smart contract is possible with a <strong>public ABI &#8211; <\/strong>a list of supported ways a user can interact with a contract.<\/p>\n<p>To interact with the contract, users submit a <span id=\"urn:enhancement-7d370933\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_transaction\">transaction<\/span> carrying any amount of gas (even 0 is acceptable) and a data payload formatted according to the ABI, specifying the type of interaction and any additional parameters.<\/p>\n<p>The logical structure of a smart contract can be divided as described below:<\/p>\n<ul>\n<li><strong>Call Data<\/strong>: the data associated with a <span id=\"urn:enhancement-c7d1f99\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_transaction\">transaction<\/span>. This usually contains a 4-byte method identifier followed by serialized arguments;<\/li>\n<li><strong>Stack<\/strong>: the EVM maintains a stack of <em>uint256<\/em> that is used to hold local <span id=\"urn:enhancement-6ccf83d8\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/variable_computer_science\">variables<\/span>, function call arguments and return addresses;<\/li>\n<li><strong>Memory<\/strong>: an array of <em>uint8 <\/em>is used to hold processing data while the contract is being executed &#8211; this data does not persist across consequent <span id=\"urn:enhancement-eff3a1fa\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_transaction\">transactions<\/span><\/li>\n<li><strong>Storage<\/strong>: a persistent associative map, with <em>uint256<\/em>s as keys and values, that contains all contract fields and mappings.<\/li>\n<\/ul>\n<h2 id=\"72iqt\"><strong>Choosing the IDE<\/strong><\/h2>\n<p>To write code and test smart contracts, a plethora of <span id=\"urn:enhancement-b9465423\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/integrated_development_environment\">IDEs<\/span> is available, both as online and offline <span id=\"urn:enhancement-1d53442e\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/application_software\">applications<\/span>. A complete list (as of today) of all the known <span id=\"urn:enhancement-30231d16\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/integrated_development_environment\">IDEs<\/span> used to develop Solidity\u00a0 is provided below, then we dive into the simplest to use.<\/p>\n<h3 id=\"dim6p\"><strong>Online<\/strong><\/h3>\n<ul>\n<li><u><strong><a href=\"https:\/\/remix.ethereum.org\/\">Remix<\/a><\/strong><\/u>: Built-in static analysis and test Blockchain VM;<\/li>\n<li><u><strong><a href=\"https:\/\/studio.ethereum.org\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Ethereum Studio<\/a><\/strong><\/u>: Built-in <span id=\"urn:enhancement-930b5c5e\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/web_browser\">browser<\/span> Blockchain VM, Metamask integration (one-click deployments to Testnet\/Mainnet), <span id=\"urn:enhancement-f9f1e8b4\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/database_transaction\">transaction<\/span> logger and <span id=\"urn:enhancement-6713a5c\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/live_coding\">live coding<\/span>;<\/li>\n<\/ul>\n<h3 id=\"7ucl7\"><strong>Offline<\/strong><\/h3>\n<ul>\n<li><u><strong><a href=\"https:\/\/atom.io\/\">Atom<\/a><\/strong><\/u>: editor with <em>Atom Solidity Linter, Etheratom, autocomplete-solidity, and language-solidity<\/em> packages;<\/li>\n<li><u><strong><a href=\"https:\/\/github.com\/tomlion\/vim-solidity\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">VIM Solidity<\/a><\/strong><\/u>: VIM syntax <span id=\"urn:enhancement-f0b129c1\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer_file\">file<\/span> for Solidity;<\/li>\n<li><u><strong><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=JuanBlanco.solidity\">Visual Studio Code<\/a><\/strong><\/u>: <span id=\"urn:enhancement-1bad4eb6\" class=\"textannotation disambiguated wl-creative-work\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/microsoft_visual_studio\">Visual Studio<\/span> Code extension that adds support for Solidity;<\/li>\n<li><u><strong><a href=\"https:\/\/github.com\/intellij-solidity\/intellij-solidity\/wiki\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">IntelliJ Solidity Plugin<\/a><\/strong><\/u>: open-source <span id=\"urn:enhancement-f4acfcc2\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/plug-in_computing\">plug-in<\/span> for JetBrains IntelliJ Idea <span id=\"urn:enhancement-d828cbf6\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/integrated_development_environment\">IDE<\/span> (free\/commercial) with syntax highlighting, formatting, code completion;<\/li>\n<li><u><strong><a href=\"https:\/\/github.com\/Yakindu\/solidity-ide\">YAKINDU Solidity Tools<\/a><\/strong><\/u>: Eclipse-based <span id=\"urn:enhancement-2571095a\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/integrated_development_environment\">IDE<\/span>, featuring context-sensitive code completion and help, code navigation, syntax coloring, built-in compiler, quick fixes and templates;<\/li>\n<li><u><strong><a href=\"https:\/\/ethfiddle.com\/\">Eth Fiddle<\/a><\/strong><\/u>: allows you to write, compile and debug the smart contract. Features sharing and <span id=\"urn:enhancement-aa566862\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/search_engine_technology\">search<\/span> of code snippets.<\/li>\n<\/ul>\n<p>For this series, we will use <strong>Ethereum Studio<\/strong>. This is the most complete out-of-the-box solution for developing and deploying smart contract on the network.<\/p>\n<h2 id=\"18n1d\"><strong>First steps with Ethereum Studio<\/strong><\/h2>\n<p><strong>Ethereum Studio <\/strong>is available on <u><a href=\"http:\/\/studio.ethereum.org\/\">studio.ethereum.org<\/a><\/u>. Visiting the website will activate a pop-up banner that instructs the user to choose from a set of smart contract templates. For now, we will choose the \u2018Hello World\u2019 smart contract template &#8211; this will allow us to understand the basics of <span id=\"urn:enhancement-33443b36\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/economic_development\">development<\/span> without writing specialized code.<\/p>\n<figure class=\"image regular \"><picture><source srcset=\"https:\/\/codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/Schermata2019-12-16alle16_10_56_46ac7061b25d299b65e7ccb316e00c8b_800.png 1x, https:\/\/images.storychief.com\/account_16344\/Schermata2019-12-16alle16_10_56_46ac7061b25d299b65e7ccb316e00c8b_1600.png 2x\" media=\"(max-width: 768px)\" \/><source srcset=\"https:\/\/codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/Schermata2019-12-16alle16_10_56_46ac7061b25d299b65e7ccb316e00c8b_800.png 1x, https:\/\/images.storychief.com\/account_16344\/Schermata2019-12-16alle16_10_56_46ac7061b25d299b65e7ccb316e00c8b_1600.png 2x\" media=\"(min-width: 769px)\" \/><img decoding=\"async\" src=\"https:\/\/codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/Schermata2019-12-16alle16_10_56_46ac7061b25d299b65e7ccb316e00c8b_800.png\" alt=\"\" \/><\/picture>\n<figcaption>An &#8216;Hello World&#8217; template on Ethereum Studio &#8211; studio.ethereum.org,<\/figcaption>\n<\/figure>\n<p>Before writing any actual code, it\u2019s important to understand all the basic functions of Ethereum Studio.<\/p>\n<p>The window is divided into three panes (from left to right):<\/p>\n<ul>\n<li><strong>Explorer<\/strong>: in the first pane, one can view the usual <span id=\"urn:enhancement-a0bd7ee0\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer_file\">file<\/span> hierarchy. At the top of the explorer, one can view the blockchain network on which the contract will run (the default is the <span id=\"urn:enhancement-a34cbb18\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/web_browser\">Browser<\/span> blockchain &#8211; a fake <span id=\"urn:enhancement-2893073c\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/blockchain\">blockchain<\/span>designed for running tests on) and the associated contract address. Note that only one smart contract can be deployed per address.<\/li>\n<li><strong>Text<\/strong>: where the code should be written<\/li>\n<li><strong>Simulator<\/strong>: a visual simulation of the functions of the smart contract or, in the case of smart contracts running at the core of an <span id=\"urn:enhancement-ec890be1\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/mobile_app\">app<\/span>, a rendering of the <span id=\"urn:enhancement-2b9ac23b\" class=\"textannotation disambiguated wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/mobile_app\">app<\/span> (much like <em>Xcode<\/em>).<\/li>\n<\/ul>\n<p>In preferences (top-right corner of the window), it\u2019s possible to adjust the gas requirements of the contract, setting personalized amounts for gas limit and gas price (in Gwei).<\/p>\n<p>At the bottom of the window, you&#8217;ll find basic information about the account address and the network: the address balance (in ETH), the gas limit, the gas price and the address of the network.<\/p>\n<p>Now we\u2019re finally ready to write some code. In the articles that follow, we will write basic functions and discover how to create smart contracts for different purposes.<\/p>\n<p><!-- strchf script --><script>        if(window.strchfSettings === undefined) window.strchfSettings = {};    window.strchfSettings.stats = {url: \"https:\/\/codemotion.storychief.io\/solidity-hello-world-blockchain?id=372928008&type=2\",title: \"Solidity, &quot;hello world&quot; with the Blockchain language\",id: \"66543c6c-96d5-4792-a44b-49339654b7a1\"};            (function(d, s, id) {      var js, sjs = d.getElementsByTagName(s)[0];      if (d.getElementById(id)) {window.strchf.update(); return;}      js = d.createElement(s); js.id = id;      js.src = \"https:\/\/d37oebn0w9ir6a.cloudfront.net\/scripts\/v0\/strchf.js\";      js.async = true;      sjs.parentNode.insertBefore(js, sjs);    }(document, 'script', 'storychief-jssdk'))    <\/script><!-- End strchf script --><\/p>\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will dive into how Solidity works, how the language is translated into the Ethereum Virtual Machine and then executed, and how to choose which IDE to use to begin to write some code.<\/p>\n","protected":false},"author":86,"featured_media":2210,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":4,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_uag_custom_page_level_css":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[13],"tags":[4240,4244],"collections":[],"class_list":{"0":"post-2209","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-blockchain","8":"tag-ethereum","9":"tag-smart-contract","10":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Solidity: &quot;Hello World&quot; with the Blockchain language - Codemotion<\/title>\n<meta name=\"description\" content=\"Dive into how Solidity works, how it is translated in the Ethereum Virtual Machine, and which IDE to use to write code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Solidity: &quot;Hello World&quot; with the Blockchain language\" \/>\n<meta property=\"og:description\" content=\"Dive into how Solidity works, how it is translated in the Ethereum Virtual Machine, and which IDE to use to write code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/\" \/>\n<meta property=\"og:site_name\" content=\"Codemotion Magazine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Codemotion.Italy\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/ijaack94\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-21T09:01:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-23T13:15:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1500\" \/>\n\t<meta property=\"og:image:height\" content=\"844\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Giacomo Barbieri\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ijaack94\" \/>\n<meta name=\"twitter:site\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Giacomo Barbieri\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/\"},\"author\":{\"name\":\"Giacomo Barbieri\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/ace6a459089546835d3262bb7aef87bf\"},\"headline\":\"Solidity: &#8220;Hello World&#8221; with the Blockchain language\",\"datePublished\":\"2019-12-21T09:01:00+00:00\",\"dateModified\":\"2021-12-23T13:15:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/\"},\"wordCount\":1027,\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png\",\"keywords\":[\"Ethereum\",\"Smart Contracts\"],\"articleSection\":[\"Blockchain\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/\",\"name\":\"Solidity: \\\"Hello World\\\" with the Blockchain language - Codemotion\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png\",\"datePublished\":\"2019-12-21T09:01:00+00:00\",\"dateModified\":\"2021-12-23T13:15:52+00:00\",\"description\":\"Dive into how Solidity works, how it is translated in the Ethereum Virtual Machine, and which IDE to use to write code.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#primaryimage\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png\",\"width\":1500,\"height\":844,\"caption\":\"Solidity, \\\"hello world\\\" with the Blockchain language\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Backend\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/backend\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Blockchain\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Solidity: &#8220;Hello World&#8221; with the Blockchain language\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"name\":\"Codemotion Magazine\",\"description\":\"We code the future. Together\",\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\",\"name\":\"Codemotion\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"width\":225,\"height\":225,\"caption\":\"Codemotion\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Codemotion.Italy\/\",\"https:\/\/x.com\/CodemotionIT\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/ace6a459089546835d3262bb7aef87bf\",\"name\":\"Giacomo Barbieri\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8381a47a5414b1154179659f56400e3eb72c3a592355c40b184a4f8a6a991c87?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8381a47a5414b1154179659f56400e3eb72c3a592355c40b184a4f8a6a991c87?s=96&d=mm&r=g\",\"caption\":\"Giacomo Barbieri\"},\"description\":\"Blogger with over 6 years of experience in blogs and newspapers, passionate about AI, 5G and blockchain. Never-ending learner of new technologies and approaches, I believe in the decentralized government and in the Internet of Money.\",\"sameAs\":[\"https:\/\/facebook.com\/ijaack94\",\"https:\/\/instagram.com\/ijaack94\/\",\"https:\/\/linkedin.com\/in\/giacomobarbieri94\",\"https:\/\/x.com\/ijaack94\"],\"url\":\"https:\/\/www.codemotion.com\/magazine\/author\/giacomo-barbieri\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Solidity: \"Hello World\" with the Blockchain language - Codemotion","description":"Dive into how Solidity works, how it is translated in the Ethereum Virtual Machine, and which IDE to use to write code.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/","og_locale":"en_US","og_type":"article","og_title":"Solidity: \"Hello World\" with the Blockchain language","og_description":"Dive into how Solidity works, how it is translated in the Ethereum Virtual Machine, and which IDE to use to write code.","og_url":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/","og_site_name":"Codemotion Magazine","article_publisher":"https:\/\/www.facebook.com\/Codemotion.Italy\/","article_author":"https:\/\/facebook.com\/ijaack94","article_published_time":"2019-12-21T09:01:00+00:00","article_modified_time":"2021-12-23T13:15:52+00:00","og_image":[{"width":1500,"height":844,"url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png","type":"image\/png"}],"author":"Giacomo Barbieri","twitter_card":"summary_large_image","twitter_creator":"@ijaack94","twitter_site":"@CodemotionIT","twitter_misc":{"Written by":"Giacomo Barbieri","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#article","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/"},"author":{"name":"Giacomo Barbieri","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/ace6a459089546835d3262bb7aef87bf"},"headline":"Solidity: &#8220;Hello World&#8221; with the Blockchain language","datePublished":"2019-12-21T09:01:00+00:00","dateModified":"2021-12-23T13:15:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/"},"wordCount":1027,"publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png","keywords":["Ethereum","Smart Contracts"],"articleSection":["Blockchain"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/","url":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/","name":"Solidity: \"Hello World\" with the Blockchain language - Codemotion","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#primaryimage"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png","datePublished":"2019-12-21T09:01:00+00:00","dateModified":"2021-12-23T13:15:52+00:00","description":"Dive into how Solidity works, how it is translated in the Ethereum Virtual Machine, and which IDE to use to write code.","breadcrumb":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#primaryimage","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png","width":1500,"height":844,"caption":"Solidity, \"hello world\" with the Blockchain language"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/solidity-hello-world-blockchain\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codemotion.com\/magazine\/"},{"@type":"ListItem","position":2,"name":"Backend","item":"https:\/\/www.codemotion.com\/magazine\/backend\/"},{"@type":"ListItem","position":3,"name":"Blockchain","item":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/"},{"@type":"ListItem","position":4,"name":"Solidity: &#8220;Hello World&#8221; with the Blockchain language"}]},{"@type":"WebSite","@id":"https:\/\/www.codemotion.com\/magazine\/#website","url":"https:\/\/www.codemotion.com\/magazine\/","name":"Codemotion Magazine","description":"We code the future. Together","publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codemotion.com\/magazine\/#organization","name":"Codemotion","url":"https:\/\/www.codemotion.com\/magazine\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","width":225,"height":225,"caption":"Codemotion"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Codemotion.Italy\/","https:\/\/x.com\/CodemotionIT"]},{"@type":"Person","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/ace6a459089546835d3262bb7aef87bf","name":"Giacomo Barbieri","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8381a47a5414b1154179659f56400e3eb72c3a592355c40b184a4f8a6a991c87?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8381a47a5414b1154179659f56400e3eb72c3a592355c40b184a4f8a6a991c87?s=96&d=mm&r=g","caption":"Giacomo Barbieri"},"description":"Blogger with over 6 years of experience in blogs and newspapers, passionate about AI, 5G and blockchain. Never-ending learner of new technologies and approaches, I believe in the decentralized government and in the Internet of Money.","sameAs":["https:\/\/facebook.com\/ijaack94","https:\/\/instagram.com\/ijaack94\/","https:\/\/linkedin.com\/in\/giacomobarbieri94","https:\/\/x.com\/ijaack94"],"url":"https:\/\/www.codemotion.com\/magazine\/author\/giacomo-barbieri\/"}]}},"featured_image_src":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000-600x400.png","featured_image_src_square":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000-600x600.png","author_info":{"display_name":"Giacomo Barbieri","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/giacomo-barbieri\/"},"uagb_featured_image_src":{"full":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png",1500,844,false],"thumbnail":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000-150x150.png",150,150,true],"medium":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000-300x169.png",300,169,true],"medium_large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000-768x432.png",768,432,true],"large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000-1024x576.png",1024,576,true],"1536x1536":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png",1500,844,false],"2048x2048":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png",1500,844,false],"small-home-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000.png",100,56,false],"sidebar-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000-180x128.png",180,128,true],"genesis-singular-images":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000-896x504.png",896,504,true],"archive-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000-400x225.png",400,225,true],"gb-block-post-grid-landscape":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000-600x400.png",600,400,true],"gb-block-post-grid-square":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/12\/logo_2c9d647735f36cbeb5dd09fc473f116e_2000-600x600.png",600,600,true]},"uagb_author_info":{"display_name":"Giacomo Barbieri","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/giacomo-barbieri\/"},"uagb_comment_info":0,"uagb_excerpt":"In this article, we will dive into how Solidity works, how the language is translated into the Ethereum Virtual Machine and then executed, and how to choose which IDE to use to begin to write some code.","lang":"en","_links":{"self":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/2209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/users\/86"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/comments?post=2209"}],"version-history":[{"count":9,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/2209\/revisions"}],"predecessor-version":[{"id":15522,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/2209\/revisions\/15522"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media\/2210"}],"wp:attachment":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media?parent=2209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/categories?post=2209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/tags?post=2209"},{"taxonomy":"collections","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/collections?post=2209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}