From c124e028a7931298f2624497ebaf9f1c1e896c7d Mon Sep 17 00:00:00 2001 From: AkemiHomura-maow <34213712+AkemiHomura-maow@users.noreply.github.com> Date: Sun, 24 Mar 2024 04:04:32 +0800 Subject: [PATCH] feat(VeloOracle): admin functions Permissioned access to enable routing through certain CL --- contracts/VeloOracle.sol | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contracts/VeloOracle.sol b/contracts/VeloOracle.sol index 7165d63..4fcfa78 100644 --- a/contracts/VeloOracle.sol +++ b/contracts/VeloOracle.sol @@ -26,6 +26,7 @@ contract VeloOracle is IVeloOracle { address public immutable factoryV2; ICLFactory public immutable CLFactory; + address owner; mapping(address => mapping(address => ICLPool[])) public enabledCLPools; /// @notice Maximum number of hops allowed for rate calculations @@ -35,6 +36,7 @@ contract VeloOracle is IVeloOracle { constructor(address _factoryV2, address _CLFactory) { factoryV2 = _factoryV2; CLFactory = ICLFactory(_CLFactory); + owner = msg.sender; } /// @notice Struct to hold balance information for a pair @@ -82,8 +84,14 @@ contract VeloOracle is IVeloOracle { int24 tickSpacing; } - /// @notice Permissioned function to enable routing through certain CL + function change_owner(address _owner) public { + require(msg.sender == owner); + owner = _owner; + } + + /// @notice Permissioned function to enable routing through certain CL pools function enableCLPairTickSpacing(CLPairParams[] calldata params) public{ + require(msg.sender == owner); for (uint256 i; i < params.length; i++){ CLPairParams memory param = params[i]; address pair = CLFactory.getPool(param.tokenA, param.tokenB, param.tickSpacing);