-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add backdoor.sol * rename to Dictator * bump version
- Loading branch information
1 parent
0f2c565
commit 8eb5cc4
Showing
5 changed files
with
328 additions
and
119 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,36 @@ | ||
pragma solidity ^0.5.17; | ||
|
||
import "../controller/Avatar.sol"; | ||
import "../controller/Controller.sol"; | ||
import "@openzeppelin/upgrades/contracts/Initializable.sol"; | ||
import "@openzeppelin/contracts-ethereum-package/contracts/ownership/Ownable.sol"; | ||
|
||
/** | ||
* @title A scheme for register other scheme with full permission. | ||
*/ | ||
|
||
contract Dictator is Initializable, Ownable { | ||
|
||
Avatar public avatar; | ||
|
||
/** | ||
* @dev registerScheme | ||
* @param _scheme the scheme to register (with full permission) | ||
*/ | ||
function registerScheme(address _scheme) external onlyOwner { | ||
//register a scheme with full permission :) | ||
require(Controller(avatar.owner()).registerScheme(_scheme, 0x0000001f), "Fail to register scheme"); | ||
} | ||
|
||
/** | ||
* @dev _initialize | ||
* @param _avatar the scheme avatar | ||
* @param _owner the contract owner | ||
*/ | ||
function initialize(Avatar _avatar, address _owner) public initializer { | ||
require(address(_avatar) != address(0), "Scheme must have avatar"); | ||
Ownable.initialize(_owner); | ||
avatar = _avatar; | ||
} | ||
|
||
} |
Oops, something went wrong.