Comments (5)
Problems and bugs should be opened in the discussion part; this section is for issues in the course / repo / etc..
In any case, have you tried prompting ChatGPT or any other AI for this problem?
This is the prompt I got when copied your issue to it, this might help:
If your test is failing, it's possible that the fundMe.fund()
method is not actually triggering the revert Not_Sufficient_Amount();
as expected.
There could be several reasons why your test is failing:
-
There is a sufficient amount of Ether: As per the condition in your contract, if
msg.value.conversionRate(s_priceFeed)
is greater than or equal to MINIMUM_USD, then the contract will not revert. Please ensure that when you callfundMe.fund()
in your test, you are not sending any Ether or the conversion rate results in a value that is less thanMINIMUM_USD
. -
Price feed data issue: If s_priceFeed doesn't return the expected value, the condition may not evaluate as expected. Make sure the oracle data feed is providing the correct value.
-
Error in expectRevert usage: Ensure you're using the expectRevert correctly. The correct syntax as per OpenZeppelin test helpers is await expectRevert.unspecified(yourFunctionCall). It could look like:
await expectRevert.unspecified(fundMe.fund());
- Mismatch in revert reason: If the revert reason in your test doesn't match the revert reason in your smart contract, the test will fail. If the contract code is using a custom error type like revert Not_Sufficient_Amount(); then you should specify this in your test code as follows:
await expectRevert(fundMe.fund(), "Not_Sufficient_Amount");
Without knowing more details about your fundMe.fund()
implementation and the context, it's hard to give a more accurate answer. Ensure to check the aforementioned points in order to troubleshoot the issue.
from foundry-full-course-cu.
msg.value.conversionRate(s_priceFeed) here msg.value is zero then how can be it greater than zero
i have used phind.com as well. but still issue not resolved
from foundry-full-course-cu.
fix the issue by changing function name
function testFailWithoutEnoughEth()
to function testFundFailsWithoutEnoughETH()
but dont know why it fixed. anyone can explain
from foundry-full-course-cu.
Could you please provide the whole contract with snapshot of error?. Additionally when your using
function testFundFailsWithoutEnoughETH()
i guess test is not able to find function cause solidity is case sensitive hence it is passing idk. But could you share this in Discussion tab + and provide source code?
from foundry-full-course-cu.
Hi
Could you help me with this
from foundry-full-course-cu.
Related Issues (20)
- Lesson 6 : Ganache URL not connecting while deploying SimpleStorage contract HOT 7
- Interact with SmartContract from the bash HOT 1
- Lesson 9 fork url error
- VULNERABILITY! redeemCollateral and redeemCollateralForDsc need to have isAllowedToken(tokenCollateralAddress) modifier HOT 3
- Lesson 7 | Style Guide url has changed HOT 2
- error with installing chainlink-brownie-contracts HOT 7
- The files do not pushed to GitHub HOT 3
- Issue with foundry in gitpod HOT 3
- Lesson 11 ModdNft, error :The path "./img/sad.svg" is not allowed to be accessed for read operations HOT 2
- Mock contract not working on anvil
- Lesson 12 -> Handler.t.sol (Video clip is not there on the Cyfrin Updarft) HOT 4
- test issue HOT 1
- Type tuple(contract Raffle,contract helperconfig) is not implicitly convertible to expected type tuple(contract Raffle,contract helperconfig). HOT 2
- compilation skipped memory allocation of 2952790016 bytes failed HOT 1
- Defi protocol - Lesson 14: Setup liquidations HOT 8
- Nft showing blank image HOT 1
- Block HOT 1
- Update to tenderly virtual networks HOT 1
- missing get_recent_deployments file HOT 5
- syntax error. invalid checksum HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foundry-full-course-cu.