-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement and unit test the claimFees method on the factory owner
Allows anyone to call claim fees, pay the payout amount in the payout token, and receive the fees earned by the protocol on a given pool.
- Loading branch information
Showing
6 changed files
with
318 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
pragma solidity ^0.8.23; | ||
|
||
interface INotifiableRewardReceiver { | ||
function notifyRewardsAmount(uint256 _amount) external; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
pragma solidity ^0.8.23; | ||
|
||
/// @title Permissioned pool actions | ||
/// @notice Contains pool methods that may only be called by the factory owner | ||
/// @dev Vendored from | ||
/// https://github.com/Uniswap/v3-core/blob/d8b1c635c275d2a9450bd6a78f3fa2484fef73eb/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol | ||
interface IUniswapV3PoolOwnerActions { | ||
/// @notice Set the denominator of the protocol's % share of the fees | ||
/// @param feeProtocol0 new protocol fee for token0 of the pool | ||
/// @param feeProtocol1 new protocol fee for token1 of the pool | ||
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; | ||
|
||
/// @notice Collect the protocol fee accrued to the pool | ||
/// @param recipient The address to which collected protocol fees should be sent | ||
/// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only | ||
/// token1 | ||
/// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only | ||
/// token0 | ||
/// @return amount0 The protocol fee collected in token0 | ||
/// @return amount1 The protocol fee collected in token1 | ||
function collectProtocol(address recipient, uint128 amount0Requested, uint128 amount1Requested) | ||
external | ||
returns (uint128 amount0, uint128 amount1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
pragma solidity 0.8.23; | ||
|
||
import {INotifiableRewardReceiver} from "src/interfaces/INotifiableRewardReceiver.sol"; | ||
|
||
contract MockRewardReceiver is INotifiableRewardReceiver { | ||
uint256 public lastParam__notifyRewardsAmount_amount; | ||
|
||
function notifyRewardsAmount(uint256 _amount) external { | ||
lastParam__notifyRewardsAmount_amount = _amount; | ||
} | ||
} |
Oops, something went wrong.