0

I am working on a cryptocurrency project with Ethereum smart contracts. I am using Nethereum web3 for .NET. I need to implement burn tokens functionality, that is to say I need to call solidity burn function from C#. I have some implementations for other solidity functions, for example:

public virtual async Task<TReturn> CallMethodAsync<TReturn>(string abi, string contractAddress, string methodName, params object[] arguments)
    {
        try
        {
            var contract = _web3.Eth.GetContract(abi, contractAddress);
            var multiplyFunction = contract.GetFunction(methodName);
            var result = await multiplyFunction.CallAsync<TReturn>(arguments);

            return result;
        }
        catch (Exception exp)
        {
            //TODO: log here                
            Debug.Write(exp);
            throw;
        }

    }

I use this function for calling nonce but when I try to use it for calling burn I get the following error:

"Function not found:burn"

TylerH
  • 20,799
  • 66
  • 75
  • 101
Aspram
  • 585
  • 5
  • 16
  • The original contract must have the function "burn" defined. If not, you obviously can't interact with it – Skyuppercut May 22 '18 at 14:18
  • Can you show your contract's source code or abi list? – Vitaly Migunov May 22 '18 at 14:47
  • Never touched to Nethereum, but all Contracts interpreters work the same : they take the abi, they look at all the defined functions and their params and that’s how they emulate the usage of the contracts. If you get this error, you probably have to check your abi to see if burn is defined. – mortimr May 23 '18 at 06:29
  • OK thanks, you are right, my ABI was incomplete. – Aspram May 23 '18 at 06:43

0 Answers0