{"id":13766845,"url":"https://github.com/shafu0x/huff-stacker","last_synced_at":"2025-05-10T22:31:23.554Z","repository":{"id":194588256,"uuid":"691159614","full_name":"shafu0x/huff-stacker","owner":"shafu0x","description":"The goal of this project is to automatically generate stack comments for huff macros","archived":false,"fork":false,"pushed_at":"2023-09-30T22:35:42.000Z","size":119,"stargazers_count":50,"open_issues_count":3,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-17T02:34:18.839Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shafu0x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-09-13T16:06:13.000Z","updated_at":"2024-07-05T13:03:09.000Z","dependencies_parsed_at":"2024-01-11T23:44:11.565Z","dependency_job_id":"1f45a308-993a-46d6-b7f7-a62b2658f5c2","html_url":"https://github.com/shafu0x/huff-stacker","commit_stats":null,"previous_names":["shafu0x/huff-stack-generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shafu0x%2Fhuff-stacker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shafu0x%2Fhuff-stacker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shafu0x%2Fhuff-stacker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shafu0x%2Fhuff-stacker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shafu0x","download_url":"https://codeload.github.com/shafu0x/huff-stacker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253492529,"owners_count":21916959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T16:01:01.660Z","updated_at":"2025-05-10T22:31:23.263Z","avatar_url":"https://github.com/shafu0x.png","language":"Rust","funding_links":[],"categories":["Huff tooling"],"sub_categories":[],"readme":"# huff-stack-generator\n\nThe goal of this project is to automatically generate the stack comments.\n\nFrom this:\n\n```huff\n#define macro SET_VALUE2() = takes (2) returns (0) {\n    0x04\n    0x04\n    _XXX_YYY\n    0x04\n    0x55\n    lt\n    0x87\n    gt\n}\n\n#define macro _XXX_YYY() = takes (1) returns (1) {\n    0x06\n    calldataload\n    [VALUE_LOCATION]\n    sstore\n    0x69\n    0x00\n}\n```\n\nTo this:\n\n```huff\n#define macro SET_VALUE2() = takes (2) returns (0) {\n    0x04      // [$0, $1, 0x04]\n    0x04      // [$0, $1, 0x04, 0x04]\n    _XXX_YYY  // [$0, $1, 0x04, _XXX_YYY: %0]\n    0x04      // [$0, $1, 0x04, _XXX_YYY: %0, 0x04]\n    0x55      // [$0, $1, 0x04, _XXX_YYY: %0, 0x04, 0x55]\n    lt        // [$0, $1, 0x04, _XXX_YYY: %0, (0x55 \u003c 0x04)]\n    0x87      // [$0, $1, 0x04, _XXX_YYY: %0, (0x55 \u003c 0x04), 0x87]\n    gt        // [$0, $1, 0x04, _XXX_YYY: %0, (0x87 \u003e (0x55 \u003c 0x04))]\n}\n\n#define macro _XXX_YYY() = takes (1) returns (1) {\n    0x06              // [$0, 0x06]\n    calldataload      // [$0, calldataload(0x06)]\n    [VALUE_LOCATION]  // [$0, calldataload(0x06), [VALUE_LOCATION]]\n    sstore            // [$0]\n    0x69              // [$0, 0x69]\n    0x00              // [$0, 0x69, 0x00]\n}\n```\n\n## How to use\n\n```console\n$ cargo run \u003cINPUT_FILE\u003e \u003cOUTPUT_FILE\u003e \n```\n\nOptional\n\n```console\nstack-direction: [--(right/left)]\n```\n\n#### Example\n\n```console\n$ cargo run /home/shafu/huff-stack-generator/macro.huff /home/shafu/huff-stack-generator/out.huff\n```\n\n#### TODO\n\n- add dup/swap\n- use iterator\n- support jumps\n- huff lexer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshafu0x%2Fhuff-stacker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshafu0x%2Fhuff-stacker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshafu0x%2Fhuff-stacker/lists"}