Skip to content

Commit

Permalink
Fix syntax pascaligo in chapter deployinvokecontract and in chapter FA12
Browse files Browse the repository at this point in the history
  • Loading branch information
OCTO-FRAH committed Jun 25, 2020
1 parent d3ea49f commit d7f8e3f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 :
Expand Down Expand Up @@ -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 :
Expand Down
Original file line number Diff line number Diff line change
@@ -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]'
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] ] ]'
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ 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 '<parameter_expression>' '<storage_expression>'
ligo dry-run --sender=tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ fa12.ligo main '<parameter_expression_step2>' '<storage_expression_step1>'
// Modify the code below
tezos-client transfer <amount> from <user> to <contract_name> --arg '<entrypoint_invocation>' --dry-run
// Modify the code below
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 '<parameter_expression>' '<storage_expression>'
ligo dry-run --sender=tz1SdT62G8tQp9fdHh4f2m4VtL8aGG6NUcmJ fa12.ligo main '<parameter_expression_step6>' '<storage_expression_step5>'
// Modify the code below
tezos-client transfer <amount> from <user> to <contract_name> --arg '<entrypoint_invocation>' --dry-run
tezos-client transfer <amount> from <user> to <contract_name> --arg '<entrypoint_invocation>' --dry-run
11 changes: 4 additions & 7 deletions src/frontend/src/pages/Chapters/Pascal/ChapterFA12/solution.ligo
Original file line number Diff line number Diff line change
@@ -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




0 comments on commit d7f8e3f

Please sign in to comment.