From ce7d2408158d8d74fc3bbf6c1dbe48e675e36579 Mon Sep 17 00:00:00 2001 From: qedk <1994constant@gmail.com> Date: Thu, 18 Jan 2024 00:36:24 +0400 Subject: [PATCH] fix: slither fixes --- src/AvailBridge.sol | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/AvailBridge.sol b/src/AvailBridge.sol index 2b1daac..4401907 100644 --- a/src/AvailBridge.sol +++ b/src/AvailBridge.sol @@ -93,6 +93,7 @@ contract AvailBridge is IVectorx newVectorx ) external initializer { feePerByte = newFeePerByte; + // slither-disable-next-line missing-zero-check feeRecipient = newFeeRecipient; vectorx = newVectorx; avail = newAvail; @@ -132,10 +133,11 @@ contract AvailBridge is external onlyRole(DEFAULT_ADMIN_ROLE) { - if (assetIds.length != tokenAddresses.length) { + uint256 length = assetIds.length; + if (length != tokenAddresses.length) { revert ArrayLengthMismatch(); } - for (uint256 i = 0; i < assetIds.length;) { + for (uint256 i = 0; i < length;) { tokens[assetIds[i]] = tokenAddresses[i]; unchecked { ++i; @@ -158,6 +160,7 @@ contract AvailBridge is * @param newFeeRecipient New fee recipient address */ function updateFeeRecipient(address newFeeRecipient) external onlyRole(DEFAULT_ADMIN_ROLE) { + // slither-disable-next-line missing-zero-check feeRecipient = newFeeRecipient; } @@ -168,6 +171,7 @@ contract AvailBridge is function withdrawFees() external { uint256 fee = fees; delete fees; + // slither-disable-next-line low-level-calls (bool success,) = feeRecipient.call{value: fee}(""); if (!success) { revert WithdrawFailed();