My Docs
My BlogLinkedin
Solidarity-Blockchain-NFTs
Solidarity-Blockchain-NFTs
  • Initial page
  • Solidarity
    • Solidity
    • Ethereum
    • Structure of a Contract
  • NFT's
    • NFT's
      • Purpose
    • How to Create NFTs
    • How to Sell NFTs
  • Blockchain & Crypto
    • Blockchain Basics
  • Misc
    • Misc
  • Practice
    • Untitled
  • Docs
    • Docs & Research
  • Resources
    • Resources
Powered by GitBook
On this page
  • IDE (to practice with)
  • Solidity
  • Getting Started
  • Contents
  • Basics

Was this helpful?

  1. Solidarity

Solidity

Solidity is an object-oriented, high-level language for implementing smart contracts. Smart contracts are programs which govern the behaviour of accounts within the Ethereum state.

PreviousInitial pageNextEthereum

Last updated 3 years ago

Was this helpful?

IDE (to practice with)

Solidity

Solidity is an object-oriented, high-level language for implementing smart contracts. Smart contracts are programs which govern the behaviour of accounts within the Ethereum state.

Solidity is statically typed, supports inheritance, libraries and complex user-defined types among other features.

With Solidity you can create contracts for uses such as voting, crowdfunding, blind auctions, and multi-signature wallets.

Warning

Getting Started

1. Understand the Smart Contract Basics

If you are new to the concept of smart contracts we recommend you to get started by digging into the “Introduction to Smart Contracts” section, which covers:

2. Get to Know Solidity

3. Install the Solidity Compiler

Hint

W

4. Learn More

Contents

Basics

Language Description

Compiler

Internals

Additional Material

Solidity is a . It is influenced by C++, Python and JavaScript, and is designed to target the Ethereum Virtual Machine (EVM). You can find more details about which languages Solidity has been inspired by in the section.

When deploying contracts, you should use the latest released version of Solidity. This is because breaking changes as well as new features and bug fixes are introduced regularly. We currently use a 0.x version number .

Solidity recently released the 0.8.x version that introduced a lot of breaking changes. Make sure you read .

Ideas for improving Solidity or this documentation are always welcome, read our for more details.

written in Solidity.

.

.

Once you are accustomed to the basics, we recommend you read the and “Language Description” sections to understand the core concepts of the language.

There are various ways to install the Solidity compiler, simply choose your preferred option and follow the steps outlined on the .

You can try out code examples directly in your browser with the . Remix is a web browser based IDE that allows you to write, deploy and administer Solidity smart contracts, without the need to install Solidity locally.

As humans write software, it can have bugs. You should follow established software development best-practices when writing your smart contracts. This includes code review, testing, audits, and correctness proofs. Smart contract users are sometimes more confident with code than their authors, and blockchains and smart contracts have their own unique issues to watch out for, so before working on production code, make sure you read the section.

If you want to learn more about building decentralized applications on Ethereum, the can help you with further general documentation around Ethereum, and a wide selection of tutorials, tools and development frameworks.

If you have any questions, you can try searching for answers or asking on the , or our .

