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

Gas Optimizations #164

Open
code423n4 opened this issue May 23, 2022 · 0 comments
Open

Gas Optimizations #164

code423n4 opened this issue May 23, 2022 · 0 comments
Labels
bug Something isn't working G (Gas Optimization) sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons

Comments

@code423n4
Copy link
Contributor

Gas Optimization

  1. remove usage of .add, .sub, .mul and .div
    Since the contract is written with solidity 0.8, there's no need to use SafeMath library for basic operation + - * /.

  2. don't read user balance in AuraClaimZap if Option.UseAllWalletFunds is false.
    In contract AuraClaimZap, it currently read crvBalance and cvxBalance first and pass it into _claimExtras. But it's not really used if Option.UseAllWalletFund is false.

uint256 crvBalance = IERC20(crv).balanceOf(msg.sender);
uint256 cvxBalance = IERC20(cvx).balanceOf(msg.sender);

That being said, it would be better if the function don't read the balance if it won't be used in _claimExtras

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels May 23, 2022
code423n4 added a commit that referenced this issue May 23, 2022
@0xMaharishi 0xMaharishi added the sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons label May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working G (Gas Optimization) sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Projects
None yet
Development

No branches or pull requests

2 participants