Upgradable smart contracts are a bug [https://medium.com/consensys-diligence/upgradeability-is-a-bug-dba0203152ce]. Remember this? It's mostly controversial now because very few projects do immutable smart contracts these days (but Curve and Yield Basis do).
So why immutable smart contracts are good?
- Humans make bugs in code. Steve McConnell in his book "Code Complete" famously wrote that average for software engineering industry is 1-25 per 1000 lines of code, which get to 0.5 defects per 1000 lines in Misrosoft after good testing. Average smart contract is several thousand lines = 1 bug after rigorous testing, hopefully not critical (critical parts should be smaller than few thousand lines). Now, imagine that smart contracts will be upgraded again and again and again - and now you need to secure not 2000 lines but 100000 lines (smart contracts in each release).
- Yes upgradability can save you if you find a mistake before hackers. But if you don't? Whoosh!
- Upgrades can break integrations. Remember Curve pools which use Aave tokens which are now disabled? Not nice.
- What if devs will be replaced by new devs? Will they be as competent as before? Less trust to humans = better!
- Maybe not an issue now, but upgradability does increase regulatory attack surface.
So, immutable smart contracts for the win!
#DeFi #security
Post #103
1.9K