flâneur — a map of the web's best reading

Introduction to Smart Contracts — Solidity 0.8.24 documentation

docs.soliditylang.org · 4,374 words · saved by 1 readers

Let us begin with a basic example that sets the value of a variable and exposes it for other contracts to access. It is fine if you do not understand everything right now, we will go into more details later. open in Remix The first line tells you that the source code is licensed under the GPL version 3.0. Machine-readable license specifiers are important in a setting where publishing the source code is the default. The next line specifies that the source code is written for Solidity version 0.4.16, or a newer version of the language up to, but not including version 0.9.0. This is to ensure that the contract is not compilable with a new (breaking) compiler version, where it could behave differently. Pragmas are common instructions for compilers about how to treat the source code (e.g. pragma once). A contract in the sense of Solidity is a collection of code (its functions) and data (its state) that resides at a specific address on the Ethereum blockchain. The line uint storedData; decla

Introduction to Smart Contracts - Solidity 0.8.24 documentation --> Introduction to Smart Contracts Edit on GitHub Introduction to Smart Contracts  A Simple Smart Contract  Let us begin with a basic example that sets the value of a variable and exposes it for other contracts to access. It is fine if you do not understand everything right now, we will go into more details later. Storage Example  open in Remix // SPDX-License-Identifier: GPL-3.0 pragma solidity >= 0.4.16 < 0.9.0 ; contract SimpleStorage { uint storedData ; function set ( uint x ) public { storedData = x ; } function get () pu

Explore this link on the map →

related reading