Skip to content

Commit

Permalink
feat(VeloOracle): admin functions
Browse files Browse the repository at this point in the history
Permissioned access to enable routing through certain CL
  • Loading branch information
AkemiHomura-maow committed Mar 23, 2024
1 parent 62d36c7 commit c124e02
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion contracts/VeloOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c124e02

Please sign in to comment.