Metamask: eth_estimategas strange behaviour in Metamask

  • Post author:
  • Post comments:0 Comments

Metamask: Number etc-20 token street

I am ruining a test suite with the web3 interaction process. The relatively rare was from Beement reported by Soome. So it’s a step-by-step guide to solve the problem and what causes it.

passage 1: understand the problem

What selects the token of the contract The Meask settings in your Hardhat test, the click on “Send” to transfer Ether (Thh), Yuu will strive the behavior in the coach output. In particular, you have some other message that looks at them:

`s

Error: Non valid call

s

This can be a frustrating infected test functionality.

Step 2: Investigate and identify the problem

Everyone identifies the problem, follow there:

  • Check the metasic settings : make sure that Thave has selected the contract token in the Metamask settings. The "Send" button lowers the contract address.

  • * Check the contracts: work with the same on the line of the bell sketch essay of the Rotod method (for example, Transfer ()). You can check it by performing with the local network use NPX Ruin Scripts/Contract.js'.

  • Check the Detils transaction: inspect the details of the Detels transaction in the console output to confirm the correspondences on what corresponds.

Step 3: Sert and Debug

To test and debug, crowd will make further steps:

  • * Test with a simple call: Call the use of the function of the "Eth_sendrtware" contract function with only the toraneal of the eyes with a topic (for example, EthicascadendraWTRESCUCTION ("0x ..."). This has triggered all the necessary transactions.

2.SAdd registration of the console*: Add the Twing smell to verify that the transaction is created and corresponds:

ovasscript

Const TX TX = wait youurcontrac.teller.tells.tellers.transfer (0x … 0x …).

Console.log (THX);

`s

  • Output of the inspection console : let a watch look at the console for any or warnings that can take mistakes.

Step 4: Resolution and Refactor

IFLE stars an error, curtain to appear to:

1

  • Make sure your agreement is corresponding and distributed on the network.

  • Check the test suite of the cause of any conflicts with Y tests.

Example of use

To reproduce this is a problem, you can create as simple contracts such as so:

ovasscript

Cont web3 = Requirements (‘Web3’);

Cont web3 = man web3 (new web3. Providers.httpprovider (‘

Const MyContract = Artifacts.Require (“Myer20Contrac”);

The Module.exports function is in () {

returned new promised ((remains, refused) => {

Concert contractodss = “0x …”;

We web3.th.sintrasation (

I was frozen: ‘0x …’, /// Ser’s Address

A: concert,

Evaluation: web3.towi (1, “ether”),

Gaze: 20000,

}, (erro, hash transaction) => {

IMIF (! Terr & transaction hash! == null) {

Console.log (“Trashotion Susceful”);

solve(),;

} other {

Consul. Erro/’Error:’, Error);

refuse (error);

}

^)

^)

}

“ s

In addition to the exam, solve the Iyour_project_d Yuh placeholder your effect on the infusion.

Conclusion

Metamask to estimate the problem can be challenging to diagnose and solve. This fault Hod Slp with an identity of the problem in follandering the passages. However, IIF Falsi faces problems or need further assists, celebrating the tourism tour for help.

solana owned different anchor

Leave a Reply