TokenLib.finalizeTransfer() decodes the EVM recipient address from transfer.to using:
address to = address(bytes20(transfer.to));
This takes the first 20 bytes of the bytes32 value.
That means Solana-to-Base EVM recipients must be encoded as left-aligned bytes20 inside bytes32:
bytes32(bytes20(recipient))
This is easy to misuse because common Solidity-style address-to-bytes32 encoding is often right-aligned:
bytes32(uint256(uint160(recipient)))
If a client or integration uses right-aligned encoding, the bridge may decode the wrong recipient address.
TokenLib.finalizeTransfer() decodes the EVM recipient address from transfer.to using:
This takes the first 20 bytes of the bytes32 value.
That means Solana-to-Base EVM recipients must be encoded as left-aligned bytes20 inside bytes32:
This is easy to misuse because common Solidity-style address-to-bytes32 encoding is often right-aligned:
If a client or integration uses right-aligned encoding, the bridge may decode the wrong recipient address.