logo
bg_imgbg_imgbg_imgbg_img
exclamation mark iconReport an issue

If you notice some outdated information please let us know!

close icon
Name
Email
Your message
arrow-left

ProtoFi

76%

Process Quality Review (0.8)

ProtoFi

Final score:76%
Date:15 Aug 2022
Audit Process:version 0.8
Author:Ryoma
PQR Score:76%

PASS

Scoring Appendix

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.

The blockchain used by this protocol
Fantom
#QuestionAnswer
89%
1.100%
2.100%
3.Yes
4.0%
5.100
94%
6.Yes
7.Yes
8.100%
9.60%
0%
10.0%
11.0%
12.No
13.0%
14.No
15.No
78%
16.90%
17.0%
97%
18.100%
19.100%
20.100%
21.100%
22.100%
23.80%
24.100%
25.100%
100%
26.100
27.Yes
28.Yes
Total:76%

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.

  • Here is my smart contract on the blockchain
  • You can see it matches a software repository used to develop the code
  • Here is the documentation that explains what my smart contract does
  • Here are the tests I ran to verify my smart contract
  • Here are the audit(s) performed to review my code by third party experts

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.

Smart Contracts & Team

89%

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? (%)

Answer: 100%

Protofi's smart contracts can be found on TheOtherCrypto's (ProtoFi's main crypto developper) fantom-contract repository, linked in their Documentation.

Percentage Score Guidance:
100%
Clearly labelled and on website, documents or repository, quick to find
70%
Clearly labelled and on website, docs or repo but takes a bit of looking
40%
Addresses in mainnet.json, in discord or sub graph, etc
20%
Address found but labeling not clear or easy to find
0%
Executing addresses could not be found

2. How active is the primary contract? (%)

Answer: 100%

The protocol's ProtofiMasterChef and ProtofiRouter contracts log in well over 100s of Fantom transactions a day. Supporting documents can be found in the appendix.

Percentage Score Guidance:
100%
More than 10 transactions a day
70%
More than 10 transactions a week
40%
More than 10 transactions a month
10%
Less than 10 transactions a month
0%
No activity

3. Does the protocol have a public software repository? (Y/N)

Answer: Yes

While ProtoFi does not have an official public software repository under its name, TheOtherCrypto (Protofi's main crypto developper)'s repositories are linked to the protocol's documentation and therefore earns a Yes to this question.

Score Guidance:
Yes
There is 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.
No
For teams with private repositories.

4. Is there a development history visible? (%)

Answer: 0%

3 out of the 5 repositories are forked from other source codes and the repositories related to ProtoFi's contracts have 1 branch and less than 30 commits each, demonstrating poor development activity and resulting in a score of 0.

Percentage Score Guidance:
100%
Any one of 100+ commits, 10+branches
70%
Any one of 70+ commits, 7+branches
50%
Any one of 50+ commits, 5+branches
30%
Any one of 30+ commits, 3+branches
0%
Less than 2 branches or less than 30 commits

5. Is the team public (not anonymous)?

Answer: 100

ProtoFi displays their team within their documentation on the Team page.

Score Guidance:
100%
At least two names can be easily found in the protocol's website, documentation or medium. These are then confirmed by the personal websites of the individuals / their linkedin / twitter.
50%
At least one public name can be found to be working on the protocol.
0%
No public team members could be found.

Documentation

94%

This section looks at the software documentation. The document explaining these questions is here.

6. Is there a whitepaper? (Y/N)

Answer: Yes

You can access their documentation here.

7. Is the protocol's software architecture documented? (Y/N)

Answer: Yes

Software architecture in and of itself is not documented. The GitHub repositories show limited information but the tokenomics, smart contract management and token utility are explained via written content on their Tokenomics page and their [Medium] posts(https://medium.com/@protofi.app/defis-new-beginning-2040a017fb29), which gives ProtoFi an electrifying Yes to the question.

Score Guidance:
Yes
The documents identify software architecture and contract interaction through any of the following: diagrams, arrows, specific reference to software functions or a written explanation on how smart contracts interact.
No
Protocols receive a "no" if none of these are included.

8. Does the software documentation fully cover the deployed contracts' source code? (%)

Answer: 100%

There is 100% coverage of all contracts and functions by cross-referencing the code in GitHub and the contact addresses in their documentation.

Percentage Score Guidance:
100%
All contracts and functions documented
80%
Only the major functions documented
79 - 1%
Estimate of the level of software documentation
0%
No software documentation

9. Is it possible to trace the documented software to its implementation in the protocol's source code? (%)

Answer: 60%

While the addresses and code can be traced non explicitly, a direct link from the addresses to the source code would make it clear and easier to look up. For that matter, ProtoFi earns a 60% on this question.

Percentage Score Guidance:
100%
Clear explicit traceability between code and documentation at a requirement level for all code
60%
Clear association between code and documents via non explicit traceability
40%
Documentation lists all the functions and describes their functions
0%
No connection between documentation and code

Testing

0%

10. Has the protocol tested their deployed code? (%)

Answer: 0%

There are no tests reported on ProtoFi's code.

Percentage Score Guidance:
100%
TtC > 120% Both unit and system test visible
80%
TtC > 80% Both unit and system test visible
40%
TtC < 80% Some tests visible
0%
No tests obvious

11. How covered is the protocol's code? (%)

Answer: 0%

As there are no visible code testing, this question is also a 0.

Percentage Score Guidance:
100%
Documented full coverage
99 - 51%
Value of test coverage from documented results
50%
No indication of code coverage but clearly there is a complete set of tests
30%
Some tests evident but not complete
0%
No test for coverage seen

12. Does the protocol provide scripts and instructions to run their tests? (Y/N)

Answer: No

There are no clear indication of scripts and instructions on ProtoFi's code testing.

Score Guidance:
Yes
Scripts and/or instructions to run tests are available in the testing suite
No
Scripts and/or instructions to run tests are not available in the testing suite

13. Is there a detailed report of the protocol's test results?(%)

Answer: 0%

As there are no visible signs of testing documentation in the GitHub or in the documentation, this question will also be a 0 for ProtoFi.

Percentage Score Guidance:
100%
Detailed test report as described below
70%
GitHub code coverage report visible
0%
No test report evident

14. Has the protocol undergone Formal Verification? (Y/N)

Answer: No

ProtoFi has not undergone Formal Verification.

Score Guidance:
Yes
Formal Verification was performed and the report is readily available
No
Formal Verification was not performed and/or the report is not readily available.

15. Were the smart contracts deployed to a testnet? (Y/N)

Answer: No

Because ProtoFi has not documented any testing and has not provided testnet smart contract addresses in their documentation, ProtoFi is assigned a "No" for this question.

Score Guidance:
Yes
Protocol has proved their tesnet usage by providing the addresses
No
Protocol has not proved their testnet usage by providing the addresses

Security

78%

This section looks at the 3rd party software audits done. It is explained in this document.

16. Is the protocol sufficiently audited? (%)

Answer: 90%

ProtoFi has been audited pre-deployment by CertiK. While the protocol has been reviewed by RugDoc, we do not consider a review as an audit and therefore, ProtoFi earns a 90 on this one.

Percentage Score Guidance:
100%
Multiple Audits performed before deployment and the audit findings are public and implemented or not required
90%
Single audit performed before deployment and audit findings are public and implemented or not required
70%
Audit(s) performed after deployment and no changes required. The Audit report is public.
65%
Code is forked from an already audited protocol and a changelog is provided explaining why forked code was used and what changes were made. This changelog must justify why the changes made do not affect the audit.
50%
Audit(s) performed after deployment and changes are needed but not implemented.
30%
Audit(s) performed are low-quality and do not indicate proper due diligence.
20%
No audit performed
0%
Audit Performed after deployment, existence is public, report is not public OR smart contract address' not found.
Deduct 25% if the audited code is not available for comparison.

17. Is the bounty value acceptably high (%)

Answer: 0%

There are no clear indication of a bug bounty program for the protocol on Immunefi nor on the website and the documentation.

Percentage Score Guidance:
100%
Bounty is 10% TVL or at least $1M AND active program (see below)
90%
Bounty is 5% TVL or at least 500k AND active program
80%
Bounty is 5% TVL or at least 500k
70%
Bounty is 100k or over AND active program
60%
Bounty is 100k or over
50%
Bounty is 50k or over AND active program
40%
Bounty is 50k or over
20%
Bug bounty program bounty is less than 50k
0%
No bug bounty program offered / the bug bounty program is dead
An active program means that a third party (such as Immunefi) is actively driving hackers to the site. An inactive program would be static mentions on the docs.

Admin Controls

97%

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?

Answer: 100%

Admin controls are clearly stated within the protocol's Contract page.  

Percentage Score Guidance:
100%
Admin Controls are clearly labelled and on website, docs or repo, quick to find
70%
Admin Controls are clearly labelled and on website, docs or repo but takes a bit of looking
40%
Admin Control docs are in multiple places and not well labelled
20%
Admin Control docs are in multiple places and not labelled
0%
Admin Control information could not be found

19. Are relevant contracts clearly labelled as upgradeable or immutable? (%)

Answer: 100%

ProtoFi displays that their smart contracts are immutable within their Investor Protection Logic page.

Percentage Score Guidance:
100%
Both the contract documentation and the smart contract code state that the code is not upgradeable or immutable.
80%
All Contracts are clearly labelled as upgradeable (or not)
50%
Code is immutable but not mentioned anywhere in the documentation
0%
Admin control information could not be found

20. Is the type of smart contract ownership clearly indicated? (%)

Answer: 100%

The ownership can be found directly within the contracts and addresses page.

Percentage Score Guidance:
100%
The type of ownership is clearly indicated in their documentation. (OnlyOwner / MultiSig / etc)
50%
The type of ownership is indicated, but only in the code. (OnlyOwner / MultiSig / etc)
0%
Admin Control information could not be found

21. Are the protocol's smart contract change capabilities described? (%)

Answer: 100%

ProtoFi describes all the change capabilities that can be made by the owner of the contract in their contracts page.

Percentage Score Guidance:
100%
The documentation covers the capabilities for change for all smart contracts
50%
The documentation covers the capabilities for change in some, but not all contracts
0%
The documentation does not cover the capabilities for change in any contract

22. Is the protocol's admin control information easy to understand? (%)

Answer: 100%

Admin control is directly displayed within the contract docs of the protocol.

Percentage Score Guidance:
100%
All the contracts are immutable
90%
Description relates to investments safety in clear non-software language
30%
Description all in software-specific language
0%
No admin control information could be found

23. Is there sufficient Pause Control documentation? (%)

Answer: 80%

Protofi describes their Pause Control documentation within their Pause controls segment. No evidence of testing yet.

Percentage Score Guidance:
100%
If immutable and no changes possible
100%
If admin control is fully via governance
80%
Robust transaction signing process (7 or more elements)
70%
Adequate transaction signing process (5 or more elements)
60%
Weak transaction signing process (3 or more elements)
0%
No transaction signing process evident
Evidence of audits of signers following the process add 20%

24. Is there sufficient Timelock documentation? (%)

Answer: 100%

ProtoFi explains why the protocol does not need a timelock in its Investor Protection Logic page. This earns the protocol 100%.

Percentage Score Guidance:
100%
Documentation identifies and explains why the protocol does not need a Timelock OR Timelock documentation identifies its duration, which contracts it applies to and justifies this time period.
60%
A Timelock is identified and its duration is specified
30%
A Timelock is identified
0%
No Timelock information was documented

25. Is the Timelock of an adequate length? (Y/N)

Answer: 100%

ProtoFi explains why the protocol does not need a timelock in its Investor Protection Logic page. This earns the protocol 100%.

Percentage Score Guidance:
100%
Timelock is between 48 hours to 1 week OR justification as to why no Timelock is needed / is outside this length.
50%
Timelock is less than 48 hours or greater than 1 week.
0%
No Timelock information was documented OR no timelock length was identified.

Oracles

100%

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? (%)

Answer: 100

ProtoFi explains why they do not use an Oracle and how they are not affected by oracle-based risks.

Score Guidance:
100%
If it uses one, the Oracle is specified. The contracts dependent on the oracle are identified. Basic software functions are identified (if the protocol provides its own price feed data). Timeframe of price feeds are identified. OR The reason as to why the protocol does not use an Oracle is identified and explained.
75%
The Oracle documentation identifies both source and timeframe, but does not provide additional context regarding smart contracts.
50%
Only the Oracle source is identified.
0%
No oracle is named / no oracle information is documented.

27. Is front running mitigated by this protocol? (Y/N)

Answer: Yes

Front running is mitigated by ProtoFi's ChronoLock feature, preventing bot arbitrage and PROTO pool manipulation here.

Score Guidance:
Yes
The protocol cannot be front run and there is an explanation as to why OR documented front running countermeasures are implemented.
No
The Oracle documentation identifies both source and timeframe, but does not provide additional context regarding smart contracts.

28. Can flashloan attacks be applied to the protocol, and if so, are those flashloan attack risks mitigated? (Y/N)

Answer: Yes

ProtoFi uses their ProtoShield system to cap the number of tokens transferrable per transaction; there are also transaction fees related to each transaction.

Score Guidance:
Yes
The protocol's documentation includes information on how they mitigate the possibilities and extents of flash loan attacks.
No
The protocol's documentation does not include any information regarding the mitigation of flash loan attacks.

Appendices

1// SPDX-License-Identifier: MIT
2pragma solidity >= 0.6.12;
3
4import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
5import "@openzeppelin/contracts/math/SafeMath.sol";
6import "@openzeppelin/contracts/access/Ownable.sol";
7import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
8
9
10/**
11This is the MoneyPot contract.
12It will be used to distribute shares rewards to ELCTs stakers.
13This is owned by the team, and the team will be able to set start and end blocks to distribute
14daily or weekly rewards to ELCTs stakers.
15Owner --> TBD, it should be activated daily, do we need a timelock?
16Modified from Pancake SmartChef contract (https://bscscan.com/address/0xABFd8d1942628124aB971937154f826Bce86DcbC#code)
17 */
18contract MoneyPot is Ownable, ReentrancyGuard {
19    using SafeMath for uint256;
20    using SafeERC20 for IERC20;
21
22    // Info of each user.
23    struct UserInfo {
24        uint256 amount;     // How many LP tokens the user has provided.
25        uint256 rewardDebt; // Reward debt. See explanation below.
26    }
27
28    // Info of each pool.
29    struct PoolInfo {
30        IERC20 stakeToken;           // Address of LP token contract.
31        uint256 allocPoint;       // How many allocation points assigned to this pool.
32        uint256 lastRewardBlock;  // Last block number that reward distribution occurs.
33        uint256 accRewardPerShare; // Accumulated reward per share, times 1e12. See below.
34    }
35
36    // Token to stake
37    IERC20 public stakingToken;
38    // Token used as reward
39    IERC20 public rewardToken;
40
41    // Reward token given per block
42    uint256 public rewardPerBlock;
43
44    // Info of each pool.
45    PoolInfo[] public poolInfo;
46    // Info of each user that stakes LP tokens.
47    mapping (address => UserInfo) public userInfo;
48    // Total allocation points. Must be the sum of all allocation points in all pools.
49    uint256 private totalAllocPoint = 0;
50    // The block number when reward mining starts.
51    uint256 public startBlock;
52    // The block number when reward mining ends.
53    uint256 public bonusEndBlock;
54
55    event Deposit(address indexed user, uint256 amount);
56    event Withdraw(address indexed user, uint256 amount);
57    event EmergencyWithdraw(address indexed user, uint256 amount);
58    event StopReward(uint256 blockNumber);
59
60    constructor(
61        IERC20 _stakingToken,
62        IERC20 _rewardToken,
63        uint256 _rewardPerBlock,
64        uint256 _startBlock,
65        uint256 _bonusEndBlock
66    ) public {
67        stakingToken = _stakingToken;
68        rewardToken = _rewardToken;
69        rewardPerBlock = _rewardPerBlock;
70        startBlock = _startBlock;
71        bonusEndBlock = _bonusEndBlock;
72
73        // staking pool
74        poolInfo.push(PoolInfo({
75            stakeToken: _stakingToken,
76            allocPoint: 1000, // Max allocation to this single pool
77            lastRewardBlock: startBlock,
78            accRewardPerShare: 0
79        }));
80        totalAllocPoint = 1000;
81    }
82
83    // Can be used for emergency to instantly stop rewards
84    function stopReward() public onlyOwner {
85        bonusEndBlock = block.number;
86        emit StopReward(block.number);
87    }
88
89    // Return reward multiplier over the given _from to _to block.
90    function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) {
91        if (_to <= bonusEndBlock) {
92            return _to.sub(_from);
93        } else if (_from >= bonusEndBlock) {
94            return 0;
95        } else {
96            return bonusEndBlock.sub(_from);
97        }
98    }
99
100    // View function to see pending Reward on frontend.
101    function pendingReward(address _user) external view returns (uint256) {
102        PoolInfo storage pool = poolInfo[0];
103        UserInfo storage user = userInfo[_user];
104        uint256 accRewardPerShare = pool.accRewardPerShare;
105        uint256 stokenSupply = pool.stakeToken.balanceOf(address(this));
106        if (block.number > pool.lastRewardBlock && stokenSupply != 0) {
107            uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
108            uint256 tokenReward = multiplier.mul(rewardPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
109            accRewardPerShare = accRewardPerShare.add(tokenReward.mul(1e12).div(stokenSupply));
110        }
111        return user.amount.mul(accRewardPerShare).div(1e12).sub(user.rewardDebt);
112    }
113
114    // Update reward variables of the given pool to be up-to-date.
115    function updatePool(uint256 _pid) public {
116        PoolInfo storage pool = poolInfo[_pid];
117        if (block.number <= pool.lastRewardBlock) {
118            return;
119        }
120        uint256 stokenSupply = pool.stakeToken.balanceOf(address(this));
121        if (stokenSupply == 0) {
122            pool.lastRewardBlock = block.number;
123            return;
124        }
125        uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
126        uint256 tokenReward = multiplier.mul(rewardPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
127        pool.accRewardPerShare = pool.accRewardPerShare.add(tokenReward.mul(1e12).div(stokenSupply));
128        pool.lastRewardBlock = block.number;
129    }
130
131    // Update reward variables for all pools. Be careful of gas spending!
132    function massUpdatePools() public {
133        uint256 length = poolInfo.length;
134        for (uint256 pid = 0; pid < length; ++pid) {
135            updatePool(pid);
136        }
137    }
138
139
140    // Stake staking tokens to moneypot
141    function deposit(uint256 _amount) public nonReentrant {
142        PoolInfo storage pool = poolInfo[0];
143        UserInfo storage user = userInfo[msg.sender];
144
145        updatePool(0);
146        if (user.amount > 0) {
147            uint256 pending = user.amount.mul(pool.accRewardPerShare).div(1e12).sub(user.rewardDebt);
148            if(pending > 0) {
149                rewardToken.safeTransfer(address(msg.sender), pending);
150            }
151        }
152        if(_amount > 0) {
153            pool.stakeToken.safeTransferFrom(address(msg.sender), address(this), _amount);
154            user.amount = user.amount.add(_amount);
155        }
156        user.rewardDebt = user.amount.mul(pool.accRewardPerShare).div(1e12);
157
158        emit Deposit(msg.sender, _amount);
159    }
160
161
162    /**
163    Sets the startBlock and bonusEndBlock for the moneypot, making it easy to update
164    the blocks distribute new rewards later in time. Resets also the lastRewardBlock.
165     */
166    function setBlocksBoundaries(uint256 _startBlock, uint256 _endBlock) public onlyOwner {
167        PoolInfo storage pool = poolInfo[0];
168
169        require(pool.lastRewardBlock <= _startBlock, "set: startBlock should be >= to the previous one");
170        require(bonusEndBlock <= _endBlock, "set: endBlock should be >= to the previous one");
171        require(_startBlock <= _endBlock, "set: _startBlock should be >= to endBlock");
172
173        updatePool(0);
174
175        pool.lastRewardBlock = _startBlock;
176        startBlock = _startBlock;
177        bonusEndBlock = _endBlock;
178    }
179
180    // Withdraw stake tokens from STAKING.
181    function withdraw(uint256 _amount) public nonReentrant {
182        PoolInfo storage pool = poolInfo[0];
183        UserInfo storage user = userInfo[msg.sender];
184        require(user.amount >= _amount, "withdraw: not good");
185        updatePool(0);
186        uint256 pending = user.amount.mul(pool.accRewardPerShare).div(1e12).sub(user.rewardDebt);
187        if(pending > 0) {
188            rewardToken.safeTransfer(address(msg.sender), pending);
189        }
190        if(_amount > 0) {
191            user.amount = user.amount.sub(_amount);
192            pool.stakeToken.safeTransfer(address(msg.sender), _amount);
193        }
194        user.rewardDebt = user.amount.mul(pool.accRewardPerShare).div(1e12);
195
196        emit Withdraw(msg.sender, _amount);
197    }
198
199    // Withdraw without caring about rewards. EMERGENCY ONLY.
200    function emergencyWithdraw() public nonReentrant {
201        PoolInfo storage pool = poolInfo[0];
202        UserInfo storage user = userInfo[msg.sender];
203        pool.stakeToken.safeTransfer(address(msg.sender), user.amount);
204        user.amount = 0;
205        user.rewardDebt = 0;
206        emit EmergencyWithdraw(msg.sender, user.amount);
207    }
208
209    // Withdraw reward. EMERGENCY ONLY.
210    function emergencyRewardWithdraw(uint256 _amount) public onlyOwner {
211        require(_amount < rewardToken.balanceOf(address(this)), 'not enough token');
212        rewardToken.safeTransfer(address(msg.sender), _amount);
213    }
214
215}

JavaScript Tests

Language
Files
Lines
Blanks
Comments
Testing Code
Deployed Code
Complexity
Enter language here
0
0
0
0
0
2048
0

Tests to Code: 0 / 2048 = 0 %