Skip to content

Cloning a Handler

The setUp function can receive arbitrary arguments, which must be provided when registering a handler in the Kyn platform. These arguments can also be modified when cloning a handler through the Kyn frontend. The frontend will generate a form in which the inputs depend on the argument type (an enum will be shown as a select, etc). Using NatSpec, it is also posible to include function and argument descriptions that will be displayed in the frontend when cloning.

/// @dev This handler monitors all `Transfer` events emitted by the specified address
/// @param addr The address to monitor
/// @param notificationType{Discord,Telegram} The notification type
/// @param notificationUrl The notification url (telegram chat id or discord webhook url)
function setUp(
    address addr,
    NotificationType notificationType,
    string memory notificationUrl
) public {
    // ...
}

When a user clones the previous handler through the frontend, the following form will be displayed:

Clone form