-
Notifications
You must be signed in to change notification settings - Fork 20
fix: refactored contracts #234
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
Conversation
shaspitz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid! Just a few comments
| ) internal pure returns (string memory) { | ||
| bytes memory HEXCHARS = "0123456789abcdef"; | ||
| bytes memory _string = new bytes(64); | ||
| for (uint8 i = 0; i < 32; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| for (uint8 i = 0; i < 32; i++) { | |
| for (uint8 i = 0; i < 32; ++i) { |
| ) public pure returns (string memory) { | ||
| bytes memory HEXCHARS = "0123456789abcdef"; | ||
| bytes memory _string = new bytes(_bytes.length * 2); | ||
| for (uint256 i = 0; i < _bytes.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| for (uint256 i = 0; i < _bytes.length; i++) { | |
| for (uint256 i = 0; i < _bytes.length; ++i) { |
|
|
||
| // Check if the dispatch timestamp is within the allowed dispatch window | ||
| require(dispatchTimestamp > minTime, "Invalid dispatch timestamp"); | ||
| require(dispatchTimestamp >= minTime, "Invalid dispatch timestamp"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change of behavior intentional? After clarifying with the auditors their stance is When inside the require statements, non-strict inequalities (>=, <=) are usually costlier than strict equalities (>, <).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it, after reading this quote:
When inside the “if/require” statements, non-strict inequalities (>=, <=) are
usually cheaper than the strict equalities (>, <).
Thank you for clarifying, I will return it back
Closes: #233