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

The staking contract address is not set in the FjordPoints::constructor function

Vulnerability Details

The staking contract address is not set in the FjordPoints::constructor function:

/* FjordPoints::constructor function */
constructor() ERC20("BjordBoint", "BJB") {
owner = msg.sender;
lastDistribution = block.timestamp;
pointsPerEpoch = 100 ether;
}

Impact

The FjordStaking contract cannot call the FjordPoints::onStaked and FjordPoints::onUnstaked functions. As a result, the contract owner needs to call the FjordPoints::setStakingContract function to set the staking contract address.

Recommendations

Update the FjordPoints::constructor function:

/* FjordPoints::constructor function */
- constructor() ERC20("BjordBoint", "BJB") {
+ constructor(address _staking) ERC20("BjordBoint", "BJB") {
owner = msg.sender;
lastDistribution = block.timestamp;
pointsPerEpoch = 100 ether;
+ staking = _staking;
}
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.