0

I want to make my own WMATIC in amoy testnet for marketplace trade. In more details, I want to suggest with WMATIC in marketplace our team had made.

I know how to deploy ERC20 name WMATIC, and I want to swap WMATIC-MATIC for 1:1.but I don't know how to swap with matic exactly. I'm trying to use uniswap v3 protocol, but it seems to swap with ERC20-ERC20, not native-ERC20.

Is there a way to swap custom wmatic and matic using uniswap protocol or any other way?

6
  • This does not mak sense. What is the rationale to create a new WMATIC token? Just use existing one. Commented May 17 at 8:23
  • @MikkoOhtamaa I wanted to use uniswap token since our team have been using other uniswap token in other chain, but they don't support amoy testnet right now. I mailed to uniswap team, and get a reply that they have no plan to support amoy for now. can you suggest one to use?
    – rrrrssss
    Commented May 17 at 8:39
  • Thank you. Just grab the source code of WMATIC from Polygonscan and deploy it yourself. However testnets are not for application testing, they are for protocol testing. Using unit tests is much better way to test your code. If you really really need to do an application testing on a public chain, just use Polygon mainnet for it. It's cheap. Commented May 17 at 8:41
  • @MikkoOhtamaa Is there no additional process to swap with native token except making transaction with method 'deposit' or 'withdrawal' in WMATIC? I thought there may be more steps to do.
    – rrrrssss
    Commented May 17 at 8:46
  • I do not have enough context to understand your last question Commented May 17 at 8:56

1 Answer 1

0

A wrapper is a simple thing; It's a contract that receives a currency and emits an amount of wrapping tokens according the ratio.

Since you want to use the native token it seems pretty simple; You just need to implement a receive() function in your ERC20 wrapper contract and issue a corresponding amount of wrapper ERC20:

receive() external payable {
  _mint(msg.sender, msg.value);
}

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.