huff-rs
huff-rs copied to clipboard
feat: Nest Builtin Functions
Thanks for this awesome project. I noticed that it is not possible to nest multiple builtin functions.
Example:
I want to store the function signature of test()
at memory[0:4]
:
// test.huff
#define function test() nonpayable returns ()
#define macro MAIN() = takes (0) returns (0) {
__PADRIGHT(__FUNC_SIG(test)) 0x0 mstore
}
$ huffc -V
huffc 0.3.2
$ huffc test.huff
Error: Invalid Macro Arguments: "("
Expected literal, identifier (string), or an argument call
__FUNC_SIG
gives me 0xXXXXXXXX
, but I need 0xXXXXXXXX00000000000000000000000000000000000000000000000000000000
.