2

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.

1

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.

| improve this answer | |
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.

| improve this answer | |
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.

| 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.