Skip to content

Warning: unused local variable #6301

Answered by Nlferu
dannyakorede12 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @dannyakorede12

As to my knowledge it is just warning and not error. It is basically what it's saying, so you have declared variable but you have never used it later in your code. If you are doing lesson 4 you should be using code below as we will be using only 1 variable provided from latestRoundData function.

(, int256 answer, , , ) = priceFeed.latestRoundData();

// ETH/USD rate in 18 digit
return uint256(answer * 10000000000);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dannyakorede12
Comment options

Answer selected by dannyakorede12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants