Documentation Index
Fetch the complete documentation index at: https://injectivelabs-mintlify-jp-developers-first-half-1777019423.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
You should already have a Foundry project set up, and have deployed your smart contract successfully. See the deploy a smart contract using Foundry tutorial for how to do so. Optionally, but strongly recommended: You should also have successfully verified your smart contract. See the verify a smart contract using Foundry tutorial for how to do so.Invoke function - query
Queries are read-only operations. So smart contract state is not updated. As no state change is needed, no wallets, signatures, or transaction fees (gas) are required. Use the following command to query thevalue() function:
${SC_ADDRESS} with the address at which you deployed your smart contract.
For example, if the smart contract address is 0x213ba803265386c10ce04a2caa0f31ff3440b9cf, the command is:
Note that
0x0000000000000000000000000000000000000000000000000000000000000000 means 0.
It is the raw representation in hexadecimal for Solidity’s uint256 (the return type of the value() function in the smart contract).Invoke function - transaction
Transactions are write operations. So smart contract state is updated. As state change can occur, the transaction must be signed by a wallet, and transaction fees (gas) need to be paid. Use the following command to transact theincrement(num) function.
Note that gas price is stated in wei.
1 wei = 10^-18 INJ.
${SC_ADDRESS} with the address at which you deployed your smart contract.
For example, if the smart contract address is 0x213ba803265386c10ce04a2caa0f31ff3440b9cf, the command is:
0x0000000000000000000000000000000000000000000000000000000000000001 because 0 + 1 = 1.
