Overview
Purchase permits are signed messages that authorize specific wallet addresses to purchase tokens for verified entities. They serve as the bridge between Sonar’s compliance verification and your onchain sale contract. Each permit proves that an entity has completed the required verification and is authorized to make a specific purchase with given funding bounds.Permit Architecture
Permits are short-lived (10 minutes) to ensure fresh compliance status. Participants can use multiple permits during a sale (e.g., to update bids in an auction), but each permit expires quickly to maintain security.Permit Structure
Sonar sets different fields in the permit based on your sale configuration:Field Reference
Price fields are denominated in the auction’s bid increment.
For example, if the bid increment is $0.01, then a price of 100 represents a willingness to pay $1.00.
Limits are enforced at the entity level, not the wallet level. A participant using multiple wallets still has a single limit across all of them. Your contract should track commitments by
saleSpecificEntityID and validate that the entity’s total stays within the min/max bounds.Common Issues
Signature Verification Failures Most permit issues stem from signature verification problems:- Wrong signer address: Ensure your contract has the correct Sonar signer address
- Struct encoding: Permit structure must exactly match Solidity definition
- Sale UUID mismatch: Verify your sale UUID matches exactly
- Generate permits just-in-time: Don’t fetch permits during page load
- Implement retry logic: Regenerate expired permits automatically
- Handle expired permit errors gracefully: Provide clear retry options
See Also
Custom Contracts
Learn how to validate permits in your custom sale contract
Frontend Integration
Generate and use permits in your application
Entities
Understanding entities and why limits are per-entity