Debugging FundMe.sol #5593
-
I have been trying but I am still not able to debug the following contract: // SPDX-License-Identifier: MIT pragma solidity ^0.8.8; error NotOwner(); contract FundMe { address[] public funders; uint256 public MINIMUM_USD = 50 * 10 ** 18; mapping (address => uint256) public addressToAmountFunded; constructor () { owner = msg.sender; } function fund() public payable { require(msg.value.getConversionRate() >= MINIMUM_USD, "YOU NEED TO SEND MORE eth!"); addressToAmountFunded[msg.sender] += msg.value; } modifier onlyOwner { _; function withdraw () public onlyOwner { for (uint256 funderIndex = 0; funderIndex < funders.length; funderIndex++){ (bool callSuccess, ) = payable(msg.sender).call{value: address(this).balance}(""); } |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
you are not importing PriceConverter.sol library in your FundMe contract. |
Beta Was this translation helpful? Give feedback.
@COSMICnoob80 you need to import
AggregatorV3Interface
inPriceConverter.sol
library and then ImportPriceConverter.sol
in yourFundMe.sol
contract.then use PriceConverter for
uint256
insideFundeMe
contractlike this
using PriceConverter for unit256
Please watch the video carefully and try to understand each step also I would suggest you to code along so that you don't run into such issues.
Click Here