Skip to content
Lattice

ERC20Lib Constants

Git Source

ERC20_STORAGE_SLOT

keccak256(abi.encode(uint256(keccak256("lattice.storage.ERC20")) - 1)) & ~bytes32(uint256(0xff)).

bytes32 constant ERC20_STORAGE_SLOT = 0x948387732d07f6e6ec1c3bf1559c10e90e518c5a59f5d2be5a80edb6f2494300;

ERC20_ERC165_STORAGE_LOCATION

ERC-165 storage location (same across all Lattice modules). keccak256(abi.encode(uint256(keccak256("diamond.lib.storage.ERC165")) - 1)) & ~bytes32(uint256(0xff)).

bytes32 constant ERC20_ERC165_STORAGE_LOCATION = 0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200;

ERC165_MAP_IERC20_SLOT

0x942e8b22 is type(IERC20).interfaceId. keccak256(abi.encode(bytes4(0x942e8b22), 0x9ca7f3e2e2bfb15fdf072b85dde92837cddacee6cf2f6b38cd06c9457c1c4200)).

bytes32 constant ERC165_MAP_IERC20_SLOT = 0xc99f0f757c400475fa5e27e7e237b05409e3b11dbfd9a8930fb35692da3f3a3d;