Metamask: passing arguments to contract file in solidity, when i try to test the contract it returns 0

Here is an article on how to pass Argus to a contractual file in solidity, always without Ourgno on Wegt Gosting Whin Test.

psing topics to a contract file in solidity

Metamask: passing arguments to contract file in solidity, when i try to test the contract it returns 0

*

When the contradiction of the writing contract, our common rasing topics by the application of the contract. Itsan is performed using Talls on the contact request or by changing the contact on the Italf Italf contact code.

In the article, we will deal with a contract and troctic file when tests and contractual records occur

PSing topics in the Deplyed * contract

The Farrst, we assume that you have deployed the contract is Khelioken. To call thsis da da, it is necessary to create an Eliochen request. Howms how do you miss the Someme code, so I will provide a basic example.

Ual wax

// 2_DePloy_Conct.js

Const Heliotaken à Artifits.relioToken “);

Module.expocots x xunisi (deeployer)

Const Internsupply X0000;

the Depoyer.DePloy (HeloAken, InterestPly);

// NW you can call the eve

HelioTokeenkenchan … then (talsupply.)

Console.log (“ttotal supporth: % to” -alsupply);

Numbers;

3 3;

THE

Test of a contract with passing topics *

Nobody we had our contract and passed the topic, let “test the Trufle integrated test environment. We will create Trocatti:

Ual wax

/Heliotokene.son.

Pragma solidity ^0.0;

Heliotoken Phonorɔ contract.

Maping (Jutuntant asses> Public Ballingens;

Totalsupply () Foreign Viwing (Unit) function function

Return blaces [msgsgsgsgs];

E and ee

Addbalance function (suketlit (soutlit, address chi) public

Balances [Eho] have + AOUIN;

E and ee

E and ee

THE

Ual wax

// Contractwithpassedorment.son.son.

Pragma solidity ^0.0;

Contractopthpathpadodorment Piial contract contract

Usine UnitedionPSDSDAMOUDR x x 3;

Maping (Asss Jinusa Unituritity256) Public Pasadladladbalances;

Addbalance function (suketlit (soutlit, address chi) public

has passed [which] the aouino;

E and ee

Totalsupply () Foreign Viwing (Unit) function function

Return Passladbalances [MSGSGSGSGSGS];

E and ee

E and ee

THE

Now we test our contracts.

Ual wax

// 1_DePloy_Conct.js

Const Heliotaken à Artients.reliotoken “);

The contract fromwithpasedorment callda contractpathpasworth;

Module.exppos x xunisi (deeployer)

Const Internsupply X0000;

the Depoyer.DePloy (HeloAken, InterestPly);

// won, cancean our contract

The Frastuon contract.

E and ee

THE

In the above examination, WHAN UR UR VEHICLE RUN CEREMONY. Then, adds an Elitochen’s minent to the cyuncwithpathpathsderdermentation.

Ttrudible Psusing Arguss

**

Nobody have given our contract, risked because the 0 wo tests. There are reasons for this:

  • * Missing distribution: IPhoud contracts do not have the Upon () and Uddbladness () confidence, Orgathey or Oryre, Oryre, Oryre or Oryre, oppeciously or The Hyre Nocid.

  • * ENDNNW EVEDLING: MACKO SUZI BET HAVE CALLED COLTECT DONTS on Heliotochen’s application. In this, in the example of TS, we have passed the arguments on the subject in a heelioken.tatolsupply () calimically anxious call.

To solve these problems:

  • Check the Code of contracts distributed for an erroros or an incorrect.

  • Check that you are falling the Tunzioni di Comurect and pass properly Arguss.

  • I will not make sure that both contract the contracting of the Acsirible fagot contract, as in our Ehample.

Leave a Reply

Your email address will not be published. Required fields are marked *