2

I'm new to substrate and Polkadot and I'm coming from ETH/Solidity. I noticed many test tokens in my Polkadot.js wallet like DOT, LDOT, ACA, KSM, etc.

I'm trying to code a dapp that lets my user send a specific token (say ACA) to another wallet. The closest tutorial I found is this. But it doesn't specify how do I send a particular token.

3
  • 1
    You would need to be connected to the relevant parachain to send its native token. For example, you'd need to be connected to an Acala node to send ACA. Then it's just a case of using the transfer function.
    – forgetso
    Jul 7, 2022 at 10:57
  • @forgetso Oh i see. But what if I would issue my own token on say on Acala or Kusama? How do I specify that token?
    – ratib90486
    Jul 7, 2022 at 11:08
  • You'd need to issue the token as part of an ERC20 contract or similar, and then deploy that contract to Acala. I don't think Kusama has smart contracts so you can't deploy it there.
    – forgetso
    Jul 7, 2022 at 11:14

1 Answer 1

4

From what I understand from your question, if you just need to send a token between two accounts using polkadot.js you should check the corresponding Substrate runtime calls exposed by the API. In your case, I would say you are interested in using either:

  • transfer(dest: MultiAddress, value: Compact<u128>) or
  • transferKeepAlive(dest: MultiAddress, value: Compact<u128>).

As @forgetso commented above, you will need to be connected to the relevant parachain to send its native token. In case, you are connected to Statemint/Statemine (which support any number of arbitrary assets), have a look to this guide on how to identify and manage different assets (tokens).

2
  • Thank you. What if I wish to transfer aUSD? I believe this token is on ACA. How does it differentiate between ACA and aUSD?
    – ratib90486
    Jul 7, 2022 at 12:49
  • AFAIK, aUSD is a "primitive currency" in the Acala parachain, this basically means it is a precompiled ERC20 token. Hence you will need to check Acala docs to know how to interact with this kind of tokens. This reference is a good starting point.
    – Iker
    Jul 7, 2022 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.