matter-labs / foundry-zksync

Fork of Foundry tailored for zkSync environment
Apache License 2.0
299 stars 130 forks source link

Add support for `isSystem` flag #352

Closed PatrickAlphaC closed 6 months ago

PatrickAlphaC commented 6 months ago

Component

Forge

Describe the feature you would like

As of today, with hardhat i can pass an isSystem flag to the zksolc compiler to hot-swap out specific calls for their EraVM opcode equivalents.

https://github.com/code-423n4/2023-10-zksync/blob/main/docs/VM%20Section/How%20compiler%20works/instructions/extensions/call.md

Is there such a flag we can use for zksync-foundry?

Additional context

No response

Jrigada commented 6 months ago

Hello Patrick,

Thank you for raising this question. We do currently support the is-system flag. Here is how we use it:

forge build --is-system=true

Please let me know if you encounter any issues.

PatrickAlphaC commented 4 months ago

Can we reopen? It looks like this was removed.

PatrickAlphaC commented 4 months ago

Ah --system-mode=true is the new thing. Got it.

PatrickAlphaC commented 4 months ago

https://github.com/matter-labs/foundry-zksync/commit/6f79d93d0cb7fdd62a71152c54d9b1079c6a1d49

Would be great to add this to the docs, it looks like using is-system in foundry.toml is broken, adding system-mode=true to the foundry.toml seems to have no affect