From ff60a148f5164ab22780584bd6b5cc859dbb73d2 Mon Sep 17 00:00:00 2001 From: donosonaumczuk Date: Fri, 2 Feb 2024 17:49:10 -0300 Subject: [PATCH] feat: Balances added to StorageLib --- contracts/libraries/StorageLib.sol | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/contracts/libraries/StorageLib.sol b/contracts/libraries/StorageLib.sol index 04bdb07..6ef7479 100644 --- a/contracts/libraries/StorageLib.sol +++ b/contracts/libraries/StorageLib.sol @@ -8,7 +8,7 @@ library StorageLib { // uint256 constant NAME_SLOT = 0; // uint256 constant SYMBOL_SLOT = 1; uint256 constant TOKEN_DATA_MAPPING_SLOT = 2; - // uint256 constant BALANCES_SLOT = 3; + uint256 constant BALANCES_SLOT = 3; // uint256 constant TOKEN_APPROVAL_MAPPING_SLOT = 4; // uint256 constant OPERATOR_APPROVAL_MAPPING_SLOT = 5; // Slot 6 is deprecated in Lens V2. In V1 it was used for ERC-721 Enumerable's `ownedTokens`. @@ -114,6 +114,12 @@ library StorageLib { } } + function balances() internal pure returns (mapping(address => uint256) storage _balances) { + assembly { + _balances.slot := BALANCES_SLOT + } + } + function blockedStatus( uint256 blockerProfileId ) internal pure returns (mapping(uint256 => bool) storage _blockedStatus) {