<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rafal Kaluzny, Author at Be on the Right Side of Change</title>
	<atom:link href="https://blog.finxter.com/author/rafalkaluzny/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.finxter.com/author/rafalkaluzny/</link>
	<description></description>
	<lastBuildDate>Fri, 17 Feb 2023 18:38:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.finxter.com/wp-content/uploads/2020/08/cropped-cropped-finxter_nobackground-32x32.png</url>
	<title>Rafal Kaluzny, Author at Be on the Right Side of Change</title>
	<link>https://blog.finxter.com/author/rafalkaluzny/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>ChatGPT at the Heart &#8211; Building a Movie Recommendation Python Web App in 2023</title>
		<link>https://blog.finxter.com/building-a-movie-recommendation-app-with-chatgpt/</link>
		
		<dc:creator><![CDATA[Rafal Kaluzny]]></dc:creator>
		<pubDate>Tue, 14 Feb 2023 16:05:45 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[ChatGPT]]></category>
		<category><![CDATA[Flask]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Web Development]]></category>
		<guid isPermaLink="false">https://blog.finxter.com/?p=1132950</guid>

					<description><![CDATA[<p>In this article, I will show you how I have built a simple but quite powerful movie recommendation app. 💻 Try It Yourself: You can play with the live demo here. I built it for two reasons: This app uses Python, HTML/CSS, Flask, Vercel, and the OpenAI API capabilities. Prerequisites Files in this project Here ... <a title="ChatGPT at the Heart &#8211; Building a Movie Recommendation Python Web App in 2023" class="read-more" href="https://blog.finxter.com/building-a-movie-recommendation-app-with-chatgpt/" aria-label="Read more about ChatGPT at the Heart &#8211; Building a Movie Recommendation Python Web App in 2023">Read more</a></p>
<p>The post <a href="https://blog.finxter.com/building-a-movie-recommendation-app-with-chatgpt/">ChatGPT at the Heart &#8211; Building a Movie Recommendation Python Web App in 2023</a> appeared first on <a href="https://blog.finxter.com">Be on the Right Side of Change</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In this article, I will show you how I have built a simple but quite powerful movie recommendation app.</p>



<p class="has-base-background-color has-background"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bb.png" alt="💻" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <strong>Try It Yourself</strong>: <a href="https://vercel-openai.vercel.app/" data-type="URL" data-id="https://vercel-openai.vercel.app/" target="_blank" rel="noreferrer noopener">You can play with the live demo here.</a></p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Building a Movie Recommendation Python App with ChatGPT" width="937" height="703" src="https://www.youtube.com/embed/6xHg66qGjdQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>I built it for two reasons: </p>



<ul class="wp-block-list">
<li>(i) to keep educating myself on modern technologies, </li>



<li>(ii) to see which movies can entertain me on a weekend night.</li>
</ul>



<p>This app uses Python, HTML/CSS, Flask, Vercel, and the OpenAI API capabilities.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<ul class="wp-block-list">
<li>Python with <strong><code><a href="https://blog.finxter.com/build-website-with-flask/" data-type="post" data-id="420533" target="_blank" rel="noreferrer noopener">flask</a></code></strong> and <strong><code><a href="https://blog.finxter.com/openai-api-or-how-i-made-my-python-code-intelligent/" data-type="post" data-id="1081478" target="_blank" rel="noreferrer noopener">openai</a></code></strong> libraries</li>



<li>OpenAI secret key from<br><a rel="noreferrer noopener" href="https://beta.openai.com/account/api-keys" target="_blank">https://beta.openai.com/account/api-keys<br></a>(see a nice <a rel="noreferrer noopener" href="https://blog.finxter.com/openai-api-or-how-i-made-my-python-code-intelligent" data-type="URL" data-id="https://blog.finxter.com/openai-api-or-how-i-made-my-python-code-intelligent" target="_blank">Finxter tutorial</a> on how to get it)</li>



<li>Vercel account for cloud deployment<br><a href="https://vercel.com/" target="_blank" rel="noreferrer noopener">https://vercel.com/</a></li>



<li>GitHub account for code storage<br>Feel free to use/fork the below code from the <a rel="noreferrer noopener" href="https://github.com/finxter/vercel-openai" data-type="URL" data-id="https://github.com/finxter/vercel-openai" target="_blank">GitHub</a></li>
</ul>



<h2 class="wp-block-heading">Files in this project</h2>



<p>Here is the snapshot of my code from GitHub.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="930" height="924" src="https://blog.finxter.com/wp-content/uploads/2023/02/image-192.png" alt="" class="wp-image-1132962" srcset="https://blog.finxter.com/wp-content/uploads/2023/02/image-192.png 930w, https://blog.finxter.com/wp-content/uploads/2023/02/image-192-300x298.png 300w, https://blog.finxter.com/wp-content/uploads/2023/02/image-192-150x150.png 150w, https://blog.finxter.com/wp-content/uploads/2023/02/image-192-768x763.png 768w" sizes="(max-width: 930px) 100vw, 930px" /></figure>
</div>


<p>The key files are these:</p>



<ul class="wp-block-list">
<li><code>.env</code></li>



<li><code>api/index.py</code></li>



<li><code>api/templates/index.html</code></li>
</ul>



<p>First, I use the <code>.env</code> file and add my secret key.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">FLASK_APP=app
FLASK_DEBUG=1
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</pre>



<p>Then goes the Python file.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import os, openai
from flask import Flask, redirect, render_template, request, url_for


app = Flask(__name__)
openai.api_key = os.getenv("OPENAI_API_KEY")




@app.route("/", methods=("GET", "POST"))
def index():
   if request.method == "POST":
       category = request.form["category"]
       number = request.form["number"]
       response = openai.Completion.create(
           model="text-davinci-003",
           prompt=generate_prompt(number, category),
           temperature=0.5,
           max_tokens=60,
           top_p=1,
           frequency_penalty=0,
           presence_penalty=0
       )


       return redirect(url_for("index", result=response.choices[0].text))


   result = request.args.get("result")
   return render_template("index.html", result=result)




def generate_prompt(number, category):
   return """Recommend the best {} {} movies to watch:""".format(number,
       category.capitalize()
   )






if __name__ == '__main__':
   app.run(host='127.0.0.1', port=5050, debug=True)
</pre>



<p>The imports I use are the following:</p>



<ul class="wp-block-list">
<li><code><a href="https://blog.finxter.com/exploring-pythons-os-module/" data-type="post" data-id="19050" target="_blank" rel="noreferrer noopener">os</a></code> &#8211; to work with the functionality dependent on the operating system</li>



<li><code><a href="https://blog.finxter.com/openai-api-or-how-i-made-my-python-code-intelligent/" data-type="post" data-id="1081478" target="_blank" rel="noreferrer noopener">openai</a></code> &#8211; to get the best of OpenAI artificial intelligence</li>



<li><code><a href="https://blog.finxter.com/build-website-with-flask/" data-type="post" data-id="420533" target="_blank" rel="noreferrer noopener">flask</a></code> &#8211; to have a nice-looking frontend framework for Python</li>
</ul>



<p>Some Flask basics.&nbsp;</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">@app.route("/", methods=("GET", "POST"))</pre>



<p>The first line there is implementing the main route (and the only one in this app). You can think of it as the main URL, whether it is <code>localhost/</code> or <code>www.mysite.com/</code>.</p>



<p>The following function <code>index()</code> is taking information from the HTML form (see <code>index.html</code>) and preparing the data to be displayed back by the <code>index.html</code> site.</p>



<p>Here’s what happens the moment you hit the “<code>Generate titles</code>” button on your site:</p>



<ul class="wp-block-list">
<li><code>index()</code> function takes the input being “number” and “category” from the form,</li>



<li>feeds it into the <code>generate_prompt()</code> function,&nbsp;</li>



<li>which crafts and passes back a question to be asked,</li>



<li>which then &#8211; via the API &#8211; is sent to OpenAI to get a “response”,&nbsp;</li>



<li>that is then passed as “result” onto <code>index.html</code> to render on the screen.</li>
</ul>



<p>Let’s also have a look at the <code>index.html</code> file.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;!DOCTYPE html>
&lt;head>
 &lt;title>OpenAI Movies&lt;/title>
 &lt;link
   rel="shortcut icon"
   href="{{ url_for('static', filename='movie.png') }}"
 />
 &lt;link rel="stylesheet" href="{{ url_for('static', filename='main.css') }}" />
&lt;/head>


&lt;body>
 &lt;img src="{{ url_for('static', filename='movie.png') }}" class="icon" />
 &lt;h3>Recommend the top movies&lt;/h3>
 &lt;form action="/" method="post">
   &lt;input type="text" name="number" placeholder="How many proposals, e.g. 1,3,10" required />
   &lt;input type="text" name="category" placeholder="Enter the category e.g. thriller, comedy" required />
   &lt;input type="submit" value="Generate titles" />
 &lt;/form>
 {% if result %}
 &lt;div class="result">
   &lt;pre>{{ result | safe }}&lt;/pre>
 &lt;/div>
 {% endif %}
&lt;/body>
</pre>



<p>I will not go over the HTML tags as these should be familiar to you, and if not, you can get yourself up to speed with that using other web sources.</p>



<p>Initially, the file will feel like an ordinary HTML/CSS site, but after a while, you will notice a strange animal.&nbsp; It is placed here at the bottom of the file.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""> {% if result %}
 &lt;div class="result">
   {{ result }}
 &lt;/div>
 {% endif %}
</pre>



<p>This is where Python co-exists with HTML and allows the “result” that we generate in our “Python backend” to be passed over to the “Flask frontend”. If it exists, the flask engine will render the website with the results at the bottom.</p>



<h2 class="wp-block-heading">Run the App Locally</h2>



<p>Running an app is simple. I just run the <code>index.py</code> file.</p>



<p>With the “<code>host</code>” and “<code>port</code>” attributes specified in the <code>index.py</code> file, Flask will run a local web server with the site.</p>



<p>This is how it looks in my Visual Studio Code:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="637" src="https://blog.finxter.com/wp-content/uploads/2023/02/image-193-1024x637.png" alt="" class="wp-image-1132977" srcset="https://blog.finxter.com/wp-content/uploads/2023/02/image-193-1024x637.png 1024w, https://blog.finxter.com/wp-content/uploads/2023/02/image-193-300x187.png 300w, https://blog.finxter.com/wp-content/uploads/2023/02/image-193-768x478.png 768w, https://blog.finxter.com/wp-content/uploads/2023/02/image-193-1536x955.png 1536w, https://blog.finxter.com/wp-content/uploads/2023/02/image-193.png 1600w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>And this is the browser view:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="581" src="https://blog.finxter.com/wp-content/uploads/2023/02/image-194-1024x581.png" alt="" class="wp-image-1132978" srcset="https://blog.finxter.com/wp-content/uploads/2023/02/image-194-1024x581.png 1024w, https://blog.finxter.com/wp-content/uploads/2023/02/image-194-300x170.png 300w, https://blog.finxter.com/wp-content/uploads/2023/02/image-194-768x436.png 768w, https://blog.finxter.com/wp-content/uploads/2023/02/image-194-1536x872.png 1536w, https://blog.finxter.com/wp-content/uploads/2023/02/image-194.png 1600w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<h2 class="wp-block-heading">Vercel deployment</h2>



<p>Alright, the app is built and works fine on my local machine.&nbsp;</p>



<p>Now &#8211; let’s get it shipped to the world!</p>



<p>First, I put the whole project into my <a rel="noreferrer noopener" href="https://github.com/finxter/vercel-openai" data-type="URL" data-id="https://github.com/finxter/vercel-openai" target="_blank">personal GitHub repo</a>. I am using a public one just so that you and other readers can use it. Yet, if you follow my steps here, I would suggest a private one to you.<br></p>



<p class="has-base-background-color has-background"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f6d1.png" alt="🛑" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <strong>Warning</strong>: The risk with public repo is that it exposes your OpenAI secret key to the world! That would be identified anyways, and your key would rotate, but why bother?</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="607" src="https://blog.finxter.com/wp-content/uploads/2023/02/image-195-1024x607.png" alt="" class="wp-image-1132980" srcset="https://blog.finxter.com/wp-content/uploads/2023/02/image-195-1024x607.png 1024w, https://blog.finxter.com/wp-content/uploads/2023/02/image-195-300x178.png 300w, https://blog.finxter.com/wp-content/uploads/2023/02/image-195-768x456.png 768w, https://blog.finxter.com/wp-content/uploads/2023/02/image-195-1536x911.png 1536w, https://blog.finxter.com/wp-content/uploads/2023/02/image-195.png 1600w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>Now, I log in to the Vercel dashboard and click on “Add New…” and select “Project”.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="353" src="https://blog.finxter.com/wp-content/uploads/2023/02/image-196-1024x353.png" alt="" class="wp-image-1132982" srcset="https://blog.finxter.com/wp-content/uploads/2023/02/image-196-1024x353.png 1024w, https://blog.finxter.com/wp-content/uploads/2023/02/image-196-300x103.png 300w, https://blog.finxter.com/wp-content/uploads/2023/02/image-196-768x264.png 768w, https://blog.finxter.com/wp-content/uploads/2023/02/image-196-1536x529.png 1536w, https://blog.finxter.com/wp-content/uploads/2023/02/image-196.png 1600w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>Selecting GitHub as Git provider.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="717" src="https://blog.finxter.com/wp-content/uploads/2023/02/image-197-1024x717.png" alt="" class="wp-image-1132983" srcset="https://blog.finxter.com/wp-content/uploads/2023/02/image-197-1024x717.png 1024w, https://blog.finxter.com/wp-content/uploads/2023/02/image-197-300x210.png 300w, https://blog.finxter.com/wp-content/uploads/2023/02/image-197-768x538.png 768w, https://blog.finxter.com/wp-content/uploads/2023/02/image-197.png 1422w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>Selecting the repository and importing it.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="666" src="https://blog.finxter.com/wp-content/uploads/2023/02/image-198-1024x666.png" alt="" class="wp-image-1132984" srcset="https://blog.finxter.com/wp-content/uploads/2023/02/image-198-1024x666.png 1024w, https://blog.finxter.com/wp-content/uploads/2023/02/image-198-300x195.png 300w, https://blog.finxter.com/wp-content/uploads/2023/02/image-198-768x499.png 768w, https://blog.finxter.com/wp-content/uploads/2023/02/image-198.png 1406w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>Arrived at the “<strong>You&#8217;re almost done.</strong>” page. There is no need to alter any of the default parameters there except adding one important variable. In environment variables, I add my own unique <code>OPENAI_API_KEY</code>.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="399" src="https://blog.finxter.com/wp-content/uploads/2023/02/image-199-1024x399.png" alt="" class="wp-image-1132986" srcset="https://blog.finxter.com/wp-content/uploads/2023/02/image-199-1024x399.png 1024w, https://blog.finxter.com/wp-content/uploads/2023/02/image-199-300x117.png 300w, https://blog.finxter.com/wp-content/uploads/2023/02/image-199-768x299.png 768w, https://blog.finxter.com/wp-content/uploads/2023/02/image-199-1536x598.png 1536w, https://blog.finxter.com/wp-content/uploads/2023/02/image-199.png 1600w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>Making sure this is indeed saved properly.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="109" src="https://blog.finxter.com/wp-content/uploads/2023/02/image-200-1024x109.png" alt="" class="wp-image-1132987" srcset="https://blog.finxter.com/wp-content/uploads/2023/02/image-200-1024x109.png 1024w, https://blog.finxter.com/wp-content/uploads/2023/02/image-200-300x32.png 300w, https://blog.finxter.com/wp-content/uploads/2023/02/image-200-768x82.png 768w, https://blog.finxter.com/wp-content/uploads/2023/02/image-200-1536x164.png 1536w, https://blog.finxter.com/wp-content/uploads/2023/02/image-200.png 1600w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>This is it. Hitting “Deploy” and watching the wheels spin.</p>



<p>Vercel builds it for me and assigns some public domains to the app.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="506" src="https://blog.finxter.com/wp-content/uploads/2023/02/image-201-1024x506.png" alt="" class="wp-image-1132993" srcset="https://blog.finxter.com/wp-content/uploads/2023/02/image-201-1024x506.png 1024w, https://blog.finxter.com/wp-content/uploads/2023/02/image-201-300x148.png 300w, https://blog.finxter.com/wp-content/uploads/2023/02/image-201-768x380.png 768w, https://blog.finxter.com/wp-content/uploads/2023/02/image-201-1536x759.png 1536w, https://blog.finxter.com/wp-content/uploads/2023/02/image-201.png 1600w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>Once I arrive at the final page, I open up the app, test it again and if all works ok, share with the family &amp; friends &amp; Finxter readers!&nbsp;</p>



<p>If you liked this journey, you can <a href="https://github.com/ralpho79/vercel-openai" data-type="URL" data-id="https://github.com/ralpho79/vercel-openai" target="_blank" rel="noreferrer noopener">give me a star in my GitHub repo</a> or this article <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" />&nbsp;</p>



<p>Any doubts or comments, drop me a line.</p>



<p class="has-base-background-color has-background"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bb.png" alt="💻" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <strong>Try It Yourself</strong>: <a href="https://vercel-openai.vercel.app/" data-type="URL" data-id="https://vercel-openai.vercel.app/" target="_blank" rel="noreferrer noopener">You can play with the live demo here.</a></p>



<p>Happy coding!</p>



<h2 class="wp-block-heading">Get Your Personal Certificate Proving Your ChatGPT-Powered Coding Skills</h2>



<p>If you&#8217;re a premium member, you can also go through <a rel="noreferrer noopener" href="https://academy.finxter.com/university/chatgpt-at-the-heart-building-a-movie-recommendation-python-web-app-in-2023/" data-type="URL" data-id="https://academy.finxter.com/university/chatgpt-at-the-heart-building-a-movie-recommendation-python-web-app-in-2023/" target="_blank">this mini-course project on the Finxter Academy</a> and certify your newly-acquired skills. </p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://academy.finxter.com/university/chatgpt-at-the-heart-building-a-movie-recommendation-python-web-app-in-2023/" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="880" height="1024" src="https://blog.finxter.com/wp-content/uploads/2023/02/image-202-880x1024.png" alt="" class="wp-image-1133475" srcset="https://blog.finxter.com/wp-content/uploads/2023/02/image-202-880x1024.png 880w, https://blog.finxter.com/wp-content/uploads/2023/02/image-202-258x300.png 258w, https://blog.finxter.com/wp-content/uploads/2023/02/image-202-768x894.png 768w, https://blog.finxter.com/wp-content/uploads/2023/02/image-202.png 915w" sizes="auto, (max-width: 880px) 100vw, 880px" /></a></figure>
</div>


<p>I&#8217;m sure many employers and clients would love to hire coders that can use the latest technological disruptions to build advanced applications (that are also easy to develop). <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The post <a href="https://blog.finxter.com/building-a-movie-recommendation-app-with-chatgpt/">ChatGPT at the Heart &#8211; Building a Movie Recommendation Python Web App in 2023</a> appeared first on <a href="https://blog.finxter.com">Be on the Right Side of Change</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Layout of a Solidity Source File</title>
		<link>https://blog.finxter.com/layout-of-a-solidity-source-file/</link>
		
		<dc:creator><![CDATA[Rafal Kaluzny]]></dc:creator>
		<pubDate>Tue, 05 Jul 2022 18:59:01 +0000</pubDate>
				<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Ethereum]]></category>
		<category><![CDATA[Smart Contracts]]></category>
		<category><![CDATA[Solidity]]></category>
		<guid isPermaLink="false">https://blog.finxter.com/?p=455693</guid>

					<description><![CDATA[<p>In this article, I am going to explain the fundamentals of a Solidity source file structure. In a way, a rookie (like me and you) can understand the basics of Ethereum programming. First things first &#8211; the Solidity file that stores your code will have a .sol extension. Take action. In your favorite browser go ... <a title="Layout of a Solidity Source File" class="read-more" href="https://blog.finxter.com/layout-of-a-solidity-source-file/" aria-label="Read more about Layout of a Solidity Source File">Read more</a></p>
<p>The post <a href="https://blog.finxter.com/layout-of-a-solidity-source-file/">Layout of a Solidity Source File</a> appeared first on <a href="https://blog.finxter.com">Be on the Right Side of Change</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In this article, I am going to explain the fundamentals of a Solidity source file structure. In a way, a rookie (like me and you) can understand the basics of <a href="https://blog.finxter.com/smart-contracts-and-evm/" data-type="post" data-id="92507" target="_blank" rel="noreferrer noopener">Ethereum</a> programming.</p>



<p>First things first &#8211; the <a rel="noreferrer noopener" href="https://blog.finxter.com/solidity-crash-course/" data-type="URL" data-id="https://blog.finxter.com/solidity-crash-course/" target="_blank">Solidity</a> file that stores your code will have a <code>.sol</code> extension.</p>



<p>Take action.</p>



<ol class="wp-block-list"><li>In your favorite browser go to <a href="https://remix.ethereum.org/" target="_blank" rel="noreferrer noopener">https://remix.ethereum.org/</a>&nbsp;</li><li>Using Create New File create a new <code>finxter.sol</code> file</li></ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="475" src="https://blog.finxter.com/wp-content/uploads/2022/07/image-30-1024x475.png" alt="" class="wp-image-455702" srcset="https://blog.finxter.com/wp-content/uploads/2022/07/image-30-1024x475.png 1024w, https://blog.finxter.com/wp-content/uploads/2022/07/image-30-300x139.png 300w, https://blog.finxter.com/wp-content/uploads/2022/07/image-30-768x357.png 768w, https://blog.finxter.com/wp-content/uploads/2022/07/image-30.png 1400w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>Well done. Your file &#8211; empty so far &#8211; is ready for more actions!</p>



<p>In this article, we’ll add (i) license identifier, (ii) pragma, (iii) another file via import, and (iv) add some comments.</p>



<p>The actual <a href="https://blog.finxter.com/introduction-to-smart-contracts-and-solidity/" data-type="post" data-id="445145" target="_blank" rel="noreferrer noopener">smart contract code</a> is out of scope here but check out other <a href="https://blog.finxter.com/email-academy/" data-type="page" data-id="12278" target="_blank" rel="noreferrer noopener">Finxter tutorials</a> &#8211; there is plenty of that.</p>



<h2 class="wp-block-heading">License Identifier</h2>



<p>I know you are eager to get to the meat, but before you jump there, bear with me.&nbsp; The so-called SPDX license identifier is the first element you need to jot down.</p>



<p>What the heck is that? SPDX, or the Software Package Data Exchange, is an international, open standard for communicating software information including licenses or copyrights.&nbsp;</p>



<p>Being a standard means that many companies and organizations have agreed to do some things in a certain way. And Solidity has also adopted that standard.</p>



<p>Why bother, you ask? </p>



<p>Well, your code will be transparent in a blockchain and that transparency triggers copyright issues. The SPDX identifier hence allows you to specify what you allow others to do with your code. And vice versa, you learn what you can do with other people&#8217;s code too.</p>



<p>An example comment line with an identifier would be:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// SPDX-License-Identifier: MIT</pre>



<p>What this means is:</p>



<p class="has-global-color-8-background-color has-background"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f469-200d-2696-fe0f.png" alt="👩‍⚖️" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &#8220;Software&#8221;), to deal in the Software without restriction, [etc etc&#8230;]</p>



<p>SPDX license list has over 450 various license identifiers! </p>



<p>But don&#8217;t worry too much now, we are here to learn Solidity, not the legal twists. So for now, take my word and use MIT as your default one. Or if you do not want to specify a license or if the source code is not open-source, please use the special value UNLICENSED.</p>



<p class="has-base-background-color has-background"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f6d1.png" alt="🛑" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Caution here folks &#8211; UNLICENSE (without &#8216;d&#8217; at the end) is a completely different license! Open door type of one. It offers free and unencumbered software released into the public domain.</p>



<p>By the way, a good rule of thumb is to use the OSI-approved ones when browsing <a rel="noreferrer noopener" href="https://spdx.org/licenses/" target="_blank">https://spdx.org/licenses/</a>. “Only” about 120+ options for consideration.</p>



<p>Does that identifier do anything technically to your code? No, it won&#8217;t break how it works. After all, it is a comment.</p>



<p>But from Solidity &gt;=0.6.8 (so 0.6.8 and any higher), that comment <strong>must</strong> be part of your code. Otherwise expect a Warning in your compiler.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="436" height="153" src="https://blog.finxter.com/wp-content/uploads/2022/07/image-29.png" alt="" class="wp-image-455701" srcset="https://blog.finxter.com/wp-content/uploads/2022/07/image-29.png 436w, https://blog.finxter.com/wp-content/uploads/2022/07/image-29-300x105.png 300w" sizes="auto, (max-width: 436px) 100vw, 436px" /></figure>
</div>


<p>The compiler checks the existence but does not know if your identifier is the right one (if it exists in the SPDX list). Starting in Solidity 0.8.8 it checks for multiple SPDX license identifiers next to each other and validates them. It still allows you to play with it though <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p>In 0.8.7 you could easily get away with some crazy identifier.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// SPDX-License-Identifier: cheating_on_you

pragma solidity 0.8.7;</pre>



<p>From 0.8.8 onwards it actually starts to pay attention and throws errors. Note the red error icon on the left in line 1.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="840" height="214" src="https://blog.finxter.com/wp-content/uploads/2022/07/image-28.png" alt="" class="wp-image-455700" srcset="https://blog.finxter.com/wp-content/uploads/2022/07/image-28.png 840w, https://blog.finxter.com/wp-content/uploads/2022/07/image-28-300x76.png 300w, https://blog.finxter.com/wp-content/uploads/2022/07/image-28-768x196.png 768w" sizes="auto, (max-width: 840px) 100vw, 840px" /></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="570" height="310" src="https://blog.finxter.com/wp-content/uploads/2022/07/image-27.png" alt="" class="wp-image-455699" srcset="https://blog.finxter.com/wp-content/uploads/2022/07/image-27.png 570w, https://blog.finxter.com/wp-content/uploads/2022/07/image-27-300x163.png 300w" sizes="auto, (max-width: 570px) 100vw, 570px" /></figure>
</div>


<p>Same happens when you add multiple licenses inappropriately.&nbsp;</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="824" height="254" src="https://blog.finxter.com/wp-content/uploads/2022/07/image-26.png" alt="" class="wp-image-455698" srcset="https://blog.finxter.com/wp-content/uploads/2022/07/image-26.png 824w, https://blog.finxter.com/wp-content/uploads/2022/07/image-26-300x92.png 300w, https://blog.finxter.com/wp-content/uploads/2022/07/image-26-768x237.png 768w" sizes="auto, (max-width: 824px) 100vw, 824px" /></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="554" height="472" src="https://blog.finxter.com/wp-content/uploads/2022/07/image-25.png" alt="" class="wp-image-455697" srcset="https://blog.finxter.com/wp-content/uploads/2022/07/image-25.png 554w, https://blog.finxter.com/wp-content/uploads/2022/07/image-25-300x256.png 300w" sizes="auto, (max-width: 554px) 100vw, 554px" /></figure>
</div>


<p>This one below goes unnoticed though &#8211; compiler says OK.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// SPDX-License-Identifier: cheatingonyou

pragma solidity 0.8.15;</pre>



<p>Since SPDX info is a comment, it is recognized by the compiler anywhere in the file at the file level, but for clarity put it at the very top of the file.</p>



<p>Lastly, the identifier will become part of your metadata once it&#8217;s compiled. And that is machine-readable so others will find it easy to query.</p>



<p><strong>Take action.</strong></p>



<p>1. Add the license-related comment to your code (<code>finxter.sol</code>)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// SPDX-License-Identifier: MIT</pre>



<h2 class="wp-block-heading">Pragmas</h2>



<p>The second important keyword is <code>pragma</code>. It comes in several shapes and forms &#8211; as a version pragma, ABI Coder pragma or experimental pragma.</p>



<p class="has-global-color-8-background-color has-background"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2b50.png" alt="⭐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <strong>Note</strong>: A pragma directive is always local to a source file. So you must add it to all your files if you want to enable it in your whole project.</p>



<p>Remember also that if you import another file, the pragma from that file does <strong>not</strong> automatically apply to the importing file.</p>



<p><strong>1. Version pragma defines for which versions of Solidity the code is written.</strong></p>



<p>In the example:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">pragma solidity >= 0.8.7;</pre>



<p>we can expect that no compiler on version 0.8.7 or higher will throw any pragma errors.</p>



<p>Other examples &#8211; for illustration and education &#8211; how to define pragma versions:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">pragma solidity 0.6.8;         //single instance
pragma solidity >= 0.6.8;         //0.6.8 and any above
pragma solidity ^0.6.8;         //0.6.8 and any above but less than 0.7.0
pragma solidity 0.6.8 ^0.7.5;     // single instance AND any above 0.7.5 but less than 0.8 -> this AND condition cannot be met here
pragma solidity 0.8.1 || ^0.8.10;     // one instance OR any from 0.8.10 but less than 0.9.0</pre>



<p>For practical reasons, the version pragma is the only type you should really care about when you <a href="https://blog.finxter.com/top-10-solidity-tutorials/" data-type="post" data-id="262867" target="_blank" rel="noreferrer noopener">start your Solidity</a> journey.</p>



<p><strong>2. ABI Coder pragma</strong></p>



<p>As per Solidity documentation, you have two options to choose from:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">pragma abicoder v1;
pragma abicoder v2;</pre>



<p>However as of Solidity 0.8.0 the <code>ABIEncoder</code> is activated by default so for a rookie like you and me, there’s nothing to worry about anymore. </p>



<p>With version 0.8.0+ you can already enjoy the benefits of working more effectively with arrays and structs. These are just some of data types but explaining this goes way beyond this tutorial. </p>



<p>And no need to call this pragma additionally, as you had to do in the past, e.g.:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.4.16;
pragma experimental ABIEncoderV2;</pre>



<p><strong>3. Experimental pragma</strong></p>



<p>Getting here is a risky business so better do not try it yourself at home <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p>Solidity might be offering features that are &#8211; as labeled &#8211; experimental. </p>



<p>So if you have some technical appetite and skills and want to play, showcase to your potential clients or whatever the purpose, go ahead. But if again, you are still early in the game, just park for now.&nbsp;</p>



<p><strong>Take Action.</strong></p>



<p>1. Add a version pragma directive to your code</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">pragma solidity ^0.8.15;</pre>



<h2 class="wp-block-heading">Importing other Source Files</h2>



<p>You can import files in Solidity. That sounds obvious but let’s say this upfront. </p>



<p>Importing other files is important since you can break down your code into multiple files, which makes it more modular, easier to manage and control, and &#8211; best of all &#8211; re-usable.</p>



<p>The simplest way to import is using this line of code:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import "filename";</pre>



<p>In our quick <a href="https://blog.finxter.com/what-is-payable-in-solidity/" data-type="post" data-id="37282" target="_blank" rel="noreferrer noopener">Remix</a> exercise, imagine we have another file called “<code>helloWorld.sol</code>” located in the same directory. In order to import it to our <code>finxter.sol</code> file, one would use:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import "./helloWorld.sol";</pre>



<p><strong>Note</strong>: Pythonic&nbsp; <code>import "helloWorld.sol"</code> would not work here.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="436" height="216" src="https://blog.finxter.com/wp-content/uploads/2022/07/image-24.png" alt="" class="wp-image-455696" srcset="https://blog.finxter.com/wp-content/uploads/2022/07/image-24.png 436w, https://blog.finxter.com/wp-content/uploads/2022/07/image-24-300x149.png 300w" sizes="auto, (max-width: 436px) 100vw, 436px" /></figure>
</div>


<p>For education purposes and in very simple implementations, this is the shortest way to import. Its disadvantage is that it pollutes the namespace by importing all global symbols from the imported file into the current global system.</p>



<p>That approach carries also a risk of importing symbols that are imported into the file we are importing. That file can contain symbols imported for yet another file and so on. Such subsequent importing may lead to confusion about where the symbols come from and where actually they are defined.</p>



<p>Solidity recommends using a variant, which may look more complex at first. But it only adds one new global symbol to the namespace, here <code>symbolName</code>, whose members are symbols from the imported file.</p>



<p>Makes sense?</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import * as symbolName from "filename";</pre>



<p>The best approach however would be to import relevant symbols explicitly. </p>



<p>So for instance, if the imported file “<code>helloWorld.sol</code>” would have a contract named “<code>sayHello</code>”, one could use only that. Rule of thumb here: import only the things you will use.&nbsp;</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import {something} from "filename";</pre>



<p><strong>Take action:</strong></p>



<p>1. Add a new file named “<code>helloWorld.sol</code>” that contains this code</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

contract sayHello {
    // empty contract
}
</pre>



<p>2. In the “<code>finxter.sol</code>” file, add import&nbsp;</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import {sayHello} from "./helloWorld.sol";</pre>



<h2 class="wp-block-heading">Comments</h2>



<p>Commenting the code is possible in the two following ways:</p>



<p>1. Regular comments</p>



<p>1.1 Single-line comment, e.g.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// this is a single-line regular comment</pre>



<p>1.2 Multi-line comment, e.g.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">/*
This
comment
spans
many
lines
*/
</pre>



<p>2. NatSpec comments</p>



<p>NatSpec stands for Ethereum Natural Language Specification. It is a special form of comments to provide rich documentation for functions, return variables, and more.&nbsp;</p>



<p>The recommendation is that Solidity contracts are fully annotated using NatSpec for all public interfaces (everything in the ABI).</p>



<p>Use NatSpecs comments directly above function declarations or statements.e.g.</p>



<p>2.1 Single-line</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">/// single-line NatSpec comment</pre>



<p>2.2 Multi-line</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">/**
multi-line
NatSpec
comment
*/
</pre>



<p>CODE example</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.16 &lt;0.9.0;

/// @author The Solidity Team
/// @title A simple storage example
contract SimpleStorage {
   uint storedData;

   /// Store `x`.
   /// @param x the new value to store
   /// @dev stores the number in the state variable `storedData`
   function set(uint x) public {
       storedData = x;
   }

   /** Return the stored value.
       @dev retrieves the value of the state variable `storedData`
       @return the stored value
   */
   function get() public view returns (uint) {
       return storedData;
   }
}
</pre>



<p><strong>Take action:</strong></p>



<p>1. Add a regular multi-line comment to your <code>finxter.sol</code> file</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">/*
This
tutorial
comes
from
finxter.com
*/
</pre>



<p><strong>Reference</strong>: This article is based on some contents from the <a href="https://docs.soliditylang.org/en/v0.8.15/layout-of-source-files.html" data-type="URL" data-id="https://docs.soliditylang.org/en/v0.8.15/layout-of-source-files.html" target="_blank" rel="noreferrer noopener">documentation</a>. Check out this awesome resource too!</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><a href="https://academy.finxter.com/university/solidity-basics/" target="_blank" rel="noreferrer noopener" title="https://academy.finxter.com/university/solidity-basics/">Learn Solidity Course</a></h2>



<p>Solidity is the programming language of the future.</p>



<p>It gives you the rare and sought-after superpower to program against the &#8220;Internet Computer&#8221;, i.e., against decentralized Blockchains such as <em>Ethereum</em>, <em>Binance Smart Chain</em>, <em>Ethereum Classic</em>, <em>Tron</em>, and <em>Avalanche </em>&#8211; to mention just a few Blockchain infrastructures that support Solidity.<br><br>In particular, Solidity allows you to<em> create smart contracts</em>, i.e., pieces of code that automatically execute on specific conditions in a completely decentralized environment. For example, smart contracts empower you to create your own <em>decentralized autonomous organizations</em> (DAOs) that run on Blockchains without being subject to centralized control.<br><br>NFTs, DeFi, DAOs, and Blockchain-based games are all based on smart contracts.<br><br><a href="https://academy.finxter.com/university/solidity-basics/" target="_blank" rel="noreferrer noopener" title="https://academy.finxter.com/university/solidity-basics/">This course</a> is a simple, low-friction introduction to creating your first smart contract using the Remix IDE on the Ethereum testnet &#8211; without fluff, significant upfront costs to purchase ETH, or unnecessary complexity.</p>



<div class="wp-block-image"><figure class="aligncenter size-full is-resized"><a href="https://academy.finxter.com/university/solidity-basics/" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://blog.finxter.com/wp-content/uploads/2021/10/image-121.png" alt="" class="wp-image-37299" width="491" height="287" srcset="https://blog.finxter.com/wp-content/uploads/2021/10/image-121.png 982w, https://blog.finxter.com/wp-content/uploads/2021/10/image-121-300x175.png 300w, https://blog.finxter.com/wp-content/uploads/2021/10/image-121-768x448.png 768w" sizes="auto, (max-width: 491px) 100vw, 491px" /></a></figure></div>
<p>The post <a href="https://blog.finxter.com/layout-of-a-solidity-source-file/">Layout of a Solidity Source File</a> appeared first on <a href="https://blog.finxter.com">Be on the Right Side of Change</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: blog.finxter.com @ 2026-06-06 13:50:08 by W3 Total Cache
-->