Skip to main content

PermissionedProxy

Description​

PermissionedProxy is a minimal access-control contract. It defines a single admin, an operator allowlist, and a deny-list of function selectors. Meant to be inherited by other contracts.

Variables​

admin
  • Description - The admin with ability to perform any action, including setting a new admin admin, managing operators, and managing the deny-list.
  • Type - address
  • Used By
    • onlyAdmin
  • Updated By
  • Read By
    • admin()
operators
  • Description - A mapping of addresses to operator status. Each address in the mapping that maps to true is enabled as an operator.
  • Type - mapping(address => bool)
  • Used By
    • onlyOperator
  • Updated By
  • Read By
    • operators(address)
permissionedCalls

Modifiers​

onlyAdmin
  • Description - Restricts function execution to the admin address.
  • Reverts
    • With "PD" if msg.sender != admin.
onlyOperator
  • Description - Restricts function execution to addresses with operators[msg.sender] == true.
  • Reverts
    • With "PD" if operators[msg.sender] != true.

Functions​

Admin Actions​

setAdmin(address _admin)
  • Description - Sets the admin to a new address.
    • @param _admin - The new admin address.
  • Visibility Specifier - external
  • State Mutability Specifier - nonpayable
  • Reverts
    • With "zero" if _admin == address(0).
  • Emits
setOperator(address _operator, bool value)
  • Description - Adds or removes an address from the operator allowlist.
    • @param _operator - Address to update.
    • @param value - true to enable as an operator, false to disable as an operator.
  • Visibility Specifier - external
  • State Mutability Specifier - nonpayable
  • Reverts
    • With "zero" if _operator == address(0).
  • Emits
setPermissionedCall(bytes4 sig, bool value)
  • Description - Marks a function selector as denied (true) or allowed (false) for proxy(...) forwarding.
    • @param sig - The function selector to modify.
    • @param value - A true/false value. true to disable proxied calls, false to allow proxied calls.
  • Visibility Specifier - external
  • State Mutability Specifier - nonpayable
  • Emits
proxy(address vault, bytes data)
  • Description - Forwards a call to the vault with the passed data. The function must not be disabled for proxied calls through the deny list. ETH is also forwarded.
    • @param vault - The address of the vault contract to call.
    • @param data - ABI-encoded calldata indiciating the selector of the function to call on the vault.
  • Visibility Specifier - external
  • State Mutability Specifier - payable
  • Access Control - onlyAdmin
  • Reverts
    • With "SEL" if data.length < 4.
    • With "PD" if the selector is on the deny list.
    • With "failed" if the forwarded call returns success == false.
  • Emits - none

Events​

  • AdminUpdated(address indexed admin) - emitted when the admin address is updated.
  • OperatorUpdated(address indexed operator) - emitted when an operator address is added or removed.
  • AddedPermissionedCall(bytes4 indexed sig) - emitted when a function selector’s deny list status is updated.