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 #11

Open
code423n4 opened this issue Jul 31, 2022 · 2 comments
Open

Gas Optimizations #11

code423n4 opened this issue Jul 31, 2022 · 2 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

x = x + y is cheaper than x += y

contracts\auth\AxelarAuthWeighted.sol:
   69          for (uint256 i = 0; i < weightsLength; ++i) {
   70:             totalWeight += newWeights[i];
   71          }

  104              // return if weight sum above threshold
  105:             weight += weights[operatorIndex];
  106              // weight needs to reach or surpass threshold

Inconsistent spacing in comments

Some lines use // x and some use //x. The instances below point out the usages that don't follow the majority, within each file

File: contracts\util\Proxy.sol
    45  // solhint-disable-next-line avoid-low-level-calls
    46  (bool success, ) = implementationAddress.delegatecall(
    47    //0x9ded06df is the setup selector.
    48    abi.encodeWithSelector(0x9ded06df, params)
);
@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Jul 31, 2022
code423n4 added a commit that referenced this issue Jul 31, 2022
@re1ro
Copy link
Member

re1ro commented Aug 5, 2022

1

Correct. Dup #2

2

Good spot

@GalloDaSballo
Copy link
Collaborator

20 gas saved

@re1ro re1ro added the sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons label Aug 23, 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

3 participants