#[storage]
attribute.
Every contract must have exactly one storage definition, which serves as the contract’s persistent state on the blockchain and is kept between contract executions.
felt252
value(base_address, offset)
where:
base_address
is the address of the first slot where the variable is storedoffset
is the distance from the base address where the variable is storedselector!
macro to derive it from the variable name (i.e., selector!("variable§_name")
).
a
(u128
):
selector!(
”a”)`b
(u8
):
selector!("b")
c
(u256
):
selector!("c")