Can we get a thread of all the random things DeFi builders should do before their contract holds $25M? As in, if you are a person considering putting your money in a DeFi thing and they haven't done this, it's a big red flag?
-
Show this thread
-
100% test coverage. Possibly Test Driven Development. Tests possibly implemented against a model/predictor written in a different language. Clear contracts architecture specification. Security audits, possibly formal verification with clear specification of the invariants tested.
3 replies 0 retweets 9 likes -
Well commented, clear code (security by obfuscation does not work). Clear description of which parts of the protocol are upgradeable, and every upgrade of the contracts should be traced with events. Contracts ALWAYS public and verified on etherscan.
1 reply 2 retweets 10 likes -
No built in backdoors to withdraw user funds. Ownership of the contracts at least to a multisig initially, but with a clear path to remove trust. Bug bounty with clear rules and decents bounties.
1 reply 0 retweets 4 likes -
There is more on the dev side, but it would go too much in detail and should probably be responsibility of the auditors to expose bad development practices (eg. we got exposed by our OZ audit specifically on PR review and we fixed it).
2 replies 0 retweets 1 like -
There is a lot of value to audits that I wish more people knew about. PR reviews are a good one. We had an audit of our build & deploy systems which was so enlightening as it educated us & improved our overall security culture way more than fixing a 2-line bug ever could.
1 reply 0 retweets 1 like
While I agree that test coverage is good to strive for, high test coverage has little overlap with the security of code we have reviewed. Defining security properties is where you want to be.https://blog.trailofbits.com/2019/08/08/246-findings-from-our-smart-contract-audits-an-executive-summary/ …
-
-
Good point Dan. I should have specified 100% * proper * test coverage. Testing against incorrect properties it's a disaster waiting to happen, even with 100% test coverage.
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.