Liquid Staking

Stakelink
DeFiHardhatOracle
50,000 USDC
View results
Submission Details
Severity: low
Invalid

Incorrect Event Data Emission in `StakingPool::transferShares`

Summary

The StakingPool::transferShares function emits incorrect event data by recording the stake equivalent of the shares transferred, rather than the actual shares. This discrepancy can lead to misleading information in the logs, which can negatively affect users and systems that depend on the event data, such as analytics platforms.

Vulnerability Details

The StakingPool::transferShares function transfers shares from one user to another by invoking the internal function _transferShares. However, after the transfer occurs, the Transfer event emits the stake equivalent of the shares instead of the actual share amount. This inconsistency can create confusion for users and external systems that rely on the event logs for accurate tracking.

The relevant part of the function is as follows:

function _transferShares(address _sender, address _recipient, uint256 _sharesAmount) internal {
require(_sender != address(0), "Transfer from the zero address");
require(_recipient != address(0), "Transfer to the zero address");
require(shares[_sender] >= _sharesAmount, "Transfer amount exceeds balance");
shares[_sender] -= _sharesAmount;
shares[_recipient] += _sharesAmount;
emit Transfer(_sender, _recipient, getStakeByShares(_sharesAmount));
}

In this code, the Transfer event emits the result of getStakeByShares(_sharesAmount) instead of the actual _sharesAmount, leading to discrepancies in the data emitted.

Impact

This issue results in incorrect data being logged by the contract, which could mislead users and external systems such as Dune Analytics or similar platforms that track contract's activities from their logs. The event does not accurately reflect the actual shares transferred.

Tools Used

Manual

Recommendations

Update the Transfer event to emit the actual shares transferred instead of the stake equivalent. This will ensure that the data accurately reflects the transaction details.

Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

[INVALID] Incorrect event data in `StakingPool::transferShares`

Appeal created

demorextess Judge
10 months ago
demorextess Judge
10 months ago
dimah7 Judge
10 months ago
demorextess Judge
10 months ago
inallhonesty Lead Judge
10 months ago
inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Out of scope
Assigned finding tags:

[INVALID] Incorrect event data in `StakingPool::transferShares`

Support

FAQs

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