code-423n4 / 2022-06-canto-v2-findings

0 stars 0 forks source link

Gas Optimizations #162

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago
  1. Value can be set as immutable

1.) File : Proposal-Store.sol Proposal-Store.sol

address private UniGovModAcct;
  1. sing short reason string can be used for saving more gas

Every reason string takes at least 32 bytes. Use short reason strings that fits in 32 bytes or it will become more expensive.

Tool Used

Manual Review

Occurances

main/contracts/NoteInterest.sol#L167 "only the admin may set the base rate"; -> change "only admin"
main/contracts/NoteInterest.sol#L180 "only the admin may set the adjuster coefficient" -> change "only admin"
main/contracts/NoteInterest.sol#L193 "only the admin may set the update frequency" -> change "only admin"
main/contracts/Stableswap/BaseV1-periphery.sol#L104 "BaseV1Router: IDENTICAL_ADDRESSES" -> change "ID" //Identical_Addresses
main/contracts/CNote.sol#L105 "Accountant has not been correctly supplied" -> change "ANCS" //Accountant not correct supplied
main/contracts/CNote.sol#L147 "TOKEN_TRANSFER_OUT_FAILED"
main/contracts/CNote.sol#L148 "cNote::doTransferOut: TransferOut Failed"
main/contracts/Treasury/TreasuryDelegator.sol#L31 "GovernorBravoDelegator::setImplementation: admin only" -> change "only admin"
main/contracts/Treasury/TreasuryDelegator.sol#L32 "GovernorBravoDelegator::setImplementation: invalid implementation address" -> "inv_addr"
GalloDaSballo commented 2 years ago

2.1k from immutable, rest is negligible