Solidity Steps
  • Learning Solidity
  • Step 1
    • 1: Introduction
    • 2: Data Types
    • 3: Functions
    • 4: Control Structures
    • 5: State Variable
    • 6: Local Variables
    • 7: Global Variables
    • 8: View Keyword
    • 9: Pure Keyword
  • STEP 2
    • 10: Immunable Keyword
    • 11: Events
    • 12: Condition
    • 13: While Loop
    • 14: Do While Loop
    • 15: For Loop
    • 16: Required
    • 17: Assert
    • 18: Revert
    • 19: Modifier
  • STEP 3
    • 20: Constructor
    • 21: Mapping
    • 22: Array
    • 23: Enum
    • 24: Structs
    • 25: Data Location
    • 26: Inheritance
    • 27: The Shadowing Effect
    • 28: Super Keyword
    • 29: Visibility
  • STEP 4
    • 30: Interface
    • 31: Abstract Contract
    • 32: Payable
    • 33: Using type()
    • 34: Sending Ether
    • 35: Receive
    • 36: Fallback
    • 37: Call
    • 38: DelegateCall
    • 39: Calling Other Contracts
  • STEP 5
    • 40: Factory Contract
    • 41: Proxy Contract
    • 42: Create2
    • 43: Try and Catch
    • 44: Solidity Library
    • 45: ABI Encoded
    • 46: ABI Decoded
    • 47: Keccak256
    • 48: Function Signature Hash
  • TIPS
    • Tips: Solidity by "Immunable"
    • Tips: Truffle Tutorial
    • Tips: Microblog Dapp
    • Tips: Reentrancy
    • Tips: Slither Tutorial
    • Tips: Remix Tutorial
    • Tips: Hardhat Tutorial
  • CAREER
    • 💲Cover Letter
    • 💲Resume
  • ABOUT
    • Contact me
Powered by GitBook
On this page
  • Explain Smart contract
  • Explain Solidity language

Learning Solidity

From zero to hero

Explain Smart contract

A smart contract is an agreement between two people or entities in the form of computer code programmed to execute automatically. The idea was proposed in the 1990s by Nick Szabo, a pioneer of modern computer science, who defined them as a set of virtual promises with associated protocols to enforce them.

Smart contracts are executed on blockchain, which means that the terms are stored in a distributed database and cannot be changed. Transactions are also processed on the blockchain, which automates payments and counterparties. Since the emergence of the digital currency Ethereum, the creation and execution of smart contracts has been simplified, as complex transactions can be programmed into the Ethereum protocol.

Some of these tutorials in the next lessons maybe deprecate or not include yet!

Explain Solidity language

Solidity is an object-oriented programming language created specifically by the Ethereum Network team for constructing and designing smart contracts on Blockchain platforms.

  • It's used to create smart contracts that implement business logic and generate a chain of transaction records in the blockchain system.

  • It acts as a tool for creating machine-level code and compiling it on the "Ethereum Virtual Machine" (EVM).

  • It has a lot of similarities with C and C++ and is pretty simple to learn and understand. For example, a “main” in C is equivalent to a “contract” in Solidity.


Create by Example Creating a contract in solidity involves writing functions and deploying them to the blockchain. Here are some examples of how to create a contract in Solidity:

Simple Storage Contract This is a simple storage contract example that stores a single value:

pragma solidity ^0.4.17; 
contract SimpleStorage { 
	uint storedData; 
	
	function set(uint x) public { 
		storedData = x; 
	} 
	
	function get() public view returns (uint) { 
		return storedData; 
	}
}

Payable Contract This is an example of a payable contract that allows users to send ether to the contract. The contract then stores the amount of ether received.

pragma solidity ^0.4.17; 
contract Payable { 
	uint storedData; 
	
	function payable(uint x) public payable { 
		storedData = x; 
	} 
	
	function get() public view returns (uint) { 
		return storedData; 
	}
}

Token Contract This is an example of a token contract that allows users to transfer tokens between accounts.

pragma solidity ^0.4.17; 
contract Token { 
	mapping (address => uint) public balances; 
	
	function transfer(address _to, uint _value) public { 
		require(balances[msg.sender] >= _value); 
		balances[msg.sender] -= _value; 
		balances[_to] += _value; 
	}
}

By using these examples, you can get started creating your own contracts in Solidity.


Using search (top right of window) : the Ai help you for your question.

Ai using this website internal data.


LESSONS

Smart Contract Language

Remix Id Tutorial

Write You First Contract

Solidity Data Type

Solidity Function

State variable

Local Variable

Global variable

View Keyword

Pure Keyword

Event Ticket Smart Contract

Constant Keyword

If Else Keyword

while loop

Do Wile Loop

For Loop

Required Error

Assert Error

Revert Error

Modifier

Constructor

Mapping

Array

Array Remove

Replace Array

Enum Solidity

Import Enum

Structs

Import Structs

Data Location

Solidity Events

Inheritance

Shadowing Effect

Super Keyword

Visibility Solidity

Interface Solidity

Payable

Sending ether solidity

fallback

Call Function

DelegateCall

Calling other Contract

Create Other Contract

Try and catch

Solidity Library

Solidity ABI Encoded

Solidity ABI Decoded

Keccak256

DAPP

. . .

In the next lesson, we'll go over Introducing Solidity language.

Next1: Introduction

Last updated 1 year ago