When consuming oracle in my case Price Feed Chainlink oracle i should implement safety checks.
I need to be sure that the data returned from oracle is valid and the oracle is working right. If something is wrong i should not allow users to use methods that is going to lead to unexpected behaviour like withdrawing(theoretically) funds when the oracle is not working right. Could lead to stolen funds or miss-calculations:
- In my case purchaseNFT with ETH is the problem, because i use oracle to fetch the ETH value for a USDC price which can lead to paying less or more than the realisting eth price.
When consuming oracle in my case Price Feed Chainlink oracle i should implement safety checks.
I need to be sure that the data returned from oracle is valid and the oracle is working right. If something is wrong i should not allow users to use methods that is going to lead to unexpected behaviour like withdrawing(theoretically) funds when the oracle is not working right. Could lead to stolen funds or miss-calculations:
- In my case purchaseNFT with ETH is the problem, because i use oracle to fetch the ETH value for a USDC price which can lead to paying less or more than the realisting eth price.