Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment issue using hardhat-ledger, error message vague #4893

Open
yohanelly95 opened this issue Feb 20, 2024 · 4 comments
Open

Deployment issue using hardhat-ledger, error message vague #4893

yohanelly95 opened this issue Feb 20, 2024 · 4 comments
Assignees
Labels
status:ready This issue is ready to be worked on type:bug Something isn't working

Comments

@yohanelly95
Copy link

yohanelly95 commented Feb 20, 2024

Version of Hardhat

2.20.1

What happened?

Running a deploy script, that deploys a set of contracts on chain using a ledger hardware wallet using the package "@nomicfoundation/hardhat-ledger": "^1.0.2". Note: The issue seems to specific to the RPC/network. Need to know what the exact issue so I can try resolving it. The same script works on Polygon for eg.

npx hardhat run scripts/deployBridge.js --network skaleChain

The error received:

Deploying ResultManager contract...
✔ [hardhat-ledger] Connecting wallet
✔ [hardhat-ledger] Waiting for confirmation
ProviderError: Invalid RPC parameters.
    at HttpProvider.request (bridge-proxy/node_modules/hardhat/src/internal/core/providers/http.ts:88:21)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at LedgerProvider.request (bridge-proxy/node_modules/@nomicfoundation/hardhat-ledger/src/provider.ts:137:18)
    at EthersProviderWrapper.send (bridge-proxy/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

Minimal reproduction steps

The deployBridge script:

const hre = require("hardhat");
require('dotenv').config();

const SIGNER_ADDRESS = process.env.SIGNER_ADDRESS ||
const { checkTimeDifference } = require('./validateTimestamp');

async function main() {
  console.log("Validating block timestamp of the deploying chain")

  await checkTimeDifference()
  .then(() => console.log('Finished checking time difference.'))
  .catch(error => console.error('An error occurred:', error));


  console.log("Deploying ResultManager contract...");
  const signer = await hre.ethers.getSigner();

  const ResultManager = await hre.ethers.getContractFactory("ResultManager");
  const resultManager = await ResultManager.deploy(SIGNER_ADDRESS);
  console.log("ResultManager contract deployed at:", resultManager.address);
}

// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

Hardhat config of the network used:

skaleChain: {
      chainId: 1564830818,
      url: "https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague",
      ledgerAccounts: [
        "", // specify Ledger Address here (required) 
      ],
      timeout: 600000, 
    }

Search terms

hardhat-ledger

@kanej
Copy link
Member

kanej commented Feb 20, 2024

Are you able to run this script (or a similar script) without using ledger?
Basically can we isolate whether the RPC error is due to hardhat-ledger or the general interaction of Hardhat and the skaleChain.

@yohanelly95
Copy link
Author

yohanelly95 commented Feb 20, 2024

Are you able to run this script (or a similar script) without using ledger? Basically can we isolate whether the RPC error is due to hardhat-ledger or the general interaction of Hardhat and the skaleChain.

you're right, I could run the script using accounts["PRIVATE_KEY"](not using ledgerAccounts). Error seems to be specific to hardhat-ledger. I need to deploy using these contracts using the hardware wallet though @kanej any suggestions on how to go about this. I cannot export the hardware wallets private key

@kanej kanej added status:ready This issue is ready to be worked on type:bug Something isn't working and removed status:triaging labels Feb 21, 2024
@kanej
Copy link
Member

kanej commented Feb 21, 2024

We will have to investigate what is happening in hardhat-ledger - intuitively a transaction that works without going through ledger should work when it does so.
Is there any information in skaleChain community that suggests with Ledger based transactions?

@yohanelly95
Copy link
Author

yohanelly95 commented Feb 23, 2024

We will have to investigate what is happening in hardhat-ledger - intuitively a transaction that works without going through ledger should work when it does so. Is there any information in skaleChain community that suggests with Ledger based transactions?

I will check with the Skale chain community and get back. In the mean time;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on type:bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants