-
Notifications
You must be signed in to change notification settings - Fork 39
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
Feature/second round audit review #79
Conversation
…, 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
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
-roundedUpNumberOfDays = (rateL1TimestampDiff + ONE_DAY_SECONDS - 1) / ONE_DAY_SECONDS
-roundedUpNumberOfDays * MAX_ALLOWED_TOKEN_RATE_DEVIATION_PER_DAY_BP
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
No description provided.