Skip to content

Commit

Permalink
Enable VSQToken and Settings to be upgradeable (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
mzxyz authored Aug 17, 2023
1 parent dbcea39 commit f6e4f38
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 2 additions & 4 deletions contracts/Settings.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

pragma solidity 0.8.15;

import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';

import './interfaces/ISettings.sol';
import './Constants.sol';

contract Settings is ISettings, Ownable, Constants {
contract Settings is ISettings, OwnableUpgradeable, Constants {
address public sqToken;
address public staking;
address public stakingManager;
Expand All @@ -28,8 +28,6 @@ contract Settings is ISettings, Ownable, Constants {
address public stateChannel;
address public consumerRegistry;

constructor() Ownable() {}

function setProjectAddresses(
address _indexerRegistry,
address _queryRegistry,
Expand Down
12 changes: 11 additions & 1 deletion contracts/VSQToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

pragma solidity ^0.8.15;

import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';

import './interfaces/ISettings.sol';
import './interfaces/IStaking.sol';
import './interfaces/IVesting.sol';

contract VSQToken is Initializable {
contract VSQToken is Initializable, OwnableUpgradeable {
string private _name = 'VotingSubQueryToken';
string private _symbol = 'VSQT';
uint8 private _decimals = 18;
Expand All @@ -20,6 +21,15 @@ contract VSQToken is Initializable {
settings = _settings;
}

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


function name() public view returns (string memory) {
return _name;
}
Expand Down

0 comments on commit f6e4f38

Please sign in to comment.