Skip to content

Solidity API

ERC2771Storage

Library for managing trusted forwarders in ERC2771 context

This library provides storage and access for trusted forwarders

Layout

Struct to hold the storage layout for ERC2771

solidity
struct Layout {
  mapping(address => bool) _trustedForwarder;
}

STORAGE_SLOT

solidity
bytes32 STORAGE_SLOT

keccak256 hash used as storage slot to avoid storage collisions

Unique storage slot for ERC2771Storage

layout

solidity
function layout() internal pure returns (struct ERC2771Storage.Layout l)

Provides access to the storage layout

Uses assembly to load the storage reference from a fixed slot

Return Values

NameTypeDescription
lstruct ERC2771Storage.LayoutStorage reference to the Layout struct