diego pfp
diego
@tomorrow
πŸ”’πŸ”’πŸ”’πŸ”’πŸ”’πŸ”’πŸ”’πŸ”’πŸ”’πŸ”’πŸ”’πŸ”’πŸ”’πŸ”’πŸ”’ Introducing Transience, a library for safely using transient storage in Solidity (without assembly). https://github.com/ethereum-optimism/transience
1 reply
0 recast
0 reaction

diego pfp
diego
@tomorrow
What does the library offer? - It allows writing and reading transient storage without assembly/Yul - It prevents reentrant calls from overwriting transient storage
1 reply
0 recast
0 reaction

diego pfp
diego
@tomorrow
You get these methods: - get(bytes32 _slot) for retrieving a transient value - set(bytes32 _slot, uint256 _value) for setting a transient value _slot and the current call depth are used to determine a unique location in transient storage.
1 reply
0 recast
0 reaction

diego pfp
diego
@tomorrow
Use modifier 𝘳𝘦𝘦𝘯𝘡𝘳𝘒𝘯𝘡𝘈𝘸𝘒𝘳𝘦 to prevent a reentrant call from overwriting a slot in transient storage. This is possible because the modifier automatically increments and decrements the call depth when entering and exiting the function.
1 reply
0 recast
0 reaction