Deploy a project's Clarity smart contract to mainnet by following the Deployment guide.
This feature goes beyond just security—it’s also a way to better understand how your contracts are being used. You can also set up alerts for various public functions in your smart contract to gain insight on which functions are receiving the most calls and how users are interacting with your contract.
Make sure to have successfully deployed your contracts to the Stacks mainnet if you plan on setting up alert monitoring for your own contracts.
If you have successfully deployed your contracts or want to set up alert monitoring for other contracts on mainnet, toggle to the Monitor tab after logging into the Hiro Platform.
After clicking on the 'Add contract' button, a slideout modal will appear with fields for you to look up any smart contract on mainnet using the contract's principal and contract name. All contracts deployed to mainnet are public, and you can monitor and set up alerts for any of them, regardless of whether you are the deployer.
Alternatively, you can also connect your wallet to view your deployment history and choose any contracts you’ve previously deployed in order to set up alerts for them.
Your contract will then appear under Contract Monitoring. Once you are monitoring a particular contract, you can view its transaction history and any pending transactions in the mempool. Click on "Create an alert" to create a specific alert you want to monitor for.
You can configure alerts for any contract calls on mainnet, whether that’s a set-contract-owner function, a transfer/mint/burn function, or anything else you’ve implemented that you want to monitor.
Once you identify the function calls you want to monitor, you can further hone in on the specific calls by creating filters for argument values and the address of the wallet which called the function.
The specific conditions you can choose to monitor for include:
When a particular function is called
When a particular function is called with a specified argument
When a particular function is called by a specified address
You can monitor these alerts in the Hiro Platform, and you can also choose to receive email alerts every time one of those alerts is triggered. Alternatively, you can configure webhook calls, which can be used for all kinds of customized alerting flows.
With each alert you set up, you can view the alert’s history and the response status from any webhook calls made. You also have the ability to edit existing alerts to change your alert conditions or notification preferences at any time.
If you've specified an email as the notification type, alert notification emails will come from Hiro Platform <platform@hiro.so>.
If you've specified a webhook to send an alert to an API endpoint, then the alert payload will look like sample-alert-payload.json below.
Note that tx_status will always return a "pending" status for monitor alert notifications. This is because contract monitoring alerts will only send notifications when your custom notification alert on a particular function hits the mempool, but not when it gets confirmed in the blockchain.