Era contract deployment can currently only be achieved through the command line, which is a bit complicated.
After some exploration, I am basically familiar with the situation. Here I will help you sort out the complete deployment and verification process, and use the deployment of the simplest contract as an example to help you get started.
step:
1. Environmental preparation
2. Contract code preparation
3. Deploy verification contract

Environmental three-piece set
Refer to the Era official documentation to install the three-piece environment:
Node, NVM, Yarn Everyone's computer environment is complex. If you encounter errors, you can Google them yourself or ask ChatGPT:
https://era.zksync.io/docs/dev/building-on-zksync/hello-world.html#prerequisites
Initialization and SDK installation
Continue to refer to the official documentation and do the following:
1. Create a new dedicated folder (mk & cd command)
2. Initialize the environment (yarn init -y command)
3. Install SDK and dependencies (yarn add command)

config configuration file
Create a hardhat.config.ts file in the current directory. The code I use is as follows (you can copy it in full in the ALT of the picture) Note: You may need to install the zksolc package once more (this is how I solved the compilation error) If you change the zksolc version, for example, change it to the official recommended version 1.3.10, it will also be automatically downloaded once
Here you need your command line environment to be able to access the Internet normally! For example, turn on Surge's "enhanced mode"

Minimalist Smart Contract
Q: What does the simplest smart contract look like?
A: A contract that contains only the contract name and nothing else. For example, the contract in the screenshot only defines the contract version and contract name, but it is indeed a legal smart contract (you can copy the code from the image ALT)
Three steps:
1. Create a new contract folder (mkdir contracts deploy)
2. Edit the contract file (mini.sol)
3. Compile the contract

Compile the contract
In theory, compilation should be very simple, with only one command. But in reality, there is a high probability of error reporting here.
If an error occurs, you can check the following two places:
1. Can the command line environment access the external network (detection method: curl http://google.com)
2. Try reinstalling zksolc (https://twitter.com/gm365/status/1644303144518848512…)
If everything goes well, the compilation is successful as shown in the figure.





Deploy the contract
There are two steps to deploy a contract:
1. Create and modify the deploy/deploy.ts file
2. `yarn hardhat deploy-zksync` command to deploy the contract
I have modified the deploy.ts file, you can copy the code from the ALT. Please note the two places marked with ❗️ in the picture, which are where you need to modify according to the situation.
1. EOA wallet private key for deploying the contract.
2. The contract name you defined in the previous step (here is WTF).
Execute the deployment command. If everything goes well, you can see the contract address after successful deployment in about ten seconds.


Verify the contract source code
After the deployment is complete, you can also choose to open source your contract code by verifying it in the blockchain browser.
After finding your contract address:
1. Zksolc version: here is 1.3.5 (select according to your actual settings)
2. Solc version: Here is 0.8.17 (settings in hardhat.config.ts file)
3. Contract name (WTF here)
4. Contract code (copy and paste)

Summarize
If everything goes well, congratulations on completing your first smart contract deployment on the Era chain.
Once you have learned this basic skill, it will be easy to deploy more complex contracts in the future.
Since we wrote the simplest contract, the deployment cost of this contract is also extremely low (it cost $0.21 for my test).
In addition, here are some resources that may be helpful:
1. Official documentation: https://era.zksync.io/docs/dev/building-on-zksync/hello-world.html…
2. Third-party tutorial: https://mirror.xyz/catpad.eth/X8lq1Qci1qjyW6Fo-e64xJfY-LJZkScGD66AD4vcHmI…
3. An introduction to the deployment of Era contracts that I wrote before: https://twitter.com/gm365/status/1644299731236171778…
Off topic
zkSync is not fully EVM-compatible, and its different contract deployment mechanisms make it impossible to directly deploy contracts on the web using methods such as Remix (ThirdWeb is also currently unable to complete the deployment. Although the website shows that it can be deployed on Era through their template contract, it is not actually feasible. They only acknowledged this in DC).
I hope the zkSync team will continue to work hard to make tasks like contract deployment easier in the future.