Closed
Conversation
zerosnacks
approved these changes
Feb 4, 2025
Member
zerosnacks
left a comment
There was a problem hiding this comment.
Hi @CodeSandwich thanks for flagging this
We are making the same assertion here in Foundry: https://github.com/foundry-rs/foundry/blob/f6133f9e5fbd37864958cc58457f795ce35cd469/testdata/default/core/ContractEnvironment.t.sol#L16
It appears that when the test contract creates its first contract it will be deployed at 0x5615deb798bb3e4dfa0139dfa1b3d433cc23b72f as seen here
compared to
Contributor
Author
|
You're right, this is all correct and the address doesn't need to be fixed; I simply didn't understand what it means. IMO the current docs are just wrong and need to be fixed, but I'll do it in a separate PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test contracts have a different address than the one in the constant. I tried printing
address(this)in 2 separate tests and they were all showing this address. It makes sense because themsg.senderandtx.originwere alwaysDEFAULT_SENDERin the constructors,setUps and the test functions, and the newDEFAULT_TEST_CONTRACTcan be obtained by calculating theCREATEaddress forDEFAULT_SENDERand nonce 1.