I'm trying to learn how to write a smart contract and using Ligo. I'm struggling with quite a few things at the same time e.g. syntax, understand the documentation, best practices etc.
Baby step is, register a user profile i.e. an ipfs hash. So storing this as a map, with the sender being the key and the hash being the value:
type artist is address
type ipfsProfileAddress is string
type artists is map (artist, ipfsProfileAddress)
const artists_storage : artists = map []
// get current address store as artist key and save ipfsProfileAddress
function register_artist (const profile: ipfsProfileAddress) : ipfsProfileAddress is block {
artists_storage(Tezos.sender, profile)
} with profile
Do I need to instantiate the map first? i.e. create the type, then create an empty one?
How do you set a key -> value?
Thanks