Skip to content

LESSON 3 fundMe getConversionRate videoTime 4:17:24 DeclarationError: Undeclared Identifier #1813

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

You must be logged in to vote

Hello @franclino

You have used incorrect variable in getConversionRate() function, you have just used ethAmount in wrong place, function should look like below:

    function getConversionRate(uint256 ethAmount) public view returns (uint256) {
        uint256 ethPrice = getPrice();
        uint256 ethAmountInUsd = (ethPrice * ethAmount) / 1e18; 
        return ethAmountInUsd;
    }

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@cromewar
Comment options

@franclino
Comment options

@cromewar
Comment options

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