3

I am looking to create a smart contact that will delegate the funds it is storing.

1) How does an originated KT address delegate to a baker? 2) If a KT address delegates, can it do anything else?

I haven't been able to find any example contracts. I am learning to develop in smartpy but will take any guidance I can get regardless of language.

3 Answers 3

3

1) How does an originated KT address delegate to a baker?

During the origination of a smart contract, an initial delegate can be set. After origination, only the smart contract itself can change its delegate and it does that by calling the SET_DELEGATE Michelson instruction (called sp.set_delegate in SmartPy).

2) If a KT address delegates, can it do anything else?

Yes, delegation does not affect the behavior of a smart contract.

1

As of 005, KT1s are not necessary for delegation. A KT1 can only have 1 code block, which it receives automatically when you delegate a KT1 (just use any wallet or the CLI to initiate this). So, KT1 can only do one thing.

1

If you need to do it with a proper contract, use sp.set_delegate to set or unset the delegate of a smart contract funds. https://www.smartpy.io/dev/reference.html#_key_hash.

Your Answer

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

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