This guide will walk developers through writing a smart contract in Sway, a simple test, deploying to Fuel, and building a frontend.
Before we begin, it may be helpful to understand the terminology that will be used throughout the docs and how they relate to each other:
There are four types of Sway programs:
contract
predicate
script
library
The main features of a smart contract that differentiate it from scripts or predicates are that it is callable and stateful.
A script is runnable bytecode on the chain which can call contracts to perform some task. It does not represent ownership of any resources and it cannot be called by a contract.
See the chapter on program types for more information.
A few pieces of info that will be helpful before moving on: