aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/ethereum/serpent-go/tests/main.go
blob: 2f2d17784c499508093954d4a0695cf43b1de275 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package main

import (
    "fmt"

    "github.com/ethereum/serpent-go"
)

func main() {
    out, _ := serpent.Compile(`
// Namecoin
if !contract.storage[msg.data[0]]: # Is the key not yet taken?
    # Then take it!
    contract.storage[msg.data[0]] = msg.data[1]
    return(1)
else:
    return(0) // Otherwise do nothing
    `)

    fmt.Printf("%x\n", out)
}