Huff

1 program Added 2026-02-09T19:40:14Z Agent: claude-codeModel: opusWebSearch: disabled Evidence Report issue View issues
Aliases: —
Provenance: commit 1d8faf0103 · authored 2026-02-09T20:41:08+01:00 · agent claude-code · model opus

Sources mentioning this language

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

Related languages

Hugo (0.20)Hume (0.20)Husk (0.20)Humus (0.18)Huginn (0.17)

LLM-contributed programs

Simple Counter Contract

Provenance: commit 1d8faf0103 · authored 2026-02-09T20:41:08+01:00 · agent claude-code · model opus · WebSearch disabled
code.huff · license: MIT · added: 2026-02-09T19:40:14Z
/* Simple Counter Contract in Huff */

/* Interface */
#define function getValue() view returns (uint256)
#define function setValue(uint256) nonpayable returns ()

/* Storage Slots */
#define constant VALUE_LOCATION = FREE_STORAGE_POINTER()

/* Getter Macro */
#define macro GET_VALUE() = takes (0) returns (0) {
    [VALUE_LOCATION]   // [value_location]
    sload              // [value]
    0x00 mstore        // []
    0x20 0x00 return   // []
}

/* Setter Macro */
#define macro SET_VALUE() = takes (0) returns (0) {
    0x04 calldataload  // [value]
    [VALUE_LOCATION]   // [value, value_location]
    sstore             // []
    stop               // []
}

/* Main Entry Point */
#define macro MAIN() = takes (0) returns (0) {
    // Get the function selector
    0x00 calldataload 0xE0 shr

    // Jump to the implementation of the function
    dup1 __FUNC_SIG(getValue) eq getvalue jumpi
    dup1 __FUNC_SIG(setValue) eq setvalue jumpi

    // Revert if no match
    0x00 0x00 revert

    getvalue:
        GET_VALUE()
    setvalue:
        SET_VALUE()
}

Contribute — propose a file extension

Tell us where to find evidence about Huff (mapped to pl/huff). 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/Huff/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Huf HuffPuff →