<!-- canonical: https://0xsimao.com/findings/fuji-finance-constants-hardcoded-better-readability -->

# Constants should be placed as constants and not hardcoded for better readability

Low/Info · Three Sigma · Lending aggregator · 6th May, 2023

Finding 3S-FUJI-N14 of the Fuji Finance security review.

- Report: /reports/fuji-finance
- Source: https://cdn.sanity.io/files/qoqld077/staging/32181a28eac3175d15fb8924d249bb0d91ca350c.pdf

---

### Description

Hardcoded values are hard to track and constants should be used instead.

### Recommendation

For example in BorrowingVault, 1e18 is used several times for precision, which could be set
as a constant such as uint256 private constant PRECISION_CONSTANT = 1e18

### Status

Addressed here: [Fujicracy/fuji-v2#625](https://github.com/Fujicracy/fuji-v2/pull/625)

---

Related findings:

- [Hardcoded variables should be placed as constants](https://0xsimao.com/findings/metazero-i-hardcoded-variables-placed-constants): MetaZero Omnichain NFTs
- [`IDORoundConfig.idoPrice` could have a comment somewhere specifying the units for better readability](https://0xsimao.com/findings/blast-ido-pools-round-price-somewhere-specifying): Blast IDO Pools
- [Constants should not be hardcoded](https://0xsimao.com/findings/metazero-ii-constants-hardcoded): MetaZero Staking
- [Admin checks in KeyringCoreV2Base could be placed in a modifier to increase readability and reduce code duplication](https://0xsimao.com/findings/keyring-ii-placed-readability-reduce-duplication): Keyring Credentials
