- Node.js and npm installed
- Access to Tenderly API
- Valid Tenderly account and project
- Webhook endpoint for receiving data
The following secrets need to be configured in your Tenderly environment. For this you'll place them inside Web3 Action Secrets:
WEBHOOK_URL
BEARER
ACCOUNT_SLUG
PROJECT_SLUG
EVENT_NAME
- Clone this repo, or create brand new Web3 Action using tihs guide
- If you've cloned repo, do the following:
cd actions && npm install
- Inside
tenderly.yaml
modifyACCOUNT_SLUG
andPROJECT_SLUG
with your information - After everything has been setup properly, do
cd ..
to get to root directory (beefy-action
) and thentenderly actions deploy
The main function beefyFn
is triggered by Tenderly Actions when a matching transaction event occurs. It performs the following operations:
- Fetches transaction trace data using Tenderly API
- Extracts relevant event information
- Retrieves contract names for involved addresses
- Processes and formats the data
- Sends the formatted data to the specified webhook
-
Transaction Information Retrieval
- Gets transaction hash and network
- Fetches detailed transaction trace data
-
Contract Information
- Fetches contract names for relevant addresses
- Handles API errors gracefully
-
Event Processing
- Filters for specified events
- Extracts unique addresses
- Processes event details and parameters
-
Data Forwarding
- Formats data for webhook consumption
- Sends data to configured webhook endpoint
- Logs operation results
{
contractName: string,
addresses: string[],
events: Array<{
name: string,
[parameterName: string]: string
}>,
traceData: object
}
The system includes error handling for:
- Missing environment variables
- API request failures
- Contract information retrieval
- Webhook communication issues
The system logs:
- Event name being processed
- Addresses involved
- Detailed event information
- Webhook transmission status
@tenderly/actions
: For interacting with Tenderly's action systemaxios
: For making HTTP requests# flexible-monitoring-solution