Skip to main content

Call Functions

If the functionality of your smart contract does not come under one of the extension interfaces, use the generic Write method to call any function on the smart contract.

The result of the transaction can be read by awaiting the result of the Write. The call will be awaited until the transaction is mined and the transaction receipt is available.


var data = await contract.Write("functionName");



The name of the function, view, mapping, variable, etc. on your smart contract.

Must be a string.


The arguments to the function/variable, in the same order they are on your smart contract.

If you provide too few or too many arguments, the function will throw an error.

var data = await contract.Read<int>("functionName", new object[] { "arg1", "arg2" });