ethers.js icon indicating copy to clipboard operation
ethers.js copied to clipboard

ProviderError: the method has been deprecated: eth_accounts

Open jwbda opened this issue 9 months ago • 0 comments

Ethers Version

6.12.0

Search Terms

ProviderError: the method has been deprecated: ethaccounts

Describe the Problem

I use the following link to test solidity contract in bsctest net, but show the error bellow.

links from chainlist and official bsc testnet link:

      url: "https://data-seed-prebsc-1-s1.binance.org:8545/",
      url: "https://endpoints.omniatech.io/v1/bsc/testnet/public",

Code Snippet

contract G {
    event Message(uint a);
    constructor() public payable {
        emit Message(111111);
    }
    function a() public payable {}
    receive() external payable {
        // console.log(">>> run in receive");
        emit Message(66666);
        emit Message(66666);
    }
    function gb() public {
        // return block.timestamp;
        uint aUint = 7777777;
        emit Message(aUint);
    }
}

// deployment
    const amount = hre.ethers.parseEther("1");
    const G = await hre.ethers.getContractFactory("G");
    const g = await G.deploy({ value: amount });
    await g.waitForDeployment();

Errors

An unexpected error occurred:

ProviderError: the method has been deprecated: eth_accounts
    at HttpProvider.request (/test/node_modules/.pnpm/[email protected][email protected][email protected]@[email protected][email protected]_xmbdaxrqyjkegdjiphb3ihp5v4/node_modules/hardhat/src/internal/core/providers/http.ts:90:21)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getSigners (/test/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_r3wjavukgrjxmtwzlpvhibfct4/node_modules/@nomicfoundation/hardhat-ethers/src/internal/helpers.ts:43:30)
    at async getContractFactoryByAbiAndBytecode (/test/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_r3wjavukgrjxmtwzlpvhibfct4/node_modules/@nomicfoundation/hardhat-ethers/src/internal/helpers.ts:305:21)
    at async SimpleTaskDefinition.action (/test/tasks/localTask.ts:175:15)
    at async Environment.runTaskDefinition (/test/node_modules/.pnpm/[email protected][email protected][email protected]@[email protected][email protected]/node_modules/hardhat/src/internal/core/runtime-environment.ts:359:14)
    at async Environment.run (/test/node_modules/.pnpm/[email protected][email protected][email protected]@[email protected]@5.4.5__typescri_xmbdaxrqyjkegdjiphb3ihp5v4/node_modules/hardhat/src/internal/core/runtime-environment.ts:192:14)
    at async main (/test/node_modules/.pnpm/[email protected][email protected][email protected]@[email protected][email protected]__typescri_xmbdaxrqyjkegdjiphb3ihp5v4/node_modules/hardhat/src/internal/cli/cli.ts:323:7)
That is all the output of simple deploy contract

jwbda avatar May 17 '24 04:05 jwbda