> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snagsolutions.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Smart Contract Event

> Smart contract event loyalty rule. Reward users for triggering specific onchain events.

<head>
  <script type="application/ld+json">
    {JSON.stringify({
            "@context": "https://schema.org",
            "@type": "TechArticle",
            "headline": "Smart Contract Event",
            "description": "Smart contract event loyalty rule. Reward users for triggering specific onchain events.",
            "author": {"@type": "Organization", "name": "Snag Solutions", "url": "https://www.snagsolutions.io/"},
            "publisher": {"@type": "Organization", "name": "Snag Solutions", "url": "https://www.snagsolutions.io/", "logo": {"@type": "ImageObject", "url": "https://assets.snagsolutions.io/public/docs/snag-logo-dark-no-bg.svg"}},
            "mainEntityOfPage": "https://docs.snagsolutions.io/loyalty/rules/contract-event"
          })}
  </script>
</head>

## **Overview**

This loyalty rule allows admins to reward users based on specific events occurring on a contract. This rule is useful for rewarding users for specific contract interactions, such as token transfers or transactions.

<Frame>
  ![Snag admin smart contract event rule configuration form](https://assets.snagsolutions.io/public/docs/rules/contract-event.png)
</Frame>

## Contract Address

Users must select a contract from the available list, or add a new contract. This contract defines where the event will be monitored.

### Recommended Rules

Users can choose from pre-configured rule templates that will show upon selection of contract, such as:

* **Reward User for Every ERC20 Transfer Received**: Grants a reward whenever a user receives any ERC20 tokens.
* **Reward User for Large ERC20 Transfer Received**: Rewards the user only if the received amount exceeds a set threshold (e.g., 1000 tokens).

## Event Selection

User will be able to see the list of all the events of the selected contract to choose from.

### Criteria

* **Every Event**: The rule applies to all occurrences of the event.
* **By Parameter**: The rule only applies when specific conditions are met.

## User Address Mapping

This lets you define a mapping of the wallet address field that should be chosen for the reward. Examples include sender, recipient, or values derived from event parameters.

## Parameter Selection

Users can define specific conditions to filter events. Each condition consists of:

* **Parameter**: The relevant field in the event (e.g., `spender`).
* **Condition**: The logic applied to the parameter (e.g., `Equal`).
* **Value**: The specific value to match (e.g., a specific wallet address like `0xd8dA6BF26964aF9D7c`).

Multiple parameters can be added, and they will be combined with an AND logic.

## Event Tracking Duration

Users can set a custom date range to track the event by enabling the toggle. The selected range determines when the event monitoring begins and ends.

## Reward Configuration

Users can define the reward granted when the event occurs.

### Points to Reward

* The user can specify the reward amount (e.g., Xp1 tokens).
* **Set Maximum**: Enables an upper limit on the number of rewards a user can earn.
* **Bonus Reward**: Optionally enables extra rewards beyond the base amount.

### Event Count & Points

Users can configure:

* **Event Count**: The number of occurrences required to trigger the reward.
* **Points to Reward**: The reward per event occurrence.

## User Reward Frequency

Determines how often a user can receive the reward. Options include:

* **One-time**: The user receives the reward only once per rule configuration.
* **Daily**: The user can receive the reward once per day.
* **Weekly**: The user can receive the reward once per week.
* **Monthly**: The user can receive the reward once per month.

## Custom Settings

Users have additional options:

* **Skip the Multiplier for this Rule**: Ignores any external multipliers affecting rewards.
* **Only Check for Known Users**: Limits rewards to users that are already present and signed into the loyalty program.

## Call to Action (Optional)

Users can define a call-to-action link with custom button text (e.g., "Browse Items").
