SIP-209: Update Exchanger for backwards compatibility

Author
StatusImplemented
TypeGovernance
NetworkEthereum & Optimism
ImplementorMark E. Barrasso (@barrasso)
ReleaseMirzam
ProposalLoading status...
Created2022-02-04

Simple Summary

This SIP proposes a modification to the current Exchanger implementation to prevent breaking changes from the Alsephina release.

Abstract

The Exchanger.feeRateForExchange function signature changed in the Alsephina release. This SIP proposes that the old function signature remains the same to prevent integrations that rely on the function from breaking.

Motivation

This function signature change has broken some integrations with key Synthetix ecosystem partners. We should re-include the older function signature in order to remedy the situation.

Specification

Overview

This SIP will revert back to the previous function signature: function feeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view returns (uint);

Rationale

We can revert back to the previous function signature by first checking tooVolatile in the feeRateForExchange function and then simply return the feeRate.

Technical Specification

In Exchanger:

    function feeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view returns (uint) {
        (uint feeRate, bool tooVolatile) = _feeRateForExchange(sourceCurrencyKey, destinationCurrencyKey);
        require(!tooVolatile, "too volatile to trade");
        return feeRate;
    }

This SIP has no implications for the public interface of Synthetix.

Test Cases

A unit test has been added to the relevant pull request for this SIP.

Configurable Values (Via SCCP)

N/A

Copyright and related rights waived via CC0.