Skip to content

Commit

Permalink
feat: pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ChefMist committed Oct 9, 2024
1 parent 071d087 commit e75a9da
Show file tree
Hide file tree
Showing 20 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .forge-snapshots/BinHookTest#testBurnSucceedsWithHook.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
178303
178321
2 changes: 1 addition & 1 deletion .forge-snapshots/BinHookTest#testMintSucceedsWithHook.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
311493
311511
2 changes: 1 addition & 1 deletion .forge-snapshots/BinPoolManagerBytecodeSize.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24242
24269
Original file line number Diff line number Diff line change
@@ -1 +1 @@
133831
133846
Original file line number Diff line number Diff line change
@@ -1 +1 @@
142628
142646
Original file line number Diff line number Diff line change
@@ -1 +1 @@
289548
289677
2 changes: 1 addition & 1 deletion .forge-snapshots/BinPoolManagerTest#testGasBurnOneBin.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
127005
127019
Original file line number Diff line number Diff line change
@@ -1 +1 @@
970345
970507
Original file line number Diff line number Diff line change
@@ -1 +1 @@
329656
329818
Original file line number Diff line number Diff line change
@@ -1 +1 @@
337809
337827
Original file line number Diff line number Diff line change
@@ -1 +1 @@
140359
140377
Original file line number Diff line number Diff line change
@@ -1 +1 @@
304766
304784
2 changes: 1 addition & 1 deletion .forge-snapshots/CLPoolManagerBytecodeSize.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21187
21220
Original file line number Diff line number Diff line change
@@ -1 +1 @@
347575
347599
Original file line number Diff line number Diff line change
@@ -1 +1 @@
163046
163070
Original file line number Diff line number Diff line change
@@ -1 +1 @@
238332
238356
Original file line number Diff line number Diff line change
@@ -1 +1 @@
112689
112713
2 changes: 1 addition & 1 deletion src/base/Pausable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.20;

/**
* @dev Copy from openZeppelin contracts(v5.0.0) (utils/Pausable.sol), and remove unnecessary functions.
* @dev Referenced from openZeppelin contracts(v5.0.0) (utils/Pausable.sol), removed unnecessary functions and gas optimization.
* Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
Expand Down
2 changes: 1 addition & 1 deletion src/pool-bin/libraries/BinPosition.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ library BinPosition {
// dev same as `positionKey = keccak256(abi.encodePacked(binId, owner, salt))`
// make salt, binId, owner to be tightly packed in memory
assembly ("memory-safe") {
mstore(0x0, or(shl(160, binId), owner)) // binId at [0x09,0x0c), owner at [0x0c, 0x20)
mstore(0x0, or(shl(160, binId), and(owner, 0xffffffffffffffffffffffffffffffffffffffff))) // binId at [0x09,0x0c), owner at [0x0c, 0x20)
mstore(0x20, salt) // salt at [0x20, 0x40)
key := keccak256(0x09, 0x37)
}
Expand Down
8 changes: 7 additions & 1 deletion src/pool-cl/libraries/CLPosition.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ library CLPosition {
// same as `positionKey = keccak256(abi.encodePacked(tickLower, tickUpper, owner, salt))`
// make salt, tickUpper, tickLower, owner to be tightly packed in memory
assembly ("memory-safe") {
mstore(0x0, or(shl(160, and(0xFFFFFF, tickUpper)), or(shl(184, tickLower), owner))) // tickLower at [0x06, 0x09), tickUpper at [0x09,0x0c), owner at [0x0c, 0x20)
mstore(
0x0,
or(
shl(160, and(0xFFFFFF, tickUpper)),
or(shl(184, tickLower), and(owner, 0xffffffffffffffffffffffffffffffffffffffff))
)
) // tickLower at [0x06, 0x09), tickUpper at [0x09,0x0c), owner at [0x0c, 0x20)
mstore(0x20, salt) // salt at [0x20, 0x40)
key := keccak256(0x06, 0x3a) // len is 58 bytes
}
Expand Down

0 comments on commit e75a9da

Please sign in to comment.