🏁Quickstart
This 5 minute tutorial will walk you through steps to create a shadow fork of Ethereum Mainnet, add a shadow event to a contract, and retrieve its data.
Last updated
This 5 minute tutorial will walk you through steps to create a shadow fork of Ethereum Mainnet, add a shadow event to a contract, and retrieve its data.
Last updated
By the end of this tutorial, you will:
Add a custom shadow event by editing the WETH contract
Test your changes
Deploy your changes to your shadow fork
Make a JSON-RPC request to retrieve your custom shadow logs
Login to app.shadow.xyz with a Google account.
You should see a screen like the one shown below. The string after project_id=
in the URL is your unique Shadow project ID (e.g. fc6ee70a-6f14-4a99-81db-6bd96226b95f
).
Navigate to the WETH token contract page by pasting the contract address into the search bar 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Click the “Open in editor” button on the top right to open the in-browser IDE.
At the top of the contract on L27, define a new event schema called HelloWorld:
Then, add a line to emit a HelloWorld log at L74 with a custom message every time WETH is transferred:
After you’re done with your changes, hit the “Compile” button on the top right.
Test run your changes by simulating a transaction, and confirming that the transaction has logged your new shadow event.
Click the “Test Run” button on the top right, paste in the following transaction hash, and hit “Run”: 0x2ce5687567574b47c9406df5b65c1d9dd0d94bdcdde7109810b642c35599774b
.
You should see your new HelloWorld
shadow event in the right hand panel!
Now that you’ve tested your shadow changes, you’re ready to deploy the shadow contract onto your shadow fork. Just hit the “Deploy” button on the top right corner.
Now that you've deployed your shadow changes, you're ready to request the data from your shadow fork's RPC. Here's how you would make an eth_getLogs
request from your terminal.
That's it! You have successfully generated custom data on your own shadow fork