Closed code423n4 closed 2 years ago
sirhashalot
The MAX_TOTAL_XDEFI_SUPPLY variable can be a constant since it does not and cannot be changed. This is documented in the Solidity docs to save gas: https://docs.soliditylang.org/en/v0.8.11/contracts.html?highlight=gas%20costs#constant-and-immutable-state-variables
https://github.com/XDeFi-tech/xdefi-distribution/blob/3856a42df295183b40c6eee89307308f196612fe/contracts/XDEFIDistribution.sol#L14
Make the MAX_TOTAL_XDEFI_SUPPLY variable constant to save gas
Agred. However, due to other changes we will be making due to the aduit, MAX_TOTAL_XDEFI_SUPPLY will be removed.
MAX_TOTAL_XDEFI_SUPPLY
Duplicate #36
Handle
sirhashalot
Vulnerability details
Impact
The MAX_TOTAL_XDEFI_SUPPLY variable can be a constant since it does not and cannot be changed. This is documented in the Solidity docs to save gas: https://docs.soliditylang.org/en/v0.8.11/contracts.html?highlight=gas%20costs#constant-and-immutable-state-variables
Proof of Concept
https://github.com/XDeFi-tech/xdefi-distribution/blob/3856a42df295183b40c6eee89307308f196612fe/contracts/XDEFIDistribution.sol#L14
Recommended Mitigation Steps
Make the MAX_TOTAL_XDEFI_SUPPLY variable constant to save gas