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

General gas tweaks #57

Merged
merged 10 commits into from
May 31, 2024
Merged

General gas tweaks #57

merged 10 commits into from
May 31, 2024

Conversation

ChefMist
Copy link
Collaborator

General minor gas tweaks to reduce gas

@@ -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))
);
Copy link
Collaborator

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

CleanShot 2024-05-31 at 10 09 42@2x

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();
Copy link
Collaborator

Choose a reason for hiding this comment

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

lollll.. This is sick

chefburger
chefburger previously approved these changes May 31, 2024
Copy link
Collaborator

@chefburger chefburger left a comment

Choose a reason for hiding this comment

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

lgtm

@ChefMist ChefMist merged commit 4e838c8 into main May 31, 2024
2 checks passed
@ChefMist ChefMist deleted the feat/gas-tweaks branch May 31, 2024 03:05
@ChefMist ChefMist mentioned this pull request Jun 1, 2024
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.

2 participants