Uniform markups for the memory requirements of structs declared in DataTypes.sol #552
Closed
IaroslavMazur
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
Good idea, thanks for taking the time to write the suggestion. |
Beta Was this translation helpful? Give feedback.
0 replies
-
It turns out that we cannot use the term "word" to refer to storage slots, because "word" refers only to memory and stack variables. See my conversation with ChatGPT4 for more details: https://chat.openai.com/share/89718543-c077-40f0-9031-15b4b78a451c What we could do is add the term "word" in all structs that are used only in memory, but this may also lead to a confusing state of affairs. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As of now, only the structs that are known to later be initialized and kept in contract
storage
have the information about how much memory (slots-wise) they occupy. I suggest using the term "word"/"EVM word" (instead of "slot") and having this information for all of the structs inDataTypes.sol
.The advantages of this approach are:
DataTypes.sol
, which increases the coupling between the declarations and the definitions of the structs (i.e. the exact opposite of the motivation for the existence ofDataTypes.sol
).Beta Was this translation helpful? Give feedback.
All reactions