Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/restructure market creation incentives #62

Open
wants to merge 60 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
9b32ef2
Distribute rewards based on gas price and bonus bPLOT
udkreddySomish Oct 17, 2020
2e5ceef
Restrict setting initial creation incentives multiple times
udkreddySomish Oct 17, 2020
ba9a4aa
Handle rewards of market creators before the contract was upgraded
udkreddySomish Oct 18, 2020
b749437
corrected gas used variable
udkreddySomish Oct 19, 2020
1cb74a0
Added buffer gas for incentive calculation
udkreddySomish Oct 19, 2020
e5379b7
Added new contract for new creation incentive calculation
udkreddySomish Oct 19, 2020
256759b
Fetch the current gas price from chainlink and updated calculations
udkreddySomish Oct 19, 2020
ee8f9a9
Removed bPLOT incentives for market creation
udkreddySomish Oct 19, 2020
f860d92
Fixed price conversion issue
udkreddySomish Oct 19, 2020
6a97208
Updated testcases
udkreddySomish Oct 19, 2020
a655293
Updated buffer gas amount, and minor fixes
udkreddySomish Oct 20, 2020
4495eec
Updated testcases for new market creation incentives
udkreddySomish Oct 20, 2020
899d465
Updated incentive formulae and added authorized address check for set…
udkreddySomish Oct 20, 2020
9a5c7ad
Added code comments
udkreddySomish Oct 20, 2020
91000c9
Corrected comments
udkreddySomish Oct 20, 2020
5cfa0d8
Increased default balance in coverage script
udkreddySomish Oct 20, 2020
a450e1f
Increased default balance in coverage script
udkreddySomish Oct 20, 2020
5b40913
Removed commented code
udkreddySomish Oct 20, 2020
afec03d
Removed unused argument
udkreddySomish Oct 21, 2020
bb552f8
Covergae: Fixed issue with high gas while running coverage
udkreddySomish Oct 21, 2020
5d22c42
Removed redundant checks and corrected indentation
udkreddySomish Oct 21, 2020
ae4a176
Covergae: Fixed issue with low balance while running coverage
udkreddySomish Oct 21, 2020
902cd4f
Updated testcases
udkreddySomish Oct 21, 2020
e45297d
Added feature to distribute percent of reward pool share for market c…
udkreddySomish Oct 30, 2020
084863a
Fixed compile issues
udkreddySomish Oct 31, 2020
41ab257
Corrected event while claimingmarket creation incentives
udkreddySomish Oct 31, 2020
64c01e1
Corrected formulae
udkreddySomish Oct 31, 2020
1f4810b
Updated plot stake required for reward pool share percent
udkreddySomish Oct 31, 2020
cb76e15
Updated plot stake required for reward pool share percent
udkreddySomish Oct 31, 2020
d8849e8
Corrected formulae for reward pool share percent
udkreddySomish Oct 31, 2020
37ce6f5
Corrected formulae
udkreddySomish Nov 1, 2020
ab5dbd0
Removed unused variables
udkreddySomish Nov 1, 2020
390af34
Added code comments
udkreddySomish Nov 1, 2020
9ddc41e
Updated MarketCreationReward eventdata
udkreddySomish Nov 2, 2020
bcf1c30
Fixed minor issues
udkreddySomish Nov 2, 2020
0600070
Updated testcases for Market creation incentives
udkreddySomish Nov 2, 2020
c56df09
Fix broken test cases
udkreddySomish Nov 2, 2020
6020c5a
Implement old Market contract instead of rewriting whole code for new…
udkreddySomish Nov 2, 2020
4e39b02
Added new function for calling market result event instead of updatin…
udkreddySomish Nov 2, 2020
95d6cb7
Added more testcases
udkreddySomish Nov 2, 2020
fe9b407
Added a market leveraged participation threshold for reward pool shar…
udkreddySomish Nov 5, 2020
c059a93
Fixed minor issue
udkreddySomish Nov 5, 2020
b685a72
Updated testcases
udkreddySomish Nov 5, 2020
bc50cd3
Fixed broken testcases in coverage run
udkreddySomish Nov 6, 2020
abd3e1b
Fixed broken testcases
udkreddySomish Nov 6, 2020
7ce214f
Fixed broken testcases
udkreddySomish Nov 6, 2020
0e74370
Fixed issue while user claiming market creation rewards
udkreddySomish Nov 8, 2020
00adefc
Added a function to get users pending market creation rewards
udkreddySomish Nov 10, 2020
e2a0e84
Added event market creator reward pool share details
udkreddySomish Nov 11, 2020
f8fbe7a
Added user address argument to check pending market creation rewards
udkreddySomish Nov 12, 2020
c21755d
Updated testcases
udkreddySomish Nov 12, 2020
cf68f6b
Added a functionality to pause market creation of particular type thr…
udkreddySomish Nov 17, 2020
81e4714
Updated comments
udkreddySomish Nov 17, 2020
90ac621
Corrected event data
udkreddySomish Nov 18, 2020
bfc5622
Fixed bug in claim reward
udkreddySomish Nov 19, 2020
78c8be6
Updated testcases
udkreddySomish Nov 19, 2020
64cb3e2
Merge branch 'feature/restructure-marketCreationIncentives' into feat…
udkreddySomish Nov 19, 2020
ccedbf1
Merge pull request #119 from plotx/feature/pauseMarketCreationOfType
udkreddySomish Nov 19, 2020
e71c3cf
Updated test cases
udkreddySomish Nov 19, 2020
4edc39b
Fixed dependencies
udkreddySomish Nov 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions contracts/MarketNew.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/* Copyright (C) 2020 PlotX.io

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/ */

