dropped USE_ from Funding constants

This commit is contained in:
tim
2025-11-12 14:19:04 -04:00
parent d8f7bef4ac
commit c2ac0e3624
6 changed files with 29 additions and 29 deletions

View File

@@ -4,8 +4,8 @@ pragma solidity ^0.8.30;
library Funding {
/// @notice a constant passed to swap as the fundingSelector to indicate that the payer has used regular ERC20 approvals to allow the pool to move the necessary input tokens.
bytes4 internal constant USE_APPROVALS = 0x00000000;
bytes4 internal constant APPROVALS = 0x00000000;
/// @notice a constant passed to swap as the fundingSelector to indicate that the payer has already sent sufficient input tokens to the pool before calling swap, so no movement of input tokens is required.
bytes4 internal constant USE_PREFUNDING = 0x00000001;
bytes4 internal constant PREFUNDING = 0x00000001;
}

View File

@@ -264,10 +264,10 @@ contract PartyPool is PartyPoolBase, OwnableExternal, ERC20External, IPartyPool
IERC20 tokenIn = _tokens[inputTokenIndex];
IERC20 tokenOut = _tokens[outputTokenIndex];
if (fundingSelector == Funding.USE_APPROVALS)
if (fundingSelector == Funding.APPROVALS)
// Regular ERC20 permit of the pool to move the tokens
_receiveTokenFrom(payer, tokenIn, totalTransferAmount);
else if (fundingSelector == Funding.USE_PREFUNDING) {
else if (fundingSelector == Funding.PREFUNDING) {
require(limitPrice==0, 'Prefunding cannot be used with a limit price');
uint256 balance = tokenIn.balanceOf(address(this));
uint256 prevBalance = _cachedUintBalances[inputTokenIndex] + _protocolFeesOwed[inputTokenIndex];