Open Dcamy opened 2 years ago
Are you sure the adresses that you have (rinkebin) is same as your metamask test network? (Both needs to be rinkebin or kovan etc.)
Did you ever figure this out? Stuck at the same issue. I suspect it could be an error with importing the SafeMath library since the rest of the code matches and the SafeMath library could have been updated since this course was released
Man I forget how I got through this... I remember for awhile I played with decimals... I think I changed
uint256 minimumUSD = 50 * 10 ** 18;
to
uint256 minimumUSD = 0.5 * 10 ** 18;
But then a day or two later I was back at it and further into the course I had another issue and I changed it back to
uint256 minimumUSD = 50 * 10 ** 18;
So my only guess is proceed and the fix is another 10 - 30 min into the course 🤷♂️
P.S. sorry for the delayed response
@Dcamy @amandacat222
.
Are you guys doing this with the Injected Web3 (Injected Provider - metamask) environment?
.
I am doing the course right now and it's working for me (using the metamask
plugin for Firefox).
.
I just had to change the ETH/USD feed address to 0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e
here and here, because I am using the Goerli network (got the correct address from here).
.
Also, like it's written in this comment, I changed those lines accordingly (wrapped msg.sender
in the payable()
function) since I'm using solidity v0.8.0
.
.
I hope that helps. Good luck!
.
.
EDIT: Also, what I did was change that minimumUSD
value to only 1 USD (1 * 10 ** 18) and I used this converter to spend a little over a dollar (at the time of this writing 700000000000000 Wei
or 700000 Gwei
or 0.0007 Ether
) to fund my contract, and it worked like a charm!
I'm having an issue with the Fund function, I've gone through all the issues here but not finding a solution that works. I get the same error for any fund amount, from any wallet, in gwie, and wie. The error I get is the one expected when funding with the wrong amount.
I'm pretty new to all of this so guessing the issue is user error but I am a bit lost here. If I comment out
uint256 minimumUSD = 50 * 10 ** 18;
andrequire(getConversionRate(msg.value) >= minimumUSD, "You need to spend more ETH!");
Everything works.
Is this user error or.?.My code below for reference
`// SPDX-License-Identifier: MIT
pragma solidity >=0.6.6 <0.9.0;
import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol"; import "@chainlink/contracts/src/v0.6/vendor/SafeMathChainlink.sol";
contract FundMe { using SafeMathChainlink for uint256;
}
`