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

Closed
code423n4 opened this issue Apr 27, 2022 · 1 comment
Closed

Gas Optimizations #91

code423n4 opened this issue Apr 27, 2022 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists G (Gas Optimization)

Comments

@code423n4
Copy link
Contributor

https://github.com/fei-protocol/xTRIBE/blob/989e47d176facbb0c38bc1e1ca58672f179159e1/src/xTRIBE.sol#L89
In solidity uint256 variables initialice in 0
In the function emitVotingBalances remove the i initialize

Proposal improve:

    function emitVotingBalances(address[] calldata accounts)
        external
        requiresAuth
    {
        uint256 size = accounts.length;

        for (uint256 i; i < size; ) {
            emit DelegateVotesChanged(accounts[i], 0, getVotes(accounts[i]));

            unchecked {
                i++;
            }
        }
    }
@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Apr 27, 2022
code423n4 added a commit that referenced this issue Apr 27, 2022
@0xean 0xean added the duplicate This issue or pull request already exists label May 19, 2022
@0xean
Copy link
Collaborator

0xean commented May 19, 2022

dupe of #90

@0xean 0xean closed this as completed May 19, 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 duplicate This issue or pull request already exists G (Gas Optimization)
Projects
None yet
Development

No branches or pull requests

2 participants