Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
SigismundSchlomo committed Oct 7, 2024
1 parent 0d7d943 commit ba3191e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions contracts/staking/token/LimitedTokenPoolsManager.sol
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";
import "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol";
import "./LimitedTokenPool.sol";
import "../../funds/RewardsBank.sol";
import "../../LockKeeper.sol";

contract LimitedTokenPoolsManager is AccessControl {
contract LimitedTokenPoolsManager is Ownable {
LockKeeper lockKeeper;
RewardsBank public bank;
UpgradeableBeacon public limitedTokenPoolBeacon;

address[] public pools;

constructor(RewardsBank bank_, LockKeeper lockKeeper_, UpgradeableBeacon doubleSideBeacon_) {
constructor(RewardsBank bank_, LockKeeper lockKeeper_, UpgradeableBeacon doubleSideBeacon_) Ownable() {
lockKeeper = lockKeeper_;
bank = bank_;
limitedTokenPoolBeacon = doubleSideBeacon_;
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
}

event LimitedPoolCreated(address pool);
Expand All @@ -28,7 +27,7 @@ contract LimitedTokenPoolsManager is AccessControl {
event LimitedPoolActivated(address pool);

// LIMITED POOL METHODS
function createPool(LimitedTokenPool.MainConfig calldata params) public onlyRole(DEFAULT_ADMIN_ROLE) returns (address) {
function createPool(LimitedTokenPool.MainConfig calldata params) public onlyOwner returns (address) {
bytes memory data = abi.encodeWithSignature(
"initialize(address,address,(string,address,address,address))",
bank, lockKeeper, params);
Expand All @@ -39,21 +38,21 @@ contract LimitedTokenPoolsManager is AccessControl {
return pool;
}

function configurePool(address _pool, LimitedTokenPool.LimitsConfig calldata params) public onlyRole(DEFAULT_ADMIN_ROLE) {
function configurePool(address _pool, LimitedTokenPool.LimitsConfig calldata params) public onlyOwner {
require(_isPool(_pool),"Pool does not exist");
LimitedTokenPool pool = LimitedTokenPool(_pool);
pool.setLimitsConfig(params);
emit LimitedPoolConfigured(_pool, params);
}

function deactivatePool(address _pool) public onlyRole(DEFAULT_ADMIN_ROLE) {
function deactivatePool(address _pool) public onlyOwner {
require(_isPool(_pool),"Pool does not exist");
LimitedTokenPool pool = LimitedTokenPool(_pool);
pool.deactivate();
emit LimitedPoolDeactivated(_pool);
}

function activatePool(address _pool) public onlyRole(DEFAULT_ADMIN_ROLE) {
function activatePool(address _pool) public onlyOwner {
require(_isPool(_pool),"Pool does not exist");
LimitedTokenPool pool = LimitedTokenPool(_pool);
pool.activate();
Expand Down

0 comments on commit ba3191e

Please sign in to comment.