Loss of rewards during cross-chain transfers. When reward distribution is initiated in SDLPoolCCIPControllerPrimary.sol, it sends tokens to secondary chains via CCIP. If a user's reSDL
NFT is in-transit between chains during this process, they will fail to receive their share of rewards.
There is no synchronization or check to ensure a user's effective balance is reflected accurately across chains before distributing rewards.
Some scenarios where users could lose rewards:
User transfers reSDL
NFT from secondary chain to primary
Rewards initiated on primary before NFT arrival
User balance not accounted for when calculating rewards
The key segment from SDLPoolCCIPControllerPrimary.sol
that distributes rewards: SDLPoolCCIPControllerPrimary.sol#distributeRewards](https://github.com/Cyfrin/2023-12-stake-link/blob/549b2b8c4a5b841686fceb9c311dca9ac58225df/contracts/core/ccip/SDLPoolCCIPControllerPrimary.sol#L56-L93)
As you can see, it calculates the reward allocation based on the reSDLSupplyByChain
- which tracks reSDL
balances on each secondary chain.
This balance may be inaccurate if reSDL
NFT transfers are in-flight.
So users who recently transferred reSDLs
to/from a secondary would fail to receive their entitled rewards.
Manual Review
Implement synchronization checks before distributing rewards
Build a buffer period between cross-chain transfers and reward cycles
Support retroactive user reward claims if missed
Adding additional synchronization around cross-chain transfers would help minimize issues with rewards.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.