diff --git a/src/frontend/src/pages/Chapters/Pascal/ChapterDeployContract/course.md b/src/frontend/src/pages/Chapters/Pascal/ChapterDeployContract/course.md index c6dd89c..613b594 100644 --- a/src/frontend/src/pages/Chapters/Pascal/ChapterDeployContract/course.md +++ b/src/frontend/src/pages/Chapters/Pascal/ChapterDeployContract/course.md @@ -161,7 +161,13 @@ The _map_ _end_ keywords can be used to initialize a *map* The command line *ligo compile-storage* for transpiling a map containg a tuple. ``` -ligo compile-storage starmap.ligo main 'map "earth" -> (1,1,1) end' +ligo compile-storage starmap.ligo main 'map [ "earth" -> (1,1,1) ]' +``` + +When specifying an empty map, one must cast the *map []* into the expected type. + +``` +ligo compile-storage starmap.ligo main '(map []: map(string,coordinates))' ``` #### Tuples @@ -171,7 +177,7 @@ Initialization of elements of a tuple is specified between _(_ and _)_ separated The command line *ligo compile-storage* for transpiling a map containg a tuple. ``` -ligo compile-storage starmap.ligo main 'map "earth" -> (1,1,1) end' +ligo compile-storage starmap.ligo main 'map [ "earth" -> (1,1,1) ]' ``` This command returns : @@ -211,7 +217,7 @@ block { skip } with case action of The command line *ligo compile-storage* for transpiling a map containg a record tuple. ``` -ligo compile-storage starmap2.ligo main 'map "earth" -> record [x=1;y=1;z=1] end' +ligo compile-storage starmap2.ligo main 'map [ "earth" -> record [x=1;y=1;z=1] ]' ``` This command returns : diff --git a/src/frontend/src/pages/Chapters/Pascal/ChapterDeployContract/solution.ligo b/src/frontend/src/pages/Chapters/Pascal/ChapterDeployContract/solution.ligo index 234a56e..de5fb13 100644 --- a/src/frontend/src/pages/Chapters/Pascal/ChapterDeployContract/solution.ligo +++ b/src/frontend/src/pages/Chapters/Pascal/ChapterDeployContract/solution.ligo @@ -1,3 +1,3 @@ -ligo compile-storage starmap3.ligo main 'record[name="Sol";systemplanets=map "earth" -> record [x=2;y=7;z=1] end]' +ligo compile-storage starmap3.ligo main 'record [name="Sol"; systemplanets=map [ "earth" -> record [x=2;y=7;z=1] ] ]' -ligo dry-run starmap3.ligo main 'AddPlanet (("mars", record[x=4;y=15;z=2]))' 'record[name="Sol";systemplanets=map "earth" -> record [x=2;y=7;z=1] end]' \ No newline at end of file +ligo dry-run starmap3.ligo main 'AddPlanet (("mars", record[x=4;y=15;z=2]))' 'record [name="Sol"; systemplanets=map [ "earth" -> record [x=2;y=7;z=1] ] ]' \ No newline at end of file diff --git a/src/frontend/src/pages/Chapters/Pascal/ChapterFA12/exercise.ligo b/src/frontend/src/pages/Chapters/Pascal/ChapterFA12/exercise.ligo index 302d28f..287e954 100644 --- a/src/frontend/src/pages/Chapters/Pascal/ChapterFA12/exercise.ligo +++ b/src/frontend/src/pages/Chapters/Pascal/ChapterFA12/exercise.ligo @@ -3,7 +3,7 @@ ligo compile-storage fa12.ligo main '' // Modify the code below ligo compile-parameter fa12.ligo main '' // Modify the code below -ligo dry-run --sender=tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ fa12.ligo main '' '' +ligo dry-run --sender=tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ fa12.ligo main '' '' // Modify the code below tezos-client transfer from to --arg '' --dry-run // Modify the code below @@ -11,6 +11,6 @@ ligo compile-parameter refa12.ligo main '' // Modify the code below ligo compile-storage fa12.ligo main '' // Modify the code below -ligo dry-run --sender=tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ fa12.ligo main '' '' +ligo dry-run --sender=tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ fa12.ligo main '' '' // Modify the code below -tezos-client transfer from to --arg '' --dry-run \ No newline at end of file +tezos-client transfer from to --arg '' --dry-run diff --git a/src/frontend/src/pages/Chapters/Pascal/ChapterFA12/solution.ligo b/src/frontend/src/pages/Chapters/Pascal/ChapterFA12/solution.ligo index 0675227..32edec1 100644 --- a/src/frontend/src/pages/Chapters/Pascal/ChapterFA12/solution.ligo +++ b/src/frontend/src/pages/Chapters/Pascal/ChapterFA12/solution.ligo @@ -1,19 +1,16 @@ -ligo compile-storage fa12.ligo main 'record totalSupply=1000000n; ledger=big_map ("tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ":address)->record balance=1000000n; allowances=(map end : map(address, amt)); end end; end' +ligo compile-storage fa12.ligo main 'record [ totalSupply=1000000n; ledger=big_map [ ("tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ":address)->record [ balance=1000000n; allowances=(map [] : map(address, amt)) ] ] ]' // Modify the code below ligo compile-parameter fa12.ligo main 'Approve(("tz1NiAGZgRV8F1E3qYFEPgajntzTRDYkU9h7":address), 2n)' // Modify the code below -ligo dry-run --sender=tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ fa12.ligo main 'Approve(("tz1NiAGZgRV8F1E3qYFEPgajntzTRDYkU9h7":address), 2n)' 'record totalSupply=1000000n; ledger=big_map ("tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ":address)->record balance=1000000n; allowances=(map end : map(address, amt)); end end; end' +ligo dry-run --sender=tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ fa12.ligo main 'Approve(("tz1NiAGZgRV8F1E3qYFEPgajntzTRDYkU9h7":address), 2n)' 'record [ totalSupply=1000000n; ledger=big_map [ ("tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ":address)->record [ balance=1000000n; allowances=(map [] : map(address, amt)) ] ] ]' // Modify the code below tezos-client transfer 0tz from me to TezosAcamedyToken --arg '(Left (Left (Left (Pair "tz1NiAGZgRV8F1E3qYFEPgajntzTRDYkU9h7" 2))))' --dry-run // Modify the code below ligo compile-parameter fa12.ligo main 'Transfer(("tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ":address), ("tz1NiAGZgRV8F1E3qYFEPgajntzTRDYkU9h7":address), 2n)' // Modify the code below -ligo compile-storage fa12.ligo main 'record totalSupply=1000000n; ledger=big_map ("tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ":address)->record balance=1000000n; allowances=(map ("tz1NiAGZgRV8F1E3qYFEPgajntzTRDYkU9h7":address)->2n end : map(address, amt)); end; end; end' +ligo compile-storage fa12.ligo main 'record [ totalSupply=1000000n; ledger=big_map [ ("tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ":address)->record [balance=1000000n; allowances=map [("tz1NiAGZgRV8F1E3qYFEPgajntzTRDYkU9h7":address)->2n] ] ] ]' // Modify the code below -ligo dry-run --sender=tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ fa12.ligo main 'Transfer(("tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ":address), ("tz1NiAGZgRV8F1E3qYFEPgajntzTRDYkU9h7":address), 2n)' 'record totalSupply=1000000n; ledger=big_map ("tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ":address)->record balance=1000000n; allowances=(map ("tz1NiAGZgRV8F1E3qYFEPgajntzTRDYkU9h7":address)->2n end : map(address, amt)); end; end; end' +ligo dry-run --sender=tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ fa12.ligo main 'Transfer(("tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ":address), ("tz1NiAGZgRV8F1E3qYFEPgajntzTRDYkU9h7":address), 2n)' 'record [ totalSupply=1000000n; ledger=big_map [ ("tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ":address)->record [balance=1000000n; allowances=map [("tz1NiAGZgRV8F1E3qYFEPgajntzTRDYkU9h7":address)->2n] ] ] ]' // Modify the code below tezos-client transfer 0tz from me to TezosAcamedyToken --arg '(Right (Pair (Pair "tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ" "tz1NiAGZgRV8F1E3qYFEPgajntzTRDYkU9h7") 2))' --dry-run - - -