Lesson 4 - Fund Me not working - Transaction reverted #128
-
contract FundMe {
using PriceConverter for uint256;
uint256 public minimumUsd = 50 * 10**18;
address[] public funders;
mapping(address => uint256) public addressToAmountFunded;
address public owner;
constructor () {
owner = msg.sender;
}
function fund() public payable {
// want to be able to set a minimum fund amount in
// 1 How do send ETH to this contract ?
require(msg.value.getConversionRate() >= minimumUsd, "Didn't send enough"); //1e18 == 1 * 10 ** 18 == 10000000000000000
addressToAmountFunded[msg.sender] += msg.value;
funders.push(msg.sender);
}
}
modifier onlyOwner {
require(msg.sender == owner, "Sender is not owner!");
_;
}
} Hi guys, i am unable to fund the wallet, transaction get reverted automatically. Can someone help, please? |
Beta Was this translation helpful? Give feedback.
Answered by
alwayscommit
Jun 4, 2022
Replies: 2 comments 5 replies
-
You can try out a few things here
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Leonardll
-
When it's reverted, does it throw your exception of "Didn't send enough"? .. Can you post the error, please? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can try out a few things here