1

I'm deploying the FA1.2 contract with the online LIGO IDE,

Here's a link to the SC: https://ide.ligolang.org/p/QZ85RIfszExxeDPEf_W52A

and i'm initializing the storage this way:

(Pair (Pair {} "tz1djN1zPWUYpanMS1YhKJ2EmFSYs6qjf4bW") 0)

But I got

Error: ligo: : Parse error in file "", line 0, characters 12-13, after "Pair" and before "{":
      121: <syntax error> {}

Can anyone confirm that i'm initializing the storage the right way? If not, what's the correct format?

Thank you.

2
  • 1
    Can you share the command you use to initialize the storage? My guess is that your storage is in Michelson syntax, whereas the command you requires the PascaLIGO syntax, which would be record [ owner = ("tz1djN1zPWUYpanMS1YhKJ2EmFSYs6qjf4bW" : address); totalSupply = 0n; ledger = (big_map [] : big_map (address, account)); ]
    – arvidj
    Apr 24, 2020 at 12:22
  • Thank you for responding. Yes I put the initialization in Michelson format, and changing with your command resolved the issue. Have you any ressource on initialization the storage in PascaLIGO syntax?
    – Daly
    Apr 24, 2020 at 13:28

2 Answers 2

2

Here's the parameter values to initialize storage for the fa1.2 contract. It is working well on my side. If you want to more look at pascaligo syntax, you can visit ligolang doc pages on https://ligolang.org/docs/language-basics/maps-records and https://ligolang.org/docs/tutorials/get-started/tezos-taco-shop-smart-contract/#populating-our-storage-in-a-dry-run

record [owner="tz1djN1zPWUYpanMS1YhKJ2EmFSYs6qjf4bW"; totalSupply=100n; ledger=big_map[("tz1djN1zPWUYpanMS1YhKJ2EmFSYs6qjf4bW" : address)->record[balance=100n; allowances=map[("tz1djN1zPWUYpanMS1YhKJ2EmFSYs6qjf4bW" : address)->50n]]]]

BTW,the FA1.2 contract you used looks different from the one in the latest dev version. please check out this : https://gitlab.com/ligolang/ligo/-/blob/dev/src/test/examples/pascaligo/fa-1.2.ligo I generated the share link with new FA1.2 contract containing parameter values. please take a look at this: https://ide.ligolang.org/p/Oj3jhBNoXrAh14hnGcoh8g

1

If nobody gets back to you soon you can always contact the Ligo team directly on Telegram at: https://t.me/LigoLang

You can also find them on Twitter at: https://twitter.com/ligolang

And can file an issue if necessary at: https://gitlab.com/ligolang/ligo/issues

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.