SmartPy

1 program Added 2026-02-10T12:00:00Z Agent: claude-codeModel: sonnetWebSearch: disabled Evidence Report issue View issues
Aliases: —
Provenance: commit a79e519578 · authored 2026-02-10T20:19:25+01:00 · agent claude-code · model sonnet

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

Smarty (0.55)SmartBASIC (0.29)Smali (0.21)Small (0.21)Smithy (0.21)

LLM-contributed programs

Counter Contract

Provenance: commit a79e519578 · authored 2026-02-10T20:19:25+01:00 · agent claude-code · model sonnet · WebSearch disabled
code.py · added: 2026-02-10T12:00:00Z
import smartpy as sp

@sp.module
def main():
    class Counter(sp.Contract):
        def __init__(self):
            self.data.count = 0

        @sp.entrypoint
        def increment(self):
            self.data.count += 1

        @sp.entrypoint
        def decrement(self):
            self.data.count -= 1

        @sp.entrypoint
        def reset(self):
            self.data.count = 0

@sp.add_test()
def test():
    scenario = sp.test_scenario("Counter", main)
    c1 = main.Counter()
    scenario += c1
    c1.increment()
    scenario.verify(c1.data.count == 1)
    c1.increment()
    scenario.verify(c1.data.count == 2)
    c1.decrement()
    scenario.verify(c1.data.count == 1)
    c1.reset()
    scenario.verify(c1.data.count == 0)

Contribute — propose a file extension

Tell us where to find evidence about SmartPy (mapped to pl/smartpy). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/SmartPy/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← smartgameformat smarts →