Releases: cakevm/huff-neo
Releases · cakevm/huff-neo
v1.5.12
v1.5.11
- Fix broken npm release workflow.
v1.5.9
- Add support to pass builtin functions to
__VERBATIM.__VERBATIMcan 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
Osakais now the default. - Update to foundry v1.5.1.
v1.5.8
v1.5.7
- Fix jump placeholders not resolved when
--relax-jumpsenabled but no optimization occurs.- Jump placeholders (
xxxx) remained unresolved in the bytecode.
- Jump placeholders (
v1.5.6
- 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].
- Example:
- Add support for string literal constants with
__BYTESbuiltin 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])produces0x68656c6c6f.
- String constants can be defined:
- Add support for constant references in
__VERBATIMbuiltin function.__VERBATIMcan now accept constant references:__VERBATIM([MY_CONSTANT]).- Example:
#define constant SIG = __FUNC_SIG("transfer(address,uint256)")then__VERBATIM([SIG]).
v1.5.5
- Fix
--relax-jumpsnot 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_PCafter jump relaxation.
- Correctly handle decimal literals in for loop bounds (have been interpreted as hex before).
- Example:
for(i in 0..255)andfor(i in 0..0xff)are now equivalent.
- Example:
- 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
keccak256opcode as an alias forsha3(fixes #145).- Both
keccak256andsha3compile to the same EVM opcode (0x20).
- Both
- Fix built-in functions not working inside if-statement bodies (fixes #144).
- Example:
if (true) { __RIGHTPAD(0x1234) }
- Example:
v1.5.4
- Add support for
trueandfalseboolean literals in if conditions and macro arguments.trueevaluates to0x01,falseevaluates to0x00.- 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)callsM2()without passingarg, thenM2cannot use<arg>.
- Fix nested macro invocation resulted in stack overflow (fixes #140).
- Example:
M1(M1(M1(<a>)))
- Example:
v1.5.3
- Introducing
--relax-jumpsCLI flag to optimize jump instructions from PUSH2 to PUSH1.- Optimizes jump instructions from PUSH2 to PUSH1 when jump targets are 0-255.
- Reduces deployment gas costs, but will not affect runtime gas costs.
- Removed unimplemented
--optimizeflag. - Fix parser bug where
forloops andif/elsestatements after labels were rejected. - Allow
for,if, andelseto be used as label names. - Add parser support for
<arg>in if/for expressions (fixes #129).- Example:
if (<MODE> == 0x01) { ... }
- Example:
- Add support for builtin functions as macro arguments (fixes #130).
- Builtin functions can now be passed as macro arguments:
__FUNC_SIG,__EVENT_HASH,__BYTES,__RIGHTPAD. - Example:
MACRO(__FUNC_SIG(transfer))
- Builtin functions can now be passed as macro arguments:
- Reject macros names that are equal to reserved builtin function names (fixes #131).
- Fix stack overflow and argument resolution errors in nested macro invocations with labels (fixes #133).
- Example:
M2(M3(<arg>))followed by a label now compiles without errors.
- Example:
- Add Windows ARM64 (
aarch64-pc-windows-msvc) binary to release targets.
v1.5.2
- Add compile-time if/else if/else statements.
- Example:
if ([MODE] == 0x01) { 0xAA } else if ([MODE] == 0x02) { 0xBB } else { 0xCC }
- Example:
- Fix constant substitution failing when referencing builtin functions (fixes #122).
- Example:
#define constant C1 = __RIGHTPAD(0x)and#define constant C2 = [C1]now works correctly. - Applies to all builtin functions:
__FUNC_SIG,__EVENT_HASH,__RIGHTPAD,__LEFTPAD,__BYTES.
- Example:
- Fix nested macro invocation argument scoping issue (fixes #123).
- The compiler now properly searches through the entire invocation stack to resolve argument names.