Developers Forum for XinFin XDC Network

ncode
ncode

Posted on • Updated on

[WIP]Account not managed by node

Hello fellow developers,

I am currently encountering an error when trying to test a contract using Hardhat. The error message states "HardhatError: HH103: Account 0x175530dfced40bbe17a22cff76c2b765f1b2f8f8 is not managed by the node you are connected to."
The error is coming as a part of the script I am running to simulate multiple wallet addresses on my contract. I have being using this account for more than a year , You can check the Blocksscan for the same.
Link to BlockSscan
Image description

I have tried resolving the issue by double-checking that the account being used is unlocked and has enough XDC to perform the action on the contract, but the error persists. I have also tried connecting to a different RPC, but the issue remains.

If anyone has encountered this error before or has any suggestions on how to resolve it, please let me know. Your help would be greatly appreciated.

Discussion (3)

Collapse
ruslan_wing profile image
ruslan wing

The Error clearly shows HardhatError: HH103: Account 0x175530dfced40bbe17a22cff76c2b765f1b2f8f8 is not managed by the node you are connected to."

So please make sure you are connected to right account and can you please share more details regarding the script

Collapse
ncode profile image
ncode Author
// scripts/create-box.js 
 const { 
     ethers, 
     upgrades, 
     deployments, 
     getNamedAccounts, 
     network, 
 } = require("hardhat"); 
 const prompt = require("prompt-sync")({ sigint: true }); 
 require("dotenv").config(); 
 const { MNEMONIC, MNEMONIC1 } = process.env; 
 console.log(MNEMONIC); 
 console.log(MNEMONIC1); 
 async function main() { 
     const [custodianContractOwner] = await ethers.getSigners() 

     const WXDCOZ = await ethers.getContractAt("WXDCOZ", "0x7fD4689BB23598422d3f4686518fEC367eA94F79"); 
     const EscrowManager = await ethers.getContract("EscrowManager", custodianContractOwner); 

     console.log("EscrowManager address: ", EscrowManager.address); 
     const investors = []; 
     for (let i = 0; i < 19; i++) { 
         investors.push( 
             await ethers.Wallet.fromMnemonic( 
                 MNEMONIC, 
                 `m/44'/60'/0'/0/${i}` 
             ) 
         ); 
     } 
     for (let i = 0; i < 19; i++) { 
         investors.push( 
             await ethers.Wallet.fromMnemonic( 
                 MNEMONIC1, 
                 `m/44'/60'/0'/0/${i}` 
             ) 
         ); 
     } 
     let WXDCOZSUB; 
     let tx; 
     // run a loop and transfer 1.1 xdc to each subscriber from the custodianContractOwner 

     for (let i = 0; i < investors.length; i++) { 

   
         console.log("----------------------🔎 Checking investor: ", i, " - ", investors[i].address, "----------------------"); 
         const signer = await ethers.provider.getSigner(investors[i].address); 
         WXDCOZSUB = await ethers.getContractAt("WXDCOZ", WXDCOZ.address, signer); 
         
         // Check if the investor has more then 1 WXDCOZ 
         let WXDCOZBalance = await WXDCOZ.balanceOf(investors[i].address); 
         if (WXDCOZBalance < 1 * 10 ** 18) { 
             // Deposit 1.0 XDC to the WXDCOZ contract 
             tx = await WXDCOZSUB.deposit({ 
                 value: ethers.utils.parseEther("1"), 
                 gasLimit: 1000000, 
             }); 
             await tx.wait(); 
             console.log("🚀 Deposited 1.0 XDC to WXDCOZ contract: ", investors[i].address, "tx hash: ", tx.hash); 
         } else { 
             console.log("✅ Investor: ", investors[i].address, "has more then 1 WXDCOZ"); 
         } 

         // Check if the investor has given approval to the EscrowManager contract 
         

      

     } 
 } 
 main();
Enter fullscreen mode Exit fullscreen mode

@ruslan_wing above is the script which I am using to load test , it's working fine for other accounts however a few accounts like the on mentioned in the original post throws error , even tho the account are active since a year on the xdc network. and since it's working for the other accounts, I am positive that I am connected to correct network

Collapse
rupps_blocksscan profile image
Rupali Mestry

Hello,

We would apppriciate if you could us share details step so that developer can reproduce issue and provide solution it.