Overview

ERC20Verifier is a role-driven ICustomVerifier implementation that enforces strict, granular permissioning over ERC20 approve and transfer function calls. It builds upon OwnedCustomVerifier, using MellowACL-style roles to validate the caller, target asset, and recipient of each operation.

This verifier is designed for use in modular vaults such as SubVault where only specific ERC20 operations should be allowed through a customizable permission matrix.

Purpose

To allow or deny ERC20 approve and transfer calls based on:

Roles

Each permission check is mapped to a distinct bytes32 role:

Role Constant Purpose
ASSET_ROLE Marks which ERC20 tokens are allowed to be interacted with
CALLER_ROLE Who is allowed to perform approve or transfer
RECIPIENT_ROLE Who is allowed to receive tokens (for transfer) or get approval (for approve)

These roles are expected to be configured via the initialize() function inherited from OwnedCustomVerifier.

Contract Behavior

Constructor

constructor(string memory name_, uint256 version_)

verifyCall Function

function verifyCall(
    address who,
    address where,
    uint256 value,
    bytes calldata callData,
    bytes calldata /* verificationData */
) external view override returns (bool)

Summary: