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

CW20 example contract which 1-to-1 mapped to native token #276

Closed
yihuang opened this issue Apr 19, 2021 · 4 comments
Closed

CW20 example contract which 1-to-1 mapped to native token #276

yihuang opened this issue Apr 19, 2021 · 4 comments

Comments

@yihuang
Copy link
Contributor

yihuang commented Apr 19, 2021

Messages

  • deposit message that lock native token and mint same amount of cw20 token
  • withdraw message that burn cw20 token and release native token
  • other standard cw20 messages.

Purpose

  • Some contract only works with cw20 token because of approval functionality, this will enable user to use native token as well.
@ethanfrey
Copy link
Member

The cw20-bonding curve with a constant price and no exit tax should work for this use-case.
You could try that locally to start.

If you think there is a larger case for a simple contract to just do this, then I am open for a PR. It would be nice to have some discussion on this (wrap native -> cw20. what about cw20 -> native? we kind of do that over IBC now, but is this an important case?)

@yihuang
Copy link
Contributor Author

yihuang commented Apr 19, 2021

The cw20-bonding curve with a constant price and no exit tax should work for this use-case.
You could try that locally to start.

cw20-bonding seems to do what I have in mind. 👍

If you think there is a larger case for a simple contract to just do this, then I am open for a PR. It would be nice to have some discussion on this (wrap native -> cw20. what about cw20 -> native? we kind of do that over IBC now, but is this an important case?)

I can think of some use cases for cw20 -> native, for example to use cw20 in native liquidity module, or use ibc-transfer with cw20 tokens?

@ethanfrey
Copy link
Member

Can I close this issue?
Does the bonding contract work well enough, or would you prefer a custom contract for this use case?
(I am happy to leave the issue open and accept a PR, but doubt I will get around to that anytime soon)

@yihuang
Copy link
Contributor Author

yihuang commented Apr 29, 2021

I think the bonding contract work well, thanks, closing now.

@yihuang yihuang closed this as completed Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants