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

feat: refactor #13

Merged
merged 21 commits into from
Sep 18, 2024
Merged

feat: refactor #13

merged 21 commits into from
Sep 18, 2024

Conversation

thaixuandang
Copy link
Collaborator

Description

Checklist

  • I have clearly commented on all the main functions following the NatSpec Format
  • The box that allows repo maintainers to update this PR is checked
  • I tested locally to make sure this feature/fix works

@thaixuandang thaixuandang force-pushed the feat/refactor branch 2 times, most recently from d95b6d9 to e3e0ee2 Compare August 21, 2024 09:25
src/periphery/V3Migrator.sol Outdated Show resolved Hide resolved
src/core/KatanaV3Factory.sol Outdated Show resolved Hide resolved
src/core/KatanaV3Pool.sol Outdated Show resolved Hide resolved
src/core/KatanaV3Pool.sol Outdated Show resolved Hide resolved
src/core/KatanaV3Pool.sol Outdated Show resolved Hide resolved
src/periphery/NonfungiblePositionManager.sol Outdated Show resolved Hide resolved
src/periphery/interfaces/IKatanaV2Pair.sol Show resolved Hide resolved
src/periphery/V3Migrator.sol Outdated Show resolved Hide resolved
src/external/KatanaGovernanceMock.sol Outdated Show resolved Hide resolved
src/core/KatanaV3Factory.sol Show resolved Hide resolved
@TuDo1403
Copy link
Collaborator

TuDo1403 commented Aug 25, 2024

I advise removing payable modifiers from functions since some peripheral contract use multi-delegate call.

foundry.toml Show resolved Hide resolved
@thaixuandang thaixuandang merged commit 0f0bb47 into release/v1.0.0 Sep 18, 2024
@thaixuandang thaixuandang deleted the feat/refactor branch September 18, 2024 08:02
(token0, token1, fee, tickSpacing) = (token0_, token1_, fee_, tickSpacing_);
// cache these immutable addresses for gas savings when swaps, mints, or burns are performed
governance = IKatanaV3Factory(factory_).owner();
positionManager = IKatanaGovernance(governance).getPositionManager();
Copy link

Choose a reason for hiding this comment

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

(Risk) Potential async risk when changing Governance or Position Manager address

Changing the governance or positionManager address in the factory (since it is upgradable) introduces a risk. It may break contract assumptions, affecting governance minting, swapping, and flash functionalities. If this occurs, the upgrade would also require updates to all active pools.

This known risk is documented here for future reference and should be formally addressed in documentation to prevent mistakes in future operations.

@@ -749,6 +734,11 @@ contract KatanaV3Pool is IKatanaV3Pool {
require(balance1Before.add(uint256(amount1)) <= balance1(), "IIA");
}

// transfer protocol fees to the treasury
if (state.protocolFee > 0) {
TransferHelper.safeTransfer(tokenIn, IKatanaV3Factory(factory).treasury(), state.protocolFee);
Copy link

Choose a reason for hiding this comment

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

should it also emit Collect event here or a new type of event (optional) ?

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.

3 participants