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

Cannot read property of 'address' of undefined #12

Open
Watermana opened this issue May 28, 2021 · 8 comments
Open

Cannot read property of 'address' of undefined #12

Watermana opened this issue May 28, 2021 · 8 comments

Comments

@Watermana
Copy link

I'm getting this error whenever I run the index.js bot and I'm not sure what the solution is. I've tried defining 'address' in the code where it's throwing the error, and it still says the same thing.

INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
C:\Users\water\Documents\github\defi-bot\node_modules\web3-eth-accounts\lib\index.js:408
if (!this[account.address]) {
^

TypeError: Cannot read property 'address' of undefined
at Wallet.add (C:\Users\water\Documents\github\defi-bot\node_modules\web3-eth-accounts\lib\index.js:408:23)
at Object. (C:\Users\water\Documents\github\defi-bot\src\index.js:23:26)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47

Does anyone have any ideas what could be causing this issue?

@restorepro
Copy link

Verify your metamask wallet addresses.

@Watermana
Copy link
Author

Verify your metamask wallet addresses.

All the addresses in my .env file are correct to my metamask wallet.

@restorepro
Copy link

Did you get it to work yet? I am getting a web3 error when I run the index.js file...

@restorepro
Copy link

Here is my output that I get when I run the script...

qwert@eqrt-MacBook-Pro defi-bot-1 % node src/index.js
Listening on 5000
Fetching market data @ 2021-05-31T16:44:51-05:00 ...

Order has taker fee
Order has taker fee
Order has taker fee
Order has taker fee
Order has taker fee
Order has taker fee
Order has taker fee
Order has taker fee
Order has taker fee
Order has taker fee
Order has taker fee
/Users/qwert/test/defi-bot-1/node_modules/web3-eth-abi/lib/index.js:298
throw new Error('Returned values aren't valid, did it run Out of Gas? ' +

@restorepro
Copy link

I read in a few places that it may be the version of web3.js that causes the issue or changing the compiler version from 5.17 to a lower 5.x version in remix. I tried both and neither worked for me.
Screen Shot 2021-05-31 at 5 55 46 PM

@restorepro
Copy link

Did you add the HDWallets package and configure it in the truffle-config.js file?

@dnblack3
Copy link

dnblack3 commented Jul 9, 2021

could this be the issue?
https://docs.soliditylang.org/en/v0.8.6/050-breaking-changes.html
Explicitness requirement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@restorepro @dnblack3 @Watermana and others