Write
컨트랙트의 일부 상태를 업데이트해야 할 때 스마트 컨트랙트와 상호작용하는 **"트랜잭션"**을 만들 수 있습니다.
Import the web3 and @kaiachain/web3js-ext packages to add kaia features on web3
Define sender's address and private key
Set up the provider with the specified kairos testnet URL. A provider in web3 is a read-only abstraction to access the blockchain data.
Also, you can change the provider URL from kairos to quicknode
Create a sender's account using web3.eth.accounts.privateKeyToAccount
Define contract Abi and address to interact with
Create a contract instance using Web3.eth.Contract
with defined contractAbi and address. You can read and write the contract through this instance
Get the number before update
Create a transaction object that increment the number
Sign the transaction with sender account
Send the transaction to network and wait for the receipt
Get the number after update