OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Solidity By Example

Solidity By Example is a public GitHub repository of short Solidity code snippets that demonstrate language features through contract examples.

Independent OpenViST project profile, based on linked sources.

Solidity By Example — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it as a focused code reference when learning a Solidity feature or comparing a small contract pattern.

Who it is for

  • People learning Solidity through code examples.
  • Developers looking up concise patterns for specific contract-language features.

Documented uses

  • Study how Solidity arrays are created, passed, returned, or modified.
  • Compare annotated and compact versions of a token-style contract example.
  • Inspect examples of mappings, contract calls, factories, and error handling.
Before you choose

Requirements & limits

  • Examples span several topics, including arrays, mappings, contract calls, factories, and token-style balance logic.
  • Some snippets use older Solidity syntax, including a pragma of ^0.4.18 in the BasicToken example; check language-version relevance before reusing code.
  • The repository presents examples for learning and does not describe a step-by-step course or a deployed blockchain service.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Study Solidity array examples

Compare examples of deleting an array element, storing strings in an array, and passing an array to a contract.

Before you start

  • Access to the Solidity By Example README.

Steps

  1. Open the repository README.

  2. Read the array-delete.sol example and note that deleting index 2 leaves a zero at that position.

  3. Compare it with array-of-strings.sol and array-passing.sol to see string-array access and array construction and passing.

Expected outcome

The examples illustrate several array patterns in concise Solidity contracts.

Guide limitations

  • The README provides code examples, not steps for compiling, deploying, or testing them.
  • The examples use Solidity syntax that may depend on compiler versions; no compatibility guidance is provided.
Source-based practical guide

Compare annotated and unannotated token examples

Use the BasicToken examples to examine how comments explain mappings, transfers, and balance queries.

Before you start

  • Access to the Solidity By Example README.

Steps

  1. Open the repository README.

  2. Read basic-token-annotated.sol to review its comments on the balance mapping, transfer, and balanceOf.

  3. Compare it with basic-token-unannotated.sol to see the same core contract code with fewer explanatory comments.

Expected outcome

The paired examples provide a side-by-side reference for the contract structure and its explanatory annotations.

Guide limitations

  • The examples do not document compilation, deployment, or tests.
  • The transfer implementation shown does not include additional validation or safety guidance.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
17 October 2026
Original website title
raineorshine/solidity-by-example · Official homepage title · retained in its source language