Encoding

Due to the large amount of information submitted and contract optimization considerations, we store the data of the check using a single uint256 field...

cheque data encoding

Field Name
Length
Bit Index
Reverse
Mask
Note

distributionId

32

0+32

224

4294967295

Bound distribution ID; uniquely identifies a distribution activity.

participationLimit

8

32+8

216

255

Participant restriction: 1. Any user, 2. Checked, 3. Others. Determine who can participate in the distribution activity.

minHardCap

8

40+8

208

255

Minimum hard cap value for the system, a positive integer from 1 to 100, where 1 equals 1/100; minimum funding target for the distribution activity.

maxHardCap

8

48+8

200

255

Maximum hard cap value for the system, a positive integer from 1 to 100, where 1 equals 1/100; maximum funding target for the distribution activity.

releaseRatio

8

56+8

192

255

Release ratio, a positive integer from 1 to 100, where 1 equals 1/100; determines the proportion of funds released to users.

releaseCycle

32

64+32

160

18446744073709551615

Unlocking period, 10-digit timestamp; time period for fund unlocking.

padding

64

96+64

128

18446744073709551615

Reserved for future extension; reserved field, currently unused, for future expansion.

financingAmount

64

128+64

64

18446744073709551615

Funding capital; total amount of funds involved in the distribution activity.

maxPerUser

64

192+64

0

18446744073709551615

Maximum amount of funds a single user can participate with during the check process.

Explanation:

  • Bit Index and Reverse Column: Provide the position and offset of each field within the bit field.

  • Mask Column: Provides the mask values used for bitwise operations to extract specific fields from the overall data.

  • Annotation Column: Provides detailed descriptions of each field and their roles within the system.

  • Length in Table: Indicates the number of bits each field occupies within the bit field.

  • Bit Index and Reverse Column: Used to calculate the exact position of each field within the bit field.

  • Mask Column: Used for bitwise operations on the bit field to ensure extraction or modification of relevant bits only.

JavaScript Encoding and Decoding Test

Last updated