Chainstack

This section guides you through deploying a Hello World smart contract using Chainstack and Foundry on the Opera testnet.

If you have any questions, reach out in the Chainstack Discord.

Deploy an Opera Testnet Node

You need a node to deploy a smart contract to the chain. To get your node:

Install Foundry

Foundry is a development toolkit to work with smart contracts.

Initialize With Foundry

In your project directory, run foundry init. This will create a boilerplate project.

Fund Your Account

You need to pay gas on the network to deploy the contract. Get testnet FTM through the faucet.

Create the Hello World Contract

In the initialized Foundry project in src/, create HelloWorld.sol:

Deploy the Contract

At this point, you are ready to deploy your contract:

  • You have your own node on the Opera testnet through which you will deploy the contract.

  • You have Foundry that you will use to deploy the contract.

  • You have a funded account that will deploy the contract.

To deploy the contract, run:

  • CONTRACT_PATH — path to your HelloWorld.sol file.

  • PRIVATE_KEY — the private key from your account.

  • HTTPS_ENDPOINT — your node's endpoint.

Example:

Congratulations! You have deployed your Hello World smart contract on Opera!

See the Chainstack documentation for more tutorials and tools.