Skip to content
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

refactor(protocol): restructure solidity code to match compilation targets #18059

Merged
merged 84 commits into from
Sep 12, 2024

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Sep 10, 2024

Summary

Prior to this PR, both L1 and L2 code were compiled using the same Solidity compilation target (cancun), which worked for now but is incompatible with future Solidity versions.

This PR reorganizes the Solidity codebase into three subdirectories:

  • shared: Contains contracts used by both L1 and L2.
  • layer1: Contains L1-specific contracts.
  • layer2: Contains L2-specific contracts.

For L1 compilation, the source directory is now contracts/layer1, with contracts/shared automatically included. The EVM target for L1 is specified as cancun. Similarly, L2 uses contracts/layer2 as the source and out/layer2 as the destination with its EVM target set to shanghai. The build directories for L1 and L2 are also separately defined.

You can use commands to test contracts for layer1 and layer2 separately now:

  • pnpm compile:l1, pnpm compile:l2, or pnpm compile to compile all files.
  • pnpm test:l1, pnpm test:l2, , or pnpm test to run all tests.

Note that:

  • Going forward, it's critical to ensure that the contracts in the shared directory remain compatible with both the layer1 and layer2 codebases.
  • Minimal code changes in EssentialContract.sol and Bridge.sol. Please focus on reviewing these specific changes.

This is a large PR, but the majority of the changes involve the directory restructuring rather than the code itself.

Copy link

vercel bot commented Sep 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
taiko-mono ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2024 0:01am

Copy link

openzeppelin-code bot commented Sep 10, 2024

refactor(protocol): restructure solidity code to match compilation targets

Generated at commit: dbf5ef92c9a6d8ea838fc6da618632e9e9b6f53d

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
2
0
8
43
55
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@dantaik dantaik added this pull request to the merge queue Sep 11, 2024
@dantaik dantaik removed this pull request from the merge queue due to a manual request Sep 11, 2024
davidtaikocha
davidtaikocha previously approved these changes Sep 11, 2024
@dantaik dantaik added this pull request to the merge queue Sep 11, 2024
@dantaik dantaik removed this pull request from the merge queue due to a manual request Sep 11, 2024
@dantaik dantaik dismissed stale reviews from davidtaikocha and YoGhurt111 September 11, 2024 09:43

redo

@dantaik dantaik added this pull request to the merge queue Sep 12, 2024
Merged via the queue into main with commit adc47f4 Sep 12, 2024
8 checks passed
@dantaik dantaik deleted the restructure_code branch September 12, 2024 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants