Skip to content

Commit

Permalink
constructor position
Browse files Browse the repository at this point in the history
  • Loading branch information
mejango committed Aug 20, 2024
1 parent afde2c7 commit e88ebc8
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/JBBuybackHook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,30 @@ contract JBBuybackHook is JBPermissioned, IJBBuybackHook {
/// @custom:param projectId The ID of the project to get the twap parameters for.
mapping(uint256 projectId => uint256) internal _twapParamsOf;

//*********************************************************************//
// ---------------------------- constructor -------------------------- //
//*********************************************************************//

/// @param directory The directory of terminals and controllers.
/// @param controller The controller used to mint and burn tokens.
/// @param weth The WETH contract.
/// @param factory The address of the Uniswap v3 factory. Used to calculate pool addresses.
constructor(
IJBDirectory directory,
IJBController controller,
IWETH9 weth,
address factory
)
JBPermissioned(IJBPermissioned(address(controller)).PERMISSIONS())
{
DIRECTORY = directory;
CONTROLLER = controller;
PROJECTS = controller.PROJECTS();
// slither-disable-next-line missing-zero-check
UNISWAP_V3_FACTORY = factory;
WETH = weth;
}

//*********************************************************************//
// ------------------------- external views -------------------------- //
//*********************************************************************//
Expand Down Expand Up @@ -319,30 +343,6 @@ contract JBBuybackHook is JBPermissioned, IJBBuybackHook {
amountOut -= (amountOut * twapSlippageTolerance) / TWAP_SLIPPAGE_DENOMINATOR;
}

//*********************************************************************//
// ---------------------------- constructor -------------------------- //
//*********************************************************************//

/// @param directory The directory of terminals and controllers.
/// @param controller The controller used to mint and burn tokens.
/// @param weth The WETH contract.
/// @param factory The address of the Uniswap v3 factory. Used to calculate pool addresses.
constructor(
IJBDirectory directory,
IJBController controller,
IWETH9 weth,
address factory
)
JBPermissioned(IJBPermissioned(address(controller)).PERMISSIONS())
{
DIRECTORY = directory;
CONTROLLER = controller;
PROJECTS = controller.PROJECTS();
// slither-disable-next-line missing-zero-check
UNISWAP_V3_FACTORY = factory;
WETH = weth;
}

//*********************************************************************//
// ---------------------- external transactions ---------------------- //
//*********************************************************************//
Expand Down

0 comments on commit e88ebc8

Please sign in to comment.