Skip to content

Commit

Permalink
add dictator.sol (#752)
Browse files Browse the repository at this point in the history
* add backdoor.sol

* rename to Dictator

* bump version
  • Loading branch information
orenyodfat authored May 25, 2020
1 parent 0f2c565 commit 8eb5cc4
Show file tree
Hide file tree
Showing 5 changed files with 328 additions and 119 deletions.
36 changes: 36 additions & 0 deletions contracts/schemes/Dictator.sol
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;
}

}
Loading

0 comments on commit 8eb5cc4

Please sign in to comment.