-
Notifications
You must be signed in to change notification settings - Fork 2
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
Rename functions to reduce gas costs #185
base: main
Are you sure you want to change the base?
Rename functions to reduce gas costs #185
Conversation
@@ -430,13 +430,13 @@ | |||
/// @notice claims rewards from a specific pool | |||
/// @param _pid the id of the pool | |||
/// @param _gauge address of the gauge | |||
function claimRewards(uint256 _pid, address _gauge) external { | |||
function claimRewards_poF(uint256 _pid, address _gauge) external { |
Check warning
Code scanning / Slither
Conformance to Solidity naming conventions
@@ -208,13 +208,18 @@ | |||
|
|||
/// @notice Claims rewards from a pool and disperses them to the rewards contract | |||
/// @param _pid the id of the pool where lp tokens are held | |||
function earmarkRewards(uint256 _pid) external; | |||
/// weird naming reduces gas cost | |||
function earmarkRewards_pcp(uint256 _pid) external; |
Check warning
Code scanning / Slither
Conformance to Solidity naming conventions
@@ -227,8 +232,11 @@ | |||
bool | |||
); | |||
|
|||
function claimRewards(uint256, address) external; | |||
/// weird naming reduces gas cost | |||
function claimRewards_poF(uint256, address) external; |
Check warning
Code scanning / Slither
Conformance to Solidity naming conventions
|
||
function claimRewards() external; | ||
function claimRewards_6H10() external; |
Check warning
Code scanning / Slither
Conformance to Solidity naming conventions
@@ -430,13 +430,13 @@ | |||
/// @notice claims rewards from a specific pool | |||
/// @param _pid the id of the pool | |||
/// @param _gauge address of the gauge | |||
function claimRewards(uint256 _pid, address _gauge) external { | |||
function claimRewards_poF(uint256 _pid, address _gauge) external { |
Check warning
Code scanning / Slither
Conformance to Solidity naming conventions
@@ -62,7 +62,7 @@ | |||
|
|||
function release() external; | |||
|
|||
function claimBal(address _gauge) external returns (uint256); | |||
function claimBal__mo(address _gauge) external returns (uint256); |
Check warning
Code scanning / Slither
Conformance to Solidity naming conventions
@@ -485,27 +485,27 @@ | |||
} | |||
|
|||
/// @inheritdoc IController | |||
function earmarkRewards(uint256 _pid) external { | |||
function earmarkRewards_pcp(uint256 _pid) external { |
Check warning
Code scanning / Slither
Conformance to Solidity naming conventions
@@ -116,9 +116,9 @@ | |||
} | |||
|
|||
interface IStash { | |||
function processStash() external; | |||
function processStash_WfQ() external; |
Check warning
Code scanning / Slither
Conformance to Solidity naming conventions
@@ -179,17 +179,17 @@ | |||
/// @notice Claims VeBal tokens | |||
/// @param _gauge The gauge to claim from | |||
/// @return amount claimed | |||
function claimBal(address _gauge) external onlyOperator returns (uint256) { | |||
function claimBal__mo(address _gauge) external onlyOperator returns (uint256) { |
Check warning
Code scanning / Slither
Conformance to Solidity naming conventions
|
||
/// @notice Claims rewards from the Balancer's fee distributor contract and transfers the tokens into the rewards contract | ||
function earmarkFees() external; | ||
/// weird naming reduces gas cost | ||
function earmarkFees_F4P() external; |
Check warning
Code scanning / Slither
Conformance to Solidity naming conventions
Codecov Report
@@ Coverage Diff @@
## main #185 +/- ##
=======================================
Coverage 99.85% 99.85%
=======================================
Files 13 13
Lines 697 697
Branches 88 88
=======================================
Hits 696 696
Misses 1 1
Continue to review full report at Codecov.
|
Just tbh I don't like this solution. I understand that it maybe saves 40 gas for each call, which is like 10^11 wei, but what we have is 10^18 is one ether, which means we need to have 10 000 000 calls to reach the price of 1 ether. And due to the fact that the contract call is let's say 20-40k gas, this thing is just 0,1% increase of the cost, but in return we get beautiful and easier to read/understand function names. |
Normal name earmarkRewards consumes 252510 and weird name one 252395. The difference is 115. Convex called earmarkRewards 125903 times from the start (8/05/21) Let's say that we do half of that. |
See issue for description and explanation