Rupto - Documentation
  • Introduction
  • The Concept
    • Tokenization
    • Token Classification
  • Rupto Project
  • RPT Token
  • Rupto Blockchain
    • EVM Compatibility
    • Gas
    • Sharding
  • Rupto Values
  • Utility
  • Ecosystem
  • Developer Resources
  • RuptoChain Network
    • RuptoChain Mainnet
    • RuptoChain Testnet
    • CLI Command
  • Deploying on RuptoChain
    • Using Remix
    • Using Truffle
    • Using Hardhat
    • Using Raplit
    • Using Alchemy
  • API
    • accounts
    • blockNumber
    • call
    • chainId
    • estimateGas
    • gasPrice
    • getBalance
    • getBlockByHash
    • getBlockByNumber
    • getBlockTransactionCountByHash
    • getBlockTransactionCountByNumber
    • getCode
    • getLogs
    • getStorageAt
    • getTransactionByBlockHashAndIndex
    • getTransactionByBlockNumberAndIndex
    • getTransactionByHash
    • getTransactionCount
    • getTransactionReceipt
    • getUncleByBlockHashAndIndex
    • getUncleByBlockNumberAndIndex
    • getUncleCountByBlockHash
    • getUncleCountByBlockNumber
    • getWork
    • hashrate
    • mining
    • protocolVersion
    • sendRawTransaction
    • submitWork
    • syncing
    • net_listening
    • net_peerCount
    • net_version
    • web3_clientVersion
    • parity_nextNonce
    • Filter methods
    • newFilter
    • newBlockFilter
    • getFilterChanges
    • uninstallFilter
  • Conclusion
Powered by GitBook
On this page
  • Hardhat-config
  • Compile Smart contract file
  • Deploying on Rupto Network
  • Verifying contract on Ruptoscan
  1. Deploying on RuptoChain

Using Hardhat

There are a few technical requirements before we start. Please install the following:

PreviousUsing TruffleNextUsing Raplit

Last updated 2 years ago

  • (comes with Node)

Once we have those installed, To install Hardhat, you need to create an npm project by going to an empty folder, running npm init, and following its instructions. Once your project is ready, you should run

$ npm install --save-dev hardhat

To create your Hardhat project run npx hardhat in your project folder Let’s create the sample project and go through these steps to try out the sample task and compile, test and deploy the sample contract.

The sample project will ask you to install hardhat-waffle and hardhat-ethers.You can learn more about it

Hardhat-config

  • Go to hardhat.config.js

  • Update the hardhat-config with rupto-network-credentials

  • Create .env file in the root to store your private key

  • Add ruptoscan API key to .env file to verify the contract on ruptoscan. You can generate an API key by

require('dotenv').config();
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");

module.exports = {
  defaultNetwork: "rupto",
  networks: {
    hardhat: {
    },
    rupto: {
      url: "https://testnet.rbcscan.com",
      accounts: [process.env.PRIVATE_KEY]
    }
  },
  etherscan: {
    apiKey: process.env.RUPTOSCAN_API_KEY
  },
  solidity: {
    version: "0.8.3",
    settings: {
      optimizer: {
        enabled: true,
        runs: 200
      }
    }
  },
}

Make sure to update the Solidity compiler version here based on what is required in your contract(s).

Compile Smart contract file

$ npx hardhat compile

Deploying on Rupto Network

Run this command in root of the project directory:

$ npx hardhat run scripts/sample-script.js --network rupto

Contract will be deployed on Rupto Chain Testnet, it look like this:

Compilation finished successfully
Greeter deployed to: 0xF0B2F5AbE5A52B5BF85B2320A730D1Ed714c1af3

Remember your address would differ, Above is just to provide an idea of structure. Congratulations! You have successfully deployed Smart Contract. Now you can interact with the Smart Contract.

Verifying contract on Ruptoscan

$ npm install --save-dev @nomiclabs/hardhat-etherscan
$ npx hardhat verify --network rupto 0xF0B2F5AbE5A52B5BF85B2320A730D1Ed714c1af3
$ npm install --save-dev @nomiclabs/hardhat-etherscan
$ npx hardhat verify --network rupto 0xF0B2F5AbE5A52B5BF85B2320A730D1Ed714c1af3

Remember to update your address to your own deployed contract address. When the command is successful, you will see your contract verified on ruptoscan!

You can check the deployment status here:

Run the following commands to quickly verify your contract on ruptoscan. This makes it easy for anyone to see the source code of your deployed contract. For contracts that have a constructor with a complex argument list, see .

Node.js v10+ LTS and npm
Git
in this guide
creating an account
https://testnet.rbcscan.com/
here