You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using sol2uml to calculate the storage slots of the Store contract (code below), which can also be found here. This contract is straightforward, with a payments struct, some storage variables, etc. The part that requires our focus is the array of structs topPayments.
After creating a .svg for this contract using sol2uml. We get this:
As you can see, topPayments takes 1792 bytes, which is correct since each payment struct covers 7 slots, equivalent to 224 bytes each. Thus, 224 * 8 = 1792 bytes, fairly simple. But as we move to the next step and spot this:
Here 4 struct elements are represented individually and allotted 224 bytes, there's no doubt in that. But the rest 4 (in the middle) are actually allotted 928 bytes which seems quite inappropriate as 224 * 4 = 896 bytes. Due to this, the whole summation becomes 1824 bytes (896 + 928).
And, we can clearly see 1792 != 1824, which makes me assume either sol2uml is wrong here or there's something that I missed in this scenario.
Hope you guys can help me out...
Thanks!
The text was updated successfully, but these errors were encountered:
Tags: @naddison36 @Nabeel-javaid
I was using
sol2uml
to calculate the storage slots of theStore
contract (code below), which can also be found here. This contract is straightforward, with apayments
struct, some storage variables, etc. The part that requires our focus is the array of structstopPayments
.After creating a
.svg
for this contract usingsol2uml
. We get this:As you can see,
topPayments
takes 1792 bytes, which is correct since each payment struct covers 7 slots, equivalent to 224 bytes each. Thus, 224 * 8 = 1792 bytes, fairly simple. But as we move to the next step and spot this:Here 4 struct elements are represented individually and allotted 224 bytes, there's no doubt in that. But the rest 4 (in the middle) are actually allotted 928 bytes which seems quite inappropriate as 224 * 4 = 896 bytes. Due to this, the whole summation becomes 1824 bytes (896 + 928).
And, we can clearly see 1792 != 1824, which makes me assume either sol2uml is wrong here or there's something that I missed in this scenario.
Hope you guys can help me out...
Thanks!
The text was updated successfully, but these errors were encountered: