Open WeTheArtist opened 2 years ago
I can correct it by editing the function with 10^12 instead of 10^10, but I am not sure if that is correct, I wanted to check what the value of adjustedPrice is but I dont know how, can you please help me?
function getEntraceFee() public view returns (uint256) {
(, int256 price, , , ) = ethUsdPriceFeed.latestRoundData();
uint256 adjustedPrice = uint256(price) * 10**12; //18 decimals
//$50, 2000 ETH
//50/2000
//50*10000/2000
uint256 costToEnter = (usdEntryFee * 10**18) / adjustedPrice;
return costToEnter;
}
To view the value of adjustedPrice you can create another
function getPrice() public view (returns uint256){
(, int256 price, , , ) = ethUsdPriceFeed.latestRoundData();
uint256 adjustedPrice = uint256(price) * 10**10;
return adjustedPrice;
}
and run it on remix IDE for a faster + clear view.
i have the same problem do ufix this already? @WeTheArtist
Hi ,
While running in the terminal brownie test --network mainnet-fork, I get the following error. I am a bit confused asI had a similar problem earlier with the number of 0's output as entracefee. So it looks like the 14number is having a 0 more than the 15 number. My code is below, since it is just the start I hope it will be easy to identify where the problem is.
my test_lottery code:
Lottery.sol:
brownie-config.yaml: