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

Consider using transient state variables without transpilation #5257

Open
Amxx opened this issue Oct 14, 2024 · 1 comment
Open

Consider using transient state variables without transpilation #5257

Amxx opened this issue Oct 14, 2024 · 1 comment

Comments

@Amxx
Copy link
Collaborator

Amxx commented Oct 14, 2024

Since solidity 0.8.28, supports transient state variables. This could for example be used in ReentracyGuardTransient, with a transient state variable replacing the slot+library calls.

This would however be challenging to the transpiler, because that is a state variable that would not moved into a namespoace, and that would remain a transient state variable. That would be ok from a layout point of view, because transient is cleared at the end of every tx and thus changing the layout during the lifecyclke of a contract is mostly safe.

Mostly but not fully. If the upgrade tx is batched with other operations that read/write to transient storage, and if the upgrade changes the layout of transient space, then you have a 1tx window that is quite dangerous.

@Amxx
Copy link
Collaborator Author

Amxx commented Oct 14, 2024

@frangio I think that upgrade to the transient layout vulnerability would be awesome for an Underhanded Solidity Contest.

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