Solidity beginners
Don't know Solidity? Don't worry.
Last updated
Don't know Solidity? Don't worry.
Last updated
Using Shadow does require some Solidity knowledge, but you don't need to be an expert.
At a high-level, you need to be able to:
Decide what you want your end shadow event data table to look like
Read smart contracts well enough to understand where to insert shadow events
Write short snippets of Solidity code to declare and emit shadow events
Use ChatGPT tools to help you out when you get stuck (see recommendations below)
If you're a non-Solidity engineer, it'll be easy. You'll be able to use Shadow within 1-2 hrs.
If you're a data analyst that doesn't know any Solidity at all, you'll be able to use Shadow effectively within a few days. Some shadow events are easier to write, so you may even be able to get things working within a few hours. Many people who primarily have a SQL skillset have learned enough to use Shadow effectively, so don't be deterred!
We'll walk you through the steps to get started with detailed instructions and screenshots, and also provide tips on common issues that may arise as you create your own shadow events.
(e.g. recommended tools and how to get contract code)
We highly recommend Solidity beginners to use these tools in order to use Shadow effectively, and have written detailed instructions with screenshots on how to get them set up.
You can also download from Etherscan using Open In > Remix IDE from the Contract tab.
Right click the folder with the contract address and select Download
Open a new Cursor window > Open from folder
> open the folder with the contract address
After this step, you should have a folder with the .sol
file(s) from the contract imported into Cursor. Most contracts will have multiple folders, subfolders, and .sol
files within each. This may look intimidating at first, but you'll usually only need to modify 1-2 files to add a shadow event.
The first step of adding a shadow event is to declare it somewhere in the contract. This makes your contract aware of the event and its data parameters.
To keep things organized, you should try to declare your shadow event where the contract's other events are already declared. Search the codebase for "event" – it's usually pretty easy to find.
Declare your new shadow event where the contract's existing events are declared.
If you don't need to add a brand new event and instead just want to add data parameters to an existing event, you can do that too. If you're modifying an existing event, it's helpful for readability to rename it by pre-fixing "Shadow" to the name, e.g. ShadowMint
The second step
Click on the Open in editor
button in the top right corner.
Copy paste your modified code into the right .sol
files, and click Deploy
. If you modified multiple .sol
files to add your shadow event, be sure to replace the contents for each one.
Once deployed, you can see your shadow events happening in realtime on the Event Feed tab.
You can also access your shadow event data via RPC, streams to your own database, or a Shadow hosted SQL API. Please talk to us if you're having trouble deciding or setting that up.
See "How to use" for the .
See "How to use" for the .
Go to the contract page on . The URL of the page should look something like this, with the contract address replaced and using your unique project_id at the end.
💬
💌