0

I have a structure that looks like this:

struc = sp.TRecord(
    addr = sp.TAddress,
    value = sp.TNat
)

struct2 = sp.big_map(
    tkey=sp.TAddress,
    tvalue=sp.TMap(
        sp.TNat,
        sp.TMap(
            sp.TNat,
            struct)
    )
)

How can I add a new struct to my struct2? When I write

def addStruct(self, addr, id1, id2, ele):
        sp.set_type(ele, struct)
        self.data.userStakeLockPack[addr][id1][id2] = ele

I cannot originate my contract because of illtype. Why? Thanks.

1
  • Can you share the code? You probably have "red text" in the right panel informing the locations where the issue is. Or you are using invalid addresses in the initial storage when originating the contract. May 21 at 15:36

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.