How to interact with a smart contract to change a variable state

5 days ago

How do I change a variable in a smartcontract (bool)

As requested, a new followup question from the above^

If I have, early in the contract:

bool public myVariable = false;

and then later on:

function set_myVariable(bool newVal) public{

require(msg.sender == 0x..myaddress);

myVariable = newVal;


How do I go about triggering that function in the published contract, and will it "permanently" toggle the true/false state of myVariable, despite the hard-coded =false part at the beginning?