tezos-client
commands to operate basic transfers and queries. The second part goes further: it uses the fatoo
command line interface to do batched-transfers and use the “operator” mechanism to delegate transfer rights.tezos-client
properly set up to talk to Carthagenet or to a “full” sandbox (i.e. with bakers).tezos-client
, as administrator
, originator
, alice
and bob
.alice
also as originator
and administrator
:%mint
entrypoint to fill the contract.administrator
address:administrator
set in the previous section.administrator
, mint 100 TK0
tokens to alice
:alice
, transfer 5 of our 100 TK0 to bob
:tezos-client
, here we obtain alice
's balance of TK0 tokens.%ledger
big-map; in this case we just display it with the FAILWITH
instruction, but one could do much more, including putting in storage (left as exercise for the reader ☺). Let's save it as get-balance.tz
:tezos-client
command to fail, since we want to read the error message:FAILWITH
) that alice
's balance is 95 TK0 (100 minted minus 5 transferred to bob
).fatoo
Applicationfatoo
command line interface to some builds of FA2-SmartPy. You need fatoo
installed in your $PATH
or you may use Docker:fatoo
application has many commands, see fatoo [subcommand] --help
. At the same time, it is work-in-progress, so feel free to submit issues and feature requests in the main repository.fatoo_root_path
: logs, outputsfatoo_client
: the more important one, it is an URI describing how to configure tezos-client
and talk to the node:fatoo show-client-uri-documentation
:The URI follows the usual pattern:://:/?
:
can behttp
orhttp
(--tls
option);:
defines the connection to the node; is the private-key (URI) for the “funder” account which is used to pay for gas and storage.Available are:
bake=true
: use thefunder
account to also bake blocks after injecting operations (useful for “manual” sandboxes);wait=
: set the--wait
option oftezos-client
(how many blocks to wait after an operation is injected);command=
: use an alternative command fortezos-client
.See for instance the current default:http://:2020/unencrypted:edsk3S7mCwuuMVS21jsYTczxBU4tgTbQp98J3YmTGcstuUxsrZxKYd?bake=true
.
client
subcommand which just calls tezos-client
properly, one may test their setup with:fatoo get-code --help
), but there is no need since one can directly originate contracts from the application. Let's originate mutran_contract
, the full blown FA2 implementation with an extra entry-point which allows the administrator to transfer funds which may potentially end-up in the contract's balance.tezos-client
but fatoo
has shortcut command to transfer from the configured “funding” account (amounts are in mutez
):owner0
does not exist on chain, we're still minting tokens to them:TQ1
still minting some to owner0
:TQ0
and TQ1
and, since we provide a “known token owner” on the command-line, we can see their balances:owner0
to do a batch-transfer. First, we need to feed some gas to that address:owner1
's secret-key to transfer TQ0s and TQ1s to owner1
and owner2
:operator
key-pair:fatoo call-update-operators --help
:operator
to run a batch-transfer-heist of all the tokens:0
except for operator
who owns the total supply:operator
wants to publicly tip/bribe the contract's administrator(s) by going through the contract itself (this may be a convoluted excuse to put XTZ on the contract …). We call the transfer
entry-point with an empty list of transfer-items but with a few XTZ as amount:fatoo
shows a non-zero balance for the contract now:admin
retrieve that money for themselves; the entry-point is called mutez_transfer
and takes a pair mutez × address
:admin
is wealthier: