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

Open
code423n4 opened this issue Aug 6, 2022 · 0 comments
Open

Gas Optimizations #250

code423n4 opened this issue Aug 6, 2022 · 0 comments

Comments

@code423n4
Copy link
Contributor

File: Community.sol

Recommendation : Change storage to memory

line 184

line 230

line 648

line 738

Recommendation : Change code order

Line can be moved before line 184

Recommendation : Remove unnecessary variable

_community.memberCount can be used directly in lines 198 and 199

Recommendation : Remove repeated require block

This syntax gets used four times so it could be a modifier in all instances except in the escrow():

require(
_msgSender() == _communities[_communityID].owner,
"Community::!Owner"
);

Likewise on line 386it is not capitalised unlike the others

"Community::!owner"

Recommendation : Remove unecessary return declaration

type name of sender not necessary line 903

Recommendation : Remove unecessary asignment

Can be set by default to true instea of doing so explicitely

File : HomeFi.sol

Recommendation : Shorten shorten ipfs (CID v1) hash to 32 bytes
line 284

mintNFT function, parameter string memory _tokenURI can be shortened to create a bytes32 type, rather than a string that stores 128 bytes for IPFS CIDs version 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants