-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Rules Wishlist #44
Comments
Not always desirable. See for example: https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/Rejector.sol |
Updated. Thanks @maraoz! |
Agreed with @maroz and no issues with the rest. My plan was to separate the linter into 2 layers - the base would only ensure compliance with the Solidity Style Guide. The 2nd layer contains all the additional rules (like you've stated above) coming from the community. But this layer is optional and therefore can be enabled / disabled by the user at any time. Until now, I've only been working with the Base. I think we should follow the 2-layer approach. |
Eslint has some notion of rulesets. See here. Perhaps we can do something similar with Solium rules, where you can choose to enable the I must confess I am not a big fan of the current |
You're right, we should deprecate I'll blog the final plan before I start implementing it but let me know if you have ideas of your own. |
Also Rule proposal:
|
Rule:
See: https://ethereum.karalabe.com/talks/2016-hackethon.html#10 P.S. Is there a secure case for this construct? Or are all its uses insecure? |
|
|
As a general rule, a linter for smart contracts should be very strict with spacing around all keywords, operators, etc. to avoid these problems. |
|
See ConsenSys best practices. Or is there any situation where this is not possible? |
|
All security-related rules finalized in this thread are being implemented at https://github.com/duaraghav8/solium-plugin-security |
I was thinking about implementing this rule, and it seems that to avoid false positives we should keep track of all variables of type Do you think Solium should support something like this? |
@mushketyk you're not overthinking. There are several rules which are on pause because of this problem of Solium only being file-aware instead of project-aware, ie, at any given time, a rule only has context of 1 file whereas it should have context of the entire project so any external elements can also be considered. This problem is well documented in #83 Let's keep this rule on hold for now, because making solium project-aware is a major design change so it will take time. I'll work on it in near future. |
This is my wishlist for additional rules. Let me know if you are against any of them getting implemented in the core. I will work on some of them but anything else is up for grabs.
send
instead of dangerouscall.value()
(WIP @federicobond)block.timestamp
as it can be manipulated by miners (only in functions) (WIP @federicobond)msg.value
has payable modifier (WIP @federicobond)Ensure fallback function has payable modifier (WIP @federicobond)send
return value is checked.selfdestruct
instead of deprecatedsuicide
(WIP @federicobond)The text was updated successfully, but these errors were encountered: