<!-- canonical: https://0xsimao.com/findings/codeup-missing-key-zero-value -->

# Missing key zero value check

Low/Info · Three Sigma · DeFi game · 23rd October, 2024

Finding L-1 of the CODEUP security review.

- Report: /reports/codeup
- Source: https://cdn.sanity.io/files/qoqld077/staging/d9e57830a75b5165fd56e8b88037de7986a165ec.pdf

---

### Description

`gameETHForWithdrawRate` is set in `Codeup::constructor()` to `_gameETHPrice / 1000` but a zero check is missing.

### Recommendation

Add the `_checkValue()` function to `gameETHForWithdrawRate = _checkValue(_gameETHPrice / 1000)`.

---

Related findings:

- [Missing key events when requesting withdrawals that could be important for the allocator bot](https://0xsimao.com/findings/yieldoor-iii-requesting-withdrawals-allocator-bot): Yieldoor LoopedVault Update
- [KeyringCoreV2Base::registerKey() could check that validTo is equal to or bigger than block.timestamp](https://0xsimao.com/findings/keyring-ii-register-equal-bigger-timestamp): Keyring Credentials
- [Attacker can block LayerZero channel due to missing check of minimum gas passed](https://0xsimao.com/findings/tapioca-dao-layer-zero-channel-gas): Tapioca DAO
- [The check rewardSelector != ZERO BYTES4 && rewardDestination.isContract() could be improved](https://0xsimao.com/findings/felix-reward-zero-bytes4-improved): Felix Price Feeds
