Energy Web Documentation
  • Energy Web Ecosystem
  • Launchpad by Energy Web
  • EWC Validator Documentation
  • Community Ressources
  • Legacy documentation
  • Welcome to Energy Web
  • Glossary
  • Solutions 2023
    • ↔️Data Exchange
      • Data Exchange Overview
      • Data Exchange Architecture
      • Use Cases and Refrence Implementations
        • Digital Spine for Electricity Markets
          • Digital Spine Integration Client Deployment Guide - from Azure marketplace
        • E-Mobility Management
    • 🔌Open Charging Network
      • Create and Manage an OCN Identity
      • Connect an OCPI/OCN Party to a Node
        • 1. Make your backend service OCN-ready
        • 2. Select an OCN Node and register in OCN Registry
        • 3. Manage your Whitelist and Blacklist
        • 4. Connect your service to an OCN Node
      • Run an OCN Node
      • Use the OCN Service Interface
        • Offer an OCN Service
        • Sign up for an OCN Service
      • Develop on the Test Network
      • Develop on the Production Network
      • Open Source Development
        • Maturity Model, Feature Roadmap and Releases
        • Developer Community Calls
      • E-Mobility Dashboard v0.1
  • EW-DOS Technology Components 2023
    • EW-DOS Overview
    • Worker Nodes
      • Worker Node Process Diagrams
      • Worker Node Architecture
      • Worker Node Guides
        • Deploy Worker Nodes
        • Customize Worker Logic
    • Identity and Access Management (IAM)
      • IAM Guides
        • Implement an SSI Hub instance
        • Verifiable Credential API
        • Sign-In with Ethereum
        • Using Switchboard
          • Switchboard Transaction Cost Estimates
      • IAM Patterns
        • Assets as Ownable Smart Contracts
        • Credential Lifecycle
        • Credential Metadata
        • SSI Credential Governance using ENS Domains
      • IAM Libraries
      • SSI Hub
      • Switchboard Application
    • Decentralized Data Hub (DDHub)
      • DDHub Message Broker
      • DDHub Client Gateway
      • DDHub Patterns
        • Channels and Topics
      • DDHub Guides
    • Green Proofs Contracts
    • Energy Web X
    • The Energy Web Chain
      • EWC Overview
      • System Architecture
        • Proof-of-Authority Consensus Mechanism
        • System Contracts
          • Name Registry
          • Holding Contract
          • Block Reward Contract
          • Validator-Set Contracts
        • Validator Node Architecture
      • Energy Web Block Explorer
      • Validator Node Installation Specifications
        • Volta Test Network: Validator Node Installation
      • Energy Web Chain Governance
      • EWC Guides and Tutorials
        • Getting started with Energy Web Chain
        • Developing on the Volta Test Network and Main Network (Energy Web Chain)
        • Run a Local RPC Node
          • Run RPC Node using Nethermind client
        • Deploy a Smart Contract on Volta with Remix
        • Interacting with Smart Contracts in EW-DOS
        • Set up MetaMask to interact with Energy Web Chain
        • Using the Ethereum Name Service
        • Using Oracles
      • Energy Web Token (EWT)
  • 🧠Foundational Concepts
    • Open-Source Software
    • Scaling Access to Grid Flexibility
    • Facilitating Clean Energy Purchases
    • Ethereum
      • Transactions and Transaction Costs
    • Self-Sovereign-Identity
      • Self-Sovereign Use Case Interaction
    • Cryptocurrency Wallets
      • Software cryptocurrency wallets
        • Metamask
        • Mycrypto wallet
      • Hardware cryptocurrency wallets
      • Hierarchical Deterministic (HD) Wallets
Powered by GitBook
On this page
  • 1. Configure MetaMask to connect to the Volta Test Network
  • 2. Get Volta Tokens
  • 3. Navigate to remix.ethereum.org
  • 4. Navigate to the "Deploy and Run Transactions" icon on the left panel (shown below).
  • 5. Confirm the connection on MetaMask
  • 6. Create a simple smart contract
  • 7. Compile the smart contract
  • 8. Copy the deployed contract's ABI (Application Binary Interface)
  • 9. Deploy the smart contract
  • 10. See and test the deployed transaction
  • 11. See deployed contract on the Volta Block Explorer
  • 12. Use your smart contract in dapps
