Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the byte3 array directly for the versioning #100

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Conversation

jmpike
Copy link
Collaborator

@jmpike jmpike commented Nov 18, 2024

The Version contract defined the version as the string "305" and the function returns a bytes3 value. The string "305" was encoded and the returned as 0x333035. This limited patch increments to the versioning. For example, we would not be able to fit the string "3010" (for version 3.0.10) into bytes3.

The update changes the version encoding to be simply 3 digits, base 256 number. This allows major, minor, and patch numbers up to 255.

The update was suggested by OpenZeppelin reviewer; no issue reference was assigned.

The Version contract defined the version as the string "305" and the function returns a bytes3 value. The string "305" was encoded and the returned as 0x333035. This limited patch increments to the versioning. For example, we would not be able to fit the string "3010" (for version 3.0.10) into bytes3.

The update changes the version encoding to be simply 3 digits, base 256 number. This allows major, minor, and patch numbers up to 255.

The update was suggested by OpenZeppelin reviewer; no issue reference was assigned.
@jmpike jmpike merged commit e86e5db into main Nov 19, 2024
2 checks passed
@jmpike jmpike deleted the jim/oz_version branch November 19, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants