Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

feat(huff_codegen): Constructor Argument Encoding #83

Closed
refcell opened this issue Jun 10, 2022 · 1 comment
Closed

feat(huff_codegen): Constructor Argument Encoding #83

refcell opened this issue Jun 10, 2022 · 1 comment
Labels
codegen Code Generation Related. high-priority High Priority Task

Comments

@refcell
Copy link
Collaborator

refcell commented Jun 10, 2022

Overview

Currently, constructor arg encoding isn't complete which is necessary for the huff_cli to function properly.

We need to implement the encode_constructor_args() function of the huff_codegen module to translate a vec of String inputs into ethers Token.

TODO: implement this function.

@refcell refcell added codegen Code Generation Related. high-priority High Priority Task labels Jun 10, 2022
@refcell refcell mentioned this issue Jun 10, 2022
Merged
7 tasks
@exp-table
Copy link
Collaborator

In the constructor macro, you are only able to retrieve the encoded constructor arguments if they are not dynamically-sized arrays, including bytes and string if they are over 31 bytes long.

Why? Because you don't know their sizes in advance, thus you cannot deduce where the constructor encoded args start, whereas with value types, short bytes/string and fixed-sized arrays, you can know the total size and substract it from the codesize to obtain the starting position of the constructor args.

See the issue on huffc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
codegen Code Generation Related. high-priority High Priority Task
Projects
None yet
Development

No branches or pull requests

2 participants