Export as PDF
  1. EW-DOS Technology Components 2023
  2. The Energy Web Chain
  3. EWC Guides and Tutorials

Deploy a Smart Contract on Volta with Remix

PreviousRun RPC Node using Nethermind clientNextInteracting with Smart Contracts in EW-DOS

Last updated 2 years ago

Below are steps to deploy a on the (the test network for the ) using . Remix is a web application used to compile, deploy and test smart contracts on Ethereum networks.

In order to deploy a smart contract to the Energy Web Chain Main Network, rather than the Volta Test Network, the steps are identical, except that you will connect your MetaMask to the Energy Web Chain rather than to Volta. We recommend that you always deploy and test your smart contracts to Volta first to make sure they behave as expected.

Once your smart contract is deployed, you can use the contract's ABI and address on the blockchain to interact with its public methods. For more information on how to interact with smart contracts, go .

1. Configure MetaMask to connect to the Volta Test Network

You can see steps for doing this are . If you do not have a MetaMask installed, you can do so .

2. Get Volta Tokens

You will need to to pay for the transaction fee for deploying the smart contract to the blockchain. For directions on how to get Volta Tokens, go . To learn more about what transaction fees are, you can go .

*Note that if you are deploying to the Energy Web Main Network, you will need to have .

3. Navigate to

4. Navigate to the "Deploy and Run Transactions" icon on the left panel (shown below).

In the "Environment" dropdown, selected "Injected Web3". Notice that when you select this, "Custom (73799) network shows up. 73799 is the Volta Test Network - this confirms that we are connected to the Volta network via MetaMask.

5. Confirm the connection on MetaMask

You will need to confirm the connection to MetaMask.

6. Create a simple smart contract

Go to the file explorer panel (select the first icon on the left panel). Add a new .sol file in the 'Contracts' folder. Below it is called VoltaContract.sol.

In the .sol file, add the following code:

pragma solidity >=0.4.0 <0.7.0;

contract SimpleReturn {
    function get() public pure returns (string) {
        return "Volta";
    }
}

7. Compile the smart contract

If there are no errors, click "Compile VoltaContract.sol" (make sure that the 'Language' selected is 'Solidity').

If you want to interact with your contract in the future using an API client, you will need the contract's ABI. The ABI is in the bottom right hand corner of the Solidity Compiler page after it is compiled.

9. Deploy the smart contract

Click 'Deploy' to deploy the contract to Volta Test Network.

Confirm the transaction in MetaMask. Make sure that you have some gwei as a gas price by doing the following:

Select EDIT

Select "Edit suggested gas fee"

Make sure you have a Gas price of 6e-8 GWEI (this should be autofilled)

Confirm the transaction in MetaMask

10. See and test the deployed transaction

Once your contract is deployed, you can see it in the "Deployed Contracts" section of the same page ("Deploy and Run Transactions")

Click on "get" to test our contract's functionality. Remember from the code that is should just return a string "Volta".

11. See deployed contract on the Volta Block Explorer

Copy the address of the contract by clicking the copy icon.

Paste the contract address in the search bar at the top right:

12. Use your smart contract in dapps

8. Copy the deployed contract's (Application Binary Interface)

Go to the . If you are deploying to the main network, the block explorer is .

You can see the smart contract address details, the block it was created in, and the byte code. The block explorer contract details from the example above is .

Now that you have your smart contract's address on the blockchain and its ABI, you can use an Ethereum API client to interact with your contract in your decentralized applications. For a tutorial on how to do this, go .

ABI
Volta Block Explorer (volta-explorer.energyweb.org)
explorer.energyweb.org
here
here
Interacting with Smart Contracts in EW-DOS
smart contract
Volta Test Network
Energy Web Chain
Remix
here
here
here
Volta tokens
here
here
remix.ethereum.org
EWT
Select Edit
Returns string "Volta"
Block explorer details for contract created