MintContextLib
Utility library for packing/unpacking MintContext into a uint256 word
Functions
pack
Packs a MintContext struct into a single uint256
function pack(MintContext memory ctx) internal pure returns (uint256 packed);
Parameters
Name | Type | Description |
---|---|---|
ctx | MintContext | The MintContext struct |
Returns
Name | Type | Description |
---|---|---|
packed | uint256 | The packed uint256 representation |
pack
Packs individual context fields into a uint256 (with _reserved = 0)
function pack(uint32 policy, uint32 tag, uint64 idStart, uint64 idEnd) internal pure returns (uint256 packed);
Parameters
Name | Type | Description |
---|---|---|
policy | uint32 | Policy index |
tag | uint32 | Custom user tag |
idStart | uint64 | Inclusive object ID start |
idEnd | uint64 | Exclusive object ID end |
Returns
Name | Type | Description |
---|---|---|
packed | uint256 | The packed uint256 representation |
unpack
Unpacks a packed uint256 into a MintContext struct
function unpack(uint256 packed) internal pure returns (MintContext memory ctx);
Parameters
Name | Type | Description |
---|---|---|
packed | uint256 | The packed uint256 |
Returns
Name | Type | Description |
---|---|---|
ctx | MintContext | The unpacked MintContext struct |