Airdrops & activities

The tutorial on deploying contracts on the Linea (ConsenSys zkEVM) testnet, launched by the parent company of MetaMask

Project introduction:

Linea is a second-layer zkEVM (zero-knowledge Ethereum Virtual Machine) that replicates the Ethereum environment as a rollup, allowing developers to build on it just as they would on the Ethereum mainnet.

Linea allows you to deploy any smart contract, use any tool, and develop just like you would on Ethereum. For users, this makes the Ethereum experience and security guarantees possible, but with lower transaction costs.

Linea released its public testnet on March 28th.

Tutorial:

Step One: Set up wallet network and claim test tokens.

Manually add Linea test network parameters:

Network Name: Linea (Goerli)

RPC URL: https://rpc.goerli.linea.build

Chain ID: 59140

Currency Symbol: ETH

Block Explorer URL: https://explorer.goerli.linea.build

Claim test tokens on the Goerli network:

https://goerlifaucet.com/

Step Two: Cross-chain interaction on the testnet

Open the cross-chain website:

https://goerli.hop.exchange/#/send?token=ETH&destNetwork=linea&sourceNetwork=ethereum

  1. Log in to the MetaMask wallet.
  2. Select the ETH token.
  3. Select “Cross Goerli ETH to Linea network” option.
  4. Click the “Send” button and confirm the transaction in your wallet.

Open the Swap testnet:

Switch your wallet to the Linea network.

  1. Click on the gear icon.
  2. Select 10%.
  3. Enable expert mode.

With these settings, the exchange of crUsdc will be faster and have a higher success rate in the next step!

  1. Switch your wallet to the Linea network and log in to your wallet.
  2. Select the ETH to crUSDC trading pair and exchange a small amount.
  3. Click the “Exchange” button and confirm the transaction in your wallet.

If there are too many people interacting, the network may be congested. If you have enough gas, you can increase the transaction speed in your wallet.

Using the same method, let’s exchange a small amount of ETH to crWETH, which will be used later.

Make sure to increase the transaction speed in your wallet to ensure faster transaction times.

  1. Choose the “Pool” module and click “Create New Pool”.
  2. Select crWETH and crUSDC to create the liquidity pool.
  3. Choose 0.05%.
  4. Click “Max” to input a small amount of crWETH.
  5. Approve crWETH and crUSDC separately and increase the transaction speed in your wallet. Then click the “Preview” button and confirm the transaction in your wallet, and increase the transaction speed again.

The frontend of this testnet is poorly designed!

Bear with it because the most important thing is to increase the transaction speed in your wallet when approving tokens or confirming transactions, otherwise it will be very slow.

If the transaction fails, try again a few times.

If the liquidity pool was added successfully, you can go back to the liquidity pool list to see it.

Perform the “Collect Fees” and “Remove Liquidity” operations separately. If the transaction is slow, increase the transaction speed in your wallet.

If you have followed my tutorial, you should know how to do this. I won’t demonstrate it in detail here.

Step Three: Contract Deployment

Open the Remix website:

https://remix.ethereum.org/#lang=en&optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.18+commit.87f61d96.js

  1. Click the “New File” button.
  2. Enter the desired contract file name, using letters and numbers.

Open this contract source code website:

https://bscscan.com/token/0xe9e7cea3dedca5984780bafc599bd69add087d56#code

Scroll down.

  1. Select the “Contract” option.
  2. Find the “Contract Source Code” section.
  3. Click the “Copy” button to copy the contract source code.

Then, let’s go back to Remix.

  1. Find the .sol file you just created.
  2. Click on its contents, right-click, and select “Paste” to paste the copied contract code into the file.

Select the “Compile” module.

Click on “Compile” for the contract file you created.

If you see a green checkmark, it means the contract has been successfully compiled.

First, make sure your MetaMask wallet is switched to the Linea network.

  1. Select the “Deploy” module.
  2. Choose the “Injected Provider-MetaMask” option.
  3. Click on the “Deploy” button to deploy the contract, and confirm the transaction in your wallet.

If you see this output, it means the contract has been successfully deployed!

https://docs.google.com/forms/d/e/1FAIpQLSen0KN2uqKMJuUxBH8yTfwrb-xdN48kA-NmO-DSCJMYRdQyMA/viewform

That concludes today’s tutorial. If you have any questions or concerns, please don’t hesitate to contact us and we’ll do our best to assist you. Thank you for reading and learning!

What's your reaction?

Related Posts

Load More Posts Loading...No More Posts.