Rename functions to reduce gas costs#185
Conversation
| /// @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
| /// @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
|
|
||
| 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 processStash_WfQ() external; | ||
|
|
||
| function claimRewards() external; | ||
| function claimRewards_6H10() external; |
Check warning
Code scanning / Slither
Conformance to Solidity naming conventions
| /// @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
| 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
|
|
||
| /// @inheritdoc IController | ||
| function earmarkFees() external { | ||
| function earmarkFees_F4P() external { |
Check warning
Code scanning / Slither
Conformance to Solidity naming conventions
|
|
||
| interface IStash { | ||
| function processStash() external; | ||
| function processStash_WfQ() external; |
Check warning
Code scanning / Slither
Conformance to Solidity naming conventions
| /// @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