Skip to content

Commit

Permalink
fix: slither fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
QEDK committed Jan 17, 2024
1 parent 3bc0739 commit ce7d240
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/AvailBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}

Expand All @@ -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();
Expand Down

0 comments on commit ce7d240

Please sign in to comment.