Use Seitrace to Read and Write to Smart Contracts
Once a contract is verified, its methods are exposed, and direct interaction is possible through Seitrace.Read contract
Read actions allow you to check various contract attributes. Connecting a web3 wallet is required to make a query, but queries do not require a transaction or any gas costs.- Find the contract address:
- Locate and enter the contract address you want to interact with into the search bar on Seitrace.
- Navigate to the contract page:
- Select the first option in the search results, which takes you to the token page.
- For more detailed information, click through to the contract page.
- Verify contract code:
- Scroll down past the contract details to see if the code is verified (indicated by a checkmark ✅).
- If the code is not verified, you cannot read or write to the contract unless a verified contract with the same bytecode is found in the Seitrace database.
- Proxy Implementation:
- If the contract is a proxy implementation, you will see options to read/write to the contract or the proxy. A proxy means the contract is upgradeable, and the admin can set a new proxy address for the primary contract if upgrades are needed.
- Interact with Contract Methods:
- Various methods within the contract are visible. Some show current values, while others are queryable.
- For example, to query the
balanceOf
method:- Fill out the
_owner
(address) field. - Click on “Query”.
- Seitrace will execute the query and return the result under the function.
- Fill out the
Write Contract
To write to a contract, follow similar steps as above but with the additional requirement of paying gas fees for transactions:- Find and navigate to the contract:
- Enter the contract address in the search bar.
- Click through to the contract page from the search results.
- Verify contract code:
- Ensure the contract code is verified.
- Proxy Implementation:
- If applicable, decide whether to interact with the contract or the proxy.
- Interact with contract methods:
- Connect your wallet with MetaMask.
- Fill out the necessary fields for the method you wish to write to. (example on function _safeMint)
- Click on “Write” and confirm the transaction in your wallet (Metamask).
- The transaction will be sent to the blockchain, and you will receive a transaction hash once completed.