docs/reference/src/documentation/misc/prelude.md
The prelude is a list of commonly used features from the standard library which is automatically imported into every Sway program.
The prelude contains the following:
Address: A struct containing a b256 value which represents the wallet addressContractId A struct containing a b256 value which represents the ID of a contractIdentity: An enum containing Address & ContractID structsVec: A growable, heap-allocated vectorStorageMap: A key-value mapping in contract storageOption: An enum containing either some generic value <T> or an absence of that value, we also expose the variants directly:
SomeNoneResult: An enum used to represent either a success or failure of an operation, we also expose the variants directly:
OkErrassert: A module containing
assert: A function that reverts the VM if the condition provided to it is falseassert_eq: A function that reverts the VM and logs its two inputs v1 and v2 if the condition v1 == v2 is falseassert_ne: A function that reverts the VM and logs its two inputs v1 and v2 if the condition v1 != v2 is falserevert: A module containing
require: A function that reverts and logs a given value if the condition is falserevert: A function that revertslog: A function that logs arbitrary stack typesmsg_sender: A function that gets the Identity from which a call was made