-
Notifications
You must be signed in to change notification settings - Fork 38
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
Feature/second round audit review #79
Closed
kovalgek
wants to merge
167
commits into
lidofinance:main
from
lidofinance:feature/second_round_audit_review
Closed
Feature/second round audit review #79
kovalgek
wants to merge
167
commits into
lidofinance:main
from
lidofinance:feature/second_round_audit_review
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…, rename consts, rename variables, fix comments
… rebnasable token tests
Draft: change rate reporting approach
Feature/ackee fixes
Add pause and unpause methods for token rate updates
…tes_audit_fixes Audit fixes
Ackee fixes 1.1
for (uint256 obIndex = 0; obIndex < cachedObserversLength; obIndex++) { | ||
// solhint-disable-next-line no-empty-blocks | ||
try ITokenRatePusher(observers[obIndex]).pushTokenRate() {} | ||
catch (bytes memory lowLevelRevertData) { |
Check warning
Code scanning / Slither
Uninitialized local variables Medium
TokenRateNotifier.handlePostTokenRebase(uint256,uint256,uint256,uint256,uint256,uint256,uint256).lowLevelRevertData is a local variable never initialized
Comment on lines
+311
to
+318
function _allowedTokenRateDeviation( | ||
uint256 newRateL1Timestamp_, | ||
uint256 currentRateL1Timestamp_ | ||
) internal view returns (uint256) { | ||
uint256 rateL1TimestampDiff = newRateL1Timestamp_ - currentRateL1Timestamp_; | ||
uint256 roundedUpNumberOfDays = (rateL1TimestampDiff + ONE_DAY_SECONDS - 1) / ONE_DAY_SECONDS; | ||
return roundedUpNumberOfDays * MAX_ALLOWED_TOKEN_RATE_DEVIATION_PER_DAY_BP; | ||
} |
Check warning
Code scanning / Slither
Divide before multiply Medium
TokenRateOracle._allowedTokenRateDeviation(uint256,uint256) performs a multiplication on the result of a division:
-roundedUpNumberOfDays = (rateL1TimestampDiff + ONE_DAY_SECONDS - 1) / ONE_DAY_SECONDS
-roundedUpNumberOfDays * MAX_ALLOWED_TOKEN_RATE_DEVIATION_PER_DAY_BP
-roundedUpNumberOfDays = (rateL1TimestampDiff + ONE_DAY_SECONDS - 1) / ONE_DAY_SECONDS
-roundedUpNumberOfDays * MAX_ALLOWED_TOKEN_RATE_DEVIATION_PER_DAY_BP
Comment on lines
+202
to
+221
function _burnTokens( | ||
address l2Token_, | ||
address from_, | ||
uint256 amount_ | ||
) internal returns (uint256) { | ||
if (amount_ == 0) { | ||
return 0; | ||
} | ||
uint256 nonRebasableTokenAmount = amount_; | ||
if (l2Token_ == L2_TOKEN_REBASABLE) { | ||
nonRebasableTokenAmount = ERC20RebasableBridged(L2_TOKEN_REBASABLE).getSharesByTokens(amount_); | ||
if (nonRebasableTokenAmount != 0) { | ||
ERC20RebasableBridged(L2_TOKEN_REBASABLE).bridgeUnwrap(from_, amount_); | ||
IERC20Bridged(L2_TOKEN_NON_REBASABLE).bridgeBurn(from_, nonRebasableTokenAmount); | ||
} | ||
return nonRebasableTokenAmount; | ||
} | ||
IERC20Bridged(L2_TOKEN_NON_REBASABLE).bridgeBurn(from_, nonRebasableTokenAmount); | ||
return nonRebasableTokenAmount; | ||
} |
Check warning
Code scanning / Slither
Unused return Medium
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.