Skip to main content
logo

Swapper

mars-swapper-base contains chain-agnostic logics for the swapper contract. Each chain specific implementation should implement its own route struct that should implement the mars_swapper_base::Route trait and then use the mars_swapper_base::SwapBase to implement the entry point functions. See mars-swapper-osmosis for an example. Each chain specific swapper will thus implement the same API.

NOTE

The swapper contracts should NEVER hold any funds and any funds sent to the contract except as part of executing the SwapExactIn message can be stolen by an attacker. See Oak Audit 2023-08-01 issue 14.