Deploying a Neo Contract to Testnet

May 24, 2024 10:52:56 PM

Deploying the Smart Contract

You can deploy your smart contract to the TestNet using different methods:

  • Linkd Dev Tools extension for Visual Studio Code
  • Neo Nova.
  • Neo SDKs
    • Available in Javascript, Python, Java, and Go.
  • Neo CLI
  • Neo Go
  • Neo GUI

Deploying a Contract using the Linkd Dev Tools Extension

Find the _deploy method in the smart contract file and click on the Deploy to Remote button. The extension will ask you to select an account. Select one that has at least 10 TestNet $GAS. The extension will compile the smart contract and deploy it to the TestNet.

Deploying a Contract using Neo Nova

Neo Nova is a tool developed by the Rentfuse team. It allows you to deploy smart contracts using a web interface. Neo Nova supports both Neo Line and Neon Wallet.

To deploy a contract using Neo Nova, follow these steps:

  • Visit the Neo Nova website.
  • Select the Contract tab in the left sidebar.
  • Click on Select Wallet in the top right corner.
    • Select the wallet you want to use.
    • Click Connect.
  • Once the wallet is connected, click Import.
    • Click to import the NEF and Manifest.
  • Click Deploy.

If the deployment fails, try other methods.

Deploying a Contract using the Neo SDKs using a WIF

Use the following code to deploy a smart contract using the Neo SDKs. Replace the wif value with your private key. The code exposes the user’s private key and should not be used in production.

Note: The code above is for demonstration purposes only. It exposes the user’s private key and should not be used in production.

Verifying the Deployment

After deploying the smart contract, visit the Dora Explorer and search for your contract.

You should see your contract on the list. Click on it to see the contract details. If you can’t find your contract, it means that the transaction has failed. Ensure that the account you are using has more than 10 TestNet $GAS.