adrianhajdin / project_web3_battle_game

With a stunning design, interactive gameplay, smart wallet pairing, live interaction with smart contracts, and, most importantly, the ability to battle other players in real-time, AvaxGods is the best and the only Web3 battle-style online multiplayer card game that you can currently find on YouTube.
https://jsmastery.pro
435 stars 144 forks source link

contract.isplayer is not a function #6

Closed Thebks closed 1 year ago

Thebks commented 1 year ago

I'm getting the "contract.isplayer is not a function" error but it's not because of the providers.getSigner . The error is coming from UpdateCurrentWalletAddress function. It shows that there is an "uncaught (in primise) object" in that function.

Thebks commented 1 year ago

Screenshot from 2022-12-08 12-34-36 Screenshot from 2022-12-08 12-34-19

warkingous commented 1 year ago

I'm getting the "contract.isplayer is not a function" error but it's not because of the providers.getSigner . The error is coming from UpdateCurrentWalletAddress function. It shows that there is an "uncaught (in primise) object" in that function.

use 'eth_accounts' instead of 'eth_requestAccounts'

cforcross commented 1 year ago

I'm getting the "contract.isplayer is not a function" error but it's not because of the providers.getSigner . The error is coming from UpdateCurrentWalletAddress function. It shows that there is an "uncaught (in primise) object" in that function.

@Thebks any luck figuring this out?

cforcross commented 1 year ago

I'm getting the "contract.isplayer is not a function" error but it's not because of the providers.getSigner . The error is coming from UpdateCurrentWalletAddress function. It shows that there is an "uncaught (in primise) object" in that function.

use 'eth_accounts' instead of 'eth_requestAccounts'

didn't solve the error on my end. copied and pasted the exact code from the repo but the error persisted

Thebks commented 1 year ago

Yes actually I somehow got rid of it and the problem had something to do with my wallet connection. Make sure you don't have a connection problem and every time you make changes in your code you have to refresh your browser and sign in to your wallet again.

could you also share your code so I can see if you don't mind?

Thebks commented 1 year ago

Make sure you added the private key in the .env file and then add the contract address once you compile it in the client/src/contract/index.js directory like this export const ADDRESS = '0x0000000000000000000000000000';

If you have copied the exact code then I think the problem is with the wallet connection so do check that.