DepositFactory ACL
Only system can call setExternalDependencies
@@ -3,15 +3,17 @@ pragma solidity ^0.5.10;
import "./CloneFactory.sol";
import "../deposit/Deposit.sol";
import "../system/TBTCSystem.sol";
+import "../system/SystemAuthority.sol";
import {TBTCDepositToken} from "../system/TBTCDepositToken.sol";
+
/// @title Deposit Factory
/// @notice Factory for the creation of new deposit clones.
/// @dev We avoid redeployment of deposit contract by using the clone factory.
/// Proxy delegates calls to Deposit and therefore does not affect deposit state.
/// This means that we only need to deploy the deposit contracts once.
/// The factory provides clean state for every new deposit clone.
-contract DepositFactory is CloneFactory{
+contract DepositFactory is CloneFactory, SystemAuthority{
// Holds the address of the deposit contract
// which will be used as a master contract for cloning.
@@ -24,6 +26,10 @@ contract DepositFactory is CloneFactory{
uint256 public keepThreshold;
uint256 public keepSize;
+ constructor(address _systemAddress)
+ SystemAuthority(_systemAddress)
+ public {}
+
/// @dev Set the required external variables
/// @param _masterDepositAddress The address of the master deposit contract
/// @param _tbtcSystem Address of system contract
@@ -42,7 +48,7 @@ contract DepositFactory is CloneFactory{
address _vendingMachine,
uint256 _keepThreshold,
uint256 _keepSize
- ) public {
+ ) public onlySystem{
masterDepositAddress = _masterDepositAddress;
tbtcSystem = _tbtcSystem;
tbtcToken = _tbtcToken;
