SIP-209: Update Exchanger for backwards compatibility
Author | |
---|---|
Status | Implemented |
Type | Governance |
Network | Ethereum & Optimism |
Implementor | Mark E. Barrasso (@barrasso) |
Release | Mirzam |
Proposal | Loading status... |
Created | 2022-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
Copyright and related rights waived via CC0.