1

burn function in KT_token contract can be called with arg format:

burn: (pair (or (unit %uSD) (unit %xTZ)) mutez)

so I tried,

./tezos-client transfer 0 from alice to KT_token --entrypoint burn --arg '(Pair %XTZ 100000)' --burn-cap 1

./tezos-client transfer 0 from alice to KT_token --entrypoint burn --arg '(Pair (unit %xTZ) 100000)' --burn-cap 1

it seems the type option can not accept both of the above format. My question is, what is the correct argument to call this function? Many thanks!

2
  • For the or type, you must specify whether you're referring to the "left" (here unit %uSD) using the Left constructor or the "right" type (here unit %xTZ) using the Right constructor.

  • The value of the type unit is written Unit

  • Michelson values does not have annotations, you should remove %xTZ/%uSD from your arg.

In you case, you get either:

--arg '(Pair (Left Unit) 100000)'

or

--arg '(Pair (Right Unit)) 100000)'

You can verify that these parameters are well-typed using tezos-client:

$ tezos.client -mode mockup typecheck data '(Pair (Left Unit) 100000)' \
      against type '(pair (or (unit %uSD) (unit %xTZ)) mutez)

Here I use mockup mode to avoid running a node.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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