Substrate Developer Hub

Substrate Developer Hub

  • Tutorials
  • Knowledge Base
  • Recipes
  • API Reference
  • Languages iconEnglish
    • 简体中文
    • Help Translate

›Smart Contracts

Getting Started

  • Overview
  • Installation
  • Getting Started on Windows
  • Glossary

Learn Substrate

  • Extrinsics
  • Transaction Pool
  • Account Abstractions
  • Session Keys
  • Transaction Weight
  • Off-Chain Features

Runtime

  • Runtime Overview
  • Runtime Primitives
  • FRAME
  • Pallets
  • Runtime Macros
  • Runtime Metadata
  • Runtime Storage
  • Runtime Origin
  • Runtime Execution
  • Runtime Events
  • Runtime Errors
  • Transaction Fees
  • Off-Chain Workers
  • Debugging
  • Runtime Tests
  • On-Chain Randomness
  • Runtime Upgrades

Smart Contracts

  • Overview
  • ink! Smart Contracts
  • ink! Concepts
  • ink! Development
  • EVM Pallet
  • ink! F.A.Q.

Integrate

  • Polkadot-JS
  • Client Libraries
  • Chain Specification
  • The Subkey Tool
  • Memory Profiling

Advanced

  • SCALE Codec
  • Consensus
  • The Block Import Pipeline
  • Executor
  • Cryptography
  • Storage
  • SS58 Address Format

Contribute

  • Help Translate
Edit

ink! F.A.Q.

This page will answer a number of common questions you may have when starting to build smart contracts for Substrate.

ink! F.A.Q.

What is the difference between memory and storage?

In ink! we refer memory to being the computer memory that is commonly known to programmers while with storage we refer to the contract instance's memory. The storage is backed up by the runtime in a data base. Accesses to it are considered to be slow.

How do I run tests?

When building a smart contract with ink, you can define a set of tests.

For example, in the minimal flipper contract, you can find a small test at the bottom of the contract.

To run this test, type the following command:

cargo +nightly test

Contracts Module

How do I add the Contracts module to my custom chain?

You can follow our guide here for instructions to add the Contracts pallet and other FRAME pallets to your blockchain runtime.

Last updated on 12/22/2020 by Jimmy Chu
← EVM PalletPolkadot-JS →
  • ink! F.A.Q.
    • What is the difference between memory and storage?
    • How do I run tests?
  • Contracts Module
    • How do I add the Contracts module to my custom chain?
Substrate Developer Hub
Developer Hub
TutorialsKnowledge BaseRecipesAPI Reference
Community
Community HomeNewsletterSubstrate Technical ChatSubstrate SeminarStack OverflowTwitterEvents
More
Substrate Builders ProgramBlogSubstrate GitHubDeveloper Hub GitHubPrivacy PolicyTerms of UseCookie Settings
Copyright © 2021 Parity Technologies