The TempleGold.sol
contract aims to restrict cross-chain transfers to self-transfers only by ensuring that the sender and recipient addresses are the same. However, this restriction may prevent users of multi-signature wallets or account abstraction wallets, which can have different addresses on different chains, from performing legitimate cross-chain transfers to themselves.
The relevant function in TempleGold.sol
is as follows:
The check if (msg.sender != _to) { revert ITempleGold.NonTransferrable(msg.sender, _to); }
ensures that users can only send tokens to themselves. This is generally good for maintaining non-transferability, but it can cause issues in certain scenarios:
MultiSig Wallets: Multi-signature wallets may have different addresses on different chains, making it impossible for the wallet to transfer tokens to itself across chains.
Account Abstraction Wallets: With account abstraction, wallets may be deployed with different addresses on different chains, especially if the deployment logic or parameters change.
Blocking Legitimate Transfers: Users with multi-signature or account abstraction wallets might be unable to transfer their tokens cross-chain to themselves.
Loss of Tokens: If users inadvertently send tokens to an address they don't control on the destination chain, it could lead to loss of tokens, especially if the address is controlled by someone else.
Consider a scenario where a multi-signature wallet MultiSigA
on Chain A has a different address MultiSigB
on Chain B due to the deployment logic.
User initiates a transfer from MultiSigA
on Chain A to MultiSigB
on Chain B.
The contract will revert the transaction because msg.sender
(which is MultiSigA
) is not equal to _to
(which is MultiSigB
).
Optional Validation for Specific Wallet Types: Implement an optional validation mechanism that allows multi-signature and account abstraction wallets to specify their corresponding addresses on the destination chain.
User-Defined Address Mapping: Allow users to define and map their corresponding addresses on different chains. This could be implemented through a registration mechanism where users register their cross-chain addresses.
This solution provides flexibility for users with multi-signature or account abstraction wallets, ensuring they can perform legitimate cross-chain transfers while maintaining the non-transferability of TempleGold
tokens.
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.