Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions src/LiquidityManagerV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,45 @@ contract LiquidityManagerV2 is Ownable, ReentrancyGuard, Pausable {

event SupportedTokenUpdated(address indexed token, bool supported);

////////////////////
// Modifiers //
////////////////////

modifier onlyFactory() {
if (msg.sender != factoryContract) {
revert LiquidityManager__UnauthorizedCaller();
}
_;
}

modifier validTokenPair(address token0, address token1) {
if (token0 == address(0) || token1 == address(0) || token0 == token1) {
revert LiquidityManager__InvalidTokenAddress();
}
_;
}

modifier onlySupportedTokens(address token0, address token1) {
if (!supportedTokens[token0] || !supportedTokens[token1]) {
revert LiquidityManager__TokenNotSupported();
}
_;
}

modifier validAmount(uint256 amount) {
if (amount == 0) {
revert LiquidityManager__InvalidAmount();
}
_;
}

modifier deadlineCheck(uint256 deadline) {
if (block.timestamp > deadline) {
revert LiquidityManager__DeadlineExpired();
}
_;
}

////////////////////
// Constructor //
////////////////////
Expand Down
Loading