all files / contracts/peripherals/ Keep3rParameters.sol

0% Statements 0/33
0% Branches 0/10
0% Functions 0/11
0% Lines 0/33
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127                                                                                                                                                                                                                                                             
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4 <0.9.0;
 
import '../../interfaces/IKeep3rHelper.sol';
import '../../interfaces/peripherals/IKeep3rParameters.sol';
import './Keep3rAccountance.sol';
import './Keep3rRoles.sol';
 
abstract contract Keep3rParameters is IKeep3rParameters, Keep3rAccountance, Keep3rRoles {
  /// @inheritdoc IKeep3rParameters
  address public override keep3rV1;
 
  /// @inheritdoc IKeep3rParameters
  address public override keep3rV1Proxy;
 
  /// @inheritdoc IKeep3rParameters
  address public override keep3rHelper;
 
  /// @inheritdoc IKeep3rParameters
  address public override kp3rWethPool;
 
  /// @inheritdoc IKeep3rParameters
  uint256 public override bondTime = 3 days;
 
  /// @inheritdoc IKeep3rParameters
  uint256 public override unbondTime = 14 days;
 
  /// @inheritdoc IKeep3rParameters
  uint256 public override liquidityMinimum = 3 ether;
 
  /// @inheritdoc IKeep3rParameters
  uint256 public override rewardPeriodTime = 5 days;
 
  /// @inheritdoc IKeep3rParameters
  uint256 public override inflationPeriod = 34 days;
 
  /// @inheritdoc IKeep3rParameters
  uint256 public override fee = 30;
 
  /// @notice The base that will be used to calculate the fee
  uint256 internal constant _BASE = 10000;
 
  /// @notice The minimum reward period
  uint256 internal constant _MIN_REWARD_PERIOD_TIME = 1 days;
 
  constructor(
    address _keep3rHelper,
    address _keep3rV1,
    address _keep3rV1Proxy,
    address _kp3rWethPool
  ) {
    keep3rHelper = _keep3rHelper;
    keep3rV1 = _keep3rV1;
    keep3rV1Proxy = _keep3rV1Proxy;
    kp3rWethPool = _kp3rWethPool;
    _liquidityPool[kp3rWethPool] = kp3rWethPool;
    _isKP3RToken0[_kp3rWethPool] = IKeep3rHelper(keep3rHelper).isKP3RToken0(kp3rWethPool);
  }
 
  /// @inheritdoc IKeep3rParameters
  function setKeep3rHelper(address _keep3rHelper) external override onlyGovernance {
    if (_keep3rHelper == address(0)) revert ZeroAddress();
    keep3rHelper = _keep3rHelper;
    emit Keep3rHelperChange(_keep3rHelper);
  }
 
  /// @inheritdoc IKeep3rParameters
  function setKeep3rV1(address _keep3rV1) external override onlyGovernance {
    if (_keep3rV1 == address(0)) revert ZeroAddress();
    keep3rV1 = _keep3rV1;
    emit Keep3rV1Change(_keep3rV1);
  }
 
  /// @inheritdoc IKeep3rParameters
  function setKeep3rV1Proxy(address _keep3rV1Proxy) external override onlyGovernance {
    if (_keep3rV1Proxy == address(0)) revert ZeroAddress();
    keep3rV1Proxy = _keep3rV1Proxy;
    emit Keep3rV1ProxyChange(_keep3rV1Proxy);
  }
 
  /// @inheritdoc IKeep3rParameters
  function setKp3rWethPool(address _kp3rWethPool) external override onlyGovernance {
    if (_kp3rWethPool == address(0)) revert ZeroAddress();
    kp3rWethPool = _kp3rWethPool;
    _liquidityPool[kp3rWethPool] = kp3rWethPool;
    _isKP3RToken0[_kp3rWethPool] = IKeep3rHelper(keep3rHelper).isKP3RToken0(_kp3rWethPool);
    emit Kp3rWethPoolChange(_kp3rWethPool);
  }
 
  /// @inheritdoc IKeep3rParameters
  function setBondTime(uint256 _bondTime) external override onlyGovernance {
    bondTime = _bondTime;
    emit BondTimeChange(_bondTime);
  }
 
  /// @inheritdoc IKeep3rParameters
  function setUnbondTime(uint256 _unbondTime) external override onlyGovernance {
    unbondTime = _unbondTime;
    emit UnbondTimeChange(_unbondTime);
  }
 
  /// @inheritdoc IKeep3rParameters
  function setLiquidityMinimum(uint256 _liquidityMinimum) external override onlyGovernance {
    liquidityMinimum = _liquidityMinimum;
    emit LiquidityMinimumChange(_liquidityMinimum);
  }
 
  /// @inheritdoc IKeep3rParameters
  function setRewardPeriodTime(uint256 _rewardPeriodTime) external override onlyGovernance {
    if (_rewardPeriodTime < _MIN_REWARD_PERIOD_TIME) revert MinRewardPeriod();
    rewardPeriodTime = _rewardPeriodTime;
    emit RewardPeriodTimeChange(_rewardPeriodTime);
  }
 
  /// @inheritdoc IKeep3rParameters
  function setInflationPeriod(uint256 _inflationPeriod) external override onlyGovernance {
    inflationPeriod = _inflationPeriod;
    emit InflationPeriodChange(_inflationPeriod);
  }
 
  /// @inheritdoc IKeep3rParameters
  function setFee(uint256 _fee) external override onlyGovernance {
    fee = _fee;
    emit FeeChange(_fee);
  }
}