Skip to content

Commit f04d4cb

Browse files
committed
add documenatation for ConversionRateEnhancedOpen
1 parent ae56626 commit f04d4cb

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

contracts/mock/ConversionRatesEnhancedOpen.sol

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@ pragma solidity 0.4.18;
22

33
import "../reserves/fprConversionRate/ConversionRateEnhancedSteps.sol";
44

5-
5+
/**
6+
* @title ConversionRateEnhancedOpen
7+
* Inherits ConversionRateEnhancedSteps.
8+
* Supports API to check new getRate logic by exposing internal data.
9+
* Additional API enables 2 options:
10+
* - get rate queries that also show steps data (accumulated Y value).
11+
* - query get rate with fake imbalance.
12+
*/
613
contract ConversionRateEnhancedOpen is ConversionRateEnhancedSteps {
714

815
function ConversionRateEnhancedOpen(address _admin) public
916
ConversionRateEnhancedSteps(_admin)
1017
{ } // solhint-disable-line no-empty-blocks
1118

19+
///@dev enables calling get rate and watching extra BPS from step functio.
20+
///@dev doesn't check: token listed, valid rate duration.
21+
/// this logic isn't required since only used to show getRate internal values. extra logic isn't
22+
///@dev rateWithSteps value should be equal to rate value from getRate call
1223
function getRateOpenData(
1324
ERC20 token,
1425
uint currentBlockNumber,
@@ -32,6 +43,8 @@ contract ConversionRateEnhancedOpen is ConversionRateEnhancedSteps {
3243
return getRateDataFakeImbalance(token, buy, qty, totalImbalance);
3344
}
3445

46+
///@dev enables calling get rate and watching extra BPS from step function.
47+
///@dev can supply fake imbalance and see steps values with this fake imbalance.
3548
function getRateDataFakeImbalance(
3649
ERC20 token,
3750
bool buy,

0 commit comments

Comments
 (0)