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

When hardhat is executing a task, an error occurs when accessing the contract mapping to obtain the account balance #6072

Open
Wangxiujie2001 opened this issue Dec 23, 2024 · 1 comment
Assignees
Labels
status:needs-more-info There's not enough information to start working on this issue

Comments

@Wangxiujie2001
Copy link

node version:v20.18.1
npm version:10.8.2
os:ubuntu 22.04
hardhat version:2.22.17

Error description:
When hardhat executes the run javascript script to deploy contracts and crowdfund, it can obtain the crowdfunding amount of the account through the address. However, when the contract deployment module and the contract interaction module are separated into two tasks, the interaction module attaches the contract address of the contract deployment module, and an error occurs when obtaining the crowdfunding amount of the account through the address.

Error phenomenon:

An unexpected error occurred:

Error: could not decode result data (value="0x", info={ "method": "fundOfAccount", "signature": "fundOfAccount(address)" }, code=BAD_DATA, version=6.13.4)
    at makeError (/home/w/hardhat/web3_tutorial/node_modules/ethers/src.ts/utils/errors.ts:694:21)
    at assert (/home/w/hardhat/web3_tutorial/node_modules/ethers/src.ts/utils/errors.ts:715:25)
    at Interface.decodeFunctionResult (/home/w/hardhat/web3_tutorial/node_modules/ethers/src.ts/abi/interface.ts:916:15)
    at staticCallResult (/home/w/hardhat/web3_tutorial/node_modules/ethers/src.ts/contract/contract.ts:346:35)
    at staticCall (/home/w/hardhat/web3_tutorial/node_modules/ethers/src.ts/contract/contract.ts:303:24)
    at Proxy.fundOfAccount (/home/w/hardhat/web3_tutorial/node_modules/ethers/src.ts/contract/contract.ts:351:41)
    at SimpleTaskDefinition.action (/home/w/hardhat/web3_tutorial/tasks/interact-fundMe.js:48:27)
    at Environment._runTaskDefinition (/home/w/hardhat/web3_tutorial/node_modules/hardhat/src/internal/core/runtime-environment.ts:351:14)
    at Environment.run (/home/w/hardhat/web3_tutorial/node_modules/hardhat/src/internal/core/runtime-environment.ts:184:14)
    at main (/home/w/hardhat/web3_tutorial/node_modules/hardhat/src/internal/cli/cli.ts:324:7) {
  code: 'BAD_DATA',
  value: '0x',
  info: { method: 'fundOfAccount', signature: 'fundOfAccount(address)' },
  shortMessage: 'could not decode result data'
}
@github-project-automation github-project-automation bot moved this to Backlog in Hardhat Dec 23, 2024
@galargh galargh added status:needs-more-info There's not enough information to start working on this issue and removed status:triaging labels Dec 23, 2024
@galargh
Copy link
Member

galargh commented Dec 23, 2024

Thanks for the report! Could you share your deployment script and hardhat configuration for us to better understand the issue?

I see that your project is in the web3_tutorial. Were you following some tutorial when you encountered this issue? If so, could you share a link to it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs-more-info There's not enough information to start working on this issue
Projects
Status: Backlog
Development

No branches or pull requests

2 participants