-
Notifications
You must be signed in to change notification settings - Fork 497
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Louis Brown <[email protected]>
could be removed v4-periphery/test/shared/Planner.sol Line 6 in d1d087f
|
getting warnings on these:
|
@@ -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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Co-authored-by: Alice <[email protected]>
/// @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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove tick
here too!
No description provided.