forked from sherlock-audit/2023-06-symmetrical
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SymbolStorage.sol
30 lines (26 loc) · 848 Bytes
/
SymbolStorage.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// SPDX-License-Identifier: SYMM-Core-Business-Source-License-1.1
// This contract is licensed under the SYMM Core Business Source License 1.1
// Copyright (c) 2023 Symmetry Labs AG
// For more information, see https://docs.symm.io/legal-disclaimer/license
pragma solidity >=0.8.18;
struct Symbol {
uint256 symbolId;
string name;
bool isValid;
uint256 minAcceptableQuoteValue;
uint256 minAcceptablePortionLF;
uint256 tradingFee;
}
library SymbolStorage {
bytes32 internal constant SYMBOL_STORAGE_SLOT = keccak256("diamond.standard.storage.symbol");
struct Layout {
mapping(uint256 => Symbol) symbols;
uint256 lastId;
}
function layout() internal pure returns (Layout storage l) {
bytes32 slot = SYMBOL_STORAGE_SLOT;
assembly {
l.slot := slot
}
}
}