nomoixyz / vulcan

Development framework for Foundry projects
https://nomoixyz.github.io/vulcan/
MIT License
286 stars 18 forks source link

Add huffc support #97

Closed jtriley-eth closed 1 year ago

jtriley-eth commented 1 year ago

Overview

Adds huff compiler support.

Additions

Adds a huff library and Huffc structure with the following fields:

Setting any value may be done via a set<Field> API and adding values to lists may be done via an add<Field> API.

Can be run directly via compile or converted to a Command via toCommand methods.

huff.create()
    .setCompilerPath("diffhuff")
    .setFilePath("./filePath.huff")
    .setOutputPath("./outputPath.json")
    .setMainName("ALT_MAIN")
    .setConstructorName("ALT_CONSTRUCTOR")
    .setOnlyRuntime(true)
    .addConstantOverride("SLOT", SLOT)
    .addConstantOverride("OTHER_SLOT", OTHER_SLOT)
    .compile();

Added documentation, reference, and github action to run huff compilation tests.