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

Feature/second round audit review #79

Closed

Conversation

kovalgek
Copy link
Contributor

No description provided.

kovalgek and others added 28 commits May 22, 2024 14:01
Add pause and unpause methods for token rate updates
@kovalgek kovalgek closed this Jun 14, 2024
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

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;
}
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;
}
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.

3 participants