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/pickle-finance/contracts as indicated in the Appendix.
2. Is the code actively being used? (%)
Activity is 800 transactions a day on contract MasterChefV2, as indicated in the Appendix.
3. Is there a public software repository? (Y/N)
GitHub: https://github.com/pickle-finance.
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 255 commits and 25 branches, this is a very healthy 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 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)
Basic capability and requirements are documented at https://docs.pickle.finance/farms/farms. This document mentions some basic functions, but does not describe them fully.
8. Does the software function documentation fully (100%) cover the deployed contracts? (%)
Only top level requirements are documented at https://docs.pickle.finance/farms/farms so a 20% overall score is given.
9. Are there sufficiently detailed comments for all functions within the deployed contract code (%)
While the CtC is 28%, reading MasterChef shows excellent quality. Score adapted to 75%
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 (%)
Some traceability in https://docs.pickle.finance/jars/strategies, but not much traceability anywhere else.
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) (%)
No code coverage tests or reports found in their repo, but there are clearly a robust set of tests.
13. Scripts and instructions to run the tests? (Y/N)
Scripts and instructions to run tests can be found at https://github.com/pickle-finance/protocol.
14. Report of the results (%)
There are no apparent test reports in their software repository.
15. Formal Verification test done (%)
No evidence of a formal verification for Pickle Finance.
16. Stress Testing environment (%)
I could not find any test-net smart contract addresses.
This section looks at the 3rd party software audits done. It is explained in this document.
17. Did 3rd Party audits take place? (%)
Pickle was audited four times before and after launch.
18. Is the bug bounty acceptable high? (%)
Bug Bounty program found at https://github.com/pickle-finance/protocol/blob/master/SECURITY.md#bug-bounty-program. Rewards go up to 50k USD.
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 (%)
20. Is the information clear and complete (%)
21. Is the information in non-technical terms that pertain to the investments (%)
It's basically written in code, and code commenting, as they link their MasterChef contract for a description of admin control capabilities.
22. Is there Pause Control documentation including records of tests (%)
No Pause Control documentation or test were found.
1pragma solidity 0.6.7;
2
3import "../lib/enumerableSet.sol";
4import "../lib/safe-math.sol";
5import "../lib/erc20.sol";
6import "../lib/ownable.sol";
7import "./pickle-token.sol";
8
9// MasterChef was the master of pickle. He now governs over PICKLES. He can make Pickles and he is a fair guy.
10//
11// Note that it's ownable and the owner wields tremendous power. The ownership
12// will be transferred to a governance smart contract once PICKLES is sufficiently
13// distributed and the community can show to govern itself.
14//
15// Have fun reading it. Hopefully it's bug-free. God bless.
16contract MasterChef is Ownable {
17 using SafeMath for uint256;
18 using SafeERC20 for IERC20;
19
20 // Info of each user.
21 struct UserInfo {
22 uint256 amount; // How many LP tokens the user has provided.
23 uint256 rewardDebt; // Reward debt. See explanation below.
24 //
25 // We do some fancy math here. Basically, any point in time, the amount of PICKLEs
26 // entitled to a user but is pending to be distributed is:
27 //
28 // pending reward = (user.amount * pool.accPicklePerShare) - user.rewardDebt
29 //
30 // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
31 // 1. The pool's `accPicklePerShare` (and `lastRewardBlock`) gets updated.
32 // 2. User receives the pending reward sent to his/her address.
33 / 3. User's `amount` gets updated.
34 / 4. User's `rewardDebt` gets updated.
35 }
36
37 // Info of each pool.
38 struct PoolInfo {
39 IERC20 lpToken; // Address of LP token contract.
40 uint256 allocPoint; // How many allocation points assigned to this pool. PICKLEs to distribute per block.
41 uint256 lastRewardBlock; // Last block number that PICKLEs distribution occurs.
42 uint256 accPicklePerShare; // Accumulated PICKLEs per share, times 1e12. See below.
43 }
44
45 // The PICKLE TOKEN!
46 PickleToken public pickle;
47 // Dev fund (2%, initially)
48 uint256 public devFundDivRate = 50;
49 // Dev address.
50 address public devaddr;
51 // Block number when bonus PICKLE period ends.
52 uint256 public bonusEndBlock;
53 // PICKLE tokens created per block.
54 uint256 public picklePerBlock;
55 // Bonus muliplier for early pickle makers.
56 uint256 public constant BONUS_MULTIPLIER = 10;
57
58 // Info of each pool.
59 PoolInfo[] public poolInfo;
60 // Info of each user that stakes LP tokens.
61 mapping(uint256 => mapping(address => UserInfo)) public userInfo;
62 // Total allocation points. Must be the sum of all allocation points in all pools.
63 uint256 public totalAllocPoint = 0;
64 // The block number when PICKLE mining starts.
65 uint256 public startBlock;
66
67 // Events
68 event Recovered(address token, uint256 amount);
69 event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
70 event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
71 event EmergencyWithdraw(
72 address indexed user,
73 uint256 indexed pid,
74 uint256 amount
75 );
76
77 constructor(
78 PickleToken _pickle,
79 address _devaddr,
80 uint256 _picklePerBlock,
81 uint256 _startBlock,
82 uint256 _bonusEndBlock
83 ) public {
84 pickle = _pickle;
85 devaddr = _devaddr;
86 picklePerBlock = _picklePerBlock;
87 bonusEndBlock = _bonusEndBlock;
88 startBlock = _startBlock;
89 }
Comments to Code: 1919 / 6933 = 28 %
Tests to Code: 6260 / 6933 = 90 %