Become an NFT Developer with Best Practice Way: Part 3: Smart Contract with Solidity

image from Unsplash

in this part, I will discuss how to create a smart contract using solidity, so in this chapter, I will create a smart contract using solidity by case study, here table of content

  • The Fundamental
  • Create Smart contract

The Fundamental

According to its documentation, “Solidity is a curly-bracket language. It is influenced by C++, Python, and JavaScript, and is designed to target the Ethereum Virtual Machine (EVM).”

Environment Setup

let’s set up the environment for blockchain development using solidity, first install nodejs, and check the version

nodejs --version

after success, install node install the solidity compiler using npm

npm -g install solc

Create Contract

Solidity’s code is encapsulated in contracts. A contract is the fundamental building block of Ethereum applications — all variables and functions belong to a contract, and this will be the starting point of all your projects.

Solidity Keyword

the solidity keyword is available on docs, or you can see it here

solidity keyword

Importing a file in Solidity is similar to JavaScript, to import a file you can simply write

All global symbols from the “file” are imported into the current global scope by the above statement. But if you want to create a new global symbol someName with all the global symbols from “file” as members, you can write

Just like other programming languages, Solidity support both single-line and multi-line comments.

  • Start the line with // to include a single-line comment.
  • Start with /* and end with */ to include a multi-line comment.

Variable in Solidity

In solidity, the variable is divided into 2 parts

  • Local variable: variables with values that will persist till the function is completed
  • State variable: permanent variable that has been defined in the contract
state variable
local variable

Solidity Operator

solidity support the following type operator

  • Arithmetic Operators
  • Relational Operators
  • Logical Operators
  • Bitwise Operators
  • Assignment operators
  • Conditional Operators
arithmetic operator
relational operator
logical operator


the fundamental of solidity is the most important step if you need for mastering blockchain.




Make Indonesia World #1 Remote Worker Provider

Recommended from Medium

Raspberry Pi 4 + Ubuntu 20.04 notes

Dirsearch to find Hidden Web Directories

Introduction to Degen Dashboard

SkaeHub Boot Camp Experience

Spiral Life Cycle Case Study

Angular Finance Leverages Composable Lab’s Incentive Program

Distributed And Cloud Computing

LEGO Theory — Multitasking

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Feri Lukmansyah

Feri Lukmansyah

Interesting with Blockchain and Opensource Project my journal:

More from Medium

How to Transfer Tokens To The Owner Address and Not stuck In Contract Address In Solidity.

Mint an NFT using Solidity

Securing you file in Remix, how to clone and push

[Solidity] Contract code size over limit