<!-- canonical: https://0xsimao.com/findings/ostium-unnecessary-typecasting-msg-sender -->

# Unnecessary Typecasting of msg.sender

Low/Info · Three Sigma · RWA perpetuals DEX · 19th February, 2024

Finding 3S-OS-N05 of the Ostium security review.

- Protocol: https://www.ostium.com/
- Report: /reports/ostium
- Source: https://cdn.sanity.io/files/qoqld077/production/a95b9c69e0f65d1d6b0e649f0d62a362358ca8ce.pdf

---

### Description

Unnecessary typecasting of msg.sender to address is seen on [L34](https://github.com/0xOstium/smart-contracts-threeSigma/blob/1b70cffbac621d39e321c159e45c048b703add92/src/OstiumLinkUpKeep.sol#L34) in
OstiumLinkUpKeep::_onlyGov() and on [L32](https://github.com/0xOstium/smart-contracts-threeSigma/blob/1b70cffbac621d39e321c159e45c048b703add92/src/OstiumRegistry.sol#L32) in OstiumRegistry::_onlyGov(). This
redundancy is unnecessary as msg.sender already returns an address.

### Recommendation

To improve efficiency and clarity, remove the typecasting operation to save gas and
eliminate confusion.

### Status

Addressed in [#0b6bca6](https://github.com/0xOstium/smart-contracts-threeSigma/pull/58/commits/0b6bca6c6dc8cf11a0bd74dfcd655d5c506c1134).

---

Related findings:

- [`Borrowing::redeemYields` debits `ABOND` from `msg.sender` but redeems to `user` using `ABOND.State` data from `user`](https://0xsimao.com/findings/autonomint-redeem-yields-debits-redeems): Autonomint
- [Anyone can get the NFT collateral token after an Auction without bidding due to missing check on msg.sender](https://0xsimao.com/findings/benddao-nft-collateral-auction-bidding): BendDAO
- [Incorrect `RefundClaim` event due to deleting `idoConfig.accountPositions[msg.sender]`](https://0xsimao.com/findings/blast-ido-pools-refund-deleting-config-positions): Blast IDO Pools
- [Depositing to another receiver othan than `msg.sender` will lead to stuck funds by increasing `avgStart` without claiming](https://0xsimao.com/findings/exactly-protocol-update-staking-contract-ii-othan-stuck-increasing-avg): Exactly Protocol Update - Staking Contract
