Summary
The codebase employs two distinct implementations of ERC20, leading to inconsistencies and exposing potential future risks.
Vulnerability Details
Following ERC20 contracts are used in FjordPoints
and FjordStaking
:
pragma solidity =0.8.21;
> import { ERC20 } from "lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";
import { ERC20Burnable } from
"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import { SafeMath } from "lib/openzeppelin-contracts/contracts/utils/math/SafeMath.sol";
import { IFjordPoints } from "./interfaces/IFjordPoints.sol";
* @title FjordPoints
* @dev ERC20 token to represent points distributed based on locked tokens in Staking contract.
*/
contract FjordPoints is ERC20, ERC20Burnable, IFjordPoints {
using SafeMath for uint256;
...
pragma solidity =0.8.21;
> import { ERC20 } from "solmate/tokens/ERC20.sol";
import { SafeTransferLib } from "solmate/utils/SafeTransferLib.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import { ISablierV2Lockup } from "lib/v2-core/src/interfaces/ISablierV2LockupLinear.sol";
import { ISablierV2LockupRecipient } from
"lib/v2-core/src/interfaces/hooks/ISablierV2LockupRecipient.sol";
import { IFjordPoints } from "./interfaces/IFjordPoints.sol";
...
contract FjordStaking is ISablierV2LockupRecipient {
...
Impact
While not posing an immediate threat according to the code implemented at the time of this audit, the issue could lead to future problems.
Tools Used
Manual Review
Recommendations
Select a single ERC20 implementation and apply it consistently across your project. Remove the unused ERC20 import and update all references to align with the chosen implementation.