Skip to content

Commit

Permalink
Add setSettings function to contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
mzxyz committed Aug 16, 2023
1 parent f3ebee4 commit 482a66f
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contracts/ConsumerHost.sol
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ contract ConsumerHost is Initializable, OwnableUpgradeable, IConsumer, ERC165 {
sqt.approve(_channel, sqt.totalSupply());
}

/**
* @notice Update setting state.
* @param _settings ISettings contract
*/
function setSettings(ISettings _settings) external onlyOwner {
settings = _settings;
}

/**
* @notice Update fee percentage
* @param _feePercentage fee percentage
Expand Down
8 changes: 8 additions & 0 deletions contracts/DisputeManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ contract DisputeManager is IDisputeManager, Initializable, OwnableUpgradeable {
minimumDeposit = _minimumDeposit;
}

/**
* @notice Update setting state.
* @param _settings ISettings contract
*/
function setSettings(ISettings _settings) external onlyOwner {
settings = _settings;
}

function setMinimumDeposit(uint256 _minimumDeposit) external onlyOwner {
minimumDeposit = _minimumDeposit;
}
Expand Down
8 changes: 8 additions & 0 deletions contracts/EraManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ contract EraManager is Initializable, OwnableUpgradeable, IEraManager {
emit NewEraStart(eraNumber, msg.sender);
}

/**
* @notice Update setting state.
* @param _settings ISettings contract
*/
function setSettings(ISettings _settings) external onlyOwner {
settings = _settings;
}

function enableMaintenance() external onlyOwner {
maintenance = true;
}
Expand Down
8 changes: 8 additions & 0 deletions contracts/InflationController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ contract InflationController is Initializable, OwnableUpgradeable, Constants {
lastInflationTimestamp = block.timestamp;
}

/**
* @notice Update setting state.
* @param _settings ISettings contract
*/
function setSettings(ISettings _settings) external onlyOwner {
settings = _settings;
}

/**
* @notice Set the inflation rate
* @param _inflationRate One year inflationRate for SQT token
Expand Down
8 changes: 8 additions & 0 deletions contracts/PermissionedExchange.sol
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ contract PermissionedExchange is Initializable, OwnableUpgradeable {
}
}

/**
* @notice Update setting state.
* @param _settings ISettings contract
*/
function setSettings(ISettings _settings) external onlyOwner {
settings = _settings;
}

/**
* @notice Set controller role for this contract, controller have the permission to addQuota for trader.
* @param _controller The account address to set.
Expand Down
8 changes: 8 additions & 0 deletions contracts/PlanManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ contract PlanManager is Initializable, OwnableUpgradeable, IPlanManager {
nextPlanId = 1;
}

/**
* @notice Update setting state.
* @param _settings ISettings contract
*/
function setSettings(ISettings _settings) external onlyOwner {
settings = _settings;
}

/**
* @notice Set the indexer plan limit.
* @param _limit limit to set
Expand Down
8 changes: 8 additions & 0 deletions contracts/PurchaseOfferMarket.sol
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ contract PurchaseOfferMarket is Initializable, OwnableUpgradeable, IPurchaseOffe
penaltyDestination = _penaltyDestination;
}

/**
* @notice Update setting state.
* @param _settings ISettings contract
*/
function setSettings(ISettings _settings) external onlyOwner {
settings = _settings;
}

/**
* @notice allow admin the set the Penalty Rate for cancel unexpired offer.
* @param _penaltyRate penalty rate to set
Expand Down
8 changes: 8 additions & 0 deletions contracts/RewardsHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ contract RewardsHelper is Initializable, OwnableUpgradeable {
settings = _settings;
}

/**
* @notice Update setting state.
* @param _settings ISettings contract
*/
function setSettings(ISettings _settings) external onlyOwner {
settings = _settings;
}

/**
* @dev Apply a list of stakers' StakeChanges, call applyStakeChange one by one.
*/
Expand Down
8 changes: 8 additions & 0 deletions contracts/StakingManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ contract StakingManager is IStakingManager, Initializable, OwnableUpgradeable {
settings = _settings;
}

/**
* @notice Update setting state.
* @param _settings ISettings contract
*/
function setSettings(ISettings _settings) external onlyOwner {
settings = _settings;
}

/**
* @dev Indexers stake to themself.
* The caller can be either an existing indexer or IndexerRegistry contract. The staking change will be applied immediately if the caller is IndexerRegistry.
Expand Down
8 changes: 8 additions & 0 deletions contracts/StateChannel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ contract StateChannel is Initializable, OwnableUpgradeable {
settings = _settings;
}

/**
* @notice Update setting state.
* @param _settings ISettings contract
*/
function setSettings(ISettings _settings) external onlyOwner {
settings = _settings;
}

/**
* @notice Update the expiration of the terminate
* @param expiration terminate expiration time in seconds
Expand Down
8 changes: 8 additions & 0 deletions contracts/VSQToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ contract VSQToken is Initializable {
uint8 private _decimals = 18;
ISettings public settings;

/**
* @notice Update setting state.
* @param _settings ISettings contract
*/
function setSettings(ISettings _settings) external onlyOwner {
settings = _settings;
}

function initialize(ISettings _settings) external initializer {
settings = _settings;
}
Expand Down

0 comments on commit 482a66f

Please sign in to comment.