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

Open
code423n4 opened this issue Mar 30, 2022 · 2 comments
Open

Gas Optimizations #149

code423n4 opened this issue Mar 30, 2022 · 2 comments
Labels
bug Something isn't working G (Gas Optimization) resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix)

Comments

@code423n4
Copy link
Contributor

Public Function Can Be Changed to External

Description

The public functions that have not been called by the contract itself should be marked as external instead to save more gas and enforce the least privilege principle.

Permalinks

  1. https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/AnyswapFacet.sol#L35
  2. https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/CBridgeFacet.sol#L57

Mitigation

It is recommended that to change the function visibility from public to external if there is no plan to be called from the contract itself.

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Mar 30, 2022
code423n4 added a commit that referenced this issue Mar 30, 2022
@H3xept
Copy link
Collaborator

H3xept commented Apr 6, 2022

Fixed in previous commit.

@H3xept H3xept closed this as completed Apr 6, 2022
@H3xept
Copy link
Collaborator

H3xept commented Apr 8, 2022

Duplicate of #197

@H3xept H3xept marked this as a duplicate of #197 Apr 8, 2022
@H3xept H3xept added the resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) label Apr 11, 2022
@H3xept H3xept reopened this Apr 11, 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) resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix)
Projects
None yet
Development

No branches or pull requests

2 participants