mirror of
https://github.com/Instadapp/yield-contract.git
synced 2024-07-29 21:47:29 +00:00
Merge pull request #15 from InstaDApp/flusher-owner-calls
Differentiating flusher from the system
This commit is contained in:
commit
c6ae072dac
|
@ -1,16 +1,98 @@
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
pragma solidity ^0.6.8;
|
pragma solidity ^0.6.8;
|
||||||
|
|
||||||
contract Deployer {
|
contract Controller {
|
||||||
|
|
||||||
mapping (address => bool) public flushers;
|
event LogNewMaster(address indexed master);
|
||||||
|
event LogUpdateMaster(address indexed master);
|
||||||
|
event LogEnableConnector(address indexed connector);
|
||||||
|
event LogDisableConnector(address indexed connector);
|
||||||
|
event LogAddSigner(address indexed signer);
|
||||||
|
event LogRemoveSigner(address indexed signer);
|
||||||
|
|
||||||
|
address private newMaster;
|
||||||
|
address public master;
|
||||||
|
mapping (address => bool) public connectors;
|
||||||
|
mapping (address => bool) public signer;
|
||||||
|
|
||||||
|
modifier isMaster() {
|
||||||
|
require(msg.sender == master, "not-master");
|
||||||
|
_;
|
||||||
|
}
|
||||||
|
|
||||||
|
// change the master address
|
||||||
|
function changeMaster(address _newMaster) external isMaster {
|
||||||
|
require(_newMaster != master, "already-a-master");
|
||||||
|
require(_newMaster != address(0), "not-valid-address");
|
||||||
|
require(newMaster != _newMaster, "already-a-new-master");
|
||||||
|
newMaster = _newMaster;
|
||||||
|
emit LogNewMaster(_newMaster);
|
||||||
|
}
|
||||||
|
|
||||||
|
// new master claiming master position
|
||||||
|
function claimMaster() external {
|
||||||
|
require(newMaster != address(0), "not-valid-address");
|
||||||
|
require(msg.sender == newMaster, "not-new-master");
|
||||||
|
master = newMaster;
|
||||||
|
newMaster = address(0);
|
||||||
|
emit LogUpdateMaster(master);
|
||||||
|
}
|
||||||
|
|
||||||
|
// enable connector
|
||||||
|
function enableConnector(address _connector) external isMaster {
|
||||||
|
require(!connectors[_connector], "already-enabled");
|
||||||
|
require(_connector != address(0), "invalid-connector");
|
||||||
|
connectors[_connector] = true;
|
||||||
|
emit LogEnableConnector(_connector);
|
||||||
|
}
|
||||||
|
|
||||||
|
// disable connector
|
||||||
|
function disableConnector(address _connector) external isMaster {
|
||||||
|
require(connectors[_connector], "already-disabled");
|
||||||
|
delete connectors[_connector];
|
||||||
|
emit LogDisableConnector(_connector);
|
||||||
|
}
|
||||||
|
|
||||||
|
// enable signer
|
||||||
|
function enableSigner(address _signer) external isMaster {
|
||||||
|
require(_signer != address(0), "invalid-address");
|
||||||
|
require(!signer[_signer], "signer-already-enabled");
|
||||||
|
signer[_signer] = true;
|
||||||
|
emit LogAddSigner(_signer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// disable signer
|
||||||
|
function disableSigner(address _signer) external isMaster {
|
||||||
|
require(_signer != address(0), "invalid-address");
|
||||||
|
require(signer[_signer], "signer-already-disabled");
|
||||||
|
delete signer[_signer];
|
||||||
|
emit LogRemoveSigner(_signer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if connectors[] are enabled
|
||||||
|
function isConnector(address[] calldata _connectors) external view returns (bool isOk) {
|
||||||
|
isOk = true;
|
||||||
|
for (uint i = 0; i < _connectors.length; i++) {
|
||||||
|
if (!connectors[_connectors[i]]) {
|
||||||
|
isOk = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
contract InstaDeployer is Controller {
|
||||||
|
|
||||||
event LogNewFlusher(address indexed owner, address indexed flusher, address indexed logic);
|
event LogNewFlusher(address indexed owner, address indexed flusher, address indexed logic);
|
||||||
|
|
||||||
|
mapping (address => address) public flushers;
|
||||||
|
|
||||||
// deploy create2 + minimal proxy
|
// deploy create2 + minimal proxy
|
||||||
function deployLogic(address owner, address logic) public returns (address proxy) {
|
function deployLogic(address owner, address logic) public returns (address proxy) {
|
||||||
require(!(isFlusherDeployed(getAddress(owner, logic))), "flusher-already-deployed");
|
require(!(isFlusherDeployed(getAddress(owner, logic))), "flusher-already-deployed");
|
||||||
bytes32 salt = keccak256(abi.encodePacked(owner, proxy));
|
bytes32 salt = keccak256(abi.encodePacked(owner, logic));
|
||||||
bytes20 targetBytes = bytes20(logic);
|
bytes20 targetBytes = bytes20(logic);
|
||||||
// solium-disable-next-line security/no-inline-assembly
|
// solium-disable-next-line security/no-inline-assembly
|
||||||
assembly {
|
assembly {
|
||||||
|
@ -26,10 +108,11 @@ contract Deployer {
|
||||||
)
|
)
|
||||||
proxy := create2(0, clone, 0x37, salt)
|
proxy := create2(0, clone, 0x37, salt)
|
||||||
}
|
}
|
||||||
flushers[proxy] = true;
|
flushers[proxy] = owner;
|
||||||
emit LogNewFlusher(owner, proxy, logic);
|
emit LogNewFlusher(owner, proxy, logic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// is flusher deployed?
|
||||||
function isFlusherDeployed(address _address) public view returns (bool) {
|
function isFlusherDeployed(address _address) public view returns (bool) {
|
||||||
uint32 size;
|
uint32 size;
|
||||||
assembly {
|
assembly {
|
||||||
|
@ -53,10 +136,17 @@ contract Deployer {
|
||||||
return address(bytes20(rawAddress << 96));
|
return address(bytes20(rawAddress << 96));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get logic contract creation code
|
||||||
function getCreationCode(address logic) public pure returns (bytes memory) {
|
function getCreationCode(address logic) public pure returns (bytes memory) {
|
||||||
bytes20 a = bytes20(0x3D602d80600A3D3981F3363d3d373d3D3D363d73);
|
bytes20 a = bytes20(0x3D602d80600A3D3981F3363d3d373d3D3D363d73);
|
||||||
bytes20 b = bytes20(logic);
|
bytes20 b = bytes20(logic);
|
||||||
bytes15 c = bytes15(0x5af43d82803e903d91602b57fd5bf3);
|
bytes15 c = bytes15(0x5af43d82803e903d91602b57fd5bf3);
|
||||||
return abi.encodePacked(a, b, c);
|
return abi.encodePacked(a, b, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constructor(address _master) public {
|
||||||
|
master = _master;
|
||||||
|
emit LogUpdateMaster(master);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,8 +3,8 @@
|
||||||
pragma solidity ^0.6.8;
|
pragma solidity ^0.6.8;
|
||||||
pragma experimental ABIEncoderV2;
|
pragma experimental ABIEncoderV2;
|
||||||
|
|
||||||
interface RegistryInterface {
|
interface DeployerInterface {
|
||||||
function signer(address) external view returns (bool);
|
function signer(address) external view returns (bool);
|
||||||
function isConnector(address[] calldata) external view returns (bool);
|
function isConnector(address[] calldata) external view returns (bool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ contract Flusher {
|
||||||
|
|
||||||
string constant public name = "Flusher-v1";
|
string constant public name = "Flusher-v1";
|
||||||
|
|
||||||
RegistryInterface public constant registry = RegistryInterface(address(0)); // TODO - Change while deploying
|
DeployerInterface public constant deployer = DeployerInterface(address(0)); // TODO - Change while deploying
|
||||||
|
|
||||||
function spell(address _target, bytes memory _data) internal {
|
function spell(address _target, bytes memory _data) internal {
|
||||||
require(_target != address(0), "target-invalid");
|
require(_target != address(0), "target-invalid");
|
||||||
|
@ -29,9 +29,9 @@ contract Flusher {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cast(address[] calldata _targets, bytes[] calldata _datas) external payable {
|
function cast(address[] calldata _targets, bytes[] calldata _datas) external payable {
|
||||||
require(registry.signer(msg.sender), "not-signer");
|
require(deployer.signer(msg.sender), "not-signer");
|
||||||
require(_targets.length == _datas.length , "invalid-array-length");
|
require(_targets.length == _datas.length , "invalid-array-length");
|
||||||
require(registry.isConnector(_targets), "not-connector");
|
require(deployer.isConnector(_targets), "not-connector");
|
||||||
for (uint i = 0; i < _targets.length; i++) {
|
for (uint i = 0; i < _targets.length; i++) {
|
||||||
spell(_targets[i], _datas[i]);
|
spell(_targets[i], _datas[i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ interface IndexInterface {
|
||||||
interface RegistryInterface {
|
interface RegistryInterface {
|
||||||
function chief(address) external view returns (bool);
|
function chief(address) external view returns (bool);
|
||||||
function poolLogic(address) external returns (address);
|
function poolLogic(address) external returns (address);
|
||||||
function flusherLogic(address) external returns (address);
|
|
||||||
function fee(address) external view returns (uint);
|
function fee(address) external view returns (uint);
|
||||||
function poolCap(address) external view returns (uint);
|
function poolCap(address) external view returns (uint);
|
||||||
function checkSettleLogics(address, address[] calldata) external view returns (bool);
|
function checkSettleLogics(address, address[] calldata) external view returns (bool);
|
||||||
|
@ -25,10 +24,6 @@ interface RateInterface {
|
||||||
function getTotalToken() external returns (uint totalUnderlyingTkn);
|
function getTotalToken() external returns (uint totalUnderlyingTkn);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FlusherLogicInterface {
|
|
||||||
function isFlusher(address) external returns (bool);
|
|
||||||
}
|
|
||||||
|
|
||||||
contract PoolToken is ReentrancyGuard, ERC20Pausable, DSMath {
|
contract PoolToken is ReentrancyGuard, ERC20Pausable, DSMath {
|
||||||
using SafeERC20 for IERC20;
|
using SafeERC20 for IERC20;
|
||||||
|
|
||||||
|
@ -61,11 +56,6 @@ contract PoolToken is ReentrancyGuard, ERC20Pausable, DSMath {
|
||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
|
|
||||||
modifier isFlusher() {
|
|
||||||
require(FlusherLogicInterface(registry.flusherLogic(address(this))).isFlusher(msg.sender), "not-flusher");
|
|
||||||
_;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev sets exchange rate
|
* @dev sets exchange rate
|
||||||
*/
|
*/
|
||||||
|
@ -128,7 +118,7 @@ contract PoolToken is ReentrancyGuard, ERC20Pausable, DSMath {
|
||||||
* @param tknAmt token amount
|
* @param tknAmt token amount
|
||||||
* @return mintAmt amount of wrap token minted
|
* @return mintAmt amount of wrap token minted
|
||||||
*/
|
*/
|
||||||
function deposit(uint tknAmt) public payable whenNotPaused isFlusher returns (uint mintAmt) {
|
function deposit(uint tknAmt) external payable whenNotPaused returns (uint mintAmt) {
|
||||||
require(msg.value == 0, "non-eth-pool");
|
require(msg.value == 0, "non-eth-pool");
|
||||||
uint _tokenBal = wdiv(totalSupply(), exchangeRate);
|
uint _tokenBal = wdiv(totalSupply(), exchangeRate);
|
||||||
uint _newTknBal = add(_tokenBal, tknAmt);
|
uint _newTknBal = add(_tokenBal, tknAmt);
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
pragma solidity ^0.6.8;
|
pragma solidity ^0.6.8;
|
||||||
pragma experimental ABIEncoderV2;
|
pragma experimental ABIEncoderV2;
|
||||||
|
|
||||||
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
|
|
||||||
import "@openzeppelin/contracts/token/ERC20/ERC20Pausable.sol";
|
import "@openzeppelin/contracts/token/ERC20/ERC20Pausable.sol";
|
||||||
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
|
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
|
||||||
|
|
||||||
|
@ -15,7 +14,6 @@ interface IndexInterface {
|
||||||
interface RegistryInterface {
|
interface RegistryInterface {
|
||||||
function chief(address) external view returns (bool);
|
function chief(address) external view returns (bool);
|
||||||
function poolLogic(address) external returns (address);
|
function poolLogic(address) external returns (address);
|
||||||
function flusherLogic(address) external returns (address);
|
|
||||||
function fee(address) external view returns (uint);
|
function fee(address) external view returns (uint);
|
||||||
function poolCap(address) external view returns (uint);
|
function poolCap(address) external view returns (uint);
|
||||||
function checkSettleLogics(address, address[] calldata) external view returns (bool);
|
function checkSettleLogics(address, address[] calldata) external view returns (bool);
|
||||||
|
@ -25,12 +23,7 @@ interface RateInterface {
|
||||||
function getTotalToken() external returns (uint totalUnderlyingTkn);
|
function getTotalToken() external returns (uint totalUnderlyingTkn);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FlusherLogicInterface {
|
|
||||||
function isFlusher(address) external returns (bool);
|
|
||||||
}
|
|
||||||
|
|
||||||
contract PoolETH is ReentrancyGuard, ERC20Pausable, DSMath {
|
contract PoolETH is ReentrancyGuard, ERC20Pausable, DSMath {
|
||||||
using SafeERC20 for IERC20;
|
|
||||||
|
|
||||||
event LogExchangeRate(uint exchangeRate, uint tokenBalance, uint insuranceAmt);
|
event LogExchangeRate(uint exchangeRate, uint tokenBalance, uint insuranceAmt);
|
||||||
event LogSettle(uint settleBlock);
|
event LogSettle(uint settleBlock);
|
||||||
|
@ -60,11 +53,6 @@ contract PoolETH is ReentrancyGuard, ERC20Pausable, DSMath {
|
||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
|
|
||||||
modifier isFlusher() {
|
|
||||||
require(FlusherLogicInterface(registry.flusherLogic(address(this))).isFlusher(msg.sender), "not-flusher");
|
|
||||||
_;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev sets exchange rate
|
* @dev sets exchange rate
|
||||||
*/
|
*/
|
||||||
|
@ -127,7 +115,7 @@ contract PoolETH is ReentrancyGuard, ERC20Pausable, DSMath {
|
||||||
* @param tknAmt token amount
|
* @param tknAmt token amount
|
||||||
* @return mintAmt amount of wrap token minted
|
* @return mintAmt amount of wrap token minted
|
||||||
*/
|
*/
|
||||||
function deposit(uint tknAmt) public whenNotPaused payable isFlusher returns (uint mintAmt) {
|
function deposit(uint tknAmt) external whenNotPaused payable returns (uint mintAmt) {
|
||||||
require(tknAmt == msg.value, "unmatched-amount");
|
require(tknAmt == msg.value, "unmatched-amount");
|
||||||
uint _tokenBal = wdiv(totalSupply(), exchangeRate);
|
uint _tokenBal = wdiv(totalSupply(), exchangeRate);
|
||||||
uint _newTknBal = add(_tokenBal, tknAmt);
|
uint _newTknBal = add(_tokenBal, tknAmt);
|
||||||
|
|
|
@ -11,27 +11,19 @@ contract Registry {
|
||||||
|
|
||||||
event LogAddChief(address indexed chief);
|
event LogAddChief(address indexed chief);
|
||||||
event LogRemoveChief(address indexed chief);
|
event LogRemoveChief(address indexed chief);
|
||||||
event LogAddSigner(address indexed signer);
|
event LogUpdatePoolLogic(address pool, address newLogic);
|
||||||
event LogRemoveSigner(address indexed signer);
|
event LogUpdateFee(address pool, uint newFee);
|
||||||
event LogUpdatePoolLogic(address token, address newLogic);
|
event LogUpdateCap(address pool, uint newCap);
|
||||||
event LogUpdateFlusherLogic(address token, address newLogic);
|
event LogAddSettleLogic(address indexed pool, address indexed logic);
|
||||||
event LogUpdateFee(address token, uint newFee);
|
event LogRemoveSettleLogic(address indexed pool, address indexed logic);
|
||||||
event LogUpdateCap(address token, uint newFee);
|
|
||||||
event LogAddSettleLogic(address indexed token, address indexed logic);
|
|
||||||
event LogRemoveSettleLogic(address indexed token, address indexed logic);
|
|
||||||
event LogFlusherConnectorsEnable(address indexed connector);
|
|
||||||
event LogFlusherConnectorsDisable(address indexed connector);
|
|
||||||
|
|
||||||
IndexInterface public constant instaIndex = IndexInterface(0x2971AdFa57b20E5a416aE5a708A8655A9c74f723);
|
IndexInterface public constant instaIndex = IndexInterface(0x2971AdFa57b20E5a416aE5a708A8655A9c74f723);
|
||||||
|
|
||||||
mapping (address => bool) public chief;
|
mapping (address => bool) public chief;
|
||||||
mapping (address => bool) public signer;
|
|
||||||
mapping (address => address) public poolLogic;
|
mapping (address => address) public poolLogic;
|
||||||
mapping (address => address) public flusherLogic;
|
|
||||||
mapping (address => uint) public poolCap;
|
mapping (address => uint) public poolCap;
|
||||||
mapping (address => uint) public fee;
|
mapping (address => uint) public fee;
|
||||||
mapping (address => mapping(address => bool)) public settleLogic;
|
mapping (address => mapping(address => bool)) public settleLogic;
|
||||||
mapping (address => bool) public flusherConnectors;
|
|
||||||
|
|
||||||
modifier isMaster() {
|
modifier isMaster() {
|
||||||
require(msg.sender == instaIndex.master(), "not-master");
|
require(msg.sender == instaIndex.master(), "not-master");
|
||||||
|
@ -65,28 +57,6 @@ contract Registry {
|
||||||
emit LogRemoveChief(_chief);
|
emit LogRemoveChief(_chief);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @dev Enable New Signer.
|
|
||||||
* @param _signer Address of the new signer.
|
|
||||||
*/
|
|
||||||
function enableSigner(address _signer) external isChief {
|
|
||||||
require(_signer != address(0), "invalid-address");
|
|
||||||
require(!signer[_signer], "signer-already-enabled");
|
|
||||||
signer[_signer] = true;
|
|
||||||
emit LogAddSigner(_signer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @dev Disable Signer.
|
|
||||||
* @param _signer Address of the existing signer.
|
|
||||||
*/
|
|
||||||
function disableSigner(address _signer) external isChief {
|
|
||||||
require(_signer != address(0), "invalid-address");
|
|
||||||
require(signer[_signer], "signer-already-disabled");
|
|
||||||
delete signer[_signer];
|
|
||||||
emit LogRemoveSigner(_signer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev update pool rate logic
|
* @dev update pool rate logic
|
||||||
* @param _pool pool address
|
* @param _pool pool address
|
||||||
|
@ -100,19 +70,6 @@ contract Registry {
|
||||||
emit LogUpdatePoolLogic(_pool, _newLogic);
|
emit LogUpdatePoolLogic(_pool, _newLogic);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @dev update flusher logic
|
|
||||||
* @param _pool pool address
|
|
||||||
* @param _newLogic new flusher logic address
|
|
||||||
*/
|
|
||||||
function updateFlusherLogic(address _pool, address _newLogic) external isMaster {
|
|
||||||
require(_pool != address(0), "invalid-pool");
|
|
||||||
require(_newLogic != address(0), "invalid-address");
|
|
||||||
require(flusherLogic[_pool] != _newLogic, "same-pool-logic");
|
|
||||||
flusherLogic[_pool] = _newLogic;
|
|
||||||
emit LogUpdateFlusherLogic(_pool, _newLogic);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev update pool fee
|
* @dev update pool fee
|
||||||
* @param _pool pool address
|
* @param _pool pool address
|
||||||
|
@ -127,9 +84,9 @@ contract Registry {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev update pool fee
|
* @dev update pool cap
|
||||||
* @param _pool pool address
|
* @param _pool pool address
|
||||||
* @param _newCap new fee amount
|
* @param _newCap new cap amount
|
||||||
*/
|
*/
|
||||||
function updateCap(address _pool, uint _newCap) external isMaster {
|
function updateCap(address _pool, uint _newCap) external isMaster {
|
||||||
require(_pool != address(0), "invalid-pool");
|
require(_pool != address(0), "invalid-pool");
|
||||||
|
@ -144,6 +101,7 @@ contract Registry {
|
||||||
*/
|
*/
|
||||||
function addSettleLogic(address _pool, address _logic) external isMaster {
|
function addSettleLogic(address _pool, address _logic) external isMaster {
|
||||||
require(_pool != address(0), "invalid-pool");
|
require(_pool != address(0), "invalid-pool");
|
||||||
|
require(!settleLogic[_pool][_logic], "already-settle-added");
|
||||||
settleLogic[_pool][_logic] = true;
|
settleLogic[_pool][_logic] = true;
|
||||||
emit LogAddSettleLogic(_pool, _logic);
|
emit LogAddSettleLogic(_pool, _logic);
|
||||||
}
|
}
|
||||||
|
@ -155,31 +113,11 @@ contract Registry {
|
||||||
*/
|
*/
|
||||||
function removeSettleLogic(address _pool, address _logic) external isMaster {
|
function removeSettleLogic(address _pool, address _logic) external isMaster {
|
||||||
require(_pool != address(0), "invalid-pool");
|
require(_pool != address(0), "invalid-pool");
|
||||||
|
require(settleLogic[_pool][_logic], "already-settle-removed");
|
||||||
delete settleLogic[_pool][_logic];
|
delete settleLogic[_pool][_logic];
|
||||||
emit LogRemoveSettleLogic(_pool, _logic);
|
emit LogRemoveSettleLogic(_pool, _logic);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @dev enable pool connector
|
|
||||||
* @param _connector logic proxy
|
|
||||||
*/
|
|
||||||
function enableConnector(address _connector) external isChief {
|
|
||||||
require(!flusherConnectors[_connector], "already-enabled");
|
|
||||||
require(_connector != address(0), "invalid-connector");
|
|
||||||
flusherConnectors[_connector] = true;
|
|
||||||
emit LogFlusherConnectorsEnable(_connector);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @dev disable pool connector
|
|
||||||
* @param _connector logic proxy
|
|
||||||
*/
|
|
||||||
function disableConnector(address _connector) external isChief {
|
|
||||||
require(flusherConnectors[_connector], "already-disabled");
|
|
||||||
delete flusherConnectors[_connector];
|
|
||||||
emit LogFlusherConnectorsDisable(_connector);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev check if settle logics are enabled
|
* @dev check if settle logics are enabled
|
||||||
* @param _pool token pool address
|
* @param _pool token pool address
|
||||||
|
@ -195,22 +133,8 @@ contract Registry {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @dev check if connectors are enabled
|
|
||||||
* @param _connectors array of logic proxy
|
|
||||||
*/
|
|
||||||
function isConnector(address[] calldata _connectors) external view returns (bool isOk) {
|
|
||||||
isOk = true;
|
|
||||||
for (uint i = 0; i < _connectors.length; i++) {
|
|
||||||
if (!flusherConnectors[_connectors[i]]) {
|
|
||||||
isOk = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(address _chief) public {
|
constructor(address _chief) public {
|
||||||
chief[_chief] = true;
|
chief[_chief] = true;
|
||||||
emit LogAddChief(_chief);
|
emit LogAddChief(_chief);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user