Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add receiver field for chain to chain transfers #1744

Merged

Conversation

yavrsky
Copy link
Contributor

@yavrsky yavrsky commented Dec 16, 2024

This pull request introduces a new function to the TokenManagerERC20 contract and updates related tests and dependencies. The most important changes include adding the transferToSchainERC20Direct function, modifying the transferToSchainERC20 function, updating the @skalenetwork/ima-interfaces dependency, and adding a new test case for the new function.

New Functionality:

  • Added the transferToSchainERC20Direct function to the TokenManagerERC20 contract, which allows for direct transfers of ERC20 tokens between schains.

Function Modifications:

  • Updated the transferToSchainERC20 function to use the to address instead of msg.sender when receiving ERC20 tokens.

Testing:

  • Added a new test case in TokenManagerERC20.ts to verify the correct behavior of the transferToSchainERC20Direct function, including various scenarios and expected outcomes.

@yavrsky yavrsky linked an issue Dec 16, 2024 that may be closed by this pull request
@yavrsky
Copy link
Contributor Author

yavrsky commented Dec 23, 2024

Steps for QA:
destinationChain - name of schain where you want to transfer tokens, in other words, name of destination chain

  1. Connect destination chain to origin chain:
    These steps are required to run from owner account:
    await messageProxyForSchain.grantRole(await messageProxyForSchain.CHAIN_CONNECTOR_ROLE(), deployer.address);
    await messageProxyForSchain.addConnectedChain(destinationChain);
  2. Deploy ERC20 token on origin chain
  3. Mint tokens for user on origin chain
    await erc20OnOriginChain.mint(user.address, amount);
  4. Approve TokenManagerERC20 to transfer tokens
    0xD2aAA00500000000000000000000000000000000 - address of TokenManagerERC20
    await erc20OnOriginChain.connect(user).approve("0xD2aAA00500000000000000000000000000000000", amount);
  5. Transfer tokens to schain
    erc20OnOriginChainAddress - address of ERC20 token on origin chain
    await tokenManagerErc20.connect(user).transferToSchainERC20(destinationChain, erc20OnOriginChainAddress, amount);

@yavrsky yavrsky merged commit 1140de1 into v2.3.0 Dec 23, 2024
6 of 7 checks passed
@yavrsky yavrsky deleted the feature/add-receiver-field-for-chain-to-chain-transfers branch December 23, 2024 15:07
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add receiver field for S-S and M->S only
3 participants