Closed chasebrownn closed 6 months ago
So when there exists an early claim, the user is penalized and the multiplier is lowered thus lowering the amount that the user can claim next. The PassiveIncomeNFT contract drops the multiplier in response to the early claim so there's no need to subtract the amount claimed. This is an intentional method for calculating amountTokens
given the NFT experienced an early claim.
CCM-01M: Incorrect Utilization of Max Pay-Out
Description:
The code of
CrossChainMigrator::migrateNFT
andCrossChainMigrator::migrateNFTBatch
functions will re-calculate the multiplier due for the lock and compare it to its active one.If the calculated multiplier is different than the one associated with the lock, it means that an
IPassiveIncomeNFT::claim
occurred that was penalized based on theIPassiveIncomeNFT
implementation. The code ofCrossChainMigrator
, however, will assign the amount of tokens to bridge as equal to themaxPayout
which is incorrect.The
IPassiveIncomeNFT
contract will decrease themultiplier
proportionately based on the percentage of tokens that were claimed as penalized, however, thenewMaxPayout
the code will calculate utilizes the fulllockedAmount
of the lock and does not account for the funds that have been claimed.Impact:
Penalized NFTs that have had their multiplier diminished will result in a significant portion of tokens being minted erroneously as the amount of funds claimed are not accounted for in the NFT.
Example:
Recommendation:
We advise the code to ensure the
claimed
tokens are properly subtracted from themaxPayout
, preventing a bridge operation from minting more tokens than expected for the NFT.