2

The Michelson Documentation does not say much about this function:

SET_DELEGATE: Forge a delegation.
:: option key_hash : 'S   ->   operation : 'S

This left me wondering about its behavior and if can produce an error in any certain cases.

  1. I am assuming SET_DELEGATE on NONE removes the delegationn and SOME key_hash sets the key_hash as the delegate, is this correct?

  2. Will it produce an error if the key_hash is not a baker or if it was once a baker and no longer is?

  3. Will it produce an error if the baker at the key_hash is fully delegated to?

  4. Are there any other conditions in which SET_DELEGATE can produce an error?

1 Answer 1

3
  1. That's correct - this constructs an operation, much the same as when you use client to set delegate for ... or withdraw delegate from ....

  2. If the key_hash is not a baker, it will produce "Unregistered delegate" error (unless it's self-delegation to register a new baker or to activate a inactive baker). It is currently not possible to de-register a baker.

  3. If it's already delegated to the same baker, it will lead to "Unchanged delegated" error.

    • Trying to de-register baker with SET_DELEGATE NONE leads to "Forbidden delegate deletion"
    • Trying to change delegate of a register baker also leads to "Forbidden delegate deletion"
    • Trying to re-activate an already active baker leads to "Delegate already active"
    • Trying to register a baker on account with 0 balance leads to "Empty delegate account"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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