-
Notifications
You must be signed in to change notification settings - Fork 997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug-Candidate]: For some reason I haven't been able to get slither to start on windows 7. #1431
Comments
Hi @mattjaf, can you confirm if this still happens after running |
Thank you for your response. and it threw this: $ slither . --solc-remaps '@openzeppelin=node_modules/@openzeppelin' --exclude naming-convention,external-function,low-level-calls
'npx hardhat compile --force' running
Compiled 12 Solidity files successfully
NftArticlesNatSpec.burnToken(uint256,string) (contracts/NatSpec.sol#158-162) deletes NftArticlesNatSpec.Article (contracts/NatSpec.sol#47-54) which contains a mapping:
-delete (tokenIdToArticle[_tokenId]) (contracts/NatSpec.sol#161)
NftArticles.burnToken(uint256,string) (contracts/ucla.sol#64-68) deletes NftArticles.Article (contracts/ucla.sol#21-28) which contains a mapping:
-delete (tokenIdToArticle[_tokenId]) (contracts/ucla.sol#67)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#deletion-on-mapping-containing-a-structure
Reentrancy in NftArticlesNatSpec.mintToken(uint256,string,string,uint8) (contracts/NatSpec.sol#131-149):
External calls:
- _safeMint(msg.sender,tokenCounter) (contracts/NatSpec.sol#146)
- IERC721Receiver(to).onERC721Received(_msgSender(),from,tokenId,data) (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#401-412)
State variables written after the call(s):
- tokenCounter ++ (contracts/NatSpec.sol#148)
Reentrancy in NftArticles.mintToken(uint256,string,string,uint8) (contracts/ucla.sol#44-62):
External calls:
- _safeMint(msg.sender,tokenCounter) (contracts/ucla.sol#59)
- IERC721Receiver(to).onERC721Received(_msgSender(),from,tokenId,data) (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#401-412)
State variables written after the call(s):
- tokenCounter ++ (contracts/ucla.sol#61)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#reentrancy-vulnerabilities-1
ERC721._checkOnERC721Received(address,address,uint256,bytes) (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#394-416) ignores return value by IERC721Receiver(to).onERC721Received(_msgSender(),from,tokenId,data) (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#401-412)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#unused-return
NftArticlesNatSpec.constructor(string,string)._name (contracts/NatSpec.sol#110) shadows:
- ERC721._name (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#24) (state variable)
NftArticlesNatSpec.constructor(string,string)._symbol (contracts/NatSpec.sol#110) shadows:
- ERC721._symbol (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#27) (state variable)
NftArticles.constructor(string,string)._name (contracts/ucla.sol#37) shadows:
- ERC721._name (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#24) (state variable)
NftArticles.constructor(string,string)._symbol (contracts/ucla.sol#37) shadows:
- ERC721._symbol (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#27) (state variable)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#local-variable-shadowing
NftArticlesNatSpec.changeOwnerReceiverAddress(address)._ownerReceiverAddress (contracts/NatSpec.sol#367) lacks a zero-check on :
- ownerReceiverAddress = _ownerReceiverAddress (contracts/NatSpec.sol#368)
NftArticles.changeOwnerReceiverAddress(address)._ownerReceiverAddress (contracts/ucla.sol#163) lacks a zero-check on :
- ownerReceiverAddress = _ownerReceiverAddress (contracts/ucla.sol#164)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#missing-zero-address-validation
Variable 'ERC721._checkOnERC721Received(address,address,uint256,bytes).retval (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#401)' in ERC721._checkOnERC721Received(address,address,uint256,bytes) (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#394-416) potentially used before declaration: retval == IERC721Receiver.onERC721Received.selector (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#402)
Variable 'ERC721._checkOnERC721Received(address,address,uint256,bytes).reason (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#403)' in ERC721._checkOnERC721Received(address,address,uint256,bytes) (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#394-416) potentially used before declaration: reason.length
== 0 (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#404)
Variable 'ERC721._checkOnERC721Received(address,address,uint256,bytes).reason (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#403)' in ERC721._checkOnERC721Received(address,address,uint256,bytes) (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#394-416) potentially used before declaration: revert(uint256,uint256)(32 + reason,mload(uint256)(reason)) (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#409)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#pre-declaration-usage-of-local-variables
Reentrancy in NftArticlesNatSpec.mintToken(uint256,string,string,uint8) (contracts/NatSpec.sol#131-149):
External calls:
- _safeMint(msg.sender,tokenCounter) (contracts/NatSpec.sol#146)
- IERC721Receiver(to).onERC721Received(_msgSender(),from,tokenId,data) (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#401-412)
Event emitted after the call(s):
- MintToken(tokenCounter,msg.sender,_ppvFee,_unPaidURI) (contracts/NatSpec.sol#147)
Reentrancy in NftArticles.mintToken(uint256,string,string,uint8) (contracts/ucla.sol#44-62):
External calls:
- _safeMint(msg.sender,tokenCounter) (contracts/ucla.sol#59)
- IERC721Receiver(to).onERC721Received(_msgSender(),from,tokenId,data) (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#401-412)
Event emitted after the call(s):
- MintToken(tokenCounter,msg.sender,_ppvFee,_unPaidURI) (contracts/ucla.sol#60)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#reentrancy-vulnerabilities-3
ERC721._checkOnERC721Received(address,address,uint256,bytes) (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#394-416) uses assembly
- INLINE ASM (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#408-410)
Address.verifyCallResult(bool,bytes,string) (node_modules/@openzeppelin/contracts/utils/Address.sol#201-221) uses assembly
- INLINE ASM (node_modules/@openzeppelin/contracts/utils/Address.sol#213-216)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#assembly-usage
NftArticlesNatSpec.payPerView(uint256) (contracts/NatSpec.sol#400-415) compares to
a boolean constant:
-require(bool,string)(tokenIdToArticle[_tokenId].paidAddress[msg.sender] != true,You have already paid per view!) (contracts/NatSpec.sol#401-404)
NftArticles.payPerView(uint256) (contracts/ucla.sol#175-190) compares to a boolean
constant:
-require(bool,string)(tokenIdToArticle[_tokenId].paidAddress[msg.sender] != true,You have already paid per view!) (contracts/ucla.sol#176-179)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#boolean-equality
Different versions of Solidity are used:
- Version used: ['0.8.7', '^0.8.0', '^0.8.1']
- ^0.8.0 (node_modules/@openzeppelin/contracts/access/Ownable.sol#4)
- ^0.8.0 (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#4)
- ^0.8.0 (node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol#4)
- ^0.8.0 (node_modules/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol#4)
- ^0.8.0 (node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol#4)
- ^0.8.1 (node_modules/@openzeppelin/contracts/utils/Address.sol#4)
- ^0.8.0 (node_modules/@openzeppelin/contracts/utils/Context.sol#4)
- ^0.8.0 (node_modules/@openzeppelin/contracts/utils/Strings.sol#4)
- ^0.8.0 (node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol#4)
- ^0.8.0 (node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol#4)
- 0.8.7 (contracts/NatSpec.sol#2)
- 0.8.7 (contracts/ucla.sol#2)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#different-pragma-directives-are-used
Pragma version^0.8.0 (node_modules/@openzeppelin/contracts/access/Ownable.sol#4) allows old versions
Pragma version^0.8.0 (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#4) allows old versions
Pragma version^0.8.0 (node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol#4) allows old versions
Pragma version^0.8.0 (node_modules/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol#4) allows old versions
Pragma version^0.8.0 (node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol#4) allows old versions
Pragma version^0.8.1 (node_modules/@openzeppelin/contracts/utils/Address.sol#4) allows old versions
Pragma version^0.8.0 (node_modules/@openzeppelin/contracts/utils/Context.sol#4) allows old versions
Pragma version^0.8.0 (node_modules/@openzeppelin/contracts/utils/Strings.sol#4) allows old versions
Pragma version^0.8.0 (node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol#4) allows old versions
Pragma version^0.8.0 (node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol#4) allows old versions
Pragma version0.8.7 (contracts/NatSpec.sol#2) allows old versions
Pragma version0.8.7 (contracts/ucla.sol#2) allows old versions
solc-0.8.7 is not recommended for deployment
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#incorrect-versions-of-solidity
Reentrancy in NftArticlesNatSpec.payPerView(uint256) (contracts/NatSpec.sol#400-415):
External calls:
- address(tokenIdToArticle[_tokenId].creator).transfer(tokenCreatorProfit)
(contracts/NatSpec.sol#412)
- address(ownerOf(_tokenId)).transfer(tokenOwnerProfit) (contracts/NatSpec.sol#413)
Event emitted after the call(s):
- PayPerView(_tokenId,msg.sender,msg.value) (contracts/NatSpec.sol#414)
Reentrancy in NftArticles.payPerView(uint256) (contracts/ucla.sol#175-190):
External calls:
- address(tokenIdToArticle[_tokenId].creator).transfer(tokenCreatorProfit)
(contracts/ucla.sol#187)
- address(ownerOf(_tokenId)).transfer(tokenOwnerProfit) (contracts/ucla.sol#188)
Event emitted after the call(s):
- PayPerView(_tokenId,msg.sender,msg.value) (contracts/ucla.sol#189)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#reentrancy-vulnerabilities-4
. analyzed (12 contracts with 78 detectors), 36 result(s) found
error Command failed with exit code 4294967295. |
Looks like it's working fine 👍 in the future, if you modify your codebase significantly, run a hardhat clean before analyzing, as stale artifacts in the hardhat directory can cause these sorts of issues. |
thanks again!!, whats up with this: error Command failed with exit code 4294967295. |
By default slither will exit with an error code if any detections are found in the codebase. With slither 0.9 you can now override the behavior to always exit with code 0 (success) by passing From the release notes:
|
oh, thank you so much!! |
sorry to bother you, is there a reason why the messages aren't in color in my terminal? |
I believe terminal color output (ANSI color escapes) in Windows requires a recent Windows 10 or 11, and a terminal emulator with support for it, like the new Windows Terminal. You mentioned you were using Windows 7, so that's probably why you get the uncolored output. |
Describe the issue:
I installed it with
py -m pip slither-analyzer
tried running it and it threw an error.
Thank you in advance and God Bless
Code example to reproduce the issue:
slither . --solc-remaps '@openzeppelin=node_modules/@openzeppelin'
Version:
slither 0.9.0
solc 0.8.7
Relevant log output:
The text was updated successfully, but these errors were encountered: