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:
- CommissionRoad (Main Contract): The entry point for all transactions. It executes the user's requested calls (via
commissionCallorcommissionCallVm) and ensures the specified commission is collected. - 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.
- 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
- Minting: A user mints a
CommissionRoadERC721NFT. This gives them a uniquenftIdand makes them a "Referrer" or "Integrator". - 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
nftIdof the referrer and thecommissionamount.
- Collection:
CommissionRoadexecutes the calls.- It enforces that the
msg.valuesent (or tokens approved) covers thecommission. - The commission is sent to the
CommissionVault.
- Claiming: The owner of the
nftIdcallsclaimon theCommissionVaultto 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
CommissionRoadExecutorto 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
commissionCallVmfunction allows executing these Weiroll scripts while still collecting commissions through the standard CommissionRoad mechanism.