-
Notifications
You must be signed in to change notification settings - Fork 45
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
[Gas optimization] Suggestion from Ottersec #180
Conversation
|
@@ -12,7 +12,7 @@ pragma solidity ^0.8.20; | |||
* simply including this module, only once the modifiers are put in place. | |||
*/ | |||
abstract contract Pausable { | |||
bool private _paused; | |||
uint256 private _paused; |
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.
if so , should we remove the comments above ?
copy from ......
src/pool-cl/libraries/CLPosition.sol
Outdated
mstore(add(fmp, 0x40), 0) // fmp+0x40 held salt | ||
mstore(add(fmp, 0x20), 0) // fmp+0x20 held tickLower, tickUpper, salt | ||
mstore(fmp, 0) // fmp held owner | ||
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) |
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 guess we might need to clear upper bits for owner as well i.e.and(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, owner)
since the or operation for owner is executed last
mstore(add(fmp, 0x40), 0) // fmp+0x40 held salt | ||
mstore(add(fmp, 0x20), 0) // fmp+0x20 held binId, salt | ||
mstore(fmp, 0) // fmp held owner | ||
mstore(0x0, or(shl(160, binId), owner)) // binId at [0x09,0x0c), owner at [0x0c, 0x20) |
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.
same as above, we might need to clear upper bits for owner
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.
rest looks good
This PR implements the gas feedback optimization from OtterSec