This document is a security audit report performed by danbogd, where Frax-stake have been reviewed.
github commit hash 258285b1783fcc691cb9b1805af3a1ae461c5a22.
In total,7 issues were reported including:
- 4 low severity issues.
- 3 notes
No critical security issues were found.
The scope contracts used openzeppelin Ownable contract, derived from Context
where it should use _msgSender()
.
https://github.com/eepdev/frax-stake/blob/258285b1783fcc691cb9b1805af3a1ae461c5a22/Jar_FxsFraxMatic.sol#L12 https://github.com/eepdev/frax-stake/blob/258285b1783fcc691cb9b1805af3a1ae461c5a22/StrategyBase.sol#L9
We suggest to replace msg.sender
to _msgSender()
Lack of transaction handling mechanism issue. WARNING! This is a very common issue and it already caused millions of dollars losses for lots of token users! More details here.
Add the following code to the transfer() function:
require( recipient != address(this) );
There is no bugs now, but it is potentialy dangerous for the re-entrancy as some state change maybe added.
It is recommended to put transfers to the end of methods.
In method setJar()
should probably emit an event.
It is recommended to create new events.
The variable is assigned the value of the constructor input parameter. But this parameter is not checked before this. If the value turns out to be zero, then it will be necessary to redeploy the contract, since there is no other functionality to set this variable.
It is necessary to add a check of the input parameter to zero before initializing the variables.
In places where you used hardcode addresses you may use constants for save gas.
https://github.com/eepdev/frax-stake/blob/258285b1783fcc691cb9b1805af3a1ae461c5a22/StrategyBase.sol#L31 https://github.com/eepdev/frax-stake/blob/258285b1783fcc691cb9b1805af3a1ae461c5a22/StrategyFxsFrax.sol#L10-L12
Different pragma directives are used: 0.6.7, >= 0.6.0.
https://github.com/eepdev/frax-stake/blob/258285b1783fcc691cb9b1805af3a1ae461c5a22/Jar_FxsFraxMatic.sol#L3 https://github.com/eepdev/frax-stake/blob/258285b1783fcc691cb9b1805af3a1ae461c5a22/StrategyBase.sol#L1 https://github.com/eepdev/frax-stake/blob/258285b1783fcc691cb9b1805af3a1ae461c5a22/StrategyFxsFrax.sol#L2 https://github.com/eepdev/frax-stake/blob/258285b1783fcc691cb9b1805af3a1ae461c5a22/StrategyStakingRewardsBase.sol#L1
Use one Solidity version.
The review did not show any critical issues, some low severity issues and notes were found.