Rhea Myers

Ethereum - This Contract Is Art

Here is a contract that can assert that it is art.

    contract.storage[1000] = "may be"

    if msg.data[0] == "toggle":
        if contract.storage[1000] == "is":
            contract.storage[1000] = "is not"
            contract.storage[1000] = "is"

It toggles its status as art when sent a message instructing it to do so.

Here’s what the UI for the contract looks like:


Here it is while the artistic state of the contract is being toggled:


And here it is after being toggled: is3 Anyone can change the contract from not being art to being art (and vice versa). We’ll look at a more advanced contract that uses behavioural economics to address this next.