Assessment reports>DojoSwap>Threat Model>Crate: dojoswap_pair

Crate: dojoswap_pair

The dojoswap_pair contract allows swaps and liquidity provisioning for a pair of tokens. It is essentially unmodified from terraswap_pair, except for the following additions:

  • When swapping, half the commission is sent as a fee to the FEE_COLLECTOR address.

  • An admin_configure option, only callable by the FEE_COLLECTOR address, permits modifying the assets that a particular pair instance manages, as well as where the decimal point for those assets is.

Function: admin_configure

The admin_configure function allows the FEE_COLLECTOR to modify which assets the pair contract swaps.

It enforces that the sender is the FEE_COLLECTOR address. It then loads the contract's PairInfoRaw, copies its liquidity_token, recomputes the contract_addr to be the same as in initialize, and overwrites asset_infos and asset_decimals with the provided values.

Zellic © 2024Back to top ↑