Interacting with FA1.2

(Note: remember to set your burn-cap on all tz transactions.)

Get Total Supply

To get the total supply of tokens (stored in the NAT_STORAGE_ADDRESS contract):

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-getTotalSupply \
--callback-contract $NAT_STORAGE_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BLfeEq4QzH94 (timestamp: 2019-10-21T20:47:52-00:00, validation: 2019-10-21T20:49:01-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 192069 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'oo1XrLgCstxAJDmWNmtsLsh2ZCkTjwp3kB7voKTWkWrEvUuRemC'
NOT waiting for the operation to be included.
Use command
tezos-client wait for oo1XrLgCstxAJDmWNmtsLsh2ZCkTjwp3kB7voKTWkWrEvUuRemC to be included --confirmations 30 --branch BLfeEq4QzH94A2SFJ2xgsyVMyfctr1Xi39u5z4utFYuvmr1PXmB
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.019524
Expected counter: 2036
Gas limit: 192169
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.019524
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.019524
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Right (Left (Left (Pair Unit "KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7"))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6 False)
(Pair 17 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7362 bytes
Consumed gas: 180746
Internal operations:
Transaction:
Amount:0
From: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
To: KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7
Parameter: 17
This transaction was successfully applied
Updated storage: 17
Storage size: 38 bytes

Note that the NAT_STORAGE_ADDRESS is given in the View. We may access its stored value using the following command:

$ tezos-client get contract storage for $NAT_STORAGE_ADDRESS
0

Get Administrator

To get the current administrator's address (stored in the ADDRESS_STORAGE_ADDRESS contract):

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-getAdministrator \
--callback-contract $ADDRESS_STORAGE_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BL4bpCykrioM (timestamp: 2019-10-21T20:49:06-00:00, validation: 2019-10-21T20:50:02-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 192805 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'op2qjkD7gwFfdzBapsydr2v6mbnGKWzxU2yigArKLgVUNjGtUxR'
NOT waiting for the operation to be included.
Use command
tezos-client wait for op2qjkD7gwFfdzBapsydr2v6mbnGKWzxU2yigArKLgVUNjGtUxR to be included --confirmations 30 --branch BL4bpCykrioMC8bXq4EdVZZjYjgbrTsLjd5eQmH8cbLwmuCyvSh
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.0196
Expected counter: 2037
Gas limit: 192905
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.0196
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.0196
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Right (Right (Left (Left (Pair Unit "KT1Kdd8aATDD2ckMTymZXYV5azyY76xfvarq")))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6 False)
(Pair 17 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7362 bytes
Consumed gas: 180773
Internal operations:
Transaction:
Amount:0
From: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
To: KT1Kdd8aATDD2ckMTymZXYV5azyY76xfvarq
Parameter: 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6
This transaction was successfully applied
Updated storage: 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6
Storage size: 63 bytes

As with NAT_STORAGE_ADDRESS, we may access the result using get contract storage for and ensure that it matches Alice's address using echo $ALICE_ADDRESS:

$ tezos-client get contract storage for $ADDRESS_STORAGE_ADDRESS
"tz1L2UAwwU4k2nxjzB2mTnxW61wCcWaZeYkp"
$ echo $ALICE_ADDRESS
tz1L2UAwwU4k2nxjzB2mTnxW61wCcWaZeYkp

Get Balance

To get the balance of tokens for a particular address (stored in the NAT_STORAGE_ADDRESS contract):

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param ManagedLedgerBabylon-getBalance \
--account $ALICE_ADDRESS --callback-contract $NAT_STORAGE_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BLavqkSqYZj3 (timestamp: 2019-10-21T20:53:40-00:00, validation: 2019-10-21T20:53:52-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 192605 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'oo1dSvMfTYSdwVtrPwZq2JTmUK4irdPWfGHTkHn7jdf4iZwbsQV'
NOT waiting for the operation to be included.
Use command
tezos-client wait for oo1dSvMfTYSdwVtrPwZq2JTmUK4irdPWfGHTkHn7jdf4iZwbsQV to be included --confirmations 30 --branch BLavqkSqYZj36pkTgp2AhAEABLQC47v76414rEWLHaQet7tcpkn
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.019619
Expected counter: 2038
Gas limit: 192705
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.019619
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.019619
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Left (Right
(Right
(Right
(Pair "tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ" "KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7")))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6 False)
(Pair 17 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7362 bytes
Consumed gas: 181283
Internal operations:
Transaction:
Amount:0
From: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
To: KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7
Parameter: 0
This transaction was successfully applied
Updated storage: 0
Storage size: 38 bytes

We can then access the result using:

$ tezos-client get contract storage for $NAT_STORAGE_ADDRESS
0

Get Allowance

To get Bob's allowance to withdraw from Alice's account, where Bob's address is BOB_ADDRESS:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param ManagedLedgerBabylon-getAllowance \
--owner $ALICE_ADDRESS --spender $BOB_ADDRESS \
--callback-contract $NAT_STORAGE_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BLPG1kF61sED (timestamp: 2019-10-21T20:54:56-00:00, validation: 2019-10-21T20:55:01-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 192653 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'op7QhBaWo6onXAqFDAxfVduJoMQztWn83aMLtTCFPxzWmAM1WPu'
NOT waiting for the operation to be included.
Use command
tezos-client wait for op7QhBaWo6onXAqFDAxfVduJoMQztWn83aMLtTCFPxzWmAM1WPu to be included --confirmations 30 --branch BLPG1kF61sEDBFN75ByaNJpuinjAK2zd3pXD6SaFoEuRBBULuV6
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.019667
Expected counter: 2039
Gas limit: 192753
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.019667
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.019667
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Left (Right
(Right
(Left (Pair (Pair "tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ" "tz1iJnQkbS2ZVjToPgpCReQTHCJiuGBWA8gw")
"KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7")))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6 False)
(Pair 17 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7362 bytes
Consumed gas: 181335
Internal operations:
Transaction:
Amount:0
From: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
To: KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7
Parameter: 0
This transaction was successfully applied
Updated storage: 0
Storage size: 38 bytes
Consumed gas: 11318

We can then access the result using:

$ tezos-client get contract storage for $NAT_STORAGE_ADDRESS
0

Transfer

From GetBalance above, we know that Alice doesn't have any tokens.

To transfer tokens from Alice to Bob, we first need to give Alice some tokens. We can do that by minting 5 tokens and allocating them to Alice (See the Mint subsection below):

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-mint --value 5 --to $ALICE_ADDRESS)" --burn-cap 0.074
Waiting for the node to be bootstrapped before injection...
Current head: BLvvHtdeHbbA (timestamp: 2019-10-21T21:00:44-00:00, validation: 2019-10-21T21:02:01-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 181185 units (will add 100 for safety)
Estimated storage: 74 bytes added (will add 20 for safety)
Operation successfully injected in the node.
Operation hash is 'opZKRW5EaV2pGorHjEpVpVKwkktk9LxHi7z3Q6tvCDL31znWc2y'
NOT waiting for the operation to be included.
Use command
tezos-client wait for opZKRW5EaV2pGorHjEpVpVKwkktk9LxHi7z3Q6tvCDL31znWc2y to be included --confirmations 30 --branch BLvvHtdeHbbAjxjcwBsiDfypvkWi11HtqRJkfP2gw3DUMDSwCMK
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.018438
Expected counter: 2041
Gas limit: 181285
Storage limit: 94 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.018438
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.018438
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Right (Right (Left (Right (Pair "tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ" 5)))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 False)
(Pair 22 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Updated big_maps:
Set map(39)[0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4] to (Pair 5 {})
Storage size: 7436 bytes
Paid storage size diff: 74 bytes
Consumed gas: 181185
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ... -0.074

We can then access the result using:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-getBalance --account $ALICE_ADDRESS \
--callback-contract $NAT_STORAGE_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BL1A1iMigTu3 (timestamp: 2019-10-21T21:10:10-00:00, validation: 2019-10-21T21:10:29-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 192847 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'onttGmVohZDEZFx6G5YQ5J3YoDwj4VFyMsUpasNKh9qx1wMv12x'
NOT waiting for the operation to be included.
Use command
tezos-client wait for onttGmVohZDEZFx6G5YQ5J3YoDwj4VFyMsUpasNKh9qx1wMv12x to be included --confirmations 30 --branch BL1A1iMigTu3GFdpTMhDwwH7mqp33tcRMQhqK8LhVrhcsFNqxBo
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.019643
Expected counter: 2042
Gas limit: 192947
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.019643
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.019643
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Left (Right
(Right
(Right
(Pair "tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ" "KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7")))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 False)
(Pair 22 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7436 bytes
Consumed gas: 181523
Internal operations:
Transaction:
Amount:0
From: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
To: KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7
Parameter: 5
This transaction was successfully applied
Updated storage: 5
Storage size: 38 bytes
Consumed gas: 11324
$ tezos-client get contract storage for $NAT_STORAGE_ADDRESS
5

To transfer 2 tokens from Alice to Bob:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-transfer --value 2 \
--from $ALICE_ADDRESS --to $BOB_ADDRESS)" --burn-cap 0.074
Waiting for the node to be bootstrapped before injection...
Current head: BL9Ca6grDYnL (timestamp: 2019-10-21T21:12:40-00:00, validation: 2019-10-21T21:12:57-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 182652 units (will add 100 for safety)
Estimated storage: 74 bytes added (will add 20 for safety)
Operation successfully injected in the node.
Operation hash is 'onmNvjj7LJ26ktXVQu4AZLezhidTHszW4mDDkczk7LtzaVxnHu9'
NOT waiting for the operation to be included.
Use command
tezos-client wait for onmNvjj7LJ26ktXVQu4AZLezhidTHszW4mDDkczk7LtzaVxnHu9 to be included --confirmations 30 --branch BL9Ca6grDYnLgGBBn2QdpzSZBHgk98Qz8bRpEH3zAXL9EEKq36c
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.018626
Expected counter: 2043
Gas limit: 182752
Storage limit: 94 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.018626
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.018626
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Left (Left (Left (Pair "tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ"
(Pair "tz1iJnQkbS2ZVjToPgpCReQTHCJiuGBWA8gw" 2)))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 False)
(Pair 22 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Updated big_maps:
Set map(39)[0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4] to (Pair 3 {})
Set map(39)[0x0000f8a7114d3ca4c432357f761e5f3dceb8e328a86b] to (Pair 2 {})
Storage size: 7510 bytes
Paid storage size diff: 74 bytes
Consumed gas: 182652
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ... -0.074

We can then access the result using:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-getBalance --account $BOB_ADDRESS \
--callback-contract $NAT_STORAGE_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BMH6qaRp3KjB (timestamp: 2019-10-21T21:14:36-00:00, validation: 2019-10-21T21:16:00-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 192851 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'ootmA6nocUBoJivBbkYdyCYVFzyquCDFQcTmRWYCSSXvrhNzdWF'
NOT waiting for the operation to be included.
Use command
tezos-client wait for ootmA6nocUBoJivBbkYdyCYVFzyquCDFQcTmRWYCSSXvrhNzdWF to be included --confirmations 30 --branch BMH6qaRp3KjBKYTTbom5sk3fuU5aBujGs6uccSGRP4nD7U3hDcN
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.019644
Expected counter: 2044
Gas limit: 192951
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.019644
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.019644
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Left (Right
(Right
(Right
(Pair "tz1iJnQkbS2ZVjToPgpCReQTHCJiuGBWA8gw" "KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7")))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 False)
(Pair 22 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7510 bytes
Consumed gas: 181523
Internal operations:
Transaction:
Amount:0
From: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
To: KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7
Parameter: 2
This transaction was successfully applied
Updated storage: 2
Storage size: 38 bytes
Consumed gas: 11328
$ tezos-client get contract storage for $NAT_STORAGE_ADDRESS
2

Approve

For Alice to approve Bob to withdraw up to 3 tokens from her address:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-approve --value 2 \
--spender $BOB_ADDRESS)" --burn-cap 0.031
Waiting for the node to be bootstrapped before injection...
Current head: BMV5vChMPe94 (timestamp: 2019-10-21T21:18:20-00:00, validation: 2019-10-21T21:18:51-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 182665 units (will add 100 for safety)
Estimated storage: 31 bytes added (will add 20 for safety)
Operation successfully injected in the node.
Operation hash is 'oohT29DgKS8yNkRDNK2Y4XiYDJWE7UFfNEXZBGhmfQkM158ti3e'
NOT waiting for the operation to be included.
Use command
tezos-client wait for oohT29DgKS8yNkRDNK2Y4XiYDJWE7UFfNEXZBGhmfQkM158ti3e to be included --confirmations 30 --bran
ch BMV5vChMPe94mQpb4aisMnkHPUwTzMgT1dhaBdVfnpXAZnW9g7U
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.018586
Expected counter: 2045
Gas limit: 182765
Storage limit: 51 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.018586
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.018586
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Left (Left (Right (Right (Pair "tz1iJnQkbS2ZVjToPgpCReQTHCJiuGBWA8gw" 2)))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 False)
(Pair 22 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Updated big_maps:
Set map(39)[0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4] to (Pair 3 { Elt 0x0000f8a7114d3ca4c432357f761e5
f3dceb8e328a86b 2 })
Storage size: 7541 bytes
Paid storage size diff: 31 bytes
Consumed gas: 182665
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ... -0.031

We can then check the resulting allowance using:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-getAllowance --owner $ALICE_ADDRESS \
--spender $BOB_ADDRESS --callback-contract $NAT_STORAGE_ADDRESS)" --burn-cap 0.071
Waiting for the node to be bootstrapped before injection...
Current head: BLdu1j42hHyv (timestamp: 2019-10-21T21:20:20-00:00, validation: 2019-10-21T21:20:57-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 193321 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'onkEFmcHXHwAu2hmT5xeXVpoZwQWj9ni1RTUHdRzT3Tvz2Zh3r3'
NOT waiting for the operation to be included.
Use command
tezos-client wait for onkEFmcHXHwAu2hmT5xeXVpoZwQWj9ni1RTUHdRzT3Tvz2Zh3r3 to be included --confirmations 30 --branch BLdu1j42hHyvpVBebxMvwP8kEJx4k1xhFZjMfbojELcTmErgAdW
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.019734
Expected counter: 2046
Gas limit: 193421
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.019734
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.019734
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Left (Right
(Right
(Left (Pair (Pair "tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ" "tz1iJnQkbS2ZVjToPgpCReQTHCJiuGBWA8gw")
"KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7")))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 False)
(Pair 22 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7541 bytes
Consumed gas: 181993
Internal operations:
Transaction:
Amount:0
From: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
To: KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7
Parameter: 2
This transaction was successfully applied
Updated storage: 2
Storage size: 38 bytes
Consumed gas: 11328
$ tezos-client get contract storage for $NAT_STORAGE_ADDRESS
2

Mint

To mint 5 tokens and allocate them to Alice:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-mint --value 5 --to $ALICE_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BKmDsWux8JuS (timestamp: 2019-10-22T15:31:34-00:00, validation: 2019-10-22T15:32:09-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 182345 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'onh1pck6fUQR5C5UoL8sSTdvDkCg1hzKMgGYwZ2z29Vma4wX8Dw'
NOT waiting for the operation to be included.
Use command
tezos-client wait for onh1pck6fUQR5C5UoL8sSTdvDkCg1hzKMgGYwZ2z29Vma4wX8Dw to be included --confirmations 30 --branch BKmDsWux8JuSfCqpcazqKg2xQGTuD6PFV4Rhos1BcKuuMsePL6f
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.018554
Expected counter: 2048
Gas limit: 182445
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.018554
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.018554
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Right (Right (Left (Right (Pair "tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ" 5)))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 False)
(Pair 27 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Updated big_maps:
Set map(39)[0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4] to (Pair 8 { Elt 0x0000f8a7114d3ca4c432357f761e5f3dceb8e328a86b 2 })
Storage size: 7541 bytes
Consumed gas: 182345

We can then access the result using:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-getBalance --account $ALICE_ADDRESS \
--callback-contract $NAT_STORAGE_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BLCz5XJTYARS (timestamp: 2019-10-22T15:36:56-00:00, validation: 2019-10-22T15:37:51-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 193269 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'ooNNU97equbsVtvKJiXwNEwN7vHkNrUCxhR8g9DrV7GWhzWQcEX'
NOT waiting for the operation to be included.
Use command
tezos-client wait for ooNNU97equbsVtvKJiXwNEwN7vHkNrUCxhR8g9DrV7GWhzWQcEX to be included --confirmations 30 --bran
ch BLCz5XJTYARShkYKQw8Kp6P8MZswsYjnZ8U6zgMppe41Z5MfGY8
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.019685
Expected counter: 2049
Gas limit: 193369
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.019685
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.019685
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Left (Right
(Right
(Right
(Pair "tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ" "KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7")
))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 False)
(Pair 27 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7541 bytes
Consumed gas: 181941
Internal operations:
Transaction:
Amount:0
From: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
To: KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7
Parameter: 8
This transaction was successfully applied
Updated storage: 8
Storage size: 38 bytes
Consumed gas: 11328
$ tezos-client get contract storage for $NAT_STORAGE_ADDRESS
5

Burn

If you've been following this guide step-by-step, Bob's account should have 3 tokens at this point. If it doesn't, add at least 1 using Transfer or Mint.

Before burning, we first add 2 tokens to Bob's address:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-mint --value 2 --to $BOB_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BLmUgACHmHSy (timestamp: 2019-10-22T15:47:22-00:00, validation: 2019-10-22T15:47:43-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 181426 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'ooGDWcJ7puiXymb6Uz3bN2oBTW1c8B4jRyVF2A5RUJ7kP36iDFv'
NOT waiting for the operation to be included.
Use command
tezos-client wait for ooGDWcJ7puiXymb6Uz3bN2oBTW1c8B4jRyVF2A5RUJ7kP36iDFv to be included --confirmations 30 --bran
ch BLmUgACHmHSyoC24u3KLGWmNLcVhPpQ6cWeejuruJYMNvex1ufy
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.018462
Expected counter: 2050
Gas limit: 181526
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.018462
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.018462
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Right (Right (Left (Right (Pair "tz1iJnQkbS2ZVjToPgpCReQTHCJiuGBWA8gw" 3)))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 False)
(Pair 30 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Updated big_maps:
Set map(39)[0x0000f8a7114d3ca4c432357f761e5f3dceb8e328a86b] to (Pair 5 {})
Storage size: 7541 bytes
Consumed gas: 181426

We can ensure Bob has at least 3 tokens using:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-getBalance --account $BOB_ADDRESS \
--callback-contract $NAT_STORAGE_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BL1DTEptvWGX (timestamp: 2019-10-22T15:48:06-00:00, validation: 2019-10-22T15:48:47-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 192851 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'onimNqmNToUyQZNUBaxxkANh92pKPHLTcLMxY78KB9fo2NqvhtH'
NOT waiting for the operation to be included.
Use command
tezos-client wait for onimNqmNToUyQZNUBaxxkANh92pKPHLTcLMxY78KB9fo2NqvhtH to be included --confirmations 30 --branch BL1DTEptvWGXQWF3yswfZGLGF9msQCfqA9uDC1WJbxKZzCzEioR
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.019644
Expected counter: 2051
Gas limit: 192951
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.019644
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.019644
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Left (Right
(Right
(Right
(Pair "tz1iJnQkbS2ZVjToPgpCReQTHCJiuGBWA8gw" "KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7")))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 False)
(Pair 30 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7541 bytes
Consumed gas: 181523
Internal operations:
Transaction:
Amount:0
From: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
To: KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7
Parameter: 5
This transaction was successfully applied
Updated storage: 5
Storage size: 38 bytes
Consumed gas: 11328
$ tezos-client get contract storage for $NAT_STORAGE_ADDRESS
5

Finally, we can burn 2 of Bob's tokens using:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-burn --value 2 --from $BOB_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BMJSLk5sGUqa (timestamp: 2019-10-22T15:49:28-00:00, validation: 2019-10-22T15:50:00-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 181434 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'onjz6j1WxxsjCPprNXaZv1ZeYQfxnmSFLFwp3fp8DLR4HzKgexN'
NOT waiting for the operation to be included.
Use command
tezos-client wait for onjz6j1WxxsjCPprNXaZv1ZeYQfxnmSFLFwp3fp8DLR4HzKgexN to be included --confirmations 30 --branch BMJSLk5sGUqaTWKSZozoDG3Cei7tRtVudfCRdLZa9E8yXN5hueY
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.018463
Expected counter: 2052
Gas limit: 181534
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.018463
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.018463
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Right (Right (Right (Left (Pair "tz1iJnQkbS2ZVjToPgpCReQTHCJiuGBWA8gw" 2)))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 False)
(Pair 28 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Updated big_maps:
Set map(39)[0x0000f8a7114d3ca4c432357f761e5f3dceb8e328a86b] to (Pair 3 {})
Storage size: 7541 bytes
Consumed gas: 181434

And then we may confirm that two tokens have been subtracted from Bob's account:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-getBalance --account $BOB_ADDRESS \
--callback-contract $NAT_STORAGE_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BKtcbjyHzWrH (timestamp: 2019-10-22T15:57:34-00:00, validation: 2019-10-22T15:57:46-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 192851 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'op53iTCkigXPkX8jaxZnobWpJsKcuk4BMnoXyhZWFCNe81eTTYz'
NOT waiting for the operation to be included.
Use command
tezos-client wait for op53iTCkigXPkX8jaxZnobWpJsKcuk4BMnoXyhZWFCNe81eTTYz to be included --confirmations 30 --branch BKtcbjyHzWrHBQFtVySXJnCcByb23NtNrGhQXVxdvBobudKazfg
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.019644
Expected counter: 2053
Gas limit: 192951
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.019644
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.019644
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Left (Right
(Right
(Right
(Pair "tz1iJnQkbS2ZVjToPgpCReQTHCJiuGBWA8gw" "KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7")))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 False)
(Pair 28 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7541 bytes
Consumed gas: 181523
Internal operations:
Transaction:
Amount:0
From: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
To: KT1TEXAiui2k9wdZgLr8Bx7oDUmXWSTf5sG7
Parameter: 3
This transaction was successfully applied
Updated storage: 3
Storage size: 38 bytes
Consumed gas: 11328
$ tezos-client get contract storage for $NAT_STORAGE_ADDRESS
3

asciinema Burn

Miscellaneous features

Pause Contract

To pause the contract:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-setPause --paused True)"
Waiting for the node to be bootstrapped before injection...
Current head: BLycw7xoQSKe (timestamp: 2019-10-22T15:58:52-00:00, validation: 2019-10-22T15:59:22-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 179974 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'ootNR8D2codVUQFoLfUcrxwRFXxjArmiw5JrMLKsEwW2VcvbVqF'
NOT waiting for the operation to be included.
Use command
tezos-client wait for ootNR8D2codVUQFoLfUcrxwRFXxjArmiw5JrMLKsEwW2VcvbVqF to be included --confirmations 30 --bran
ch BLycw7xoQSKeu9bGowgGJRLtVXhFmuK5zPzLDHGwig44qDt9uqF
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.018274
Expected counter: 2054
Gas limit: 180074
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.018274
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.018274
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Right (Left (Right (Left True))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 True)
(Pair 28 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7541 bytes
Consumed gas: 179974

We can check whether the contract is paused using:

$ tezos-client get contract storage for $FA12_ADDRESS
Pair {}
(Pair (Pair "tz1L2UAwwU4k2nxjzB2mTnxW61wCcWaZeYkp" True)
(Pair 18 (Left "tz1L2UAwwU4k2nxjzB2mTnxW61wCcWaZeYkp")))

Note: the True value indicates that it's paused, a False value indicicates that it's not paused.

To unpause the contract:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-setPause --paused False)"
Waiting for the node to be bootstrapped before injection...
Current head: BLKmXMESk5s2 (timestamp: 2019-10-22T16:01:30-00:00, validation: 2019-10-22T16:03:03-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 179974 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'opBmGq8VR4Nz9gceJZUa4oezcVP8JdwW3SyYog2sJqZHcofwsp7'
NOT waiting for the operation to be included.
Use command
tezos-client wait for opBmGq8VR4Nz9gceJZUa4oezcVP8JdwW3SyYog2sJqZHcofwsp7 to be included --confirmations 30 --bran
ch BLKmXMESk5s2B9DMC1NLmM1JGd9BgUJ3zqwxzdNJFkQVC5Za9cB
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.018274
Expected counter: 2055
Gas limit: 180074
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.018274
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.018274
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Right (Left (Right (Left False))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x00006e5364bb8d20e4fb62ff1a602e50140505fa88e4 False)
(Pair 28 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7541 bytes
Consumed gas: 179974
$ tezos-client get contract storage for $FA12_ADDRESS
Pair {}
(Pair (Pair "tz1L2UAwwU4k2nxjzB2mTnxW61wCcWaZeYkp" False)
(Pair 18 (Left "tz1L2UAwwU4k2nxjzB2mTnxW61wCcWaZeYkp")))

Set New Administrator

To make Bob the new administrator:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS \
--arg "$(lorentz-contract-param \
ManagedLedgerBabylon-setAdministrator \
--new-administrator-address $BOB_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BLCmW4hM4P18 (timestamp: 2019-10-22T16:10:40-00:00, validation: 2019-10-22T16:11:21-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 179986 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'ooojjL4gJaH3idzRiPvVT6jW5BNrGYx4JTGHjg3wSmg3hF3LpmK'
NOT waiting for the operation to be included.
Use command
tezos-client wait for ooojjL4gJaH3idzRiPvVT6jW5BNrGYx4JTGHjg3wSmg3hF3LpmK to be included --confirmations 30 --bran
ch BLCmW4hM4P18oLDm6kMGp6VFMuRUxTsYJ9jEHeBroijNeZVyseh
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.018314
Expected counter: 2056
Gas limit: 180086
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.018314
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.018314
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Right (Left (Right (Right "tz1iJnQkbS2ZVjToPgpCReQTHCJiuGBWA8gw"))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x0000f8a7114d3ca4c432357f761e5f3dceb8e328a86b False)
(Pair 28 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7541 bytes
Consumed gas: 179986

We can ensure that the administrator has been updated using:

$FA12_ADDRESS \ --arg "$(lorentz-contract-param \
ManagedLedgerBabylon-getAdministrator \ --callback-contract
$ADDRESS_STORAGE_ADDRESS)"
Waiting for the node to be bootstrapped before injection...
Current head: BLsbaa2JfmS2 (timestamp: 2019-10-22T16:12:06-00:00, validation: 2019-10-22T16:12:29-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 192805 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'opWCDSoTiNuWKfCAGij811CynHV3gfQLYesgiZGFzNXjeLdckgJ'
NOT waiting for the operation to be included.
Use command
tezos-client wait for opWCDSoTiNuWKfCAGij811CynHV3gfQLYesgiZGFzNXjeLdckgJ to be included --confirmations 30 --bran
ch BLsbaa2JfmS21mRoY85LCwpaeguEC4HC5Ukd8G9nZTrmKeaHoea
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Manager signed operations:
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
Fee to the baker:0.0196
Expected counter: 2057
Gas limit: 192905
Storage limit: 0 bytes
Balance updates:
tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ ............ -0.0196
fees(tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU,23) ... +0.0196
Transaction:
Amount:0
From: tz1VhNvW3aWCHRNawF4sHfBfJAu5WrpcEbSQ
To: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
Parameter: (Right (Right (Left (Left (Pair Unit "KT1Kdd8aATDD2ckMTymZXYV5azyY76xfvarq")))))
This transaction was successfully applied
Updated storage:
(Pair 39
(Pair (Pair 0x0000f8a7114d3ca4c432357f761e5f3dceb8e328a86b False)
(Pair 28 (Left 0x00005700599cb27ba1c9415e4fb928f3a9435f879ce6))))
Storage size: 7541 bytes
Consumed gas: 180773
Internal operations:
Transaction:
Amount:0
From: KT1XvNBJovT7XVedr29vw7QDWrqTU96NTQwR
To: KT1Kdd8aATDD2ckMTymZXYV5azyY76xfvarq
Parameter: 0x0000f8a7114d3ca4c432357f761e5f3dceb8e328a86b
This transaction was successfully applied
Updated storage: 0x0000f8a7114d3ca4c432357f761e5f3dceb8e328a86b
Storage size: 63 bytes
Consumed gas: 12032
$ tezos-client get contract storage for $ADDRESS_STORAGE_ADDRESS
"tz1WWkcu7VFWgUTB9AAAomXGMS27tPKXrE9C"
$ echo $BOB_ADDRESS
tz1WWkcu7VFWgUTB9AAAomXGMS27tPKXrE9C

Troubleshooting

Counter _ already used

This error occurs when a dependent operation has not yet been included and can take one of the following forms:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS --arg ..
Waiting for the node to be bootstrapped before injection...
Current head: BMe8VmYBa1Ye (timestamp: 2019-08-12T15:34:56-00:00, validation: 2019-08-12T15:35:00-00:00)
Node is bootstrapped, ready for injecting operations.
Counter 565668 already used for contract tz1QLne6uZFxPRdRfJG8msx5RouENpJoRsfP (expected 565669)
Fatal error:
transfer simulation failed
$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS --arg ..
Waiting for the node to be bootstrapped before injection...
Current head: BL7QrQjGhkut (timestamp: 2019-08-12T15:39:26-00:00, validation: 2019-08-12T15:39:45-00:00)
Node is bootstrapped, ready for injecting operations.
Estimated gas: 212314 units (will add 100 for safety)
Estimated storage: no bytes added
Unregistred error:
{ "kind": "generic",
"error":
"Error while applying operation op1imCEMKFm7bTN9cwX4uoKPb6FjHJDv6NCkWKGVE7srh4XN6UP:\nbranch refused (Error:\n
Counter 565670 already used for contract tz1QLne6uZFxPRdRfJG8msx5RouENpJoRsfP (expected 565671)\n)" }
Fatal error:
transfer simulation failed

To fix, either:

  • Wait for the operation to be included
  • Run tz wait for [Operation Hash] to be included with the dependent operation's Operation Hash before continuing
    • Alternatively, you may run: tz get receipt for [Operation Hash]

Higher than the configured burn cap

This error may occur when --burn-cap is not specified or it's set too low for the current operation:

$ tezos-client --wait none transfer 0 from $ALICE_ADDRESS to $FA12_ADDRESS --arg ..
Waiting for the node to be bootstrapped before injection...
Current head: BLBsvLowXAPf (timestamp: 2019-08-12T15:41:56-00:00, validation: 2019-08-12T15:42:45-00:00)
Node is bootstrapped, ready for injecting operations.
Fatal error:
The operation will burn ꜩ0.021 which is higher than the configured burn cap (0).
Use `--burn-cap 0.021` to emit this operation.

To fix, replace or add --burn-cap with the given recommendation (in this case, --burn-cap 0.021)