Content pfp
Content
@
https://opensea.io/collection/dev-21
0 reply
0 recast
2 reactions

eric.base.eth 🔵 pfp
eric.base.eth 🔵
@ericbrown.eth
Solidity v0.8.29 includes syntax for relocating a contract's storage variables to an arbitrary location. This is necessary to make EIP7702 secure. Put together a quick thread that makes clear why this is the case: https://x.com/0xEricBrown/status/1900189049026998457
1 reply
2 recasts
10 reactions

Mo pfp
Mo
@meb
Super cool, is there any reason to not continue using hard coded storage locations ie. hashing a variable name into a pointer and using that pointer directly?
1 reply
0 recast
0 reaction

eric.base.eth 🔵 pfp
eric.base.eth 🔵
@ericbrown.eth
I’d only recommend custom storage implementations (at the contract or variable level) when there’s a clear need due to clashing risk. Otherwise you’re introducing unnecessary attack surface and making code less legible
1 reply
0 recast
0 reaction

Mo pfp
Mo
@meb
Interesting, assuming we are using something like open zeppelin storage slot to manage the getters and setters, and we don’t have methods that allow writing code to arbitrary locations, what is the security risk? And secondary question, with this new upgrade you’ve developed, will it fix the issue of consecutive memory slots? I’d like to be able to clean up contracts and reorder variables without that
1 reply
0 recast
0 reaction