-
I'm getting started with rainbow bridge and didn't really understand adminSstoreWithMask function does. Can anyone describe what the inline assembly is supposed to do? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Reference to the function. This functions replace specific bits of the value from the storage at specified key. Only bits that are set in The motivation for this function is that sometimes, different values are packed inside the same slot on ethereum, either by some solidity optimisation, or our own optimisation. In this case, we only want to replace some part of the value, instead of the whole value. In practice most of the time adminSstore is enough. How does adminSstoreWork:
Hope this helps to get the idea what is happening under the hood. |
Beta Was this translation helpful? Give feedback.
Reference to the function.
This functions replace specific bits of the value from the storage at specified key. Only bits that are set in
mask
will be replaced with bits at the same position fromvalue
.The motivation for this function is that sometimes, different values are packed inside the same slot on ethereum, either by some solidity optimisation, or our own optimisation. In this case, we only want to replace some part of the value, instead of the whole value. In practice most of the time adminSstore is enough.
How does adminSstoreWork:
merged
) we merge the two values together, w…