1

I am in the process of developing a decentralized exchange (DEX) using Substrate on the Polkadot network and could use some assistance with the implementation. The key features I want to incorporate into my DEX are as follows:

  1. Enable users to create their own tokens with the Substrate contract node, utilizing ink!.

  2. Allow users to deploy the created token contracts on my network using substrate-node-contract.

  3. Permit users to list their custom tokens on the DEX for trading.

My question is related to the interaction between the token contracts and the DEX. When users deploy their token contracts on the network with substrate-node-contract, will I be able to use the smart contract address for transferring tokens within the DEX?

I would appreciate any guidance on implementing these features in a Substrate pallet, as well as suggestions or resources that could be helpful. Thank you!

3
  • Maybe this question's scope is too large? Need more focus? --- (ask chatgpt LOL, no offences, just kidding) Mar 29, 2023 at 15:49
  • @AurevoirXavier i dont know . i need some clue to strat the implement dex by this option ( allow user to upload smart contract on my network and use the smart contract for transfer token to other users )
    – Mr Coder
    Mar 29, 2023 at 15:51
  • @AurevoirXavier , i asked , it could not answer me , it have updated from 2021
    – Mr Coder
    Mar 29, 2023 at 15:52

1 Answer 1

2

I think what you are asking is whether it is possible for smart contract to interact with the pallet-assets? The answer is yes. You can do so in the low-level way using chain-extensions or referring to OpenBrush example on how to interact and create new PSP22 tokens from the ink! smart contract.

Realistically, I would advise to start with proof-of-concept of the DEX in ink! before moving onto FRAME development.

You can use Uniswap V2 implementation in ink! by Astar for inspiration.

8
  • why i have to use proof-of-concept ?
    – Mr Coder
    Mar 29, 2023 at 17:53
  • You don't have to use it, I recommend you to develop DEX in ink! first before doing in in FRAME. Mar 29, 2023 at 17:54
  • i want implement DEx in substrate pallet , not in the ink! . i want allow user created their token with ink! and deploy that on my chain , also they can add their token into my dex .
    – Mr Coder
    Mar 29, 2023 at 17:56
  • You runtime should have pallet-assets to allow token creation and pallet-contracts for smart contract functionality. The users can create their tokens in ink! by interacting with the pallet-assets through chain extensions as illustrated in the example by OpenBrush. Mar 29, 2023 at 17:59
  • i have to use pallet-assets ? can i call pallet-contracts functions without use pallet-assets ?
    – Mr Coder
    Mar 29, 2023 at 18:02

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.