Skip to content

Rationale for reducing u240 to u120 #30

@GalloDaSballo

Description

@GalloDaSballo
type(uint120).max
Type: uint120
├ Hex: 0xffffffffffffffffffffffffffffff
├ Hex (full word): 0x0000000000000000000000000000000000ffffffffffffffffffffffffffffff
└ Decimal: 1329227995784915872903807060280344575uint256(type(uint32).max) * uint256(type(uint88).max)
Type: uint256
├ Hex: 0x0000000000000000000000000000000000fffffffeffffffffffffff00000001
├ Hex (full word): 0x0000000000000000000000000000000000fffffffeffffffffffffff00000001
└ Decimal: 1329227995475430863082461987260596225
>>> (2**88-1)*(2**32-1)
1329227995475430863082461987260596225
>>> 1329227995784915872903807060280344576 - 1329227995475430863082461987260596225
309485009821345073019748351
>>> hex(1329227995784915872903807060280344576)
'0x1000000000000000000000000000000'
>>> hex(1329227995475430863082461987260596225)
'0xfffffffeffffffffffffff00000001'
>>> 2**120-1
1329227995784915872903807060280344575
>>> hex(1329227995784915872903807060280344575)
'0xffffffffffffffffffffffffffffff'

Meaning we can represent the values safely (until 2106)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions