[Deployment] Need help with error while deploying contract #671
-
EnvironmentTestnet L2 block numbern/a zkSolc VersionSolidity compiler for ZKsync v1.5.2 (LLVM build 280f38e3b73cbed0b037aa7e6c073d8e25dbdaa1) zksync-ethers Versionusing Zksync Web3j v0.2.0 Minimal Reproducible Code or Repo Linkpragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract BUSD is ERC20, Ownable, ReentrancyGuard {
} Does this work on other EVMs? (If yes, please list at least 1 of them)no Description of What Your Contract DoesNothing, I am test-deploying a simple ERC-20 token with no added functionality Additional DetailsI have the solc compiler installed: I have the zksolc copiler installed: I compile my test contract with this command: I get the following output I get the attached output for busd.zbin (compressed to busd.zip) PROBLEM: when I deploy the bytecode, I get an error saying the bytecode length in bytes must be divisible by 32. (Shaving off the "0x" at the beginning does not help.) Can anyone shed light on this for me? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
It appears that the error you're encountering is related to the specific requirements for deploying contracts on ZKsync. According to the ZKsync documentation, the bytecode for a contract must meet certain criteria:
Here are a few steps you can take to resolve this issue:
For more detailed information on these requirements, you can refer to the ZKsync documentation on Contract Deployment. If adjustments to the contract do not resolve the issue, consider reviewing or seeking further assistance with the specifics of your contract's compilation and deployment process to ensure compatibility with ZKsync's requirements. 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.
-
Are you using the zksync-cli or just doing |
Beta Was this translation helpful? Give feedback.
-
Smart contract deployment is different on ZKsync vs EVM networks. you can learn more in this section of the docs, but in short, in ZKsync you interact with a system contract called ContractDeployer. As you're using Java, make sure you're using the the zksync java SDK: https://sdk.zksync.io/java/introduction/overview |
Beta Was this translation helpful? Give feedback.
-
Her you can find examples on how to deploy contracts. If you still experience issue could you please share your code |
Beta Was this translation helpful? Give feedback.
Smart contract deployment is different on ZKsync vs EVM networks. you can learn more in this section of the docs, but in short, in ZKsync you interact with a system contract called ContractDeployer.
As you're using Java, make sure you're using the the zksync java SDK: https://sdk.zksync.io/java/introduction/overview