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 audit 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 Mainnet that gets reviewed and its corresponding software repository. The document explaining these questions is here.
1. Are the executing code addresses readily available? (%)
They are available at website https://github.com/UMAprotocol/protocol/blob/master/packages/core/networks/1.json as indicated in the Appendix.
2. Is the code actively being used? (%)
Activity is 35 transactions a day on contract voting.sol, as indicated in the Appendix.
3. Is there a public software repository? (Y/N)
GitHub: https://github.com/UMAprotocol
Is there a public software repository with the code at a minimum, but also normally test and scripts. Even if the repository was created just to hold the files and has just 1 transaction, it gets a "Yes". For teams with private repositories, this answer is "No"
4. Is there a development history visible? (%)
With 2003 commits and 290 branches, this is a very healthy software repository.
This metric checks if the software repository demonstrates a strong steady history. This is normally demonstrated by commits, branches and releases in a software repository. A healthy history demonstrates a history of more than a month (at a minimum).
5. Is the team public (not anonymous)? (Y/N)
Team info can be found at https://angel.co/company/uma-project/people
For a "Yes" in this question, the real names of some team members must be public on the website or other documentation (LinkedIn, etc). If the team is anonymous, then this question is a "No".
This section looks at the software documentation. The document explaining these questions is here.
7. Are the basic software functions documented? (Y/N)
8. Does the software function documentation fully (100%) cover the deployed contracts? (%)
Major functions such as Oracle Interface, Store Interface, and Voting Interface are covered in https://docs.umaproject.org/oracle/dvm-interface. There is also API documentation at https://docs.umaproject.org/getting-started/oracle.
9. Are there sufficiently detailed comments for all functions within the deployed contract code (%)
The Comments to Code (CtC) ratio is the primary metric for this score.
10. Is it possible to trace from software documentation to the implementation in code (%)
There is a clear association between the code and documentation via non-explicit tracability at https://docs.umaproject.org/oracle/dvm-interface
11. Full test suite (Covers all the deployed code) (%)
This score is guided by the Test to Code ratio (TtC). Generally a good test to code ratio is over 100%. However the reviewers best judgement is the final deciding factor.
12. Code coverage (Covers all the deployed lines of code, or explains misses) (%)
Code coverage available at https://coveralls.io/github/UMAprotocol/protocol
13. Scripts and instructions to run the tests? (Y/N)
Instructions to run tests available at the bottom of https://github.com/UMAprotocol/protocol
14. Report of the results (%)
Detailed test report available at https://coveralls.io/github/UMAprotocol/protocol.
15. Formal Verification test done (%)
No UMA formal verification was found.
16. Stress Testing environment (%)
Kovan test-net smart contract addresses can be found at https://github.com/UMAprotocol/protocol/blob/master/packages/core/networks/42.json.
This section looks at the 3rd party software audits done. It is explained in this document.
17. Did 3rd Party audits take place? (%)
18. Is the bug bounty acceptable high? (%)
Their Bug Bounty program rewards as high as 7.5k for the most critical of bugs.
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. Can a user clearly and quickly find the status of the access controls (%)
Admin access controls found in https://docs.umaproject.org/oracle/tech-architecture
20. Is the information clear and complete (%)
21. Is the information in non-technical terms that pertain to the investments (%)
22. Is there Pause Control documentation including records of tests (%)
1// SPDX-License-Identifier: AGPL-3.0-only
2pragma solidity ^0.8.0;
3
4import "../../common/implementation/FixedPoint.sol";
5import "../../common/implementation/Testable.sol";
6import "../interfaces/FinderInterface.sol";
7import "../interfaces/OracleInterface.sol";
8import "../interfaces/OracleAncillaryInterface.sol";
9import "../interfaces/VotingInterface.sol";
10import "../interfaces/VotingAncillaryInterface.sol";
11import "../interfaces/IdentifierWhitelistInterface.sol";
12import "./Registry.sol";
13import "./ResultComputation.sol";
14import "./VoteTiming.sol";
15import "./VotingToken.sol";
16import "./Constants.sol";
17
18import "@openzeppelin/contracts/access/Ownable.sol";
19import "@openzeppelin/contracts/utils/math/SafeMath.sol";
20import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
21
22/**
23 * @title Voting system for Oracle.
24 * @dev Handles receiving and resolving price requests via a commit-reveal voting scheme.
25 */
26contract Voting is
27 Testable,
28 Ownable,
29 OracleInterface,
30 OracleAncillaryInterface, // Interface to support ancillary data with price requests.
31 VotingInterface,
32 VotingAncillaryInterface // Interface to support ancillary data with voting rounds.
33{
34 using FixedPoint for FixedPoint.Unsigned;
35 using SafeMath for uint256;
36 using VoteTiming for VoteTiming.Data;
37 using ResultComputation for ResultComputation.Data;
38
39 /****************************************
40 * VOTING DATA STRUCTURES *
41 ****************************************/
42
43 // Identifies a unique price request for which the Oracle will always return the same value.
44 // Tracks ongoing votes as well as the result of the vote.
45 struct PriceRequest {
46 bytes32 identifier;
47 uint256 time;
48 // A map containing all votes for this price in various rounds.
49 mapping(uint256 => VoteInstance) voteInstances;
50 // If in the past, this was the voting round where this price was resolved. If current or the upcoming round,
51 // this is the voting round where this price will be voted on, but not necessarily resolved.
52 uint256 lastVotingRound;
53 / The index in the `pendingPriceRequests` that references this PriceRequest. A value of UINT_MAX means that
54 / this PriceRequest is resolved and has been cleaned up from `pendingPriceRequests`.
55 uint256 index;
56 bytes ancillaryData;
57 }
58
59 struct VoteInstance {
60 // Maps (voterAddress) to their submission.
61 mapping(address => VoteSubmission) voteSubmissions;
62 // The data structure containing the computed voting results.
63 ResultComputation.Data resultComputation;
64 }
65
66 struct VoteSubmission {
67 // A bytes32 of `0` indicates no commit or a commit that was already revealed.
68 bytes32 commit;
69 // The hash of the value that was revealed.
70 // Note: this is only used for computation of rewards.
71 bytes32 revealHash;
72 }
73
74 struct Round {
75 uint256 snapshotId; // Voting token snapshot ID for this round. 0 if no snapshot has been taken.
76 FixedPoint.Unsigned inflationRate; // Inflation rate set for this round.
77 FixedPoint.Unsigned gatPercentage; // Gat rate set for this round.
78 uint256 rewardsExpirationTime; // Time that rewards for this round can be claimed until.
79 }
80
Comments to Code: 5931 / 8812 = 67 %
Tests to Code: 15500 / 8812 = 176 %