How do I recognize nefarious coding in a smart contract vs a good one? I’ve been reading smart contracts but I’m unaware as of yet how to recognize the difference.
2 Answers
do you mean:
a. Un-optimized coding: meaning code is not optimal; and would consume more gas than required. This also means data-structures; function calls are not optimal for memory and cpu usage.
b. Security breach: That is, smart contract has loop holes which can cause security breaches.
c. Dead-End: Smart contract code is written in a way that is not updateable at all and require new contract to be deployed altogether for a CR.
Nefarious (actively malicious) contracts generally (A) have unverified code, (B) have hidden/ undocumented functions, or (C) go against their whitepaper. Most of this auditing process is basically just comparing the whitepaper to the verified code. It's also not enough to simply be looking at the contract though. (e.g. for ERC20s you must make sure that liquidity is locked correctly)