Skip to content

Commit

Permalink
Suppress Slither false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-zimnoch committed Jan 30, 2024
1 parent f40a560 commit ff77f7d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions solidity/contracts/integrator/TBTCDepositorProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ abstract contract TBTCDepositorProxy is Initializable {

/// @notice Initializes the contract. MUST BE CALLED from the child
/// contract initializer.
// slither-disable-next-line dead-code
function __TBTCDepositorProxy_initialize(
address _bridge,
address _tbtcVault
Expand All @@ -178,6 +179,7 @@ abstract contract TBTCDepositorProxy is Initializable {
/// - The revealed vault address must match the TBTCVault address,
/// - All requirements from {Bridge#revealDepositWithExtraData}
/// function must be met.
// slither-disable-next-line dead-code
function initializeDeposit(
BitcoinTx.Info calldata fundingTx,
Deposit.DepositRevealInfo calldata reveal,
Expand Down Expand Up @@ -216,6 +218,7 @@ abstract contract TBTCDepositorProxy is Initializable {
/// (in the context of this contract) yet.
/// - The deposit must be finalized on the Bridge side. That means the
/// deposit must be either swept or optimistically minted.
// slither-disable-next-line dead-code
function finalizeDeposit(uint256 depositKey) internal {
require(pendingDeposits[depositKey], "Deposit not initialized");

Expand All @@ -234,13 +237,15 @@ abstract contract TBTCDepositorProxy is Initializable {
// allow to reveal the same deposit twice. Deleting the deposit from
// the mapping will also prevent the finalizeDeposit function from
// being called again for the same deposit.
// slither-disable-next-line reentrancy-no-eth
delete pendingDeposits[depositKey];

uint256 tbtcAmount = calculateTbtcAmount(
deposit.amount,
deposit.treasuryFee
);

// slither-disable-next-line reentrancy-events
emit DepositFinalized(
depositKey,
tbtcAmount,
Expand Down Expand Up @@ -278,6 +283,7 @@ abstract contract TBTCDepositorProxy is Initializable {
/// to wait for finalization until the reserve is refilled by subsequent
/// deposits or a manual top-up. The integrator is responsible for
/// handling such cases.
// slither-disable-next-line dead-code
function calculateTbtcAmount(
uint64 depositAmountSat,
uint64 depositTreasuryFeeSat
Expand Down Expand Up @@ -310,6 +316,7 @@ abstract contract TBTCDepositorProxy is Initializable {
/// @dev IMPORTANT NOTE: The tbtcAmount passed to this function is an
/// approximation. See documentation of the `calculateTbtcAmount`
/// responsible for calculating this value for more details.
// slither-disable-next-line unimplemented-functions
function onDepositFinalized(
uint256 depositKey,
uint256 tbtcAmount,
Expand All @@ -324,6 +331,7 @@ abstract contract TBTCDepositorProxy is Initializable {
/// `keccak256(fundingTxHash | reveal.fundingOutputIndex)`. This
/// key can be used to refer to the deposit in the Bridge and
/// TBTCVault contracts.
// slither-disable-next-line dead-code
function calculateDepositKey(
bytes32 fundingTxHash,
uint32 fundingOutputIndex
Expand All @@ -338,6 +346,7 @@ abstract contract TBTCDepositorProxy is Initializable {
/// transaction data.
/// @param txInfo Bitcoin transaction data, see `BitcoinTx.Info` struct.
/// @return txHash Bitcoin transaction hash.
// slither-disable-next-line dead-code
function calculateBitcoinTxHash(BitcoinTx.Info calldata txInfo)
internal
view
Expand Down

0 comments on commit ff77f7d

Please sign in to comment.