lambdaclass / zksync_era_precompiles

Yul precompile library to speedup elliptic curves operations.
Apache License 2.0
51 stars 19 forks source link

error: compiling pre-compiles with solc fails #209

Closed bajpai244 closed 8 months ago

bajpai244 commented 10 months ago

When I am trying to compile the precompiles with solc, I am getting various errors, and I wanted to know is there something i am missing?

Here is what I am doing:

I get the following error:

Error: Cannot use builtin function name "number" as identifier name.
   --> Modexp.yul:370:34:
    |
370 |             function UIntBitSize(number) -> bitSize {
    |                                  ^^^^^^

Error: Expected keyword "data" or "object" or "}".
   --> Modexp.yul:370:34:
    |
370 |             function UIntBitSize(number) -> bitSize {

solc version: Version: 0.8.13+commit.abaa5c0e.Darwin.appleclang

IAvecilla commented 10 months ago

Hey @bajpai244! Towards the end of the README file, we've included some handy commands to get the precompiles up and running. To compile these precompiles, you'll need the zksolc compiler, a solc wrapper that compiles contracts compatible with zksync nodes.

If you're interested in running a local memory node with the precompile contracts, execute make setup followed by make run. However, if you only wish to compile contracts without initiating the local node for any reason, you can utilize another command, make build-precompiles.

Please note, there might be an issue when running the node, specifically #208. We're currently investigating this error related to some version problem.

bajpai244 commented 10 months ago

Hello @IAvecilla , thanks for the response here.

I don't want to run these pre-compiles on zk-sync era vm, but on the EVM itself, and hence I need them to be compiled via solc, but as explained they are giving errors.

IAvecilla commented 10 months ago

Mmmh I see. These precompiles aren't designed explicitly to operate within the EVM itself. They use ZKSync opcodes through the 'verbatim' instruction. While it might be possible to ensure compatibility, it would require a few adjustments to achieve that.

ilitteri commented 8 months ago

Closing as it is not possible for compiling the precompiles using solely solc.