If you notice some outdated information please let us know!
PASS
The final review score is indicated as a percentage. The percentage is calculated as Achieved Points due to MAX Possible Points. For each element the answer can be either Yes/No or a percentage. For a detailed breakdown of the individual weights of each question, please consult this document.
Very simply, the review looks for the following declarations from the developer's site. With these declarations, it is reasonable to trust the smart contracts.
This report is for informational purposes only and does not constitute investment advice of any kind, nor does it constitute an offer to provide investment advisory or other services. Nothing in this report shall be considered a solicitation or offer to buy or sell any security, token, future, option or other financial instrument or to offer or provide any investment advice or service to any person in any jurisdiction. Nothing contained in this report constitutes investment advice or offers any opinion with respect to the suitability of any security, and the views expressed in this report should not be taken as advice to buy, sell or hold any security. The information in this report should not be relied upon for the purpose of investing. In preparing the information contained in this report, we have not taken into account the investment needs, objectives and financial circumstances of any particular investor. This information has no regard to the specific investment objectives, financial situation and particular needs of any specific recipient of this information and investments discussed may not be suitable for all investors.
Any views expressed in this report by us were prepared based upon the information available to us at the time such views were written. The views expressed within this report are limited to DeFiSafety and the author and do not reflect those of any additional or third party and are strictly based upon DeFiSafety, its authors, interpretations and evaluation of relevant data. Changed or additional information could cause such views to change. All information is subject to possible correction. Information may quickly become unreliable for various reasons, including changes in market conditions or economic circumstances.
This completed report is copyright (c) DeFiSafety 2023. Permission is given to copy in whole, retaining this copyright label.
This section looks at the code deployed on the relevant chains and team aspects. The document explaining these questions is here.
1. Are the smart contract addresses easy to find? (%)
The smart contract addresses for the Uniswap protocol are easily accessible and clearly labeled on the protocol’s official documentation and GitHub repository. The addresses are available in the protocol's documentation under the 'deployments' section. There, the addresses for each unique instance of the UniswapV3Pool contract are listed. Additionally, the protocol's documentation provides detailed information on how to interact with these contracts. This level of accessibility and clarity meets the criteria for a score of 100%.
2. Does the protocol have a public software repository? (Y/N)
Research indicates that the Uniswap V2 protocol has a public software repository. Links to the relevant GitHub repositories are provided in the Uniswap documentation. These include links to 'uniswap-v2-core', 'uniswap-v2-periphery', 'uniswap-sdk', and 'uniswap-sdk-core'. This evidence suggests that the protocol's software repository is available to the public.
3. Is the team public (not anonymous)?
Where we found the team is documented in our team appendix at the end of this report. The majority of Uniswap's contributors are public, linking twitters, personal websites, and using pictures of themselves.
4. How responsive are the devs when we present our initial report?
Unable to contact the team. I was even kicked from their discord for politely asking.
This section looks at the software documentation. The document explaining these questions is here.
5. Is there a whitepaper? (Y/N)
Location: https://uniswap.org/whitepaper-v3.pdf
6. Is the protocol's software architecture documented? (%)
Uniswap has a video describing the functioning of concentrated liquidity, additionally, there are many other novice-friendly explanations in their doc's overview section. Even better, Uniswap's Engineering Lead, Noah Zinsmeister, created a video where he walks the viewer through the Uniswap code as well as other videos. I believe this is something brilliant that developers should do more often, I just wish Uniswap had this published it as well.
7. Does the software documentation fully cover the deployed contracts' source code? (%)
There is full coverage of deployed contracts by software function documentation in the "core" section of the Uniswap docs.
8. Is it possible to trace the documented software to its implementation in the protocol's source code? (%)
There is non-explicit traceability between software documentation and implemented code.
9. Is the documentation organized to ensure information availability and clarity? (%)
Organization is excellent
This section covers the testing process of the protocol’s smart contract code previous to its deployment on the mainnet. The document explaining these questions is here.
10. Has the protocol tested their deployed code? (%)
Code examples are in the Appendix at the end of this report. As per the SLOC, there is 7333/1602= ~478% testing to code (TtC). This score is guided by the Test to Code ratio (TtC). Generally a good test to code ratio is over 100%. However, the reviewer's best judgement is the final deciding factor.
11. How covered is the protocol's code? (%)
No coverage report could be found. However, Uniswap clearly has a very robust testing suite.
12. Is there a detailed report of the protocol's test results?(%)
Detailed test reports for unit tests, mythx test, fuzz tests, and more can be found at https://github.com/Uniswap/v3-core/actions/workflows/tests.yml. (you need to sign in to view the logs).
13. Has the protocol undergone Formal Verification? (Y/N)
Uniswap v3 has not undergone formal verification.
This section looks at the 3rd party software audits done. It is explained in this document.
14. Is the protocol sufficiently audited? (%)
uniswap V3 audits are in the GitHub. Uniswap V2 has undergone a rigorous process of review and formal verification by a team of six engineers over a period of several months. The scope of work included a formal verification of the core smart contracts, code review of core and periphery smart contracts, and numerical error analysis. The protocol also has an open and ongoing bug bounty program, indicating a commitment to security and continuous improvement. Reduced score by 10% because the V2 audit link is dead.
15. Is there a matrix of audit applicability on deployed code (%)? Please refer to the example doc for reference.
Functional V3 matrix of applicability is achieved because the audits are clearly in the V3 GitHub. Since UniSwap is immutable, the audits have not changed. I will subtract 10% because the V2 audits could not be found. I am aware that this is a V3 review, but with UniSwap you never know if you're using V2 or V3. So this report is a good place to ensure the relevant links for the V2, especially for the audits, are available. I am aware that UniSwap the two is extremely mature code. But users should still expect a link to the audits.
16. Is the bug bounty value acceptably high (%)
UniSwap has a very large ($2.25 million) fund bounty. However it is self managed. As self managed bug bounties have been difficult for white hat hackers to use, a score of 80% is given, asked for guidance.
17. Is there documented protocol monitoring (%)?
There is no indication of protocol monitoring in the documentation. Given the immutable and un-pauseable nature of the protocol, I'm not sure what they could do effectively. Still, we will need the response at 0% because at least an indication of their reasoning for protocol monitoring would be useful.
18. Is there documented protocol front-end monitoring (%)?
There is no specific mentions of DDOS Protection, DNS steps to protect the domain, and intrusion detection protection on the front end were found in the presented documentation
This section covers the documentation of special access controls for a DeFi protocol. The admin access controls are the contracts that allow updating contracts or coefficients in the protocol. Since these contracts can allow the protocol admins to "change the rules", complete disclosure of capabilities is vital for user's transparency. It is explained in this document.
19. Is the protocol code immutable or upgradeable? (%)
The protocol's code is immutable and non-upgradeable. No party has the ability to pause the contracts, reverse trade execution, or otherwise alter the protocol's behavior.
20. Is the protocol's code upgradeability clearly explained in non technical terms? (%)
The protocol's documentation clearly states that the contracts are immutable and not upgradeable. There is no party that has the ability to pause the contracts, reverse trade execution, or otherwise change the protocol's behavior.
21. Are the admin addresses, roles and capabilities clearly explained? (%)
The information could not be found in the documentation. It is however very clearly stated in section 4 of the V3 white paper.
22. Are the signers of the admin addresses clearly listed and provably distinct humans? (%)
As explained in the White paper (section 4) the governance is owned by the time lock which is owned by the governance software. This fully fulfills requirements.
23. Is there a robust documented transaction signing policy? Please refer to the Example doc for reference.(%)
As explained in the previous question, since governance is the owner of the admin capabilities, there is no need for a transaction signing procedure. This is effectively equivalent to 100% as it is immutable and the governance changes are owned by a smart contract.
This section goes over the documentation that a protocol may or may not supply about their Oracle usage. Oracles are a fundamental part of DeFi as they are responsible for relaying tons of price data information to thousands of protocols using blockchain technology. Not only are they important for price feeds, but they are also an essential component of transaction verification and security. These questions are explained in this document.
24. Are Oracles relevant? (Y/N)
25. Is the protocol's Oracle sufficiently documented? (%)
The Oracle of Uniswap is well-documented with comprehensive information about its function, source, and usage. Its documentation provides details on how to build a price oracle on Uniswap V2, including the steps to understand requirements and the strategies to implement. It also discusses the need for an oracle as a safety check against potential attacks, and provides insights into the concept of an oracle, its importance in retrieving price information on-chain, and the vulnerabilities associated with its implementation. Furthermore, it explains how all Uniswap v3 pools can serve as oracles, providing access to historical price and liquidity data, and the mechanism for storing and accessing this historical data.
26. Can flashloan attacks be applied to the protocol, and if so, are those flashloan attack risks mitigated? (Y/N)
Uniswap mitigates the extent of front running attacks through a combination of TWAP and TWAL. Technical details can be found here.