If you notice some outdated information please let us know!
FAIL
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/OlympusDAO/olympus-contracts#mainnet-contracts--addresses, as indicated in the Appendix.
2. Is the code actively being used? (%)
3. Is there a public software repository? (Y/N)
GitHub: https://github.com/OlympusDAO/
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 24 commits and 8 branches, Olympus' main smart contract repository has an acceptable development history.
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)
The team is anonymous.
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)
Software functions are not covered by the documentation.
8. Does the software function documentation fully (100%) cover the deployed contracts? (%)
Aside from one contract, no documentation could be found relating to the remaining contracts.
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 (%)
The documentation does not list all software functions.
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) (%)
There is no evidence of code coverage testing. However, there is an incomplete although existing set of tests.
13. Scripts and instructions to run the tests? (Y/N)
14. Report of the results (%)
There is no test report result.
15. Formal Verification test done (%)
No formal verification test has been done.
16. Stress Testing environment (%)
There is evidence of Olympus using the Rinkeby network for testing.
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? (%)
There is no bug bounty program.
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 (%)
Access control information can be found in the DAO section of the Olympus documentation, as well as the Treasury section. There is also a Medium article about their Governance at https://olympusdao.medium.com/the-genesis-dao-70f0ee6b5b8. Although this is good access control information, it is in multiple places and is not well-labelled.
20. Is the information clear and complete (%)
21. Is the information in non-technical terms that pertain to the investments (%)
The {medium article](https://olympusdao.medium.com/the-genesis-dao-70f0ee6b5b80) is clearly explained. in user-friendly language.
22. Is there Pause Control documentation including records of tests (%)
A halt function is mentioned without further elaboration.
1contract OlympusStaking is Ownable {
2
3 using SafeMath for uint256;
4 using SafeERC20 for IERC20;
5
6 address public immutable OHM;
7 address public immutable sOHM;
8
9 struct Epoch {
10 uint length;
11 uint number;
12 uint endBlock;
13 uint distribute;
14 }
15 Epoch public epoch;
16
17 address public distributor;
18
19 address public locker;
20 uint public totalBonus;
21
22 address public warmupContract;
23 uint public warmupPeriod;
24
25 constructor (
26 address _OHM,
27 address _sOHM,
28 uint _epochLength,
29 uint _firstEpochNumber,
30 uint _firstEpochBlock
31 ) {
32 require( _OHM != address(0) );
33 OHM = _OHM;
34 require( _sOHM != address(0) );
35 sOHM = _sOHM;
36
37 epoch = Epoch({
38 length: _epochLength,
39 number: _firstEpochNumber,
40 endBlock: _firstEpochBlock,
41 distribute: 0
42 });
43 }
44
45 struct Claim {
46 uint deposit;
47 uint gons;
48 uint expiry;
49 bool lock; // prevents malicious delays
50 }
51 mapping( address => Claim ) public warmupInfo;
52
53 /**
54 @notice stake OHM to enter warmup
55 @param _amount uint
56 @return bool
57 */
58 function stake( uint _amount, address _recipient ) external returns ( bool ) {
59 rebase();
60
61 IERC20( OHM ).safeTransferFrom( msg.sender, address(this), _amount );
62
63 Claim memory info = warmupInfo[ _recipient ];
64 require( !info.lock, "Deposits for account are locked" );
65
66 warmupInfo[ _recipient ] = Claim ({
67 deposit: info.deposit.add( _amount ),
68 gons: info.gons.add( IsOHM( sOHM ).gonsForBalance( _amount ) ),
69 expiry: epoch.number.add( warmupPeriod ),
70 lock: false
71 });
72
73 IERC20( sOHM ).safeTransfer( warmupContract, _amount );
74 return true;
75 }
76
77 /**
78 @notice retrieve sOHM from warmup
79 @param _recipient address
80 */
81 function claim ( address _recipient ) public {
82 Claim memory info = warmupInfo[ _recipient ];
83 if ( epoch.number >= info.expiry && info.expiry != 0 ) {
84 delete warmupInfo[ _recipient ];
85 IWarmup( warmupContract ).retrieve( _recipient, IsOHM( sOHM ).balanceForGons( info.gons ) );
86 }
87 }
88
89 /**
90 @notice forfeit sOHM in warmup and retrieve OHM
91 */
92 function forfeit() external {
93 Claim memory info = warmupInfo[ msg.sender ];
94 delete warmupInfo[ msg.sender ];
95
96 IWarmup( warmupContract ).retrieve( address(this), IsOHM( sOHM ).balanceForGons( info.gons ) );
97 IERC20( OHM ).safeTransfer( msg.sender, info.deposit );
98 }
99
100 /**
101 @notice prevent new deposits to address (protection from malicious activity)
102 */
103 function toggleDepositLock() external {
104 warmupInfo[ msg.sender ].lock = !warmupInfo[ msg.sender ].lock;
105 }
106
107 /**
108 @notice redeem sOHM for OHM
109 @param _amount uint
110 @param _trigger bool
111 */
112 function unstake( uint _amount, bool _trigger ) external {
113 if ( _trigger ) {
114 rebase();
115 }
116 IERC20( sOHM ).safeTransferFrom( msg.sender, address(this), _amount );
117 IERC20( OHM ).safeTransfer( msg.sender, _amount );
118 }
119
120 /**
121 @notice returns the sOHM index, which tracks rebase growth
122 @return uint
123 */
124 function index() public view returns ( uint ) {
125 return IsOHM( sOHM ).index();
126 }
127
128 /**
129 @notice trigger rebase if epoch over
130 */
131 function rebase() public {
132 if( epoch.endBlock <= block.number ) {
133
134 IsOHM( sOHM ).rebase( epoch.distribute, epoch.number );
135
136 epoch.endBlock = epoch.endBlock.add( epoch.length );
137 epoch.number++;
138
139 if ( distributor != address(0) ) {
140 IDistributor( distributor ).distribute();
141 }
142
143 uint balance = contractBalance();
144 uint staked = IsOHM( sOHM ).circulatingSupply();
145
146 if( balance <= staked ) {
147 epoch.distribute = 0;
148 } else {
149 epoch.distribute = balance.sub( staked );
150 }
151 }
152 }
153
154 /**
155 @notice returns contract OHM holdings, including bonuses provided
156 @return uint
157 */
158 function contractBalance() public view returns ( uint ) {
159 return IERC20( OHM ).balanceOf( address(this) ).add( totalBonus );
160 }
161
162 /*
163 @notice provide bonus to locked staking contract
164 @param _amount uint
165 */
166 function giveLockBonus( uint _amount ) external {
167 require( msg.sender == locker );
168 totalBonus = totalBonus.add( _amount );
169 IERC20( sOHM ).safeTransfer( locker, _amount );
170 }
171
172 /*
173 @notice reclaim bonus from locked staking contract
174 @param _amount uint
175 */
Comments to Code: 2162 / 4142 = 52 %
Tests to Code: 758 / 4142 = 18 %