ethereum / serpent

Other
366 stars 107 forks source link

Too many array index lookups. I cannot run anything #99

Open jl2035 opened 8 years ago

jl2035 commented 8 years ago

I want to write a simple namecoin example:

data storage[]

def register(domain):
    if !self.storage[domain]:
        self.storage[domain] = msg.sender
        return(1)
    else:
        return(0)

I'm getting the following error:

Exception: Error (file "namecoin.se", line 11, char 25): Too many array index lookups

joeykrug commented 8 years ago

Odd... exact code works for me verbatim. Are you on dev branch?

jl2035 commented 8 years ago

it's been a month since i've played with that.. not sure on which branch i was.. i probably just did "git clone"

i will try again in the near future and update here..

ChrisCalderon commented 8 years ago

Also, you don't need to explicitly create a storage data, self.storage should just be available to use. You can also use the sload and sstore functions if you (as I do) find typing self.storage[x] to be more cumbersome than sload(x)