Enable more optional clippy
lints when building contracts
#1472
Labels
enhancement
New feature or request
clippy
lints when building contracts
#1472
We could enable some optional
clippy
lints to find common errors when compiling ink! contracts.Since smart contracts demand increased security requirements, it makes sense to add as much available security checks as possible, if it is feasible to get any reasonable results on ink! contracts.
My suggestion is to enable
clippy
lints to highlight some constructions that look suspicious in production contracts. It would be good to draw the additional attention to them:panic!
andpanic!
inside functions returningResult
todo!
unimplemented!
unreachable!
There is also the
.unwrap()
and.expect()
lint that works forOption
andResult
types, but it would be too noisy if we add it.By default, all these lints are suppressed. I suggest changing their warning level to
Warn
to allow them to raise non-critical warnings when building withcargo-contract
. This might be achieved by changing a single line incargo-contract
, enabling us to reuse the existing infrastructure without extendingink_linting
.The text was updated successfully, but these errors were encountered: