diego
@tomorrow
3 Following
29 Followers
Casts
Casts + replies
diego
@tomorrow
Check out the code! h/t @philogy and @jtriley, whose libraries served as inspiration :) https://github.com/ethereum-optimism/transience
0 reply
0 recast
0 reaction
diego
@tomorrow
Transience was developed for the interop contracts of the OP Stack/Optimism, specifically for CrossL2Inbox, where it's used for storing the identifier of a cross-chain message during its execution. https://github.com/ethereum-optimism/optimism/blob/3aeb6bdd3efe798713098f890359513eaaa91522/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol
1 reply
0 recast
0 reaction
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
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
@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
@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
@tomorrow
wasap
1 reply
0 recast
0 reaction