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

How to make an automatic exchange? #6

Open
vporton opened this issue Apr 17, 2020 · 4 comments
Open

How to make an automatic exchange? #6

vporton opened this issue Apr 17, 2020 · 4 comments

Comments

@vporton
Copy link
Owner

vporton commented Apr 17, 2020

I remind that I have a Ethereum ERC-1155 contract with minting facility. Further you can assume full control over a currency in this contract (ability to mint and transfer it).

Need to build an automatic exchange that exchanges some other tokens (including ETH) to our tokens (that could be for example minted as needed). You can assume that the exchange rate is a fixed floating point number.

This bounty requires you to describe (without actually implementing) how the exchange would work.

I see two problems:

  1. We cannot watch EVM events from a smart contract. So we probably need to create our own wallet under our control to which the money is transferred before we direct it to start the exchange operation. But EVM cannot create random numbers. So how to create the wallet securely?

  2. How we give ourselves full control over that temporary wallet to be able to command it to send money? (E.g. if it is ERC-20, then the exchange could not control the token contract and so could not cause it to send the token for the exchange operation. If it is say an ERC-721 or ERC-1155, then the exchange also can't control the contract and the same trouble arises.)

Those problems are somehow solved in decentralized exchanges. Please explain how DEXes work around these and probably other problems.

Related question.

The exchange needs to work through an API (not just in a browser).

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 0.03 ETH (5.08 USD @ $169.26/ETH) attached to it as part of the vporton fund.

@vporton
Copy link
Owner Author

vporton commented Apr 17, 2020

The exchange needs to work through an API (not just in a browser).

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 4 weeks, 1 day from now.
Please review their action plans below:

1) dawidzioor has started work.

Djdnrnrkyorntn4kotnfemekjrnrkdndenirn

Learn more on the Gitcoin Issue Details page.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Cancelled


The funding of 0.03 ETH (5.8 USD @ $193.21/ETH) attached to this issue has been cancelled by the bounty submitter

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