Skip to content

Releases: cakevm/huff-neo

v1.5.14

03 Feb 08:41
a71891b

Choose a tag to compare

  • Breaking: Enforce EIP-170 contract size limit (24,576 bytes) by default.
    • Compilation now fails if the runtime bytecode exceeds the EIP-170 limit.
    • Use --no-size-limit flag to bypass this check.
  • Increase maximum loop iterations from 10,000 to 100,000.
  • Update to foundry v1.6.0-rc1.

v1.5.13

18 Jan 10:06
9722810

Choose a tag to compare

  • Add support for true and false keywords as constant override values via -c CLI flag.
    • Example: hnc test.huff -c DEBUG=true
    • true is equivalent to 0x01, false is equivalent to 0x00.

v1.5.12

03 Jan 12:23
37f8ea8

Choose a tag to compare

  • Fix lexer not handling UTF-8 characters correctly in comments.
    • Multi-byte UTF-8 characters (e.g., ) in comments caused incorrect span positions for subsequent tokens.
    • The lexer now properly tracks byte positions instead of character indices.

v1.5.11

24 Dec 15:16

Choose a tag to compare

  • Fix broken npm release workflow.

v1.5.9

24 Dec 14:40

Choose a tag to compare

  • Add support to pass builtin functions to __VERBATIM.
    • __VERBATIM can now wrap builtins that generate PUSH + value, stripping the PUSH opcode.
    • Supported: __FUNC_SIG, __EVENT_HASH, __BYTES, __ERROR, __RIGHTPAD, __LEFTPAD.
    • Example: __VERBATIM(__FUNC_SIG("withdraw(uint256)")) emits raw 4-byte selector without PUSH4.
  • EVM version Osaka is now the default.
  • Update to foundry v1.5.1.

v1.5.8

29 Nov 11:15
77cb0f9

Choose a tag to compare

  • Fix __RIGHTPAD() incorrectly padding odd-length hex values.
    • Example: __RIGHTPAD(0x1af) now produces 0x1af000... instead of 0x01af00....
  • Reject 0x as valid hex value. Before it was treated as 0x00 (fixes #154).
  • Update to foundry v1.5.0.

v1.5.7

09 Nov 15:53

Choose a tag to compare

  • Fix jump placeholders not resolved when --relax-jumps enabled but no optimization occurs.
    • Jump placeholders (xxxx) remained unresolved in the bytecode.

v1.5.6

09 Nov 12:35

Choose a tag to compare

  • Fix constants defined with builtin functions not working in code tables (fixes #149).
    • Example: #define constant C = __RIGHTPAD(0x) can now be used in tables with [C].
  • Add support for string literal constants with __BYTES builtin function.
    • String constants can be defined: #define constant GREETING = "hello".
    • String constants must be used with __BYTES: __BYTES([GREETING]) converts to UTF-8 bytes.
    • Example: #define constant MSG = "hello" then __BYTES([MSG]) produces 0x68656c6c6f.
  • Add support for constant references in __VERBATIM builtin function.
    • __VERBATIM can now accept constant references: __VERBATIM([MY_CONSTANT]).
    • Example: #define constant SIG = __FUNC_SIG("transfer(address,uint256)") then __VERBATIM([SIG]).

v1.5.5

08 Nov 13:08
2e5bdaf

Choose a tag to compare

  • Fix --relax-jumps not updating label positions always correct during iterative optimization.
    • Fix jump table entries are now correctly updated after each relaxation iteration.
    • Fixes issue where jumps at the PUSH1/PUSH2 boundary (byte 255/256) were not optimized.
    • Use correct PC for __ASSERT_PC after jump relaxation.
  • Correctly handle decimal literals in for loop bounds (have been interpreted as hex before).
    • Example: for(i in 0..255) and for(i in 0..0xff) are now equivalent.
  • Add __EMBED_TABLE(TABLE_NAME) builtin function to embed code tables inline.
    • Embeds table bytes at the current position instead of at the end of bytecode.
    • Each table can only be embedded once to avoid ambiguity.
    • __tablestart(TABLE) returns the inline embedding position for embedded tables.
  • Add support for keccak256 opcode as an alias for sha3 (fixes #145).
    • Both keccak256 and sha3 compile to the same EVM opcode (0x20).
  • Fix built-in functions not working inside if-statement bodies (fixes #144).
    • Example: if (true) { __RIGHTPAD(0x1234) }

v1.5.4

07 Nov 19:34

Choose a tag to compare

  • Add support for true and false boolean literals in if conditions and macro arguments.
    • true evaluates to 0x01, false evaluates to 0x00.
    • Example: if (true) { 0xAA } else { 0xBB }
  • Fix macro argument scoping bug where parameters leaked across macro boundaries (fixes #139).
    • Macros can no longer access parameters from parent scopes unless explicitly passed.
    • Example: If M1(arg) calls M2() without passing arg, then M2 cannot use <arg>.
  • Fix nested macro invocation resulted in stack overflow (fixes #140).
    • Example: M1(M1(M1(<a>)))