Solana-to-Base transfer.to recipient encoding is not clearly documented and is easy to misuse
Open
- Dominant language
- TypeScript
- Stars
- 213
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
TokenLib.finalizeTransfer() decodes the EVM recipient address from transfer.to using:
```solidity
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:
```solidity
bytes32(bytes20(recipient))
```
This is easy to misuse because common Solidity-style address-to-bytes32 encoding is often right-aligned:
```solidity
bytes32(uint256(uint160(recipient)))
```
If a client or integration uses right-aligned encoding, the bridge may decode the wrong recipient address.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.