TempleTeleporter::quote function is implemented wrong, quoting for less gas, potentially causing LZ to revert as the real needed gas is more than the quoted one.
quote gives the wrong quote as it encodes the to address together with the amount in their raw forms.
https://github.com/Cyfrin/2024-07-templegold/blob/main/protocol/contracts/templegold/TempleTeleporter.sol#L87
However the real messages are sent with their addresses converted to bytes32 using bytes32ToAddress().
This will return a wrong quote, either too small or too big, which can cause a mismatch between the msg.value our users provide and the real msg.value that is needed by LZ to execute the TX.
quote does not send accurate quotes.
Manual review
Fix the encoding to encode to as bytes32.
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.