Skip to main content

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) and single-use to ensure fresh compliance status and prevent replay attacks.

Permit Types

Sonar generates different permit structures based on your sale configuration:
  • Basic Permit
  • Allocation Permit
  • Fixed6 Permit
Simple entity authorization without allocation data.
{
  permit: {
    entityID: "0x1234567890abcdef1234567890abcdef", // Entity UUID
    saleUUID: "0xabcdef1234567890abcdef1234567890",  // Your sale UUID
    wallet: "0x742d35Cc6364C0532d0ef6b1234567890abcdef", // Authorized wallet
    expiresAt: 1704067200, // Unix timestamp (10 minutes from now)
    payload: "0x" // Reserved for future use
  }
}

Common Issues

Signature Verification Failures Most permit issues stem from signature verification problems:
  1. Wrong signer address: Ensure your contract has the correct Sonar signer address
  2. Struct encoding: Permit structure must exactly match Solidity definition
  3. Sale UUID mismatch: Verify your sale UUID matches exactly
Debug by logging the recovered signer address in your contract. Expiration Handling Permits expire in 10 minutes:
  1. Generate permits just-in-time: Don’t fetch permits during page load
  2. Implement retry logic: Regenerate expired permits automatically
  3. Handle expired permit errors gracefully: Provide clear retry options

See Also

I