1
  • I was developing a contract on EVM on Shibuya, Astar Network's testnet.
  • I'm using hardhat.
  • We successfully deployed to Shibuya testnet and Shiden network using the following settings.
  • But it doesn't work well with Astar Network.
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";

const { privateKey } = require('./private.json');

const config: HardhatUserConfig = {
  solidity: "0.8.9",
  networks: {
    localhost: {
      url:"http://localhost:8545",
      chainId:31337,
      accounts: [privateKey]
    },
    shibuya: {
      url:"https://shibuya.public.blastapi.io",
      chainId:81,
      accounts: [privateKey]
    },
    shiden: {
      url:"https://shiden.public.blastapi.io",
      chainId:336,
      accounts: [privateKey],
    },
    astar: {
      url:"https://astar-rpc.dwellir.com",
      chainId:592,
      accounts: [privateKey]
    }
  },
};

export default config;

1 Answer 1

1
  • I asked a core team engineer how to work around this issue.
  • There's a way to use the API to get gas, and a way to let hardhat do it.

API: https://docs.astar.network/docs/integrations/api/gas_api/#api

sample settings:

import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";

const { privateKey } = require('./private.json');

const config: HardhatUserConfig = {
  solidity: "0.8.9",
  networks: {
    localhost: {
      url:"http://localhost:8545",
      chainId:31337,
      accounts: [privateKey],
      gasPrice: "auto"
    },
    shibuya: {
      url:"https://shibuya.public.blastapi.io",
      chainId:81,
      accounts: [privateKey],
      gasPrice: "auto"
    },
    shiden: {
      url:"https://shiden.public.blastapi.io",
      chainId:336,
      accounts: [privateKey],
    },
    astar: {
      url:"https://astar-rpc.dwellir.com",
      chainId:592,
      accounts: [privateKey],
      gasPrice: 4000000000
    }
  },
};

export default config;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.