Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #224 from PolymathNetwork/freeze-minting
Freeze Minting Permanently
- Loading branch information
Showing
25 changed files
with
845 additions
and
411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ReclaimTokens.sol"; | ||
import "./interfaces/IFeatureRegistry.sol"; | ||
|
||
/** | ||
* @title Registry for managing polymath feature switches | ||
*/ | ||
contract FeatureRegistry is IFeatureRegistry, ReclaimTokens { | ||
|
||
mapping (bytes32 => bool) public featureStatus; | ||
|
||
event LogChangeFeatureStatus(string _nameKey, bool _newStatus); | ||
|
||
/** | ||
* @notice Get the status of a feature | ||
* @param _nameKey is the key for the feature status mapping | ||
* @return bool | ||
*/ | ||
function getFeatureStatus(string _nameKey) external view returns(bool) { | ||
bytes32 key = keccak256(bytes(_nameKey)); | ||
return featureStatus[key]; | ||
} | ||
|
||
/** | ||
* @notice change a feature status | ||
* @param _nameKey is the key for the feature status mapping | ||
* @param _newStatus is the new feature status | ||
*/ | ||
function setFeatureStatus(string _nameKey, bool _newStatus) public onlyOwner { | ||
bytes32 key = keccak256(bytes(_nameKey)); | ||
require(featureStatus[key] != _newStatus, "New feature status must be different than existing status"); | ||
emit LogChangeFeatureStatus(_nameKey, _newStatus); | ||
featureStatus[key] = _newStatus; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
/** | ||
* @title Interface for managing polymath feature switches | ||
*/ | ||
interface IFeatureRegistry { | ||
|
||
/** | ||
* @notice Get the status of a feature | ||
* @param _nameKey is the key for the feature status mapping | ||
* @return bool | ||
*/ | ||
function getFeatureStatus(string _nameKey) external view returns(bool); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.