Skip to content

Commit

Permalink
Suppress Slither's false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-zimnoch committed Feb 21, 2024
1 parent 584c4bb commit d3cc2e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions solidity/contracts/bridge/RedemptionWatchtower.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import "./Redemption.sol";
/// requester while inflicting a freeze and financial penalty on the
/// amount. The goal of this penalty is to introduce a cost that guards
/// against repeated malicious redemption requests.
// slither-disable-next-line missing-inheritance
contract RedemptionWatchtower is OwnableUpgradeable {
struct VetoProposal {
// Address of the redeemer that requested the redemption.
Expand Down Expand Up @@ -217,6 +218,7 @@ contract RedemptionWatchtower is OwnableUpgradeable {
function disableWatchtower() external {
require(watchtowerEnabledAt != 0, "Not enabled");

// slither-disable-next-line incorrect-equality
require(watchtowerDisabledAt == 0, "Already disabled");

require(
Expand Down Expand Up @@ -403,11 +405,20 @@ contract RedemptionWatchtower is OwnableUpgradeable {
return 0;
}

if (objectionsCount == 0) {
if (
// slither-disable-next-line incorrect-equality
objectionsCount == 0
) {
return defaultDelay;
} else if (objectionsCount == 1) {
} else if (
// slither-disable-next-line incorrect-equality
objectionsCount == 1
) {
return levelOneDelay;
} else if (objectionsCount == 2) {
} else if (
// slither-disable-next-line incorrect-equality
objectionsCount == 2
) {
return levelTwoDelay;
} else {
revert("No delay for given objections count");
Expand Down
1 change: 1 addition & 0 deletions solidity/contracts/bridge/WalletProposalValidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ contract WalletProposalValidator {
uint32 minAge = REDEMPTION_REQUEST_MIN_AGE;
if (redemptionWatchtower != address(0)) {
// Check the redemption delay enforced by the watchtower.
// slither-disable-next-line calls-loop
uint32 delay = IRedemptionWatchtower(redemptionWatchtower)
.getRedemptionDelay(redemptionKey);
// If the delay is greater than the usual minimum age, use it.
Expand Down
1 change: 0 additions & 1 deletion solidity/test/bridge/WalletProposalValidator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ethers, helpers } from "hardhat"
import chai, { expect } from "chai"
import { FakeContract, smock } from "@defi-wonderland/smock"
import { BigNumber, BigNumberish, BytesLike } from "ethers"
import { arch } from "node:os"
import type {
Bridge,
IRedemptionWatchtower,
Expand Down

0 comments on commit d3cc2e8

Please sign in to comment.