HelheimLabs / autochessia

Fully on-chain auto chess, built with MUD
https://dev.autochessia.xyz
GNU Affero General Public License v3.0
21 stars 14 forks source link

ContractFunctionExecutionError: HTTP request failed. #199

Closed VictorECDSA closed 9 months ago

VictorECDSA commented 9 months ago

Version: develop 439c3d6e

After execute the command below:

pnpm dev

I go to http://localhost:3000/ in explorer, and click the button 'Single Play', and then wait a while. I hit an error on the 'singlePlay()' of Actions, as below:

ContractFunctionExecutionError: HTTP request failed.

URL: https://flashlayer.alt.technology/autochessia37806fd60
Request body: {"method":"eth_call","params":[{"from":"0x52e5145EaF688dD5b36E371E28F419c8E4112903","data":"0xe4b4792c","to":"0xa39f9c7590c220aeDFA98038D31fa51B5fed5a18"},"pending"]}

Raw Call Arguments:
  from:  0x52e5145EaF688dD5b36E371E28F419c8E4112903
  to:    0xa39f9c7590c220aeDFA98038D31fa51B5fed5a18
  data:  0xe4b4792c

Contract Call:
  address:   0xa39f9c7590c220aeDFA98038D31fa51B5fed5a18
  function:  singlePlay()
  sender:    0x52e5145EaF688dD5b36E371E28F419c8E4112903

Docs: https://viem.sh/docs/contract/simulateContract.html
Details: Failed to fetch
Version: viem@1.13.2
    at getContractError (http://localhost:3000/node_modules/.vite/deps/chunk-FOH7TKH3.js?v=83bcda20:988:10)
    at simulateContract (http://localhost:3000/node_modules/.vite/deps/chunk-FOH7TKH3.js?v=83bcda20:1678:11)
    at async a (http://localhost:3000/node_modules/.vite/deps/chunk-WLWLZ3I7.js?v=83bcda20:20782:151)
    at async H (http://localhost:3000/node_modules/.vite/deps/chunk-WLWLZ3I7.js?v=83bcda20:20784:11)
noyyyy commented 9 months ago

For local preview, you need to switch to foundy testnet. image

VictorECDSA commented 9 months ago

For local preview, you need to switch to foundy testnet. image

Thank you! I can enter Single Play now. But the status bar on the right blocking my game interface. Could you tell me how to "collapse" it?

WeChatWorkScreenshot_5970e599-a468-42c7-b840-8c02611bb6a6
noyyyy commented 9 months ago

press tab

VictorECDSA commented 9 months ago

press tab

Oh thank you, I see it.

But I still have some questions.

Firstly, according to 'How to Play', there should be a 'Refresh Heros' button, but I haven't see it, so I have not heros. So I can not perform any operation. I can just wait for the time pass by.

Secondly, there are some errors on the 'Actions', present periodically. I know it is the operation of bot. But some 'tick' are failure. And the error info is as below. Is this normal?

ContractFunctionExecutionError: The contract function "tick" reverted with the following reason:
preparing time

Contract Call:
  address:   0xe3a6d6d5570f1d87d45036eac17342ffe32d8f46
  function:  tick(uint32 _gameId, address _player)
  args:          (3, 0x52e5145EaF688dD5b36E371E28F419c8E4112903)
  sender:    0x52e5145EaF688dD5b36E371E28F419c8E4112903

Docs: https://viem.sh/docs/contract/simulateContract.html
Version: viem@1.13.2
    at getContractError (http://localhost:3000/node_modules/.vite/deps/chunk-FOH7TKH3.js?v=83bcda20:988:10)
    at simulateContract (http://localhost:3000/node_modules/.vite/deps/chunk-FOH7TKH3.js?v=83bcda20:1678:11)
    at async a (http://localhost:3000/node_modules/.vite/deps/chunk-WLWLZ3I7.js?v=83bcda20:20782:151)
    at async H (http://localhost:3000/node_modules/.vite/deps/chunk-WLWLZ3I7.js?v=83bcda20:20784:11)
WeChatWorkScreenshot_ff6aa280-1f51-4bd6-9881-325e9249ecc4
noyyyy commented 9 months ago

@fenghaoming Thanks for your trying.

The shop btn is a little covert so that you need to click the autochessia to open it. We are making a new interface in #191

Secondly, the error of tick is expected.

It's not ready for playtest now but you can read code to learn how it work.

VictorECDSA commented 9 months ago

@fenghaoming Thanks for your trying.

The shop btn is a little covert so that you need to click the autochessia to open it. We are making a new interface in #191

Secondly, the error of tick is expected.

It's not ready for playtest now but you can read code to learn how it work.

Thanks. I am reading the source code of such a charming game.