@0x/contracts-staking: Add getHyperParameters() to MixinHyperParameters.
This commit is contained in:
@@ -40,6 +40,30 @@ contract MixinHyperParameters is
|
||||
// Denominator for cobb douglas alpha factor.
|
||||
uint256 internal cobbDouglasAlphaDenomintor = 2;
|
||||
|
||||
/// @dev Retrives all tuned values.
|
||||
/// @return _epochDurationInSeconds Minimum seconds between epochs.
|
||||
/// @return _rewardDelegatedStakeWeight How much delegated stake is weighted vs operator stake, in ppm.
|
||||
/// @return _minimumPoolStake Minimum amount of stake required in a pool to collect rewards.
|
||||
/// @return _cobbDouglasAlphaNumerator Numerator for cobb douglas alpha factor.
|
||||
/// @return _cobbDouglasAlphaDenomintor Denominator for cobb douglas alpha factor.
|
||||
function getHyperParameters()
|
||||
external
|
||||
view
|
||||
returns (
|
||||
uint256 _epochDurationInSeconds,
|
||||
uint32 _rewardDelegatedStakeWeight,
|
||||
uint256 _minimumPoolStake,
|
||||
uint256 _cobbDouglasAlphaNumerator,
|
||||
uint256 _cobbDouglasAlphaDenomintor
|
||||
)
|
||||
{
|
||||
_epochDurationInSeconds = epochDurationInSeconds;
|
||||
_rewardDelegatedStakeWeight = rewardDelegatedStakeWeight;
|
||||
_minimumPoolStake = minimumPoolStake;
|
||||
_cobbDouglasAlphaNumerator = cobbDouglasAlphaNumerator;
|
||||
_cobbDouglasAlphaDenomintor = cobbDouglasAlphaDenomintor;
|
||||
}
|
||||
|
||||
/// @dev Set all hyperparameters at once.
|
||||
/// @param _epochDurationInSeconds Minimum seconds between epochs.
|
||||
/// @param _rewardDelegatedStakeWeight How much delegated stake is weighted vs operator stake, in ppm.
|
||||
|
||||
@@ -18,27 +18,11 @@
|
||||
pragma solidity ^0.5.9;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "../src/Staking.sol";
|
||||
import "../src/fees/MixinExchangeFees.sol";
|
||||
|
||||
|
||||
contract TestCobbDouglas is
|
||||
IStaking,
|
||||
IStakingEvents,
|
||||
MixinConstants,
|
||||
Ownable,
|
||||
MixinStorage,
|
||||
MixinHyperParameters,
|
||||
MixinZrxVault,
|
||||
MixinExchangeManager,
|
||||
MixinStakingPoolRewardVault,
|
||||
MixinScheduler,
|
||||
MixinStakeStorage,
|
||||
MixinStakeBalances,
|
||||
MixinStakingPoolRewards,
|
||||
MixinStake,
|
||||
MixinStakingPool,
|
||||
MixinExchangeFees,
|
||||
Staking
|
||||
MixinExchangeFees
|
||||
{
|
||||
function cobbDouglas(
|
||||
uint256 totalRewards,
|
||||
@@ -63,13 +47,4 @@ contract TestCobbDouglas is
|
||||
alphaDenominator
|
||||
);
|
||||
}
|
||||
|
||||
function getCobbDouglasAlpha()
|
||||
external
|
||||
view
|
||||
returns (uint256 numerator, uint256 denominator)
|
||||
{
|
||||
numerator = cobbDouglasAlphaNumerator;
|
||||
denominator = cobbDouglasAlphaDenomintor;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user