Skip to content

Commit

Permalink
Fixed slither issues
Browse files Browse the repository at this point in the history
  • Loading branch information
drinkcoffee committed Jan 25, 2024
1 parent 6232c6f commit d073dc2
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions contracts/allowlist/OperatorAllowlistUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ contract OperatorAllowlistUpgradeable is
function _authorizeUpgrade(address newImplementation) internal override onlyRole(UPGRADE_ROLE) {}

/// @notice storage gap for additional variables for upgrades
// slither-disable-start unused-state
// solhint-disable-next-line var-name-mixedcase
uint256[20] private __OperatorAllowlistUpgradeableGap;
// slither-disable-end unused-state
}
2 changes: 1 addition & 1 deletion contracts/mocks/MockDisguisedEOA.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ contract MockDisguisedEOA {
tokenAddress = _tokenAddress;
}

/// @notice This code is only for testing purposes. Do not use similar
/// @notice This code is only for testing purposes. Do not use similar
/// @notice constructions in production code as they are open to attack.
/// @dev For details see: https://github.com/crytic/slither/wiki/Detector-Documentation#arbitrary-from-in-transferfrom
function executeTransfer(address from, address recipient, uint256 _tokenId) external {
Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/MockMarketplace.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract MockMarketplace {
tokenAddress.transferFrom(msg.sender, recipient, _tokenId);
}

/// @notice This code is only for testing purposes. Do not use similar
/// @notice This code is only for testing purposes. Do not use similar
/// @notice constructions in production code as they are open to attack.
/// @dev For details see: https://github.com/crytic/slither/wiki/Detector-Documentation#arbitrary-from-in-transferfrom
function executeTransferFrom(address from, address to, uint256 _tokenId) public {
Expand All @@ -29,7 +29,7 @@ contract MockMarketplace {
tokenAddress.setApprovalForAll(operator, approved);
}

/// @notice This code is only for testing purposes. Do not use similar
/// @notice This code is only for testing purposes. Do not use similar
/// @notice constructions in production code as they are open to attack.
/// @dev For details see: https://github.com/crytic/slither/wiki/Detector-Documentation#arbitrary-from-in-transferfrom
function executeTransferRoyalties(address from, address recipient, uint256 _tokenId, uint256 price) public payable {
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/MockWallet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ contract MockWallet {

event ReceivedBatch(address, address, uint256[], uint256[], bytes);

/// @notice This code is only for testing purposes. Do not use similar
/// @notice This code is only for testing purposes. Do not use similar
/// @notice constructions in production code as they are open to attack.
/// @dev For details see: https://github.com/crytic/slither/wiki/Detector-Documentation#arbitrary-from-in-transferfrom
function transferNFT(address token, address from, address to, uint256 tokenId) external {
Expand Down
1 change: 1 addition & 0 deletions contracts/token/erc1155/abstract/ERC1155Permit.Sol
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ abstract contract ERC1155Permit is ERC1155Burnable, EIP712, IERC1155Permit, IImm
* @return True if the signature is valid according to EIP-1271, otherwise false.
*/
function _isValidERC1271Signature(address spender, bytes32 digest, bytes memory sig) private view returns(bool) {
// slither-disable-next-line low-level-calls
(bool success, bytes memory res) = spender.staticcall(
abi.encodeWithSelector(
IERC1271.isValidSignature.selector,
Expand Down
1 change: 1 addition & 0 deletions contracts/token/erc721/abstract/ERC721HybridPermit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ abstract contract ERC721HybridPermit is ERC721Hybrid, IERC4494, EIP712 {
* @return True if the signature is valid according to EIP-1271, otherwise false.
*/
function _isValidERC1271Signature(address spender, bytes32 digest, bytes memory sig) private view returns (bool) {
// slither-disable-next-line low-level-calls
(bool success, bytes memory res) = spender.staticcall(
abi.encodeWithSelector(IERC1271.isValidSignature.selector, digest, sig)
);
Expand Down
1 change: 1 addition & 0 deletions contracts/token/erc721/abstract/ERC721Permit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ abstract contract ERC721Permit is ERC721Burnable, IERC4494, EIP712, IImmutableER
* @return True if the signature is valid according to EIP-1271, otherwise false.
*/
function _isValidERC1271Signature(address spender, bytes32 digest, bytes memory sig) private view returns (bool) {
// slither-disable-next-line low-level-calls
(bool success, bytes memory res) = spender.staticcall(
abi.encodeWithSelector(IERC1271.isValidSignature.selector, digest, sig)
);
Expand Down
2 changes: 2 additions & 0 deletions contracts/token/erc721/x/Asset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pragma solidity ^0.8.4;
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {Mintable} from "./Mintable.sol";

// slither-disable-start missing-inheritance
contract Asset is ERC721, Mintable {
constructor(
address _owner,
Expand All @@ -17,3 +18,4 @@ contract Asset is ERC721, Mintable {
_safeMint(user, id);
}
}
// slither-disable-end missing-inheritance
3 changes: 0 additions & 3 deletions contracts/token/erc721/x/utils/Bytes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ library Bytes {
return string(buffer);
}

// solhint-disable-next-line const-name-snakecase
bytes private constant alphabet = "0123456789abcdef";

/**
* Index Of
*
Expand Down
2 changes: 2 additions & 0 deletions contracts/trading/seaport/zones/ImmutableSignedZone.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ contract ImmutableSignedZone is
// solhint-disable-next-line var-name-mixedcase
string private _ZONE_NAME;

// slither-disable-start immutable-states
// solhint-disable-next-line var-name-mixedcase
bytes32 internal _NAME_HASH;
// slither-disable-end immutable-states

/// @dev The allowed signers.
// solhint-disable-next-line named-parameters-mapping
Expand Down
2 changes: 1 addition & 1 deletion slither.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"detectors_to_exclude": "naming-convention, solc-version",
"detectors_to_exclude": "naming-convention, solc-version, similar-names",

"filter_paths": "lib"
}
Expand Down

0 comments on commit d073dc2

Please sign in to comment.