Skip to content

Commit

Permalink
rename getHooksCalls --> getHookPermissions
Browse files Browse the repository at this point in the history
  • Loading branch information
saucepoint committed Dec 22, 2023
1 parent 75bbc78 commit 79adb27
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .forge-snapshots/FullRangeAddInitialLiquidity.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
409213
409191
2 changes: 1 addition & 1 deletion .forge-snapshots/FullRangeAddLiquidity.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
203210
203188
2 changes: 1 addition & 1 deletion .forge-snapshots/FullRangeRemoveLiquidity.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
196013
195978
2 changes: 1 addition & 1 deletion .forge-snapshots/FullRangeRemoveLiquidityAndRebalance.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
376728
376636
2 changes: 1 addition & 1 deletion .forge-snapshots/TWAMMSubmitOrder.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
145878
145856
4 changes: 2 additions & 2 deletions contracts/BaseHook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ abstract contract BaseHook is IHooks {
_;
}

function getHooksCalls() public pure virtual returns (Hooks.Permissions memory);
function getHookPermissions() public pure virtual returns (Hooks.Permissions memory);

// this function is virtual so that we can override it during testing,
// which allows us to deploy an implementation to any address
// and then etch the bytecode into the correct address
function validateHookAddress(BaseHook _this) internal pure virtual {
Hooks.validateHookPermissions(_this, getHooksCalls());
Hooks.validateHookPermissions(_this, getHookPermissions());
}

function lockAcquired(address, /*sender*/ bytes calldata data)
Expand Down
2 changes: 1 addition & 1 deletion contracts/hooks/examples/FullRange.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ contract FullRange is BaseHook, ILockCallback {
_;
}

function getHooksCalls() public pure override returns (Hooks.Permissions memory) {
function getHookPermissions() public pure override returns (Hooks.Permissions memory) {
return Hooks.Permissions({
beforeInitialize: true,
afterInitialize: false,
Expand Down
2 changes: 1 addition & 1 deletion contracts/hooks/examples/GeomeanOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ contract GeomeanOracle is BaseHook {

constructor(IPoolManager _poolManager) BaseHook(_poolManager) {}

function getHooksCalls() public pure override returns (Hooks.Permissions memory) {
function getHookPermissions() public pure override returns (Hooks.Permissions memory) {
return Hooks.Permissions({
beforeInitialize: true,
afterInitialize: true,
Expand Down
2 changes: 1 addition & 1 deletion contracts/hooks/examples/LimitOrder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ contract LimitOrder is BaseHook {

constructor(IPoolManager _poolManager) BaseHook(_poolManager) {}

function getHooksCalls() public pure override returns (Hooks.Permissions memory) {
function getHookPermissions() public pure override returns (Hooks.Permissions memory) {
return Hooks.Permissions({
beforeInitialize: false,
afterInitialize: true,
Expand Down
2 changes: 1 addition & 1 deletion contracts/hooks/examples/TWAMM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ contract TWAMM is BaseHook, ITWAMM {
expirationInterval = _expirationInterval;
}

function getHooksCalls() public pure override returns (Hooks.Permissions memory) {
function getHookPermissions() public pure override returns (Hooks.Permissions memory) {
return Hooks.Permissions({
beforeInitialize: true,
afterInitialize: false,
Expand Down
2 changes: 1 addition & 1 deletion contracts/hooks/examples/VolatilityOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract VolatilityOracle is BaseHook, IDynamicFeeManager {
deployTimestamp = _blockTimestamp();
}

function getHooksCalls() public pure override returns (Hooks.Permissions memory) {
function getHookPermissions() public pure override returns (Hooks.Permissions memory) {
return Hooks.Permissions({
beforeInitialize: true,
afterInitialize: false,
Expand Down
2 changes: 1 addition & 1 deletion test/shared/implementation/FullRangeImplementation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {Hooks} from "@uniswap/v4-core/src/libraries/Hooks.sol";

contract FullRangeImplementation is FullRange {
constructor(IPoolManager _poolManager, FullRange addressToEtch) FullRange(_poolManager) {
Hooks.validateHookPermissions(addressToEtch, getHooksCalls());
Hooks.validateHookPermissions(addressToEtch, getHookPermissions());
}

// make this a no-op in testing
Expand Down
2 changes: 1 addition & 1 deletion test/shared/implementation/GeomeanOracleImplementation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ contract GeomeanOracleImplementation is GeomeanOracle {
uint32 public time;

constructor(IPoolManager _poolManager, GeomeanOracle addressToEtch) GeomeanOracle(_poolManager) {
Hooks.validateHookPermissions(addressToEtch, getHooksCalls());
Hooks.validateHookPermissions(addressToEtch, getHookPermissions());
}

// make this a no-op in testing
Expand Down
2 changes: 1 addition & 1 deletion test/shared/implementation/LimitOrderImplementation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {Hooks} from "@uniswap/v4-core/src/libraries/Hooks.sol";

contract LimitOrderImplementation is LimitOrder {
constructor(IPoolManager _poolManager, LimitOrder addressToEtch) LimitOrder(_poolManager) {
Hooks.validateHookPermissions(addressToEtch, getHooksCalls());
Hooks.validateHookPermissions(addressToEtch, getHookPermissions());
}

// make this a no-op in testing
Expand Down
2 changes: 1 addition & 1 deletion test/shared/implementation/TWAMMImplementation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {Hooks} from "@uniswap/v4-core/src/libraries/Hooks.sol";

contract TWAMMImplementation is TWAMM {
constructor(IPoolManager poolManager, uint256 interval, TWAMM addressToEtch) TWAMM(poolManager, interval) {
Hooks.validateHookPermissions(addressToEtch, getHooksCalls());
Hooks.validateHookPermissions(addressToEtch, getHookPermissions());
}

// make this a no-op in testing
Expand Down

0 comments on commit 79adb27

Please sign in to comment.