Universal Action Policy
The universal action policy allows for controlled access to specific contract functions with optional parameter-based rules. Below is an example that restricts a function call to a specific parameter value.Security Consideration: Always set appropriate time bounds and carefully consider which contract functions to expose.
Common Use Cases
- Token Allowances: Set maximum spending limits for ERC20 tokens
- Whitelisted Transfers: Restrict transfers to approved addresses only
- Budget Management: Implement departmental spending controls
- DeFi Risk Management: Limit exposure in DeFi protocols
- Automated Payments: Control recurring token payments
- Treasury Operations: Manage organizational token distributions
Best Practices
- Whitelist Recipients: Always specify allowed recipient addresses
- Dual Limits: Implement both per-transaction and cumulative limits
- Token Decimals: Carefully account for token decimal places when setting limits
- Usage Tracking: Monitor cumulative usage against total limits
- Multiple Tokens: Set appropriate limits for each token type
- Regular Reviews: Periodically audit spending patterns and adjust limits
- Combine Policies: Use with time-based restrictions for enhanced security