SetProtocol/set-protocol-contracts

Create Bancor Exchange Wrapper

richardliang opened this issue · 0 comments

Summary

Integrate Bancor as a liquidity provider for Set issuance orders by creating an Exchange Wrapper contract similar to what we have done with 0x and Kyber.

Implementation

Our exchanges wrappers expose a single public function exchange which implements the necessary logic behind the exchange protocol. Our current exchange wrapper implementations are here for reference.

In the case of Bancor, it uses the quickConvert function to execute conversion between any 2 integrated tokens on its network. The function is payable and takes in a path, the message value, and the minimum return willing to receive back.

The exchange function should:

  1. check allowance for transfer
  2. parse order data from the Set issuance order
  3. execute quickConvert
  4. transfer unused maker token back to the issuance order user

A good source of reference is how we've implemented our exchange wrappers linked above. Feel free to discuss with us further on Telegram!