Skip to content

Protocol Overview

CommissionRoad is a monetization protocol that allows developers and protocol integrators to earn commissions on smart contract transactions. It separates the execution of transactions from the fee collection logic, providing a flexible and permissionless way to monetize any on-chain activity.

Architecture

The protocol consists of three main contracts that interact to provide the core functionality:

  1. CommissionRoad (Main Contract): The entry point for all transactions. It executes the user's requested calls (via commissionCall or commissionCallVm) and ensures the specified commission is collected.
  2. CommissionRoadERC721 (NFT Contract): Represents "Ownership" of a CommissionRoad ID. Each ID is an NFT. Commissions earned by a specific ID are tied to the owner of that NFT.
  3. CommissionVault (The Bank): Holds the collected fees. It splits the fees between the protocol (a small tax) and the NFT owner. The NFT owner can claim their earnings from the Vault at any time.

Protocol Flow

  1. Minting: A user mints a CommissionRoadERC721 NFT. This gives them a unique nftId and makes them a "Referrer" or "Integrator".
  2. Execution: An interface (dApp, wallet, script) constructs a transaction using CommissionRoad.commissionCall.
    • This transaction includes a list of calls to execute (e.g., "Swap 1 ETH for USDC").
    • It also specifies the nftId of the referrer and the commission amount.
  3. Collection:
    • CommissionRoad executes the calls.
    • It enforces that the msg.value sent (or tokens approved) covers the commission.
    • The commission is sent to the CommissionVault.
  4. Claiming: The owner of the nftId calls claim on the CommissionVault to withdraw their earned tokens (ETH or ERC20).

Key Features

Permit2 Integration

CommissionRoad natively supports paying execution costs and commissions using Permit2. This allows for:

  • Any-Token Payments: Users don't need ETH to pay commission fees; they can pay in the token they are swapping or moving.
  • Batched Approvals: Multiple token approvals can be handled in a single signature, improving user experience.
  • Signature-Based Transfers: Tokens are pulled only when the transaction is successfully executing, adding a layer of security.

EIP-7702 & Batched Transactions

With the advent of EIP-7702, CommissionRoad becomes even more powerful.

  • EOA as Contract: Users can authorize the CommissionRoadExecutor to act on behalf of their Externally Owned Account (EOA).
  • Atomic Operations: This enables complex flows like "Mint NFT + Burn NFT + Pay Fee" to happen in a single atomic transaction.
  • Simplified UX: Users can sign a single authorization to perform multiple actions, reducing the number of pop-ups and gas costs.

Weiroll VM Support

For advanced use cases, CommissionRoad integrates the Weiroll VM.

  • Scripting on Chain: Weiroll allows constructing complex, dependent transaction chains (e.g., "Get the result of Call A and use it as input for Call B").
  • Efficiency: Reduces the need for custom "helper" contracts by allowing logic to be defined in the transaction data itself.
  • CommissionCallVm: The commissionCallVm function allows executing these Weiroll scripts while still collecting commissions through the standard CommissionRoad mechanism.