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

Enable VSQToken and Settings to be upgradeable #227

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading