{"id":2524,"date":"2019-06-10T17:46:00","date_gmt":"2019-06-10T05:46:00","guid":{"rendered":"http:\/\/www.talkcrypto.org\/blog\/?p=2524"},"modified":"2020-06-03T12:37:42","modified_gmt":"2020-06-03T00:37:42","slug":"tutorialtoken-smart-contract-with-truffle","status":"publish","type":"post","link":"https:\/\/www.talkcrypto.org\/blog\/2019\/06\/10\/tutorialtoken-smart-contract-with-truffle\/","title":{"rendered":"TutorialToken smart contract with Truffle"},"content":{"rendered":"\n<p>If you are trying to go through the<a rel=\"noreferrer noopener\" aria-label=\" token tutorial (opens in a new tab)\" href=\"https:\/\/www.trufflesuite.com\/tutorials\/robust-smart-contracts-with-openzeppelin\" target=\"_blank\"> token tutorial<\/a> by Truffle there are a few things to note. <\/p>\n\n\n\n<p>If you follow the instructions fully, it will not work. Firstly the pragma version needs to be updated from 0.4.24 to 0.5.0. This is because if you install Truffle, it will install the latest version of solc, the solidity compiler which will be 0.5.8 at this time of writing. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"323\" src=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-4.05.45-pm-1024x323.png\" alt=\"\" class=\"wp-image-2525\" srcset=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-4.05.45-pm-1024x323.png 1024w, https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-4.05.45-pm-300x95.png 300w, https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-4.05.45-pm-768x242.png 768w, https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-4.05.45-pm.png 1212w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next, if you run &#8220;npm run dev&#8221;, you might encounter and error like ERR! tutorialtoken@1.0.0 dev: `lite-server`. If you do, you&#8217;ll want to fix it by doing <a rel=\"noreferrer noopener\" aria-label=\"this (opens in a new tab)\" href=\"https:\/\/www.talkcrypto.org\/blog\/2019\/06\/07\/tutorialtoken1-0-0-dev-lite-server\/\" target=\"_blank\">this<\/a>.<\/p>\n\n\n\n<p>Then you&#8217;ll want to make sure that Metamask is either not yet installed or that it is disabled. Otherwise the tokens will appear in Metamask instead of on the webpage. <\/p>\n\n\n\n<p>Finally, you need to change the port in app.js from 9545 to 7545 which is the Ganache port. <\/p>\n\n\n\n<p>The tutorial is great but is several years old so needs these modifications. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are trying to go through the token tutorial<\/p>\n","protected":false},"author":1,"featured_media":2526,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2524","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ethereum"],"featured_image_urls":{"full":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-3.38.16-pm.png",562,210,false],"thumbnail":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-3.38.16-pm-150x150.png",150,150,true],"medium":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-3.38.16-pm-300x112.png",300,112,true],"medium_large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-3.38.16-pm.png",562,210,false],"large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-3.38.16-pm.png",562,210,false],"1536x1536":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-3.38.16-pm.png",562,210,false],"2048x2048":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-3.38.16-pm.png",562,210,false],"chromenews-featured":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-3.38.16-pm.png",562,210,false],"chromenews-large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-3.38.16-pm.png",562,210,false],"chromenews-medium":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-3.38.16-pm.png",562,210,false]},"author_info":{"info":["seandotau"]},"category_info":"<a href=\"https:\/\/www.talkcrypto.org\/blog\/category\/ethereum\/\" rel=\"category tag\">Ethereum<\/a>","tag_info":"Ethereum","comment_count":"0","_links":{"self":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/2524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/comments?post=2524"}],"version-history":[{"count":2,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/2524\/revisions"}],"predecessor-version":[{"id":2682,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/2524\/revisions\/2682"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/media\/2526"}],"wp:attachment":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/media?parent=2524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/categories?post=2524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/tags?post=2524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}