pragma solidity 0.5.7;

import "./Market.sol";

contract MarketNew is Market {

/**
* @dev Check if threshold reached for reward pool share percent for market creator.
* Calculate total leveraged amount staked in market value in ETH
* @param _rewardPoolShareThreshold Threshold for reward pool share
*/
function _checkIfThresholdReachedForRPS(uint256 _rewardPoolShareThreshold) internal view returns(bool) {
uint256 ethStaked;
uint256 plotStaked;
for(uint256 i = 1; i<= totalOptions;i++) {
ethStaked = ethStaked.add(optionsAvailable[i].assetLeveraged[ETH_ADDRESS]);
plotStaked = plotStaked.add(optionsAvailable[i].assetLeveraged[plotToken]);
}
( , uint riskPercentage, , ) = marketUtility.getBasicMarketDetails();
ethStaked = _calculatePercentage(riskPercentage, ethStaked, 100);
plotStaked = _calculatePercentage(riskPercentage, plotStaked, 100);
plotStaked = marketUtility.getAssetValueETH(plotToken, plotStaked);
return (plotStaked.add(ethStaked) > _rewardPoolShareThreshold);
}

/**
* @dev Calculate the result of market.
* @param _value The current price of market currency.
*/
function _postResult(uint256 _value, uint256 _roundId) internal {
require(now >= marketSettleTime(),"Time not reached");
require(_value > 0,"value should be greater than 0");
uint riskPercentage;
( , riskPercentage, , ) = marketUtility.getBasicMarketDetails();
if(predictionStatus != PredictionStatus.InDispute) {
marketSettleData.settleTime = uint64(now);
} else {
delete marketSettleData.settleTime;
}
predictionStatus = PredictionStatus.Settled;
if(_value < marketData.neutralMinValue) {
marketSettleData.WinningOption = 1;
} else if(_value > marketData.neutralMaxValue) {
marketSettleData.WinningOption = 3;
} else {
marketSettleData.WinningOption = 2;
}
(uint256 rewardPoolSharePerc, uint256 rewardPoolShareThreshold) = marketRegistry.getMarketCreatorRPoolShareParams(address(this));
bool _thresholdReached = _checkIfThresholdReachedForRPS(rewardPoolShareThreshold);
uint[] memory totalReward = new uint256[](2);
uint[] memory marketCreatorIncentive = new uint256[](2);
if(optionsAvailable[marketSettleData.WinningOption].assetStaked[ETH_ADDRESS] > 0 ||
optionsAvailable[marketSettleData.WinningOption].assetStaked[plotToken] > 0
){
for(uint i=1;i <= totalOptions;i++){
if(i!=marketSettleData.WinningOption) {
uint256 leveragedAsset = _calculatePercentage(riskPercentage, optionsAvailable[i].assetLeveraged[plotToken], 100);
totalReward[0] = totalReward[0].add(leveragedAsset);
leveragedAsset = _calculatePercentage(riskPercentage, optionsAvailable[i].assetLeveraged[ETH_ADDRESS], 100);
totalReward[1] = totalReward[1].add(leveragedAsset);
}
}
if(_thresholdReached) {
marketCreatorIncentive[0] = _calculatePercentage(rewardPoolSharePerc, totalReward[0], 10000);
marketCreatorIncentive[1] = _calculatePercentage(rewardPoolSharePerc, totalReward[1], 10000);
}
totalReward[0] = totalReward[0].sub(marketCreatorIncentive[0]);
totalReward[1] = totalReward[1].sub(marketCreatorIncentive[1]);
rewardToDistribute = totalReward;
} else {
for(uint i=1;i <= totalOptions;i++){
uint256 leveragedAsset = _calculatePercentage(riskPercentage, optionsAvailable[i].assetLeveraged[plotToken], 100);
tokenAmountToPool = tokenAmountToPool.add(leveragedAsset);
leveragedAsset = _calculatePercentage(riskPercentage, optionsAvailable[i].assetLeveraged[ETH_ADDRESS], 100);
ethAmountToPool = ethAmountToPool.add(leveragedAsset);
}
if(_thresholdReached) {
marketCreatorIncentive[0] = _calculatePercentage(rewardPoolSharePerc, tokenAmountToPool, 10000);
marketCreatorIncentive[1] = _calculatePercentage(rewardPoolSharePerc, ethAmountToPool, 10000);
tokenAmountToPool = tokenAmountToPool.sub(marketCreatorIncentive[0]);
ethAmountToPool = ethAmountToPool.sub(marketCreatorIncentive[1]);
}
}
_transferAsset(ETH_ADDRESS, address(marketRegistry), ethAmountToPool.add(ethCommissionAmount).add(marketCreatorIncentive[1]));
_transferAsset(plotToken, address(marketRegistry), tokenAmountToPool.add(plotCommissionAmount).add(marketCreatorIncentive[0]));
delete ethCommissionAmount;
delete plotCommissionAmount;
marketRegistry.callMarketResultEventAndSetIncentives(rewardToDistribute, marketCreatorIncentive, marketSettleData.WinningOption, _value, _roundId);
}
}
267 changes: 267 additions & 0 deletions contracts/MarketRegistryNew.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
/* Copyright (C) 2020 PlotX.io

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/ */

