How it Works ‒ Substrate
Substrate's Framework for Runtime Aggregation of Modularized 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
you can find its repository here.
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
Hence ink! contracts are compiled to Wasm.
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.