@@ -80,13 +80,13 @@ event Transfer(address indexed _from, address indexed _to, uint256 _value);
8080 * @notice Storage slot for ERC-20 token using ERC8042 for storage location standardization
8181 * @dev Storage position determined by the keccak256 hash of the diamond storage identifier.
8282 */
83- bytes32 constant ERC20_TRANSFER_STORAGE_POSITION = keccak256 ("erc20.transfer " );
83+ bytes32 constant ERC20_STORAGE_POSITION = keccak256 ("erc20 " );
8484
8585/**
8686 * @dev ERC-8042 compliant storage struct for ERC20 token data.
87- * @custom:storage-location erc8042:erc20.transfer
87+ * @custom:storage-location erc8042:erc20
8888 */
89- struct ERC20TransferStorage {
89+ struct ERC20Storage {
9090 mapping (address owner = > uint256 balance ) balanceOf;
9191 uint256 totalSupply;
9292}
@@ -96,8 +96,8 @@ struct ERC20TransferStorage {
9696 * @return s The ERC20 storage struct reference.
9797 */
9898
99- function getERC20TransferStorage () pure returns (ERC20TransferStorage storage s ) {
100- bytes32 position = ERC20_TRANSFER_STORAGE_POSITION ;
99+ function getERC20Storage () pure returns (ERC20Storage storage s ) {
100+ bytes32 position = ERC20_STORAGE_POSITION ;
101101 assembly {
102102 s.slot := position
103103 }
@@ -137,7 +137,7 @@ function getAccessControlStorage() pure returns (AccessControlStorage storage s)
137137 * @param _value The amount to mint.
138138 */
139139function crosschainMint (address _account , uint256 _value ) {
140- ERC20TransferStorage storage erc20Transfer = getERC20TransferStorage ();
140+ ERC20Storage storage erc20Storage = getERC20Storage ();
141141
142142 AccessControlStorage storage acs = getAccessControlStorage ();
143143
@@ -153,8 +153,8 @@ function crosschainMint(address _account, uint256 _value) {
153153 }
154154
155155 unchecked {
156- erc20Transfer .totalSupply += _value;
157- erc20Transfer .balanceOf[_account] += _value;
156+ erc20Storage .totalSupply += _value;
157+ erc20Storage .balanceOf[_account] += _value;
158158 }
159159
160160 emit Transfer (address (0 ), _account, _value);
@@ -167,7 +167,7 @@ function crosschainMint(address _account, uint256 _value) {
167167 * @param _value The amount to burn.
168168 */
169169function crosschainBurn (address _from , uint256 _value ) {
170- ERC20TransferStorage storage erc20Transfer = getERC20TransferStorage ();
170+ ERC20Storage storage erc20Storage = getERC20Storage ();
171171
172172 AccessControlStorage storage acs = getAccessControlStorage ();
173173
@@ -182,15 +182,15 @@ function crosschainBurn(address _from, uint256 _value) {
182182 revert ERC20InvalidReceiver (address (0 ));
183183 }
184184
185- uint256 accountBalance = erc20Transfer .balanceOf[_from];
185+ uint256 accountBalance = erc20Storage .balanceOf[_from];
186186
187187 if (accountBalance < _value) {
188188 revert ERC20InsufficientBalance (_from, accountBalance, _value);
189189 }
190190
191191 unchecked {
192- erc20Transfer .totalSupply -= _value;
193- erc20Transfer .balanceOf[_from] -= _value;
192+ erc20Storage .totalSupply -= _value;
193+ erc20Storage .balanceOf[_from] -= _value;
194194 }
195195 emit Transfer (_from, address (0 ), _value);
196196 emit CrosschainBurn (_from, _value, msg .sender );
0 commit comments