KyberNetwork / smart-contracts

Main smart contracts for Kyber Network, including the main platform contract, reserve contracts etc.
https://kyber.network
MIT License
378 stars 341 forks source link

Enable new reserve to work with higher max rate ( PRECISION * 10^7). in contracts KyberReserveHighRate + enhanced steps contract. #1048

Closed ilanDoron closed 4 years ago

ilanDoron commented 4 years ago

Current ConversionRateEnhancedSteps inherits MAX_RATE from utils contract and uses it in addBps function.

currently our code uses PRECISION 10^6 but in Katalyst MAX_RATE is PRECISION 10^7 for using the bigger value. this PR updates MAX_RATE in use for two contracts: KyberReseve - creates a new contract KyberReserveHighRate and updating enhanced steps contract, which can be updated since not yet used in production.

code was written to enable max code reuse and minimal code duplication

Wrapper for enhanced conversion rates was modified:

  1. remove call to setQtyStepFunction which can't be used in enhanced conversion rate.
  2. call set imbalance with x and y arrays with different length.
ilanDoron commented 4 years ago

will be merged in another PR