Open PatrickAlphaC opened 3 months ago
Actually... digging into this more. Seems like the issue goes a bit deeper than I thought. The way this repo compiles the contracts is... a bit odd.
We have javascript magic like this:
uint160 constant SYSTEM_CONTRACTS_OFFSET = {{SYSTEM_CONTRACTS_OFFSET}}; // 2^15
Which it looks like is fixed when we compile with the precompiles, but it prevents our foundry friends from having a good time, and sort of vendor locks people into Hardhat.
The preprocess-system-contracts.ts
seems to do some clever stuff, which is "fine" but it might not be acceptable to use as a package that users use. It might make sense to have a separate repo where users can import the systems contract library so they can mock interacting with the system contracts.
Or, you could have foundry-zksync
deal with processing these contracts.
So... we have a few options:
I'm leaning towards number 2, but not sure how others feel
We actually used to have this repo as a mirror of the contracts that can be easily imported. While it is somewhat outdated, we generally ensure backward compatibility, so if the functionality provided by that repo is enough for you, you can use it temporarily. We will soon update it though
Still not fixed.
@StanislavBreadless is it still safe to use the repo you mentioned?
As of today, using any of these contracts as a package results in the following issue.
To get around this, you can instead use structs instead of so many variables.
You can only get this error if you try to compile the contracts using foundry, like so:
Replace this with _anything
Add a foundry.toml