Add token recipient param
Closed this issue · 0 comments
abhi3700 commented
Background
Currently, when an account sends tokens from the holdings of token A (on chain A) to chain B, the tokens get transferred to the token B's balance by default.
This is a snapshot of the token holders taken as per block #5574099 :
token[0]'s total supply: 999997.0
token[1]'s total supply: 1000003.0
Address '0x0370...d246' with token-[0] has balance: 999994.0
Address '0x0370...d246' with token-[1] has balance: 999997.0
Address '0xcd17...76ba' with token-[0] has balance: 3.0
Address '0xcd17...76ba' with token-[1] has balance: 0.0
Address '0x5c91...59cD' with token-[0] has balance: 0.0
Address '0x5c91...59cD' with token-[1] has balance: 6.0
As you can see that 3 addresses (1 EOA, 2 contracts) have balances of the tokens A & B. Cumulatively, on either chain the total supply is 1 M and hence 2 M in total.
Description
So, there should be a parameter (like receiver
as tokenRecipient
) added in order for the receiver to get the transferred tokens on destination chain.
- Look into the LayerZero contract suite to add the required parameter and update MyToken.sol.
- Modify the script,
TokenBridge
object.