-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contracts top level #422
Contracts top level #422
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bindings checker has something failing. Otherwise LGTM
.gitmodules
Outdated
branch = v1 | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
ignore = dirty | ||
[submodule "lib/openzeppelin-contracts"] | ||
branch = v4.8.1 | ||
[submodule "contracts/lib/subnet-evm"] | ||
path = contracts/lib/subnet-evm | ||
path = lib/openzeppelin-contracts | ||
url = https://github.com/openzeppelin/openzeppelin-contracts | ||
ignore = dirty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to change the lib/forge-std
branch and/or add the ignore = dirty
flags here? Seems like just changing the paths would be sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When putting together this change, I noticed a few things:
- our forge-std submodule was using a different branch than openzeppelin-contract's submodule
- We weren't specifying a path to our forge-std submodule in remappings.txt
From what I could tell, this means that the exact forge-std version that's used is whatever one is found first when resolving include paths. To get around this, I added forge-std to remappings.txt explicitly, and updated our submodule to use the same version as openzeppelin-contracts
As for ignore = dirty
, that is added as a developer convenience. I noticed that when playing with submodules it was quite easy to get to a state in which no submodule changes were made, but it was still showing as modified in git status
. ignore = dirty
shouldn't impact CI or fresh clones.
@@ -5,7 +5,7 @@ | |||
|
|||
pragma solidity 0.8.25; | |||
|
|||
import {Test} from "forge-std/Test.sol"; | |||
import {Test} from "@forge-std/Test.sol"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did we need this change? I think this was working previously from the auto remappings, but we could consider turning auto remappings off to be more explicit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm I see that it's updated in remappings. If we're going to explicitly set it for forge-std that differs from the default, might want to consider turning off auto remapping detection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was encountering a scenario where the auto remapping used open-zeppelin-contracts
' forge-std
instead of ours. IMO we should be explicit wherever possible to prevent this sort of ambiguity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm in favor of copying the remappings we need, then disabling auto remapping detection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly LGTM, left some comments
@@ -10,14 +10,6 @@ import {ITeleporterMessenger} from "@teleporter/ITeleporterMessenger.sol"; | |||
import {TeleporterMessenger} from "@teleporter/TeleporterMessenger.sol"; | |||
|
|||
abstract contract GetTeleporterMessengerTest is BaseTeleporterRegistryAppTest { | |||
function testGetTeleporterMessengerBasic() public { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was there a reason to move this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like a lint with the new version, did it hit a lint rule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the linter complained about public view
functions being before public
ones. solc
was throwing warnings saying that this function could be marked view
. I'm not sure what change prompted solc
to start warning though.
@@ -5,7 +5,7 @@ | |||
|
|||
pragma solidity 0.8.25; | |||
|
|||
import {Test} from "forge-std/Test.sol"; | |||
import {Test} from "@forge-std/Test.sol"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm I see that it's updated in remappings. If we're going to explicitly set it for forge-std that differs from the default, might want to consider turning off auto remapping detection
do we need to update |
Let's continue ignoring generated docs from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
Next time the file structures of any of the |
Why this should be merged
Converts the repo to be a top-level forge project. The new repo structure is as follows:
contracts-monorepo
is the staging branch for all changes related to #419How this works
Reogranizes the repo into the above structure
How this was tested
CI
How is this documented
Updated paths in READMEs