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. ctrl + shift + P - open VScode command palate.

  2. Ethcode: Contract call - command used to display a quick menu of all the functions present in the contract.

3. select a function with no parameter.

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.

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.

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.

4. select safeMint function.

Last updated