Interacting with a Smart Contract
Prerequisites
Ensure Olatte is installed correctly:
If this command fails, see Setting up your environment.
Introduction
Olatte enables interaction with smart contracts via two primary methods:
call: for read-only functions.
invoke: for write functions that modify the state.
Call a function
The call command can query a smart contract function without sending a transaction.
As an example you can use the get_proposer function which expect index of the proposal and returns the address of the proposer:
vote_simple_abi.json is the smart contract's abi file.
0x444b.. is the contract address
winningProposal is function name. For functions with parameters, enter the function's inputs after the function name.
This will return the winner proposal:
Invoke a function
when we need to modify the state of the smart contract, we need to send a transaction. This requires the use of the invoke command in Olatte, which sends a transaction to the Ola network.
In this example, we are sending a transaction to vote for proposal 7.
Last updated