Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

SignersInfoStorePackingV2

Packs a SignersInfo entity into a u128 value.

The packing is done as follows:

  • quorum value occupies 32 bits in bit range 64..95.
  • signers_count value occupies the highest 32 bits in bit range 96..127.
  • The 63rd bit indicates the packing version: 0 for V1 (legacy) and 1 for V2 (current).

WARNING: A bug in the original StorePacking trait for SignersInfo multiplied the quorum value by 0xffffffff instead of 0x100000000. This affected only the case where signers_count was 0xffffffff, resulting in an off-by-one quorum value and a signers_count of 0 after unpacking. The issue is resolved in V2 of StorePacking. For backward compatibility, V2 can still correctly unpack values from both V1 and V2 by checking the 63rd bit (0 for V1, 1 for V2).

Fully qualified path: openzeppelin_governance::multisig::storage_utils::SignersInfoStorePackingV2

pub impl SignersInfoStorePackingV2 of StorePacking<SignersInfo, u128>;

Impl functions

pack

Fully qualified path: openzeppelin_governance::multisig::storage_utils::SignersInfoStorePackingV2::pack

fn pack(value: SignersInfo) -> u128

unpack

Fully qualified path: openzeppelin_governance::multisig::storage_utils::SignersInfoStorePackingV2::unpack

fn unpack(value: u128) -> SignersInfo