1

Struggling with Ligo so took a look at Fi. I want to create a provenancy smart contract i.e. add an artwork, then transfer ownership. The Fi compiler says Error: Error with variable ext - for variable ext. I've noticed there have been no code updates for 12 months now though ...

struct Artist(
  string ipfsProfileAddress
);

struct Artwork(
  string id,
  address artist,
  address owner,
  string ipfsArtworkAddress
);

storage map[address => Artist] artists;
storage map[string => Artwork] artworks;

entry register_artist(Artist ipfsProfileAddress) {
  storage.artists.push(SENDER, input.ipfsProfileAddress);
}

entry update_artist(string newIpfsProfileAddress) {
  let Artist me = storage.artists.get(SENDER);
  me.ipfsProfileAddress = input.newIpfsProfileAddress;
  storage.artists.push(SENDER, me);
}

entry register_artwork(string id, string ipfsArtworkAddress) {
  storage.artworks.push(input.id, new Artwork(input.id, SENDER, SENDER, input.ipfsArtworkAddress))
}

entry transfer_ownership(string id, address newOwner) {
  let Artwork artwork = storage.artworks.get(input.id)
  assert(SENDER == artwork.owner, string 'no permission')
  artwork.owner = newOwner
  storage.artworks.push(input.id, artwork)
  return artwork
}
  • Hi Mark, just a warning: it seems like fi is not maintained anymore, where as LIGO is in active development. If you're having issues with LIGO we can probably help you here :) – arvidj Mar 13 at 12:25
  • Yeah ... Ligo ... this is as far as I got with Ligo – Mark Robson Mar 13 at 12:36
  • Okay, looks good. What problems did you encounter? – arvidj Mar 13 at 13:34
  • Thanks @arvidj. It doesn't compile. I don't know how to write functions. Trying to grok the syntax. Struggling – Mark Robson Mar 13 at 14:07
  • @arvidj I created a new issue thanks – Mark Robson Mar 13 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.