Now that your contract has been fully deployed, we can start interacting with it! Flipper only has
get() so we will show you what it's like to play with both of them.
Click the Execute button under the contract after you instantiate the Flipper contract in the
Take a look at our contract's
default() function, we set the initial value of the Flipper contract
No when we instantiated the contract. Let's check that this is the case.
In the Message to Send section, select the "get(): bool" message and accept the default values for the other options.
Press "Call" and confirm that it returns the value
NOTE: You might be wondering "Why did we need to specify gas when reading a value from a contract?"
If you notice right above the "Call" button is a dropdown select box that allows you to "Send as RPC call" or "Send as transaction". For a read-only request like this, we can simply use an RPC call which will simulate a transaction, but not actually storing anything on-chain. Thus, you will still need to specify the right amount of gas to cover your "virtual fee". But don't worry, nothing will be charged when making a call this way. :)
So let's make the value turn
The alternative message to send with the UI is
flip(). Again, accept the default values for the other options.
You will notice that the
flip() message defaults to a transaction call.
If the transaction was successful, we should then be able to go back to the
get() function and see our updated storage:
Woohoo! You deployed your first smart contract!
We will not go over these setup and deployment steps again, but you can use them throughout the tutorial to deploy certain contract on-chain.