Solidity

This page is a reduced version of the Solidity docs site that is adapted to Viction network to avoid overwhelming information.

About

Solidity is a contract-oriented, high-level language for implementing smart contracts. It was influenced by Python and JavaScript and is designed to target the Ethereum Virtual Machine (EVM) both Ethereum and Viction.

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

Solidity in Viction

Viction support Solidity compiler version <=0.8.17, which targets London hardfork in Ethereum. However, due the fee mechanism in Viction, BASEFEE opcode is unused and not supported by the runtime.

circle-info

For Solidity compiler version >=0.8.18, you may still compile and deploy to Viction. However, use it at your own risk.

The table below describes all the opcodes that isn't available in Viction:

Opcode
Description

BASEFEE

Return base fee of block, this using for https://eips.ethereum.org/EIPS/eip-1559arrow-up-right on London hardfork.

TLOAD

This opcode using for Access List Transaction Type, which hasn’t have any implement for now

TSTORE

This opcode using for Access List Transaction Type

PUSH0

This opcode pushes the constant value 0 onto the stack. It is generated in Solidity version 0.8.20 or higher.

INVALID

Improve the traces process.

BLOBHASH

Which is specific to DankSharing hardfork.

Example

As you will see, it is possible to create contracts for voting, crowdfunding, blind auctions, multi-signature wallets and more.

circle-info

The best way to try out Solidity right now is using Remixarrow-up-right (it can take a while to load, please be patient). Remix is a web browser-based IDE that allows you to write Solidity smart contracts, then deploy and run the smart contracts.

Once you're strong enough, on the next pages, we will first see a simple smart contractarrow-up-right written in Solidity followed by the basics about blockchainsarrow-up-right and the Ethereum Virtual Machinearrow-up-right.

The next section will explain several features of Solidity by giving useful example contractsarrow-up-right. Remember that you can always try out the contracts in your browserarrow-up-right!

The last and most extensive section will cover all aspects of Solidity in depth.

If you still have questions, you can try searching or asking on the Ethereum Stackexchangearrow-up-right site, or come to our Gitter channelarrow-up-right. Ideas for improving Solidity or this documentation are always welcome! the world:

Last updated