Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better modularization of StorageSlot.sol::getAddressFromSlot() #5162

Open
Z323323 opened this issue Aug 25, 2024 · 0 comments
Open

Better modularization of StorageSlot.sol::getAddressFromSlot() #5162

Z323323 opened this issue Aug 25, 2024 · 0 comments

Comments

@Z323323
Copy link

Z323323 commented Aug 25, 2024

getAddressFromSlot() is both used to set addresses into precalculated storage slots (returning a reference of the AddressSlot struct), and to get addresses stored into that slot. I guess it would be better to separate the setter from the getter, which I've already done in the code below. There's no need to reassign the storage slot of the struct everytime we need to read the value.
Schermata del 2024-08-25 05-33-10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant