The send
function in TempleGold
smart contract is designed to facilitate cross-chain token transfers using LayerZero. However, it contains a restrictive condition that disallows transfers if the sender's address does not match the recipient's address. This creates a significant issue for users utilizing multisig wallets, as these wallets often have different addresses across different chains, preventing them from transferring their funds cross-chain.
The vulnerability lies in the address validation check: if (msg.sender != _to) { revert ITempleGold.NonTransferrable(msg.sender, _to); }
. This condition ensures that the sender and the recipient addresses are identical, which is not the case for multisig wallets operating across different chains such as Ethereum and Arbitrum.
This vulnerability prevents users of multisig wallets from performing cross-chain transfers of their tokens. The condition if (msg.sender != _to)
fails for multisig wallet users due to differing addresses across chains, which:
Restricts the usability of the contract for multisig wallet users.
Limits the flexibility and accessibility of cross-chain token transfers.
Potentially deters users from adopting the contract due to this inflexibility.
User A, who owns a multisig wallet, attempts to transfer his temple tokens from Ethereum to Arbitrum using the send
function.
The send
function checks if the sender's address matches the recipient's address.
The condition if (msg.sender != _to)
fails due to the differing addresses of the multisig wallet on Ethereum and Arbitrum.
The transaction reverts, preventing User A from completing the cross-chain transfer.
Proof Of Code:
Place the following code in the TempleGoldLayerZero.t.sol
contract:
Manual code review
Foundry
Remove or Modify Address Check: Consider modifying or removing the restrictive address check to accommodate multisig wallet users. For example:
Implement Whitelisting: Implement a whitelisting mechanism for known multisig wallet addresses across chains to bypass the restrictive check.
User Validation: Introduce a more sophisticated user validation process that allows for different addresses on different chains but ensures the integrity of the cross-chain transfer.
By addressing this vulnerability, the contract will become more inclusive and practical for a broader range of users, particularly those using multisig wallets.
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.