You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This codebase currently uses magic numbers in certain areas. Replacing these magic numbers with descriptive constants will significantly improve code readability and maintainability.
some more magic numbers are used. It can be updated with constants
Also, Instead of declaring all variables as public. All variables can be declared as private and we can write external getter functions to get the values. Which can prove to be gas-efficient.
The text was updated successfully, but these errors were encountered:
allwin199
changed the title
Update Magic Number with constants and Update public variables with private for gas-efficiency
Update Magic Numbers with constants and Update public variables with private for gas-efficiency
Mar 17, 2024
allwin199
changed the title
Update Magic Numbers with constants and Update public variables with private for gas-efficiency
Update Magic Numbers with constants and Update public variables with private for gas-efficiency
Mar 17, 2024
This codebase currently uses magic numbers in certain areas. Replacing these magic numbers with descriptive constants will significantly improve code readability and maintainability.
erc20-paymaster/src/ERC20Paymaster.sol
Line 79 in 8e37933
1e6
magic number
can be updated withPRICE_DENOMINATOR
in the below lineerc20-paymaster/src/ERC20Paymaster.sol
Lines 134 to 136 in 8e37933
erc20-paymaster/src/ERC20Paymaster.sol
Lines 140 to 142 in 8e37933
The above lines can be updated with the below lines of code.
some more magic numbers are used. It can be updated with
constants
Also, Instead of declaring all variables as
public
. All variables can be declared asprivate
and we can writeexternal
getter functions to get the values. Which can prove to be gas-efficient.External Getter function
The text was updated successfully, but these errors were encountered: