1

I have a question about programming VB.NET & Nethereum.

The contract address works flawlessly. For testing purposes I have built in a maintrace - pause function that can be set via function.

In the Remix tool + Metamask, the pause and resume function works perfectly.

I've been desperately looking for a solution for VB.NET (or else C #) for days:

The contract function (i have for test remove OnlyOwner variable in this Contract):

function SetPause() external returns  (string memory)   {

    if (paused) {
        paused = false;
        emit Unpause();
        Unpause;
        return "Pause Set inactive";
    } else {
        paused = true;
        Pause;
        emit Pause();
        return "Pause Set active";
    }
}

When I address the function via VB.NET I get the return messages as normal, but my wallet does not carry out a transaction. Thus the status does not change. Other functions like transfer. Query of token names and balance work fine.

The VB.NET code:

Dim changeFunction As Task(Of String) = Contract.GetFunction("SetPause").SendTransactionAsync(senderAddress, gas)
changeFunction.Wait()
Textbox1.Text = changeFunction.Result

As I said, I get all the correct feedback, but no transactions are carried out (changes), only read queries. I also tried other VB.NET codes. Unsuccessful ...

Patrick
  • 3,073
  • 2
  • 22
  • 60
mr.pepe
  • 11
  • 2

0 Answers0