We advise the amount value emitted in the SendToChain event within LayerZeroRebaseTokenUpgradeable::_send to be set to the message.shares.toTokens(message.rebaseIndex) value, ensuring that the amount emitted matches the actual one transferred by the cross-chain transfer.
LZR-01C: Cross-Chain Amount Truncation
Description:
The
SendToChain
event'samount
emitted during theLayerZeroRebaseTokenUpgradeable::_send
function may not be equal to the actualamount
transferred by the function due to potential truncation in theLayerZeroRebaseTokenUpgradeable::_debitFrom
function.Impact:
In contrast to the EIP-20 related exhibit, this one relates to a custom
event
and thus is of minimal impact.Example:
Recommendation:
We advise the
amount
value emitted in theSendToChain
event withinLayerZeroRebaseTokenUpgradeable::_send
to be set to themessage.shares.toTokens(message.rebaseIndex)
value, ensuring that theamount
emitted matches the actual one transferred by the cross-chain transfer.