0

I want to originate a contract in SmartPy with an initial map() payload. However the originated contract always has an empty contracts storage. Here's what I have:

def __init__(self):
    self.init_type(
        sp.TRecord(
            contracts = sp.TMap(
                sp.TString,
                sp.TAddress
            )
        )
    )
    self.init(
            contracts = {"contractA": sp.address("KT...")}
        )
    )

I have also tried removing sp.address and having a simple string like "KT...". I also tried the alternate method of defining a map, anything that's described in the official documentation. I cannot understand what I'm doing wrong.

1
  • This looks correct. You can try and find a minimal non working example and share it.
    – FFF
    Mar 23 at 17:07

0

Your Answer

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

Browse other questions tagged or ask your own question.