[Dev Tools] Foundry compilation failure #822
Replies: 5 comments 5 replies
-
It appears that the error you're encountering during the compilation of your contract using Foundry on ZKsync is due to a misuse of the Here's how you can correct the issue:
Modify your contract code as follows: // SPDX-License-Identifier: None
pragma solidity ^0.8.28;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/Ownable2Step.sol";
contract OptionResolver is Ownable2Step {
constructor () Ownable() {
// Constructor body if needed
}
}
If you continue to face issues or if the error persists, it might be helpful to review the OpenZeppelin documentation or the specific versions of the contracts you are using to ensure compatibility with your Solidity version and constructor expectations. For more detailed discussions and support, you can also visit the ZKsync developers discussions on Github. Your feedback helps us serve you better. If this fully addresses your question, please give it a thumbs up. If it doesn't, please give it a thumbs down. This will inform the community and team so we can improve our support. |
Beta Was this translation helpful? Give feedback.
-
Hello @cytadela8 This is based on your OZ dependency version. Please double check the version being used. Here is an example of the latest OZ dep being used in a foundry project with |
Beta Was this translation helpful? Give feedback.
-
I will look to create a min-example for a quick test and post back here. Also is that version required? |
Beta Was this translation helpful? Give feedback.
-
Here is a min-example that compiles fine with OZ version Steps to run:
Foundry-zksync version:
Perhaps can you add more details to the issue or try running |
Beta Was this translation helpful? Give feedback.
-
We found one more required step. You need to run:
|
Beta Was this translation helpful? Give feedback.
-
Team or Project
No response
Environment
Testnet
Select the Dev Tool you are using
Foundry
Provide the version of the tool (if applicable)
No response
Provide a brief description of the functionality you're trying to implement and the issue you are running into.
Compilation of my contract (attached below). Fails with this error on zksync-foundry:
Contract code:
I'm using OZ with commit hash
dbb6104ce834628e473d2173bbc9d47f81a9eec3
Repo Link (Optional)
No response
Additional Details
Issue posted on behalf of client.
Beta Was this translation helpful? Give feedback.
All reactions