-
Notifications
You must be signed in to change notification settings - Fork 47
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
General gas tweaks #57
Conversation
@@ -50,7 +50,7 @@ abstract contract ProtocolFees is IProtocolFees, PausableRole { | |||
if (gasleft() < controllerGasLimit) revert ProtocolFeeCannotBeFetched(); | |||
|
|||
(bool _success, bytes memory _data) = address(protocolFeeController).call{gas: controllerGasLimit}( | |||
abi.encodeWithSelector(IProtocolFeeController.protocolFeeForPool.selector, key) | |||
abi.encodeCall(IProtocolFeeController.protocolFeeForPool, (key)) | |||
); |
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.
tbh i never used encodeCall
before 😂.. Just in case someone is with me
https://soliditylang.org/blog/2021/12/20/solidity-0.8.11-release-announcement/
/// @param x The uint256 to be downcasted | ||
/// @return The downcasted integer, now type uint160 | ||
function toUint160(uint256 x) internal pure returns (uint160) { | ||
if (x >= 1 << 160) _revertOverflow(); |
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.
lollll.. This is sick
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.
lgtm
General minor gas tweaks to reduce gas