Skip to content

Commit

Permalink
Merge pull request #72 from stabilitydao/skip-rest-alerts
Browse files Browse the repository at this point in the history
Fix semgrep alert detections
  • Loading branch information
a17 authored Dec 12, 2023
2 parents f66055e + cb025e0 commit 961cc79
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/core/HardWorker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ contract HardWorker is Controllable, IHardWorker {

uint gasUsed = startGas - gasleft();
uint gasCost = gasUsed * tx.gasprice;
//slither-disable-start unused-return
// nosemgrep
//slither-disable-next-line unused-return
if (isServer && gasCost > 0 && address(this).balance >= gasCost) {
// nosemgrep
//slither-disable-next-line low-level-calls
Expand All @@ -231,7 +231,7 @@ contract HardWorker is Controllable, IHardWorker {
revert IControllable.ETHTransferFailed();
}
}

//slither-disable-end unused-return
emit Call(counter, gasUsed, gasCost, isServer);
}

Expand Down
5 changes: 3 additions & 2 deletions src/core/base/VaultBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ abstract contract VaultBase is Controllable, ERC20Upgradeable, ReentrancyGuardUp
if (IFactory(IPlatform(platform()).factory()).vaultStatus(address(this)) != VaultStatusLib.ACTIVE) {
revert IFactory.NotActiveVault();
}

// slither-disable-start timestamp
// nosemgrep
//slither-disable-next-line timestamp
if ($.doHardWorkOnDeposit && block.timestamp > $.strategy.lastHardWork() + _MIN_HARDWORK_DELAY) {
// nosemgrep
// slither-disable-end timestamp
$.strategy.doHardWork();
}

Expand Down
3 changes: 2 additions & 1 deletion src/core/libs/RVaultLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ library RVaultLib {
) public {
address localRewardToken = $.rewardToken[rewardTokenIndex];
uint reward = earned($, rewardTokenIndex, owner);
//slither-disable-start timestamp
// nosemgrep
//slither-disable-next-line timestamp
if (reward > 0 && IERC20(localRewardToken).balanceOf(address(this)) >= reward) {
$.rewardsForToken[rewardTokenIndex][owner] = 0;
IERC20(localRewardToken).safeTransfer(receiver, reward);
emit IRVault.RewardPaid(owner, localRewardToken, reward);
}
//slither-disable-end timestamp
}

/// @dev Use it for any underlying movements
Expand Down
2 changes: 1 addition & 1 deletion src/strategies/GammaQuickSwapFarmStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ contract GammaQuickSwapFarmStrategy is LPStrategyBase, FarmingStrategyBase {

IFactory.Farm[] memory farms = IFactory(IPlatform(platform_).factory()).farms();
uint len = farms.length;
// nosemgrep
//slither-disable-next-line uninitialized-local
uint localTtotal;
// nosemgrep
for (uint i; i < len; ++i) {
// nosemgrep
IFactory.Farm memory farm = farms[i];
Expand Down

0 comments on commit 961cc79

Please sign in to comment.