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

How do I use zksync2-python to compile contract? #7

Closed
VietnameseRick opened this issue Mar 27, 2023 · 3 comments
Closed

How do I use zksync2-python to compile contract? #7

VietnameseRick opened this issue Mar 27, 2023 · 3 comments
Assignees

Comments

@VietnameseRick
Copy link

How do I use zksync2-python to compile contract?

@vyastrebovvareger
Copy link
Collaborator

You have to use the hardhat plugin to compile the contract. Python SDK is the client for interaction with ZkSync node
I can provide an example soon

@vyastrebovvareger vyastrebovvareger self-assigned this Apr 2, 2023
@vyastrebovvareger
Copy link
Collaborator

Here are the steps that you may compile your contracts

  • create folder for example zksync_contracts
  • inside it run: yarn init
  • add to it the hardhat.config.ts file that is listed below
  • create sub folder like contracts and organize contract files there
  • run yarn add --dev ts-node typescript
  • run npm i @matterlabs/hardhat-zksync-solc
  • run npm i @openzeppelin/contracts if you are going to use it
  • run yarn hardhat compile

hardhat.config.ts:

import '@matterlabs/hardhat-zksync-solc';

export default {
    zksolc: {
        version: '1.3.8',
        compilerSource: 'binary',
        settings: {
            isSystem: true
        }
    },
    networks: {
        hardhat: {
            zksync: true
        }
    },
    solidity: {
        version: '0.8.16'
    }
};

@danijelTxFusion
Copy link
Contributor

There is a guide how to use docker to compile solidity smart contracts.

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

No branches or pull requests

3 participants