foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.31k stars 1.75k forks source link

error code -32602: duplicate field `data` at line 1 column 194 #9327

Closed HowHsu closed 7 hours ago

HowHsu commented 11 hours ago

Component

Cast

Have you ensured that all of these are up to date?

What version of Foundry are you on?

forge 0.2.0 (36cbce7 2024-11-15T00:21:52.319667269Z)

What command(s) is the bug in?

cast call

Operating System

Linux

Describe the bug

cast call {contract_address} {function_sig} {args} --rpc-url ...

Call a view contract function =, but got this error retuns: Error: server returned an error response: error code -32602: duplicate fielddataat line 1 column 194

yash-atreya commented 10 hours ago

Can you provide the full command with the contract address and func sig?

yash-atreya commented 10 hours ago

Can you provide the full command with the contract address and func sig?

HowHsu commented 10 hours ago

Can you provide the full command with the contract address and func sig?

It's a private blockchain, the func is "owner()" (the owner() of Ownable)

HowHsu commented 10 hours ago

cast call 0xECaE5ba39d697753D1936D76a3852FeB08c11d82 "owner()" --rpc-url

grandizzy commented 10 hours ago

It looks like an issue with the chain as it cannot be reproduced on local anvil nor or mainnet / optimism etc. We'll probably need more details for the ticket @HowHsu

HowHsu commented 7 hours ago

It looks like an issue with the chain as it cannot be reproduced on local anvil nor or mainnet / optimism etc. We'll probably need more details for the ticket @HowHsu

More info: I alternatively use foundry solidity script, it works

HowHsu commented 7 hours ago

I guess the root-cause is maybe that:

  1. the chain is not a standard evm chain
  2. difference between cast and foundry script

The chain is called Deep Brain Chain, which is a variant of Substrate: https://www.deepbrainchain.org/

zerosnacks commented 7 hours ago

Yes, Foundry does not support non-EVM chains

Marking as won't fix

HowHsu commented 6 hours ago

Yes, Foundry does not support non-EVM chains

Marking as won't fix

It's not 'non-EVM', it is EVM-compatible

grandizzy commented 6 hours ago

Yeah, but non standard could be incompatible in some aspects like this (here's another ticket / sample with chain that doesn't follow standard https://github.com/foundry-rs/foundry/issues/7640#issuecomment-2429278005). Do you use the same evm_version for both script and cast? (if not specified it is using paris)