Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add compilation restrictions #402

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

add compilation restrictions #402

wants to merge 14 commits into from

Conversation

gretzke
Copy link
Contributor

@gretzke gretzke commented Nov 26, 2024

No description provided.

@dianakocsis
Copy link
Contributor

could be removed

import {IPositionManager} from "../../src/interfaces/IPositionManager.sol";

@dianakocsis
Copy link
Contributor

getting warnings on these:

function notifyBurn(uint256 tokenId, address owner, PositionInfo info, uint256 liquidity, BalanceDelta feesAccrued)

function notifyBurn(uint256 tokenId, address owner, PositionInfo info, uint256 liquidity, BalanceDelta feesAccrued)

function notifyBurn(uint256 tokenId, address owner, PositionInfo info, uint256 liquidity, BalanceDelta feesAccrued)

@@ -21,8 +22,8 @@ contract MockReenterHook is BaseTestHooks {
}
(bytes4 selector, address owner, uint256 tokenId) = abi.decode(functionSelector, (bytes4, address, uint256));

if (selector == posm.transferFrom.selector) {
posm.transferFrom(owner, address(this), tokenId);
if (selector == IERC721(address(posm)).transferFrom.selector) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why doesnt IPositionManager just inherit from IERC721?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't really use an interface that defines the events because the solmate ERC721 implementation already includes the events and doesn't have an interface. So if IPositionManager inherits from IERC721 I get an error that the event with the same name and parameter types was defined twice. The only way around that would be to create a custom ERC721 interface without the events, so I opted for casting in the tests instead

@@ -20,12 +20,11 @@ import {SafeCast} from "@uniswap/v4-core/src/libraries/SafeCast.sol";
import {Position} from "@uniswap/v4-core/src/libraries/Position.sol";

import {IERC20} from "forge-std/interfaces/IERC20.sol";
import {IERC721} from "forge-std/interfaces/IERC721.sol";
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the change from OZ to forge?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every other test file was using forge for the token interfaces so I wanted to be consistent

@@ -837,6 +837,16 @@ contract PositionManagerModifyLiquiditiesTest is Test, PosmTestSetup, LiquidityF
assertEq(lpm.getPositionLiquidity(tokenId), initialLiquidity + newLiquidity);
}

struct BalanceDiff {
uint256 before;
uint256 _after;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the underscore needed? would prefer .after and .0 and .1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after is a reserved keyword, also you cannot use pure numbers as variable names

foundry.toml Outdated Show resolved Hide resolved
test/shared/Deploy.sol Outdated Show resolved Hide resolved
/// @dev If the pool is already initialized, this function will not revert and just return type(int24).max
/// @param key The PoolKey of the pool to initialize
/// @param sqrtPriceX96 The initial sqrtPriceX96 of the pool
/// @return tick The current tick of the pool, or type(int24).max if the pool creation failed, or the pool already existed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove tick here too!

@snreynolds snreynolds mentioned this pull request Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants