medium10 pts · first answer countssmart-contract-securityoraclesarithmetic
Mixing oracle and token decimals
A Chainlink ETH/USD feed returns prices with 8 decimals. A contract multiplies it with an 18-decimal ETH amount and divides by 1e18 to get a USD value it treats as 18 decimals. What is wrong?
Discussion 0
Join free to post in the discussion.
Related questions
- Private variables are public dataBlockchain Developer
- Verifying a contract on EtherscanBlockchain Developer
- Sharing a seed phraseBlockchain Developer
- Why use OpenZeppelinBlockchain Developer
- Why contracts need oraclesBlockchain Developer
- The checks-effects-interactions orderBlockchain Developer
- What nonReentrant doesBlockchain Developer
- What front-running isBlockchain Developer