Incorrect payload encoding from the original leads to incorrect price estimation and griefing.
In the TempleTeleporter.sol
contract, we can use teleport()
function to teleport temple tokens cross chain. It uses _lzSend()
function for that.
Here, we are paying messagingFee
in msg.value
. Thus, fee need to be sent with this function. For the accurate estimation of fees, the _quote()
function of OAppSender.sol is used.
In TempleTeleporter.sol, one of the quote()
function is implemented as:
Notice that in the teleport()
function, payload
is calculated as:
But in the quote()
function, payload
is calculated as:
Thus the payload
value which is the message
that is used for quoting fee will be different from the original message which is sent. This will cause inaccurate calculation of fee.
Inaccurate calculation of fee amount will lead to _lzSend()
function reverting due to insufficient fee amount sent and grief the user everytime. The likelihood is very high and impact is medium. Thus, the high severity.
Manual Analysis
Modify the quote()
function to encode payload
correctly:
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.