Error interacting with contract: TypeError: Cannot read properties of undefined (reading 'publicKey') #5
Labels
Bug
A error that causes the feature to behave differently than what was expected based on design docs
Description
hey,
i've been trying to deploy my smart contract on the hedera testnet account (ECDSA), followed all the steps mentioned in the readme.md file, all the environment variables have been set as mentioned but i still keep encountering this error.
when i run
npx hardhat test
the tests pass, but when i try to interact with the contract again gives me this error:Issue
node uploadToHedera.js
OK till here Error interacting with contract: TypeError: Cannot read properties of undefined (reading 'publicKey') at NodeClient.setOperator (C:\Users\bawgi\OneDrive\Documents\DEHRSys\dehrsys\node_modules\@hashgraph\sdk\lib\client\Client.cjs:286:48) at interactWithContract (C:\Users\bawgi\OneDrive\Documents\DEHRSys\dehrsys\uploadToHedera.js:28:16) at Object.<anonymous> (C:\Users\bawgi\OneDrive\Documents\DEHRSys\dehrsys\uploadToHedera.js:44:1) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47
i believe the issue is occurring in the
\node_modules\@hashgraph\sdk\lib\client\Client.cjs:286:48
file.the code that is triggering the error:
Environment
Steps to reproduce
node index.js
to obtain the hash by Moralis Web3 to store in the uploadToHedera.js file.npx hardhat compile
npx hardhat deploy-contract
npx hardhat test
node uploadToHedera.js
Additional context
No response
Hedera network
testnet
Version
Hardhat: v2.12.6
Operating system
Windows
The text was updated successfully, but these errors were encountered: