DeFiFoundry
20,000 USDC
View results
Submission Details
Severity: low
Invalid

`Constructor` of FjordPoints.sol doesn't set the `staking` contract address

Summary

Constructor of FjordPoints.sol doesn't set the staking contract address

Vulnerability Details

Constructor of FjordPoints.sol says to set staking contract & initializes the ERC20 token but it only initializes the ERC20 tokens

@dev Sets the staking contract address and initializes the ERC20 token

/**
* @dev Sets the staking contract address and initializes the ERC20 token.
*/
constructor() ERC20("BjordBoint", "BJB") {
owner = msg.sender;
lastDistribution = block.timestamp;
pointsPerEpoch = 100 ether;
}

Impact

onStake() & onUnStake() functions will revert as they are only called by staking contract

Tools Used

Manual Review

Recommendations

Set staking contract in contructor as said in natspecs

+ constructor(address stakingContract) ERC20("BjordBoint", "BJB") {
owner = msg.sender;
lastDistribution = block.timestamp;
pointsPerEpoch = 100 ether;
+ staking = stakingContract
}
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.