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

Error while calling smart contract method with web3 version 4+ #3392

Open
beawareoftheg opened this issue May 3, 2024 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@beawareoftheg
Copy link

Describe the bug
Calling a smart contract function (not a view) from web3.js library version 4.x, using Metamask, raise the error "Params specify an EIP-1559 transaction but the current network does not support EIP-1559"

To Reproduce

  1. Deploy contract with a function to be called (for example, with Remix)
  2. Obtain the contract object from Metamask, with the web3.js library, inserting the correct information:
    const address = "0x....";<br> const abitext = 'abi....';<br> const abi = JSON.parse(abitext);<br> contractObject = new web3.eth.Contract(abi, address);
  3. Interact with the contract by calling the method using the web3.js library version 4.x
    try{ await contractObject.methods.methodName(parameters).send({ from: account, gas: '1000000', }); } catch (err) { console.log(err) }
  4. Read the console to see the error.

Expected behavior
The call to the function should work with this code, as it works connecting Metamask to different blockchains. This code works properly with the ShimmerEVM Testnet using the web3.js library version 1.10.4, that is now deprecated.

Network and versioning

  • Type of Wasp chain: ShimmerEVM Testnet
  • Interaction method: JSON/RPC HTTP
  • Interaction software: Metamask
@beawareoftheg beawareoftheg added the bug Something isn't working label May 3, 2024
@beawareoftheg
Copy link
Author

beawareoftheg commented May 9, 2024

Another problem with smart contract deployment: the cancun evm is not working in the Shimmer evm Testnet when calling view functions that works with strings (e.g. returning string in a function). Instead the previous evm version, shangai, is working.

@beawareoftheg
Copy link
Author

Update: the error is present even without the use of Metamask, but also connecting directly to the nodes via JSON-RPC url, with web3 libraries functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants