Solidity

Solidity logo

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

Solidity is acurly-bracket language.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 inthelanguage influences section.

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

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

When deploying contracts, you should use the latest releasedversion of Solidity. This is because breaking changes as well asnew features and bug fixes are introduced regularly. We currently usea 0.x version numberto indicate this fast pace of change.

Warning

Solidity recently released the 0.8.x version that introduced a lot of breakingchanges. Make sure you readthe full list.

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

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 digginginto the “Introduction to Smart Contracts” section, which covers:

2. Get to Know Solidity

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

3. Install the Solidity Compiler

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

Hint

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

Warning

As humans write software, it can have bugs. You should follow establishedsoftware development best-practices when writing your smart contracts. Thisincludes code review, testing, audits, and correctness proofs. Smart contractusers are sometimes more confident with code than their authors, andblockchains and smart contracts have their own unique issues towatch out for, so before working on production code, make sure you read theSecurity Considerations section.

4. Learn More

If you want to learn more about building decentralized applications on Ethereum, theEthereum Developer Resourcescan 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 theEthereum StackExchange, orourGitter channel.

Translations

Community volunteers help translate this documentation into several languages.They have varying degrees of completeness and up-to-dateness. The Englishversion stands as a reference.

Note

We recently set up a new GitHub organization and translation workflow to help streamline thecommunity efforts. Please refer to thetranslation guidefor information on how to contribute to the community translations moving forward.

Contents

Keyword Index,Search Page

Language Description

Internals

Additional Material