Liquid Staking

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

event is missing in `priorityPool::OnTokenTransfer`

Summary

according to https://github.com/ethereum/EIPs/issues/677 "the token contract calls the receiving contract's function onTokenTransfer(address,uint256,bytes) and triggers an event, following the convention set in ERC223."

function onTokenTransfer(address _sender, uint256 _value, bytes calldata _calldata) external {
if (_value == 0) revert InvalidValue();
(bool shouldQueue, bytes[] memory data) = abi.decode(_calldata, (bool, bytes[]));
if (msg.sender == address(token)) {
_deposit(_sender, _value, shouldQueue, data);
} else if (msg.sender == address(stakingPool)) {
uint256 amountQueued = _withdraw(_sender, _value, shouldQueue);
token.safeTransfer(_sender, _value - amountQueued);
} else {
revert UnauthorizedToken();
}
}

https://github.com/Cyfrin/2024-09-stakelink/blob/main/contracts/core/priorityPool/PriorityPool.sol#L233

like OperatorStakingPool::onTokenTransfer which has the deposit event , also needed for priorityPool::OnTokenTransfer

Impact

  • Without events, the function will still perform its task (like transferring tokens or adjusting balances), but transparency and monitoring will be significantly reduced.

  • For systems that rely on clear tracking and user notifications, omitting events can lead to poor user experience or difficulty in debugging.

Recommendations

add Deposit/Withdraw event

Updates

Lead Judging Commences

inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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