Skip to content

Allowlist

The allowlist is an opt-in security feature that lets NFT owners restrict which contracts can be called through their CommissionRoad NFT ID.

WHEN TO USE

Use the allowlist when you want to lock down which protocols can be used with your NFT ID.

  • Example: "Only allow Uniswap and Aave as call targets."
  • Example: "Prevent anyone from routing unknown contracts through my ID."

If you don't enable the allowlist, all targets are allowed — the same behavior as before.

How It Works

  1. Enable — The NFT owner calls setAllowlistEnabled(nftId, true).
  2. Add targets — The NFT owner calls setAllowlist(nftId, targetAddress, true) for each allowed contract.
  3. Enforce — When anyone calls commissionCall or commissionPlan with that nftId, every call target is checked against the allowlist. If a target isn't allowlisted, the transaction reverts.
  4. Disable (optional) — The NFT owner can call setAllowlistEnabled(nftId, false) to turn it off again.

Implementation

1. Enable the Allowlist

typescript
// Only the NFT owner can enable/disable
await commissionRoad.write.setAllowlistEnabled([nftId, true]);

2. Add Allowed Targets

typescript
// Allowlist Uniswap router
await commissionRoad.write.setAllowlist([
  nftId,
  uniswapRouterAddress,
  true,
]);

// Allowlist Aave lending pool
await commissionRoad.write.setAllowlist([
  nftId,
  aaveLendingPoolAddress,
  true,
]);

3. Remove a Target

typescript
// Remove a previously allowlisted address
await commissionRoad.write.setAllowlist([
  nftId,
  oldContractAddress,
  false,
]);

4. Disable the Allowlist

typescript
// Disable entirely — all targets allowed again
await commissionRoad.write.setAllowlistEnabled([nftId, false]);

Scope

The allowlist is enforced in both execution paths:

MethodWhere enforced
commissionCallCommissionRoad.checkCallTargets — checks each BatchCallData.target
commissionPlanCommissionRoad.checkPlanTargets — extracts the target from the lower 20 bytes of each weiroll command

EIP-7702 / CommissionRoadExecutor

The CommissionRoadExecutor used for EIP-7702 flows also enforces the allowlist. The Executor reads isCallTargetAllowlisted and isAllowlistEnabled directly from the CommissionRoad contract — NFT owners only need to manage their allowlist in one place.

NOTE

The Executor's execute and batchCall functions accept an nftId parameter so the correct allowlist is applied.

Events

Two events are emitted when allowlist state changes:

EventEmitted byParameters
AllowlistUpdatedsetAllowlistnftId (indexed), target (indexed), allowed
AllowlistEnabledUpdatedsetAllowlistEnablednftId (indexed), enabled

These events enable indexers and UIs to track allowlist configuration in real time.

⚠️ Gotchas

  • Disabled by default — After minting, the allowlist is off. All targets are allowed until you explicitly enable it.
  • Owner only — Only the NFT owner can call setAllowlist and setAllowlistEnabled. Attempting to call from another address reverts with NotNftOwner.
  • Remember to allowlist sweeps — If your integration uses sweepERC20Token or sweepERC1155Token, the CommissionRoad contract address itself must be allowlisted as a target.