website logo
Join the CommunityContact Us
Navigate through spaces
Main
⌘K
Palm Network Developer Portal
The Palm Network
Submit an Article
Network Details
Validators
Get Started
Get PALM Tokens
Gas Fees
Connect to Palm network
Run a Transaction Node
How To Tutorials
MetaMask Wallet Setup
Deploy NFT Contracts
Verifying NFT Contracts
Mint NFTs with Hardhat
Bridge
Use the Bridge
Integrate With the Bridge
Bridge Component Addresses
Deprecated
Use Supported Tools
Block Explorer
Moralis
The Graph
Covalent API
Docs powered by archbee 
21min

Interacting with Smart Contracts

Overview

You can use the Palm Network Block Explorer to interact with a smart contract built on the Palm network once a contract is verified on Palm testnet or Palm mainnet. Verification exposes the contract ensuring blockchain trustlessness and enables essential developer tools. You can divide these interaction into two categories:

  1. Read
  2. Write

Read Contract

Read values are read-only methods that query publicly available data attributes of a contract. To make a query you will need to have a web3 wallet. Querying does not require gas or transaction fees.

Tutorial

1. Lookup Address, TX hash, block number etc.

Find the contract address you want to interact with and enter it into the search bar in the Palm Network Block Explorer. In this example, we're searching at a verified contract that was deployed using Truffle.

Document image

2. View Contract Data

a) Click on the contract address details to review the data. The contract must be verified in order to do any read or write queries.

Document image

b) There will be a green checkmark ✅ next to the Code tab if it is verified.

Document image

3. Read Contract

a) Click on the Read Contract tab to see various values that are queryable. When you try to query, you will be prompted to connect your web3 wallet.

Document image

b) In the example below we are querying the balanceOf the contract owner by their address .



Document image

Write Contract

Write values are methods that affect the state of the blockchain.

Many write functions can only be performed by an approved contract owner or other permissioned roles. Connect a wallet that has the appropriate write permissions when performing gated functions.

Tutorial

1. Lookup Address, TX hash, block number etc.

Find the contract address you want to interact with and enter it into the search bar. In this example, we're searching at a verified contract that was deployed using Truffle.

Document image

2. View Contract Data

a) Click on the contract address to review the details. The contract must be verified in order to do any read or write queries.

Document image

b) There will be a green checkmark ✅ next to the Code tab if it is verified.

3. Write Contract

a) Click the Write Contract tab to perform write queries. In the example below we are trying the transferFrom method.

b) Input the following values:

  • from(address) : The 0x address sending the NFT. Note this account is the one to connected to write
  • to the contract.
  • to(address) : The 0x address receiving the NFT.
  • tokenId(uint256) : tokenID you want to transfer from

c) Then click Write

Document image

d) Success! ✅

Document image







Updated 11 Jan 2023
Did this page help you?
Yes
No
UP NEXT
Verifying a Smart Contract
Docs powered by archbee 
TABLE OF CONTENTS
Overview
Read Contract
Tutorial
1. Lookup Address, TX hash, block number etc.
2. View Contract Data
3. Read Contract
Write Contract
Tutorial
1. Lookup Address, TX hash, block number etc.
2. View Contract Data
3. Write Contract