If you notice some outdated information please let us know!
-15%(Penalty)
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 relevant chain that gets reviewed and its corresponding software repository. The document explaining these questions is here.
1. Are the smart contract addresses easy to find? (%)
2. How active is the primary contract? (%)
3. Does the protocol have a public software repository? (Y/N)
Velodrome uses Github.
4. Is there a development history visible? (%)
With 1 commit and 1 branch, Velodrome's main software repository is unmaintained.
5. Is the team public (not anonymous)?
Public team members were found on Velodrome's LinkedIn page.
This section looks at the software documentation. The document explaining these questions is here.
6. Is there a whitepaper? (Y/N)
Location: https://docs.velodrome.finance/protocol
7. Is the protocol's software architecture documented? (Y/N)
While the major changes to Solidly's forked code are described on this page, this does not constitute in-depth software documentation. At the very least, Velodrome should publish developer documentation. Also, considering how Solidly also suffers from the same lack of software docs, both protocols have a fundamental lack of detail pertaining to function and architecture.
8. Does the software documentation fully cover the deployed contracts' source code? (%)
There is virtually no software documentation available. Velodrome is in dire need of developer docs.
9. Is it possible to trace the documented software to its implementation in the protocol's source code? (%)
While Velodrome certainly does not offer in-depth software documentation, there nonetheless is a relation between the docs and the source code.
10. Has the protocol tested their deployed code? (%)
At 81% Test to Code (see Appendix), Velodrome has a decent testing suite.
11. How covered is the protocol's code? (%)
While a code coverage report is unavailable, Velodrome does have an extensive set of tests.
12. Does the protocol provide scripts and instructions to run their tests? (Y/N)
Scripts can be found here.
13. Is there a detailed report of the protocol's test results?(%)
No in-depth test report is provided by the Velodrome team. DeFiSafety would love to see Velodrome pollinate their GitHub test runs.
14. Has the protocol undergone Formal Verification? (Y/N)
Velodrome has not undergone formal verification.
15. Were the smart contracts deployed to a testnet? (Y/N)
Velodrome's testnet deployments can be found here.
This section looks at the 3rd party software audits done. It is explained in this document.
16. Is the protocol sufficiently audited? (%)
Velodrome is forked from Solidly, an audited protocol. Velodrome provides an adequate changelog, and these additions were audited during the protocol's C4 contest. This audit contest was performed before Velodrome's launch, and the team has dutifully implemented any fix recommendations that arose through the auditing. In addition, while informal, Velodrome did perform MythX runs on all their key smart contracts before deployment. Combined with their pre-launch audit contest and the pre-existing Solidly audit, we think this team deserves 100% here.
17. Is the bounty value acceptably high (%)
Velodrome offered an bug bounty of $75K via code arena. It is since dead and no funds are now offered. Same thing for the Immunefi program they once had. Meaning, Velodrome does not currently have an active bug bounty program. As it stands, Velodrome offers a static bug bounty program [on their GitHub](.
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.
18. Is the protocol's admin control information easy to find?
The contracts are clearly stated as being immutable here.
19. Are relevant contracts clearly labelled as upgradeable or immutable? (%)
All contracts were declared as fundamentally immutable, meaning that the underlying logic cannot be altered.
20. Is the type of smart contract ownership clearly indicated? (%)
While the existence of a MultiSig and on-chain governor is detailed here, there isn't really much information regarding their roles in the protocol as a whole. As such, smart contract ownership is sort of defined but not elaborated upon. Nonetheless, by examining the code, we were able to deduce that Velodrome does utilize this 3/7 MultiSig address on-chain. Therefore, half the points will be awarded here.
21. Are the protocol's smart contract change capabilities described? (%)
Since the Velodrome smart contracts are immutable, it is inferred that no change to smart contract logic is possible. What little change is possible in whitelisting or emissions is adequately mentioned by Velodrome.
22. Is the protocol's admin control information easy to understand? (%)
All contracts are stated as being immutable - see question 19.
23. Is there sufficient Pause Control documentation? (%)
Most of the protocol is completely unpausable due to the smart contracts being immutable. However, there's a brief mention of killable gauges owned by Veldrome's "Commissaire", but there is no information relating to powers. Additionally, the team has stated that swapping is pausable via pairFactory, but that this only pauses pair swapping and not deposits/withdraws. This is then well within scope of their AMM structure.
24. Is there sufficient Timelock documentation? (%)
Because most of the protocol is not upgradeable, timelocks are not necessary here.
25. Is the Timelock of an adequate length? (Y/N)
Because most of the protocol is not upgradeable, timelocks are not necessary here.
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.
26. Is the protocol's Oracle sufficiently documented? (%)
No oracle information was documented. However, as an AMM Velodrome / Solidly doesn't need an oracle - it uses x*y>=k and other generic pool formulas.
27. Is front running mitigated by this protocol? (Y/N)
The Optimism blockchain's inherent lack of an open mempool is itself enough to mitigate any possibilities of frontrunning the Velodrome protocol.
28. Can flashloan attacks be applied to the protocol, and if so, are those flashloan attack risks mitigated? (Y/N)
Velodrome's documentation mentions that they use 30 mins TWAPs in order to mitigate against flash loan / liquidity attacks.
1contract Velo is IVelo {
2
3 string public constant name = "Velodrome";
4 string public constant symbol = "VELO";
5 uint8 public constant decimals = 18;
6 uint public totalSupply = 0;
7
8 mapping(address => uint) public balanceOf;
9 mapping(address => mapping(address => uint)) public allowance;
10
11 bool public initialMinted;
12 address public minter;
13 address public redemptionReceiver;
14 address public merkleClaim;
15
16 event Transfer(address indexed from, address indexed to, uint value);
17 event Approval(address indexed owner, address indexed spender, uint value);
18
19 constructor() {
20 minter = msg.sender;
21 _mint(msg.sender, 0);
22 }
23
24 // No checks as its meant to be once off to set minting rights to BaseV1 Minter
25 function setMinter(address _minter) external {
26 require(msg.sender == minter);
27 minter = _minter;
28 }
29
30 function setRedemptionReceiver(address _receiver) external {
31 require(msg.sender == minter);
32 redemptionReceiver = _receiver;
33 }
34
35 function setMerkleClaim(address _merkleClaim) external {
36 require(msg.sender == minter);
37 merkleClaim = _merkleClaim;
38 }
39
40 // Initial mint: total 82M
41 // 4M for "Genesis" pools
42 // 30M for liquid team allocation (40M excl init veNFT)
43 // 48M for future partners
44 function initialMint(address _recipient) external {
45 require(msg.sender == minter && !initialMinted);
46 initialMinted = true;
47 _mint(_recipient, 82 * 1e6 * 1e18);
48 }
49
50 function approve(address _spender, uint _value) external returns (bool) {
51 allowance[msg.sender][_spender] = _value;
52 emit Approval(msg.sender, _spender, _value);
53 return true;
54 }
55
56 function _mint(address _to, uint _amount) internal returns (bool) {
57 totalSupply += _amount;
58 unchecked {
59 balanceOf[_to] += _amount;
60 }
61 emit Transfer(address(0x0), _to, _amount);
62 return true;
63 }
64
65 function _transfer(address _from, address _to, uint _value) internal returns (bool) {
66 balanceOf[_from] -= _value;
67 unchecked {
68 balanceOf[_to] += _value;
69 }
70 emit Transfer(_from, _to, _value);
71 return true;
72 }
73
74 function transfer(address _to, uint _value) external returns (bool) {
75 return _transfer(msg.sender, _to, _value);
76 }
77
78 function transferFrom(address _from, address _to, uint _value) external returns (bool) {
79 uint allowed_from = allowance[_from][msg.sender];
80 if (allowed_from != type(uint).max) {
81 allowance[_from][msg.sender] -= _value;
82 }
83 return _transfer(_from, _to, _value);
84 }
85
86 function mint(address account, uint amount) external returns (bool) {
87 require(msg.sender == minter);
88 _mint(account, amount);
89 return true;
90 }
91
92 function claim(address account, uint amount) external returns (bool) {
93 require(msg.sender == redemptionReceiver || msg.sender == merkleClaim);
94 _mint(account, amount);
95 return true;
96 }
97}
Tests to Code: 3662 / 4668 = 78 %