From 6d99940a27293ac52a71bd81cec10f86cc422d62 Mon Sep 17 00:00:00 2001 From: AnshuJalan Date: Tue, 30 Jul 2024 12:22:43 +0530 Subject: [PATCH] feat: make task manager upgradeable --- SmartContracts/src/avs/PreconfTaskManager.sol | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SmartContracts/src/avs/PreconfTaskManager.sol b/SmartContracts/src/avs/PreconfTaskManager.sol index e5c5a49..670b6a5 100644 --- a/SmartContracts/src/avs/PreconfTaskManager.sol +++ b/SmartContracts/src/avs/PreconfTaskManager.sol @@ -8,8 +8,10 @@ import {IPreconfServiceManager} from "../interfaces/IPreconfServiceManager.sol"; import {IRegistryCoordinator} from "eigenlayer-middleware/interfaces/IRegistryCoordinator.sol"; import {IIndexRegistry} from "eigenlayer-middleware/interfaces/IIndexRegistry.sol"; import {ECDSA} from "openzeppelin-contracts/utils/cryptography/ECDSA.sol"; +import {IERC20} from "openzeppelin-contracts/token/ERC20/IERC20.sol"; +import {Initializable} from "openzeppelin-contracts-upgradeable/proxy/utils/Initializable.sol"; -contract PreconfTaskManager is IPreconfTaskManager { +contract PreconfTaskManager is IPreconfTaskManager, Initializable { IPreconfServiceManager internal immutable preconfServiceManager; IRegistryCoordinator internal immutable registryCoordinator; IIndexRegistry internal immutable indexRegistry; @@ -59,8 +61,11 @@ contract PreconfTaskManager is IPreconfTaskManager { indexRegistry = _indexRegistry; taikoL1 = _taikoL1; beaconBlockRootContract = _beaconBlockRootContract; + } + function initialize(IERC20 _taikoToken) external initializer { nextBlockId = 1; + _taikoToken.approve(address(taikoL1), type(uint256).max); } /**