Ethcode docs
Search…
⌃K

Calling contracts

Ethcode call all the mutable and immutable functions of your deployed smart contract using Ethcode in just a few simple steps.

Call immutable functions

Immutable functions are those functions that do not contain any parameter. They do not send any transaction to the blockchain and only return the value.
  1. 1.
    ctrl + shift + P - open VScode command palate.
  2. 2.
    Ethcode: Contract call - command used to display a quick menu of all the functions present in the contract.
contract call
3. select a function with no parameter.
calling immutable function
called immutable function

Call mutable functions

Mutable functions are those functions that contain one or more parameters. They send the transactions to the blockchain and manipulate the data in the smart contract.
1. Navigate to projectName/artifacts/contracts/<MYCONTRACT>.sol/MYCONTRACT_functions_input.json file and pass values of all the parameters in the selected function input array.
json file before passing paramenters
Here I want to call thesafeMint function of my NFT contract so I will pass all the parameters required to call the function in the input array of safeMint function.
json file after passing paramenters
2. ctrl + shift + P - open VScode command palate.
3. Ethcode: Contract call - command used to display a quick menu of all the functions present in the contract.
contract call
4. select safeMint function.
select safeMint