Watch contracts
Monitor state changes for a specific smart contract
ContractsTrigger
type triggers allow you to track state changes for a specific smart contract variable (exposed via getter function) or any kind of value returned by a view Solitidy/Viper function.
A simple example
Let's see how we can use a ContractTrigger
to monitor state changes on Uniswap. We can use the getTokenToEthOutputPrice
function to know how many MKR is 1 ETH worth. It is simple to create a trigger that sends us an email every time the ETH price drops below a certain threshold:
Here is a summary of the supported types and predicates:
Type | Supported predicates |
| Eq, SmallerThan, BiggerThan |
| Eq, SmallerThan, BiggerThan, IsIn* |
| Eq |
It is also possible to define more complex data types as inputs to our trigger this way:
Last updated