Skip to content

Ideal Restructure Of Adapter Contracts #54

Open
@NotJeremyLiu

Description

@NotJeremyLiu

Background

  • Skip API contracts consist of 1) a main entry point contract where the exact bytecode is intended to be deployed across all networks, 2) swap adapter contracts that differ between dexes, and 3) IBC transfer adapter contracts that differ between IBC infra (IBC hooks, Neutron Transfer module, etc.)
  • The current folder / file structure of the Skip API repo is one where the adapter contracts are separated by Network, where each Network has a parent folder, and within that folder exists an IBC folder containing the IBC transfer adapter contract and a Swap folder containing a single DEX adapter contract.
  • It already became apparent at the time of developing just the Osmosis and Neutron adapter contracts that this is not ideal, with many tests shared between the adapter contracts and only specific types being the differentiator on the expected output.

Example Near-Term Future Support

In the near-term, Skip API contracts will be deployed across more networks and dexes, with a realistic example being:

  1. Osmosis:
    • Swap Adapter: Poolmanager Module
    • IBC Adapter: IBC-Hooks
  2. Neutron
    • Swap Adapter: Astroport CW Contract
    • IBC Adapter: Neutron Transfer Module
  3. Terra2
    • Swap Adapters: Astroport CW Contract, WhiteWhale CW Contract
    • IBC Adapter: IBC-Hooks
  4. Juno
    • Swap Adapters: WyndDex CW Contract, Hopers CW Contract
    • IBC Adapter: IBC-Hooks
  5. Injective
    • Swap Adapters: Astroport CW Contract, Injective Dex module
    • IBC Adapter: IBC-Hooks

This Issue

Serves as a design / tracking issue to work towards a refactor of the repo (incl. tests) that:

  1. Makes supporting multiple swap adapter contracts per network as easy as possible
  2. Makes developing new swap adapter contracts as easy as possible
  3. Makes developing new ibc transfer adapter contracts as easy as possible

easy as possible = least amount of redundant dev/testing work to launch/maintain adapter contracts.

Current Status

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions