The TempleTeleporter::teleport
function does not verify if the provided msg.value
is sufficient to cover the necessary fees for cross-chain teleportation. This oversight can lead to increased gas costs and unclear error handling.
The teleport
function requires a certain amount of msg.value
to be sent to cover the execution and transfer fees on both the source and destination chains. However, there is no check within the function to ensure that the supplied msg.value
is adequate. The quote
function can be used to estimate the necessary value, but it is not utilized in the teleport
function to validate the provided msg.value
.
Failure to check if msg.value
is sufficient can lead to unsuccessful transactions, increased gas costs, and unclear error messages, causing confusion for users and potentially leading to loss of funds due to failed transactions.
Manual Review
Add a call to the quote
function within the teleport
function to check if the supplied msg.value
is enough to cover the required fees. This will help reduce gas costs and make error handling clearer. Below is the updated teleport
function with the recommended check:
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.