September 22, 2023

Deploy a smart contract on the ZetaChain Athens-3 network and interact with it

RU | ENG

Adding a new network to your wallet

Network name - ZetaChain Athens-3 Testnet

New RPC URL - https://zetachain-athens-evm.blockpi.network/v1/rpc/public

Chain ID - 7001

Currency symbol - aZETA

Block explorer URL - https://zetachain-athens-3.blockscout.com/

Go to the Remix website and deploy the smart contract

Don’t forget to select the ZetaChain Athens-3 Testnet network we need in your wallet in advance and request tokens to your wallet address, otherwise we will have an error at the stage of signing the transaction in your wallet.

Go to the website https://remix.ethereum.org/

Select the "contracts" folder and click on the "Storage.sol" file - on the right we will see the code for the template of the simplest smart contract, in which there are only two functions "store" and "retrieve" - we will interact with them after we deploy our smart contract.

Now we need to compile our code, go to the required menu item under the number “1” in the screenshot, select the same compiler version as in the screenshot and click the “Compile 1_Storage.sol” button.

Next, go to the menu item below - in the screenshot it is the number “1”, select the provider we need in the “2” field, if you have a metamask, then this will be the name.

Look below in the “ACCOUNT” field, your wallet address is displayed and click the “Deploy” button.

Sign the transaction in your wallet.

If everything is fine, then in the bottom panel of the site we will see this message with a green checkmark.

If something went wrong and you didn’t see a warning from me at the very beginning of the guide :) that you need to select the right network right away and have a positive balance of tokens in your wallet, then click refresh page and start all over again. All problems mainly occur due to the fact that the desired network has not been selected.

Now we need to interact with our smart contract and with the two functions that I described above.

Expand the list - shown with an arrow in the screenshot.

Click on this arrow.

We write any numbers and only numbers in the field :) and close this expanded field.

Now you will call our first function from the contract called "store". Click the "store" button.

Sign the transaction in the wallet.

If everything is fine, then in the bottom panel of the site we will see this message.

Now it's time for the second "retrieve" function.

Press the "retrieve" button and we will receive in response the number that we entered)

And we will receive in response the number that we entered earlier.

That's all for now.... :)