From 6600facbfb978a684207106828e003e045d0e581 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Thu, 24 Sep 2020 16:23:18 +0530 Subject: [PATCH] Added whitelist logic mapping in deployer.sol --- contracts/flusher/deployer.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/contracts/flusher/deployer.sol b/contracts/flusher/deployer.sol index a72d99d..1d28381 100644 --- a/contracts/flusher/deployer.sol +++ b/contracts/flusher/deployer.sol @@ -7,6 +7,8 @@ contract Controller { event LogNewMaster(address indexed master); event LogUpdateMaster(address indexed master); event LogEnableConnector(address indexed connector); + event LogDisableImplementation(address indexed logic); + event LogEnableImplementation(address indexed logic); event LogDisableConnector(address indexed connector); event LogAddSigner(address indexed signer); event LogRemoveSigner(address indexed signer); @@ -14,6 +16,7 @@ contract Controller { address private newMaster; address public master; mapping (address => bool) public connectors; + mapping (address => bool) public implementationLogic; mapping (address => bool) public signer; modifier isMaster() { @@ -54,6 +57,21 @@ contract Controller { emit LogDisableConnector(_connector); } + // enable Implementation Logic + function enableImplementationLogic(address _implementationLogic) external isMaster { + require(!implementationLogic[_implementationLogic], "already-enabled"); + require(_implementationLogic != address(0), "invalid-logic"); + implementationLogic[_implementationLogic] = true; + emit LogEnableImplementation(_implementationLogic); + } + + // disable Implementation Logic + function disableImplementationLogic(address _implementationLogic) external isMaster { + require(implementationLogic[_implementationLogic], "already-disabled"); + delete implementationLogic[_implementationLogic]; + emit LogDisableImplementation(_implementationLogic); + } + // enable signer function enableSigner(address _signer) external isMaster { require(_signer != address(0), "invalid-address");