pragma solidity 0.5.7;
import "./MarketRegistry.sol";
import "./interfaces/IChainLinkOracle.sol";
import "./external/openzeppelin-solidity/math/Math.sol";
import "./interfaces/ITokenController.sol";

contract MarketRegistryNew is MarketRegistry {

uint256 internal maxGasPrice;
IChainLinkOracle public clGasPriceAggregator;
struct MarketCreationRewardUserData {
uint incentives;
uint lastClaimedIndex;
address[] marketsCreated;
}

struct MarketCreationRewardData {
uint ethIncentive;
uint plotIncentive;
uint rewardPoolSharePerc;
}

uint256 maxRewardPoolPercForMC;
uint256 minRewardPoolPercForMC;
uint256 plotStakeForRewardPoolShare;
uint256 rewardPoolShareThreshold;

mapping(address => MarketCreationRewardUserData) private marketCreationRewardUserData; //Of user
mapping(address => MarketCreationRewardData) private marketCreationRewardData; //Of user
event MarketCreationReward(address indexed createdBy, address marketAddress, uint256 plotIncentive, uint256 gasUsed, uint256 gasCost, uint256 gasPriceConsidered, uint256 gasPriceGiven, uint256 maxGasCap, uint256 rewardPoolSharePerc);
event ClaimedMarketCreationReward(address indexed user, uint256 ethIncentive, uint256 plotIncentive);

/**
* @dev Set initial market creation incentive params.
*/
function setGasPriceAggAndMaxGas(address _clGasPriceAggregator) external {
require(address(clGasPriceAggregator) == address(0));
require(msg.sender == marketInitiater);
clGasPriceAggregator = IChainLinkOracle(_clGasPriceAggregator);
maxGasPrice = 100 * 10**9;
maxsam4 marked this conversation as resolved.
Show resolved Hide resolved
maxRewardPoolPercForMC = 500; // Raised by 2 decimals
minRewardPoolPercForMC = 50; // Raised by 2 decimals
plotStakeForRewardPoolShare = 25000 ether;
rewardPoolShareThreshold = 1 ether;
}

/**
* @dev Creates the new market
* @param _marketType The type of the market.
* @param _marketCurrencyIndex the index of market currency.
*/
function createMarket(uint256 _marketType, uint256 _marketCurrencyIndex) public payable{
uint256 gasProvided = gasleft();
address penultimateMarket = marketCreationData[_marketType][_marketCurrencyIndex].penultimateMarket;
if(penultimateMarket != address(0)) {
IMarket(penultimateMarket).settleMarket();
}
if(marketCreationData[_marketType][_marketCurrencyIndex].marketAddress != address(0)) {
(,,,,,,,, uint _status) = getMarketDetails(marketCreationData[_marketType][_marketCurrencyIndex].marketAddress);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making marketStatus() public and then directly using that instead of this generic function will save a decent chunk of gas. However, that'll only work for new markets.

require(_status >= uint(IMarket.PredictionStatus.InSettlement));
}
(uint8 _roundOfToNearest, bytes32 _currencyName, address _priceFeed) = IMarket(marketCurrencies[_marketCurrencyIndex].marketImplementation).getMarketFeedData();
marketUtility.update();
uint64 _marketStartTime = calculateStartTimeForMarket(_marketType, _marketCurrencyIndex);
uint64 _optionRangePerc = marketTypes[_marketType].optionRangePerc;
uint currentPrice = marketUtility.getAssetPriceUSD(_priceFeed);
_optionRangePerc = uint64(currentPrice.mul(_optionRangePerc.div(2)).div(10000));
maxsam4 marked this conversation as resolved.
Show resolved Hide resolved
uint64 _decimals = marketCurrencies[_marketCurrencyIndex].decimals;
uint64 _minValue = uint64((ceil(currentPrice.sub(_optionRangePerc).div(_roundOfToNearest), 10**_decimals)).mul(_roundOfToNearest));
uint64 _maxValue = uint64((ceil(currentPrice.add(_optionRangePerc).div(_roundOfToNearest), 10**_decimals)).mul(_roundOfToNearest));
maxsam4 marked this conversation as resolved.
Show resolved Hide resolved
_createMarket(_marketType, _marketCurrencyIndex, _minValue, _maxValue, _marketStartTime, _currencyName);
_checkIfCreatorStaked(marketCreationData[_marketType][_marketCurrencyIndex].marketAddress);
marketCreationRewardUserData[msg.sender].marketsCreated.push(marketCreationData[_marketType][_marketCurrencyIndex].marketAddress);
uint256 gasUsed = gasProvided - gasleft();
_calculateIncentive(gasUsed, _marketType, _marketCurrencyIndex);
}

/**
* @dev internal function to calculate user incentive for market creation
*/
function _calculateIncentive(uint256 gasUsed, uint256 _marketType, uint256 _marketCurrencyIndex) internal{
address _marketAddress = marketCreationData[_marketType][_marketCurrencyIndex].marketAddress;
//Adding buffer gas for below calculations
gasUsed = gasUsed + 38500;
uint256 gasPrice = _checkGasPrice();
uint256 gasCost = gasUsed.mul(gasPrice);
(, uint256 incentive) = marketUtility.getValueAndMultiplierParameters(ETH_ADDRESS, gasCost);
marketCreationRewardUserData[msg.sender].incentives = marketCreationRewardUserData[msg.sender].incentives.add(incentive);
emit MarketCreationReward(msg.sender, _marketAddress, incentive, gasUsed, gasCost, gasPrice, tx.gasprice, maxGasPrice, marketCreationRewardData[_marketAddress].rewardPoolSharePerc);
}

/**
* @dev internal function to calculate market reward pool share percent to be rewarded to market creator
*/
function _checkIfCreatorStaked(address _market) internal {
uint256 tokensLocked = ITokenController(tokenController).tokensLockedAtTime(msg.sender, "SM", now);
//Intentionally performed mul operation after div, to get absolute value instead of decimals
marketCreationRewardData[_market].rewardPoolSharePerc
= Math.min(
maxRewardPoolPercForMC,
minRewardPoolPercForMC + tokensLocked.div(plotStakeForRewardPoolShare).mul(minRewardPoolPercForMC)
);
}

/**
* @dev Get market reward pool share percent to be rewarded to market creator
*/
function getMarketCreatorRPoolShareParams(address _market) external view returns(uint256, uint256) {
return (marketCreationRewardData[_market].rewardPoolSharePerc, rewardPoolShareThreshold);
}

/**
* @dev internal function to calculate gas price for market creation incentives
*/
function _checkGasPrice() internal view returns(uint256) {
uint fastGas = uint(clGasPriceAggregator.latestAnswer());
uint fastGasWithMaxDeviation = fastGas.mul(125).div(100);
return Math.min(Math.min(tx.gasprice,fastGasWithMaxDeviation), maxGasPrice);
}

/**
* @dev Resolve the dispute if wrong value passed at the time of market result declaration.
* @param _marketAddress The address specify the market.
* @param _result The final result of the market.
*/
function resolveDispute(address payable _marketAddress, uint256 _result) external onlyAuthorizedToGovern {
uint256 ethDepositedInPool = marketData[_marketAddress].disputeStakes.ethDeposited;
uint256 plotDepositedInPool = marketData[_marketAddress].disputeStakes.tokenDeposited;
uint256 stakedAmount = marketData[_marketAddress].disputeStakes.stakeAmount;
address payable staker = address(uint160(marketData[_marketAddress].disputeStakes.staker));
address plotTokenAddress = address(plotToken);
plotDepositedInPool = plotDepositedInPool.add(marketCreationRewardData[_marketAddress].plotIncentive);
ethDepositedInPool = ethDepositedInPool.add(marketCreationRewardData[_marketAddress].ethIncentive);
delete marketCreationRewardData[_marketAddress].plotIncentive;
delete marketCreationRewardData[_marketAddress].ethIncentive;
_transferAsset(plotTokenAddress, _marketAddress, plotDepositedInPool);
IMarket(_marketAddress).resolveDispute.value(ethDepositedInPool)(true, _result);
emit DisputeResolved(_marketAddress, true);
_transferAsset(plotTokenAddress, staker, stakedAmount);
}

/**
* @dev function to reward user for initiating market creation calls as per the new incetive calculations
*/
function claimCreationRewardV2(uint256 _maxRecords) external {
uint256 pendingPLOTReward = marketCreationRewardUserData[msg.sender].incentives;
require(pendingPLOTReward > 0);
delete marketCreationRewardUserData[msg.sender].incentives;
(uint256 ethIncentive, uint256 plotIncentive) = _getRewardPoolIncentives(_maxRecords);
pendingPLOTReward = pendingPLOTReward.add(plotIncentive);
_transferAsset(address(plotToken), msg.sender, pendingPLOTReward);
_transferAsset(ETH_ADDRESS, msg.sender, ethIncentive);
emit ClaimedMarketCreationReward(msg.sender, ethIncentive, pendingPLOTReward);
}

/**
* @dev internal function to calculate market reward pool share incentives for market creator
*/
function _getRewardPoolIncentives(uint256 _maxRecords) internal returns(uint256 ethIncentive, uint256 plotIncentive) {
MarketCreationRewardUserData storage rewardData = marketCreationRewardUserData[msg.sender];
uint256 len = rewardData.marketsCreated.length;
uint lastClaimed = len;
uint256 count;
uint256 i;
for(i = rewardData.lastClaimedIndex;i < len && count < _maxRecords; i++) {
maxsam4 marked this conversation as resolved.
Show resolved Hide resolved
MarketCreationRewardData memory marketData = marketCreationRewardData[rewardData.marketsCreated[i]];
if(marketData.ethIncentive > 0 || marketData.plotIncentive > 0) {
( , , , , , , , , uint _predictionStatus) = IMarket(rewardData.marketsCreated[i]).getData();
if(_predictionStatus == uint(IMarket.PredictionStatus.Settled)) {
ethIncentive = ethIncentive.add(marketData.ethIncentive);
plotIncentive = plotIncentive.add(marketData.plotIncentive);
count++;
maxsam4 marked this conversation as resolved.
Show resolved Hide resolved
} else {
if(lastClaimed == len) {
lastClaimed = i;
}
}
}
}
if(lastClaimed == len) {
lastClaimed = i;
}
rewardData.lastClaimedIndex = lastClaimed;
}

/**
* @dev Emits the MarketResult event.
* @param _totalReward The amount of reward to be distribute.
* @param winningOption The winning option of the market.
* @param closeValue The closing value of the market currency.
*/
function callMarketResultEventAndSetIncentives(uint256[] calldata _totalReward, uint256[] calldata marketCreatorIncentive, uint256 winningOption, uint256 closeValue, uint _roundId) external {
require(isMarket(msg.sender));
marketCreationRewardData[msg.sender].plotIncentive = marketCreatorIncentive[0];
marketCreationRewardData[msg.sender].ethIncentive = marketCreatorIncentive[1];
emit MarketResult(msg.sender, _totalReward, winningOption, closeValue, _roundId);
}


/**
* @dev function to update address parameters of market
*/
function updateConfigAddressParameters(bytes8 code, address payable value) external onlyAuthorizedToGovern {
if(code == "GASAGG") { // Incentive to be distributed to user for market creation
clGasPriceAggregator = IChainLinkOracle(value);
} else {
marketUtility.updateAddressParameters(code, value);
}
}

/**
* @dev function to update integer parameters of market
*/
function updateUintParameters(bytes8 code, uint256 value) external onlyAuthorizedToGovern {
if(code == "MCRINC") { // Incentive to be distributed to user for market creation
marketCreationIncentive = value;
} else if(code == "MAXGAS") { // Maximum gas upto which is considered while calculating market creation incentives
maxGasPrice = value;
} else if(code == "MAXRPSP") { // Max Reward Pool percent for market creator
maxRewardPoolPercForMC = value;
} else if(code == "MINRPSP") { // Min Reward Pool percent for market creator
minRewardPoolPercForMC = value;
} else if(code == "PSFRPS") { // Reward Pool percent for market creator
plotStakeForRewardPoolShare = value;
} else if(code == "RPSTH") { // Reward Pool percent for market creator
rewardPoolShareThreshold = value;
} else {
marketUtility.updateUintParameters(code, value);
}
}

/**
* @dev Get uint config parameters
*/
function getUintParameters(bytes8 code) external view returns(bytes8 codeVal, uint256 value) {
codeVal = code;
if(code == "MCRINC") {
value = marketCreationIncentive;
} else if(code == "MAXGAS") {
value = maxGasPrice;
} else if(code == "MAXRPSP") {
value = maxRewardPoolPercForMC;
} else if(code == "MINRPSP") {
value = minRewardPoolPercForMC;
} else if(code == "PSFRPS") {
value = plotStakeForRewardPoolShare;
} else if(code == "RPSTH") {
value = rewardPoolShareThreshold;
}
}

}
6 changes: 6 additions & 0 deletions contracts/interfaces/IMarketRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ contract IMarketRegistry {

function transferAssets(address _asset, address _to, uint _amount) external;

function callMarketResultEventAndSetIncentives(uint256[] calldata _totalReward, uint256[] calldata marketCreatorIncentive, uint256 winningOption, uint256 closeValue, uint _roundId) external;

function getUintParameters(bytes8 code) external view returns(bytes8 codeVal, uint256 value);

function getMarketCreatorRPoolShareParams(address _market) external view returns(uint256, uint256);

/**
* @dev Initialize the PlotX.
* @param _marketConfig The address of market config.
Expand Down
Loading