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
considering that DelegateeRecord.percentage is limited to 100_000, it can be changed to uint24. And as DelegateeRecord.delegate is address ( == uint160), then DelegateeRecord will take only 1 slot (24 + 160 < 256) instead of 2 slots, hence write and read gas will be 2 times less
The text was updated successfully, but these errors were encountered:
Thanks, I think we can use uint64 and leave the whole number as a fraction of 2**64 in case we are delegating to more than 100,000 addresses. Also, there is a thing with precision, because we are using BigNumber off-chain and fractions on-chain we have to double check there are no discrepancies due to the hashing. If we do both on-chain and off-chain (currently on-chain only fraction is checked, not net balance, but can be added).
https://github.com/windranger-io/windranger-mass-delegation-contracts/blob/main/contracts/MerkleDelegation.sol#L13
considering that DelegateeRecord.percentage is limited to 100_000, it can be changed to uint24. And as DelegateeRecord.delegate is address ( == uint160), then DelegateeRecord will take only 1 slot (24 + 160 < 256) instead of 2 slots, hence write and read gas will be 2 times less
The text was updated successfully, but these errors were encountered: