avatarAlex Roan

Summary

This context provides a collection of examples and explanations of Solidity, a programming language used for developing smart contracts on the Ethereum blockchain.

Abstract

The provided context is a cheat sheet for programming in Solidity, the programming language used for Ethereum smart contracts. The cheat sheet includes explanations and examples of data types, mappings, structs, require statements, access modifiers, custom modifiers, and inheritance. Data types discussed include strings, booleans, and integers. Mappings are used to create key-value pairs, and structs are used for structured data. Require statements ensure that certain conditions are met before a function can be executed. Access modifiers define who can access certain functions or variables. Custom modifiers are also discussed, with an example of an "onlyOwner" modifier. The context also includes an example of inheritance in Solidity.

Bullet points

  • The context provides examples and explanations of Solidity programming language for Ethereum smart contracts.
  • Data types such as strings, booleans, and integers are discussed.
  • Mappings are used to create key-value pairs.
  • Structs are used for structured data.
  • Require statements ensure that certain conditions are met before a function can be executed.
  • Access modifiers define who can access certain functions or variables.
  • Custom modifiers are also discussed, with an example of an "onlyOwner" modifier.
  • Inheritance in Solidity is demonstrated with an example.
  • The context also includes links to resources for further learning about blockchain development.

Solidity Cheat Sheet

Ethereum Smart Contracts for dummies

Photo by Kelly Sikkema on Unsplash

A collection of Smart Contract examples breaking down basic concepts for programming in Solidity.

Data Types

Useful data types used to store state variables or local variables

Mappings

Mappings are key, value pairs or associative arrays.

Structs

Structured data

Require Statements

Require statements are essential conditions that must be true in order to continue executing the function. Use these to ensure that no ambiguities exist in the data before performing changes to the state.

Access Modifiers

Access modifiers define who or what can access state variables and functions. They are public, external, private and internal.

Custom Modifiers

As well as built-in Access Modifiers, you can also create your own. Here’s an example of an onlyOwner modifier, a commonly used concept.

Inheritance

Tutorials And Resources

For tutorials on how to start, where to start and what to make to learn Blockchain Development, check out these resources:

Happy coding :)

Blockchain
Programming
Ethereum
Solidity
Cheatsheet
Recommended from ReadMedium