Cyfrin Updraft.

Post

Share your knowledge.

Cyfrin Moderator Pst.
Mar 29, 2024
Expert Q&A

FundMe Smart Contract Accepts Less Than Minimum USD in ETH

I recently sent 0.02 ETH to the FundMe contract, which equates to a value greater than the specified minimum USD amount of 5e18. However, I am puzzled as to why the contract accepted this transaction despite it being below the minimum USD threshold.

  • Transaction
  • Solidity
  • Blockchain
  • Smart Contract
  • Gas
0
1
Share
Comments
.

Answers

1
Cyfrin Moderator Ans.
Mar 29 2024, 12:20

The cost of the oracle is a determining factor in this scenario. If the price of ETH is $2000, then the calculation would be 0.02 ETH * $2000 = $40.

In your case, if 0.05 ETH is less than $5, then the price should be less than this: 0.02 ETH * $250 = $5. There are two possible solutions for you:

  1. You can increase the price of the mock contract.
  2. You can send additional ETH to cover the cost differential.
0
Official Answer
Comments
.

Do you know the answer?

Please log in and share it.

We use cookies to ensure you get the best experience on our website.
More info