Categories
Art Ethereum Projects

Ethereum – This Contract Is Art

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

init:
    contract.storage[1000] = "may be"

code:
    if msg.data[0] == "toggle":
        if contract.storage[1000] == "is":
            contract.storage[1000] = "is not"
        else:
            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:

is1

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

is2

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.