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

Anatomy of smart contracts | ethereum.org

ethereum.org · 3,871 words · saved by 1 readers

A smart contract is a program that runs at an address on Ethereum. They're made up of data and functions that can execute upon receiving a transaction. Here's an overview of what makes up a smart contract. Make sure you've read about smart contracts first. This document assumes you're already familiar with programming languages such as JavaScript or Python. Any contract data must be assigned to a location: either to storage or memory. It's costly to modify storage in a smart contract so you need to consider where your data should live. Persistent data is referred to as storage and is represented by state variables. These values get stored permanently on the blockchain. You need to declare the type so that the contract can keep track of how much storage on the blockchain it needs when it compiles. If you've already programmed object-oriented languages, you'll likely be familiar with most types. However address should be new to you if you're new to Ethereum development. An address type c

Anatomy of smart contracts Copy .md Copy .md Edit page (opens in a new tab) On this page A smart contract is a program that runs at an address on Ethereum. They're made up of data and functions that can execute upon receiving a transaction. Here's an overview of what makes up a smart contract. Prerequisites Make sure you've read about smart contracts first. This document assumes you're already familiar with programming languages such as JavaScript or Python. Data Any contract data must be assigned to a location: either to storage or memory . It's costly to modify storage in a smart contract so

Explore this link on the map →

related reading