Skip to main content

How it Works โ€’ Substrate

How it Works

Substrate's Framework for Runtime Aggregation of Modularised Entities (FRAME) contains a module which implements an API for typical functions smart contracts need (storage, querying information about accounts, โ€ฆ). This module is called the contracts pallet, you can find its repository here.

The contracts pallet requires smart contracts to be uploaded to the blockchain as a Wasm blob.

ink! is a smart contract language which targets the API exposed by contracts. Hence ink! contracts are compiled to Wasm.

When executing cargo contract build an additional file metadata.json is created. It contains information about e.g. what methods the contract provides for others to call.