Understanding and Creating Actions
Step 1: Action Details
First, you need to fill in your action details. This includes the action name (basically, the action your user did that you want to verify), the category your action falls under (just pick from the dropdown), a description of the action, and the type of transaction you want to validate (like a user interacting with a smart contract or with an address).
Smart Contract Transactions
If you're verifying a user interacting with a smart contract, you'll need to add that contract. Just copy and paste your contract address, choose the network it's on and name the contract if you want. Don't worry, you can add both verified and unverified contracts.
Once you've done that, we'll fetch contract details. We'll check if the contract is a proxy and fetch contract ABI from the block explorer. However, If the contract is not a proxy, you can manually input the ABI. If you're not a developer, all you need to know is that you need two green checks!
With two green ticks, you can edit and preview the proxy contract ABI and implementation ABI. You can see all the functions and events.
Functions: These are actions that smart contracts can perform. Think of them as tools that a smart contract can use to do things, like transferring tokens or updating data.
Events: These are notifications that smart contracts send out when something happens. They're like messages that tell other parts of the system what's happening, like when a transaction is completed or a condition is met.
Once you've reviewed/edited the ABI, click on "Add Contract".
Address Transactions
If an external address is creating a transaction (like in bridges), you just need to add that external address, select the chain, and you're good to go.
Step 2: Setting Up Interaction Criteria
Next, define what makes a valid transaction for your action.
Function Selection:
Choose the function that must be called for the action to be considered valid. You can pick two functions, but you'll need to create two separate actions for them.
Event Selection:
Choose the event that must be emitted for the action to be validated. You can add a custom event if yours isn't listed.
User Address Field:
This is where the address of a user is stored in a smart contract. It helps identify who's interacting with the contract.
Step 3: Testing
After setting up the details and criteria, test the action. Add a hash (or multiple hashes separated by commas) of transactions that have interacted with the smart contract or address and hit test. It will show you if the action is valid or not. Then, you can proceed and your action will be added. You'll be prompted to add queries after this.
Last updated