Skip to content

Solidity API

ERC20BaseStorage

Defines the storage layout for the core ERC20 token functionality Uses the diamond storage pattern to avoid storage collisions in upgradeable contracts

Layout

Storage layout structure for ERC20 token data

Parameters

NameTypeDescription
solidity
struct Layout {
  mapping(address => uint256) balances;
  mapping(address => mapping(address => uint256)) allowances;
  uint256 totalSupply;
}

STORAGE_SLOT

solidity
bytes32 STORAGE_SLOT

Unique storage slot for ERC20 base storage Generated using the contract's full path to ensure uniqueness Used in diamond storage pattern to prevent storage collision with other facets

layout

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

Provides access to the storage layout

Return Values

NameTypeDescription
lstruct ERC20BaseStorage.LayoutStorage layout struct with proper positioning Uses assembly to position the storage struct at the predetermined slot