wrong decoding of payload
Context:
TempleTeleporter.sol#L52
TempleTeleporter.sol#L107
The TempleTeleporter.sol::teleport() before invoking _lzSend encodes the payload to be sent, as a (bytes32, uint256) format due to converting the to
address type to bytes32() to support for non-EVM chains:
However, was decoded in a (address, uint256) on the _lzReceive():
This causes a mismatch in the payload sent and received.
For example:
Consider an example where the address is 0x1234567890abcdef1234567890abcdef12345678 and the amount is 1000.
Encoding:
The address is padded to 32 bytes: 0x0000000000000000000000001234567890abcdef1234567890abcdef12345678.
The amount (1000) as uint256 is 0x00000000000000000000000000000000000000000000000000000000000003e8.
The resulting _payload will be:
0x0000000000000000000000001234567890abcdef1234567890abcdef12345678000000000000000000000000000000000000000000000000000000000000003e8
Decoding:
When decoding, Solidity will interpret the first 20 bytes as the address, leading to:
_recipient = 0x0000000000000000000000001234567890abcdef12345678
This is incorrect because the intended address is 0x1234567890abcdef1234567890abcdef12345678
This causes a mismatch in the payload sent and received.
Maual Review
Ensure the payload is decoded 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.