curly-bracket language
language influences
to indicate this fast pace of change
the full list
contributors guide
A simple example smart contract
Blockchain Basics
The Ethereum Virtual Machine
“Solidity by Example”
installation page
Remix IDE
Security Considerations
Ethereum Developer Resources
Ethereum StackExchange
Gitter channel
Introduction to Smart Contracts
A Simple Smart Contract
Blockchain Basics
The Ethereum Virtual Machine
Installing the Solidity Compiler
Versioning
Remix
npm / Node.js
Docker
Linux Packages
macOS Packages
Static Binaries
Building from Source
CMake Options
The Version String in Detail
Important Information About Versioning
Solidity by Example
Voting
Blind Auction
Safe Remote Purchase
Micropayment Channel
Modular Contracts
Layout of a Solidity Source File
SPDX License Identifier
Pragmas
Importing other Source Files
Comments
Structure of a Contract
State Variables
Functions
Function Modifiers
Events
Errors
Struct Types
Enum Types
Types
Value Types
Reference Types
Mapping Types
Operators Involving LValues
Conversions between Elementary Types
Conversions between Literals and Elementary Types
Units and Globally Available Variables
Ether Units
Time Units
Special Variables and Functions
Expressions and Control Structures
Control Structures
Function Calls
Creating Contracts via new
Order of Evaluation of Expressions
Assignment
Scoping and Declarations
Checked or Unchecked Arithmetic
Error handling: Assert, Require, Revert and Exceptions
Contracts
Creating Contracts
Visibility and Getters
Function Modifiers
Constant and Immutable State Variables
Functions
Events
Errors and the Revert Statement
Inheritance
Abstract Contracts
Interfaces
Libraries
Using For
Inline Assembly
Example
Access to External Variables, Functions and Libraries
Things to Avoid
Conventions in Solidity
Cheatsheet
Order of Precedence of Operators
Global Variables
Function Visibility Specifiers
Modifiers
Reserved Keywords
Language Grammar
Using the Compiler
Using the Commandline Compiler
Setting the EVM Version to Target
Compiler Input and Output JSON Description
Compiler Tools
Analysing the Compiler Output
Layout of State Variables in Storage
Mappings and Dynamic Arrays
JSON Output
Layout in Memory
Differences to Layout in Storage
Layout of Call Data
Cleaning Up Variables
Source Mappings
The Optimizer
Benefits of Optimizing Solidity Code
Differences between Optimized and Non-Optimized Code
Optimizer Parameter Runs
Opcode-Based Optimizer Module
Yul-Based Optimizer Module
Contract Metadata
Encoding of the Metadata Hash in the Bytecode
Usage for Automatic Interface Generation and NatSpec
Usage for Source Code Verification
Contract ABI Specification
Basic Design
Function Selector
Argument Encoding
Types
Design Criteria for the Encoding
Formal Specification of the Encoding
Function Selector and Argument Encoding
Examples
Use of Dynamic Types
Events
Errors
JSON
Strict Encoding Mode
Non-standard Packed Mode
Encoding of Indexed Event Parameters
Solidity v0.5.0 Breaking Changes
Semantic Only Changes
Semantic and Syntactic Changes
Explicitness Requirements
Deprecated Elements
Interoperability With Older Contracts
Example
Solidity v0.6.0 Breaking Changes
Changes the Compiler Might not Warn About
Explicitness Requirements
Semantic and Syntactic Changes
New Features
Interface Changes
How to update your code
Solidity v0.7.0 Breaking Changes
Silent Changes of the Semantics
Changes to the Syntax
Removal of Unused or Unsafe Features
Interface Changes
How to update your code
Solidity v0.8.0 Breaking Changes
Silent Changes of the Semantics
New Restrictions
Interface Changes
How to update your code
NatSpec Format
Documentation Example
Tags
Documentation Output
Security Considerations
Pitfalls
Recommendations
SMTChecker and Formal Verification
Tutorial
SMTChecker Options and Tuning
Abstraction and False Positives
Real World Assumptions
Resources
General Resources
Integrated (Ethereum) Development Environments
Editor Integrations
Solidity Tools
Third-Party Solidity Parsers and Grammars
Import Path Resolution
Virtual Filesystem
Imports
Base Path
Import Remapping
Using URLs in imports
Yul
Motivation and High-level Description
Simple Example
Stand-Alone Usage
Informal Description of Yul
Specification of Yul
Specification of Yul Object
Yul Optimizer
Complete ERC20 Example
Style Guide
Introduction
Code Layout
Order of Layout
Naming Conventions
NatSpec
Common Patterns
Withdrawal from Contracts
Restricting Access
State Machine
List of Known Bugs
Contributing
Team Calls
How to Report Issues
Workflow for Pull Requests
Running the Compiler Tests
Running the Fuzzer via AFL
Whiskers
Documentation Style Guide
Solidity Language Design
Solidity Brand Guide
The Solidity Brand
Solidity Brand Name
Solidity Logo License
Solidity Logo Guidelines
Credits
Language Influences
Remix - Ethereum IDE
Logo