Solidity
The Solidity smart contract programming language.
Overview
Solidity is a contract-oriented, high-level programming language for creating smart contracts. It was influenced by C++, Python, and JavaScript and is designed to target the Ethereum Virtual Machine (EVM) environments. Solidity is statically typed, supports inheritance, and libraries. It allows developers to create smart contracts for a wide range of use cases and applications. Key features of Solidity include:
- Complex user-defined types
- Inheritance and complex user-defined contracts
- Error checking, including requirements and assertions
- Support for libraries and user-defined functions
- Strong security features that ensure contract integrity.
The Quai Network EVM supports Solidity versions up to 0.8.19. Using a newer version of Solidity may result in errors when deploying smart contracts.
Example Contract
The Greeter contract shown below is written with Solidity v0.8.0. Greeter serves two functions:
- Store a greeting on-chain.
- Return the greeting when the contract function is called.
It also contains a function for users to set a new greeting of their choice. While the Greeter contract may be simple, it showcases some of the unique functionality that smart contracts offer.
Resources
Solidity Homepage | The official Solidity homepage. |
Solidity Documentation | The official Solidity documentation. |
GitHub | The Solidity GitHub Repository. |
Examples | Solidity by Example - a collection of example contracts in Solidity. |
Was this page helpful?