TempleTeleporter:quote() does not estimate the exact nativeFee due to the inconsistent usage of abi.encodePacked().
In teleport() the message payload is packed-encoded after converting _to to bytes32 in order to correctly pad the result so that it can be decoded on destination.
However, the quote()function with the _to parameter, incorrectly uses encodePacked without converting the parameter to a bytes32 first:
Meaning that the function will quote a lighter payload since encodePacked will trim the 24 leading 0-bytes of the address, leading to a lower nativeFee amount than the actual payload that will be sent by teleport().
For example:
If the quote() above is used before sending a message it will estimate a lower gas amount than expected and potentially lead to "out of gas" failures on the destination chain.
I belive this finding to be of low severity since:
HIGH impact -> since there is a direct loss of funds for users
VERY LOW likelihood -> since the actual gas difference is very low thus unlikely to actually cause a revert
Add the following test to TempleTeleporter.t.sol:
Manual Review
Modify quote(.., _to, ...) in order to be consistent with how teleport() constructs the payload:
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.