LazyIMTData
A struct that holds a LazyIMT data
struct LazyIMTData {
uint40 maxIndex;
uint40 numberOfLeaves;
mapping(uint256 => uint256) elements;
}
InternalLazyIMT
This implementation is taken from zk-kit https://github.com/privacy-scaling-explorations/zk-kit/blob/main/packages/imt.sol/contracts/internal/InternalLazyIMT.sol and modified to work with MACI.
A LazyIMT with Zeroes value set to the hash of a MACI Blank State Leaf
MAX_DEPTH
uint256 MAX_DEPTH
MAX_INDEX
uint40 MAX_INDEX
Z_0
uint256 Z_0
Z_1
uint256 Z_1
Z_2
uint256 Z_2
Z_3
uint256 Z_3
Z_4
uint256 Z_4
Z_5
uint256 Z_5
Z_6
uint256 Z_6
Z_7
uint256 Z_7
Z_8
uint256 Z_8
Z_9
uint256 Z_9
Z_10
uint256 Z_10
Z_11
uint256 Z_11
Z_12
uint256 Z_12
Z_13
uint256 Z_13
Z_14
uint256 Z_14
Z_15
uint256 Z_15
Z_16
uint256 Z_16
Z_17
uint256 Z_17
Z_18
uint256 Z_18
Z_19
uint256 Z_19
Z_20
uint256 Z_20
Z_21
uint256 Z_21
Z_22
uint256 Z_22
Z_23
uint256 Z_23
Z_24
uint256 Z_24
Z_25
uint256 Z_25
Z_26
uint256 Z_26
Z_27
uint256 Z_27
Z_28
uint256 Z_28
Z_29
uint256 Z_29
Z_30
uint256 Z_30
Z_31
uint256 Z_31
Z_32
uint256 Z_32
_defaultZero
function _defaultZero(uint8 index) internal pure returns (uint256)
Returns the default zero value for a given index
Parameters
Name | Type | Description |
---|---|---|
index | uint8 | The index of the zero value |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The zero value |
_init
function _init(struct LazyIMTData self, uint8 depth) internal
Initializes the LazyIMT
Parameters
Name | Type | Description |
---|---|---|
self | struct LazyIMTData | The LazyIMTData |
depth | uint8 | The depth of the tree |