{"id":3638,"date":"2020-03-18T11:00:00","date_gmt":"2020-03-18T10:00:00","guid":{"rendered":"https:\/\/www.codemotion.com\/magazine\/?p=3638"},"modified":"2021-07-08T17:01:34","modified_gmt":"2021-07-08T15:01:34","slug":"smart-contract-create-interface-token-blockchain","status":"publish","type":"post","link":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/","title":{"rendered":"Creating the interface of a smart contract"},"content":{"rendered":"\t\t\t\t<div class=\"wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-427e1f09-ed78-45fc-a401-2b2dd5aeba30      \"\n\t\t\t\t\tdata-scroll= \"1\"\n\t\t\t\t\tdata-offset= \"30\"\n\t\t\t\t\tstyle=\"\"\n\t\t\t\t>\n\t\t\t\t<div class=\"uagb-toc__wrap\">\n\t\t\t\t\t\t<div class=\"uagb-toc__title\">\n\t\t\t\t\t\t\tTable Of Contents\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"uagb-toc__list-wrap \">\n\t\t\t\t\t\t<ol class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#introduction\" class=\"uagb-toc-link__trigger\">Introduction<\/a><li class=\"uagb-toc__list\"><a href=\"#smart-contract-building-a-simple-interface\" class=\"uagb-toc-link__trigger\">Smart contract: building a simple interface<\/a><\/ol>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\r\n\r\n\r\n\r\n<p>In previous articles in this series, we learned <a class=\"ek-link\" href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/blockchain-dev\/simple-contract-solidity-blockchain\/\">how a basic contract is made<\/a>, and discovered that <a class=\"ek-link\" href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/blockchain-dev\/solidity-hello-world-blockchain\/\">Ethereum Studio<\/a> is a simple and easy way to develop and deploy on a testnet. We demonstrated how to build a simple web interface using the <strong>Web3.js<\/strong> Javascript framework to handle user interaction via web browser. With that in mind, in this chapter we will go through an example of a web page, and in the following (and final) chapter, we\u2019ll see how web3 is actually implemented in order to connect the smart contract to a web page.<\/p>\r\n\r\n\r\n\r\n<p>This article is part four of a series on <strong>how to create an ERC-20 token<\/strong>. If you want to begin from scratch, please read <a href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/blockchain-dev\/what-is-an-erc-20-token-an-overview\/\">part one<\/a>, <a href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/blockchain-dev\/solidity-hello-world-blockchain\/\">part two<\/a> and <a href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/blockchain-dev\/simple-contract-solidity-blockchain\/\">part three<\/a> of this series first (here&#8217;s <a href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/blockchain-dev\/web3-js-ethereum-blockchain-javascript-api\/\">part five<\/a>).<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Smart contract: building a simple interface<\/h2>\r\n\r\n\r\n\r\n<p>Web3.js is the <a href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/javascript\/javascript-frameworks-guide\/\" target=\"_blank\" rel=\"noopener\">Javascript framework<\/a> that allows users to interact with the Blockchain. To implement a smart contract with an interactive interface, we must build a simple web page.<\/p>\r\n\r\n\r\n\r\n<p>We begin by creating an HTML file:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-meta\">&lt;!DOCTYPE <span class=\"hljs-meta-keyword\">html<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">html<\/span> <span class=\"hljs-attr\">lang<\/span>=<span class=\"hljs-string\">\"en\"<\/span>&gt;<\/span>\r\n\/\/ here lies the smart contract interface\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">html<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p>Then, we need to configure the metadata in the header. We load jQuery and Web3.js packages:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">head<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">meta<\/span> <span class=\"hljs-attr\">charset<\/span>=<span class=\"hljs-string\">\"utf-8\"<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\/javascript\"<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"https:\/\/unpkg.com\/jquery@3.3.1\/dist\/jquery.js\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\/javascript\"<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"https:\/\/unpkg.com\/web3@0.20.5\/dist\/web3.min.js\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">head<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p>Then we can actually <strong>design the interface<\/strong>. In this example, we are going to create a user interface that has two sections: the first will let users create an address with an attached amount of token, whilst the second will check the balance of an address.<\/p>\r\n\r\n\r\n\r\n<p>Here is the first section:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">body<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"create\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"tabcontent\"<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h2<\/span>&gt;<\/span>Create new coins<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h2<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h3<\/span>&gt;<\/span>Address<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h3<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"create-address\"<\/span> <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"Enter address\"<\/span> \/&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h3<\/span>&gt;<\/span>Amount<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h3<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"number\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"create-amount\"<\/span> <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"Enter amount...\"<\/span> \/&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"btn\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"button-create\"<\/span>&gt;<\/span>Send<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p>And here is the second section:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"balances\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"tabcontent\"<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h2<\/span>&gt;<\/span>Check balance of wallet<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h2<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h3<\/span>&gt;<\/span>Address<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h3<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"balance-address\"<\/span> <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"Enter address...\"<\/span> \/&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"btn\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"button-check\"<\/span>&gt;<\/span>Check balance<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h1<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"text message\"<\/span>&gt;<\/span>Balance:\u00a0<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">span<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"message\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">span<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h1<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">body<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p>It\u2019s important to note that there\u2019s not even a single script within the HTML code. That\u2019s because the contract connects with the page through a <em>.js<\/em> file that builds objects from the smart contract.<\/p>\r\n\r\n\r\n\r\n<p>In the <code>&lt;div&gt;<\/code> elements, one can see the <code>id<\/code> of every element: these will later be called by the <em>.js<\/em> core to match the attributes in the smart contract.<\/p>\r\n\r\n\r\n\r\n<p>Here\u2019s the complete HTML page:<\/p>\r\n\r\n\r\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-meta\">&lt;!DOCTYPE <span class=\"hljs-meta-keyword\">html<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">html<\/span> <span class=\"hljs-attr\">lang<\/span>=<span class=\"hljs-string\">\"en\"<\/span>&gt;<\/span>\r\n\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">head<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">meta<\/span> <span class=\"hljs-attr\">charset<\/span>=<span class=\"hljs-string\">\"utf-8\"<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\/javascript\"<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"https:\/\/unpkg.com\/jquery@3.3.1\/dist\/jquery.js\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\/javascript\"<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"https:\/\/unpkg.com\/web3@0.20.5\/dist\/web3.min.js\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">head<\/span>&gt;<\/span>\r\n\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">body<\/span>&gt;<\/span>\r\n\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"create\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"tabcontent\"<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h2<\/span>&gt;<\/span>Create new coins<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h2<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h3<\/span>&gt;<\/span>Address<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h3<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"create-address\"<\/span> <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"Enter address...\"<\/span> \/&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h3<\/span>&gt;<\/span>Amount<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h3<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"number\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"create-amount\"<\/span> <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"Enter amount...\"<\/span> \/&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"btn\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"button-create\"<\/span>&gt;<\/span>Send<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"balances\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"tabcontent\"<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h2<\/span>&gt;<\/span>Check balance of wallet<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h2<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h3<\/span>&gt;<\/span>Address<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h3<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"balance-address\"<\/span> <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"Enter address...\"<\/span> \/&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"btn\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"button-check\"<\/span>&gt;<\/span>Check balance<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\r\n\r\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h1<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"text message\"<\/span>&gt;<\/span>Balance:\u00a0<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">span<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"message\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">span<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h1<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">body<\/span>&gt;<\/span>\r\n\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">html<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\r\n\r\n\r\n<p>So, to recap:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>The logic of the token is described in the <em>.sol<\/em> file, in Solidity;<\/li>\r\n<li>The token logic is built (initialized) in a <em>.js<\/em> file, that \u2018prepares\u2019 the smart contract to be interactive in a HTML page;<\/li>\r\n<li>The HTML page visualizes the objects rendered with the <em>.js<\/em> file.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>Of course, the HTML page can and should be built with a CSS file as well (which can be put in the same folder as the HTML page). Coding the stylesheet of the interface is beyond the scope of this series, so we won\u2019t show it here, but the page can be customized as much as one wants.<\/p>\r\n\r\n\r\n\r\n<p>So, we have the token logic and we have designed the HTML page. We must now code the <em>.js<\/em> core file that acts as a bridge between the two. That\u2019s the focus of the final chapter in this series.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Introduction In previous articles in this series, we learned how a basic contract is made, and discovered that Ethereum Studio is a simple and easy way to develop and deploy on a testnet. We demonstrated how to build a simple web interface using the Web3.js Javascript framework to handle user interaction via web browser. With&#8230; <a class=\"more-link\" href=\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/\">Read more<\/a><\/p>\n","protected":false},"author":86,"featured_media":3641,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":2,"_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,63,4244],"collections":[],"class_list":{"0":"post-3638","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-blockchain","8":"tag-ethereum","9":"tag-html","10":"tag-smart-contract","11":"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>Smart contract: how to create the interface - Codemotion Magazine<\/title>\n<meta name=\"description\" content=\"Now that we understand the basic logic of a smart contract in Solidity, we will dive into tweaking the attributes of a token, using a web-based UI to make it interactive.\" \/>\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\/smart-contract-create-interface-token-blockchain\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating the interface of a smart contract\" \/>\n<meta property=\"og:description\" content=\"Now that we understand the basic logic of a smart contract in Solidity, we will dive into tweaking the attributes of a token, using a web-based UI to make it interactive.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-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=\"2020-03-18T10:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-08T15:01:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\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=\"4 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\/smart-contract-create-interface-token-blockchain\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/\"},\"author\":{\"name\":\"Giacomo Barbieri\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/ace6a459089546835d3262bb7aef87bf\"},\"headline\":\"Creating the interface of a smart contract\",\"datePublished\":\"2020-03-18T10:00:00+00:00\",\"dateModified\":\"2021-07-08T15:01:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/\"},\"wordCount\":488,\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain.png\",\"keywords\":[\"Ethereum\",\"HTML\",\"Smart Contracts\"],\"articleSection\":[\"Blockchain\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/\",\"name\":\"Smart contract: how to create the interface - Codemotion Magazine\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain.png\",\"datePublished\":\"2020-03-18T10:00:00+00:00\",\"dateModified\":\"2021-07-08T15:01:34+00:00\",\"description\":\"Now that we understand the basic logic of a smart contract in Solidity, we will dive into tweaking the attributes of a token, using a web-based UI to make it interactive.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/#primaryimage\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain.png\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain.png\",\"width\":1200,\"height\":675,\"caption\":\"Blockchain\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-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\":\"Creating the interface of a smart contract\"}]},{\"@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":"Smart contract: how to create the interface - Codemotion Magazine","description":"Now that we understand the basic logic of a smart contract in Solidity, we will dive into tweaking the attributes of a token, using a web-based UI to make it interactive.","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\/smart-contract-create-interface-token-blockchain\/","og_locale":"en_US","og_type":"article","og_title":"Creating the interface of a smart contract","og_description":"Now that we understand the basic logic of a smart contract in Solidity, we will dive into tweaking the attributes of a token, using a web-based UI to make it interactive.","og_url":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/","og_site_name":"Codemotion Magazine","article_publisher":"https:\/\/www.facebook.com\/Codemotion.Italy\/","article_author":"https:\/\/facebook.com\/ijaack94","article_published_time":"2020-03-18T10:00:00+00:00","article_modified_time":"2021-07-08T15:01:34+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain.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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/#article","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/"},"author":{"name":"Giacomo Barbieri","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/ace6a459089546835d3262bb7aef87bf"},"headline":"Creating the interface of a smart contract","datePublished":"2020-03-18T10:00:00+00:00","dateModified":"2021-07-08T15:01:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/"},"wordCount":488,"publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain.png","keywords":["Ethereum","HTML","Smart Contracts"],"articleSection":["Blockchain"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/","url":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/","name":"Smart contract: how to create the interface - Codemotion Magazine","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/#primaryimage"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain.png","datePublished":"2020-03-18T10:00:00+00:00","dateModified":"2021-07-08T15:01:34+00:00","description":"Now that we understand the basic logic of a smart contract in Solidity, we will dive into tweaking the attributes of a token, using a web-based UI to make it interactive.","breadcrumb":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-blockchain\/#primaryimage","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain.png","width":1200,"height":675,"caption":"Blockchain"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/blockchain\/smart-contract-create-interface-token-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":"Creating the interface of a smart contract"}]},{"@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\/2020\/03\/blockchain-600x400.png","featured_image_src_square":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain-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\/2020\/03\/blockchain.png",1200,675,false],"thumbnail":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain-150x150.png",150,150,true],"medium":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain-300x169.png",300,169,true],"medium_large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain-768x432.png",768,432,true],"large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain-1024x576.png",1024,576,true],"1536x1536":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain.png",1200,675,false],"2048x2048":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain.png",1200,675,false],"small-home-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain.png",100,56,false],"sidebar-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain-180x128.png",180,128,true],"genesis-singular-images":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain-896x504.png",896,504,true],"archive-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain-400x225.png",400,225,true],"gb-block-post-grid-landscape":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain-600x400.png",600,400,true],"gb-block-post-grid-square":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/03\/blockchain-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":"Introduction In previous articles in this series, we learned how a basic contract is made, and discovered that Ethereum Studio is a simple and easy way to develop and deploy on a testnet. We demonstrated how to build a simple web interface using the Web3.js Javascript framework to handle user interaction via web browser. With&#8230;&hellip;","lang":"en","_links":{"self":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/3638","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=3638"}],"version-history":[{"count":8,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/3638\/revisions"}],"predecessor-version":[{"id":15518,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/3638\/revisions\/15518"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media\/3641"}],"wp:attachment":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media?parent=3638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/categories?post=3638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/tags?post=3638"},{"taxonomy":"collections","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/collections?post=3638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}