Clarification Needed: Actual Funder in testUserCanFundAndOwnerWithdraw Test #1674
Closed
JarvisChan666
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
Upon reviewing the testUserCanFundAndOwnerWithdraw test within the InteractionsTest , I've encountered a discrepancy regarding the identity of the actual funder in the scenario. The test name suggests that a user (referred to as USER) funds the FundMe contract. However, through logging and analysis, it appears that the actual funder is the default account set in Foundry's lib\forge-std\src\Base.sol, specifically the address 0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38.
Observed Behavior:
Logs and analysis indicate that the fundFundMe function within the interaction scripts results in funding from the default Foundry account (0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38), rather than the USER constant (address(1)) as might be inferred from the test's name.
Expected Behavior:
The expectation, based on the test's naming convention, is for USER to be the entity funding the FundMe contract. This discrepancy could lead to confusion regarding the roles and actions being tested, particularly in terms of accurately simulating user interactions within this project.
Proposed Solutions:
InteractionsTest.t.sol
If the intention is indeed for the default Foundry account to fund the contract in this test scenario, it may be beneficial to clarify this within the test comments or documentation to prevent any misunderstandings regarding the roles and actions being tested.
The complete test code:
Beta Was this translation helpful? Give feedback.
All reactions