-
Notifications
You must be signed in to change notification settings - Fork 50
/
storage.dump.sol
354 lines (332 loc) · 11 KB
/
storage.dump.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.11<0.9.0;
// @custom:artifact @synthetixio/core-contracts/contracts/ownership/OwnableStorage.sol:OwnableStorage
library OwnableStorage {
bytes32 private constant _SLOT_OWNABLE_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Ownable"));
struct Data {
bool initialized;
address owner;
address nominatedOwner;
}
function load() internal pure returns (Data storage store) {
bytes32 s = _SLOT_OWNABLE_STORAGE;
assembly {
store.slot := s
}
}
}
// @custom:artifact @synthetixio/core-contracts/contracts/proxy/ProxyStorage.sol:ProxyStorage
contract ProxyStorage {
bytes32 private constant _SLOT_PROXY_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Proxy"));
struct ProxyStore {
address implementation;
bool simulatingUpgrade;
}
function _proxyStore() internal pure returns (ProxyStore storage store) {
bytes32 s = _SLOT_PROXY_STORAGE;
assembly {
store.slot := s
}
}
}
// @custom:artifact @synthetixio/core-contracts/contracts/token/ERC20Storage.sol:ERC20Storage
library ERC20Storage {
bytes32 private constant _SLOT_ERC20_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.ERC20"));
struct Data {
string name;
string symbol;
uint8 decimals;
mapping(address => uint256) balanceOf;
mapping(address => mapping(address => uint256)) allowance;
uint256 totalSupply;
}
function load() internal pure returns (Data storage store) {
bytes32 s = _SLOT_ERC20_STORAGE;
assembly {
store.slot := s
}
}
}
// @custom:artifact @synthetixio/core-contracts/contracts/token/ERC721EnumerableStorage.sol:ERC721EnumerableStorage
library ERC721EnumerableStorage {
bytes32 private constant _SLOT_ERC721_ENUMERABLE_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.ERC721Enumerable"));
struct Data {
mapping(uint256 => uint256) ownedTokensIndex;
mapping(uint256 => uint256) allTokensIndex;
mapping(address => mapping(uint256 => uint256)) ownedTokens;
uint256[] allTokens;
}
function load() internal pure returns (Data storage store) {
bytes32 s = _SLOT_ERC721_ENUMERABLE_STORAGE;
assembly {
store.slot := s
}
}
}
// @custom:artifact @synthetixio/core-contracts/contracts/token/ERC721Storage.sol:ERC721Storage
library ERC721Storage {
bytes32 private constant _SLOT_ERC721_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.ERC721"));
struct Data {
string name;
string symbol;
string baseTokenURI;
mapping(uint256 => address) ownerOf;
mapping(address => uint256) balanceOf;
mapping(uint256 => address) tokenApprovals;
mapping(address => mapping(address => bool)) operatorApprovals;
}
function load() internal pure returns (Data storage store) {
bytes32 s = _SLOT_ERC721_STORAGE;
assembly {
store.slot := s
}
}
}
// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath
library DecimalMath {
uint256 public constant UNIT = 1e18;
int256 public constant UNIT_INT = int256(UNIT);
uint128 public constant UNIT_UINT128 = uint128(UNIT);
int128 public constant UNIT_INT128 = int128(UNIT_INT);
uint256 public constant UNIT_PRECISE = 1e27;
int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE);
int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT);
uint256 public constant PRECISION_FACTOR = 9;
}
// @custom:artifact @synthetixio/core-contracts/contracts/utils/SetUtil.sol:SetUtil
library SetUtil {
struct UintSet {
Bytes32Set raw;
}
struct AddressSet {
Bytes32Set raw;
}
struct Bytes32Set {
bytes32[] _values;
mapping(bytes32 => uint) _positions;
}
}
// @custom:artifact @synthetixio/core-modules/contracts/modules/NftModule.sol:NftModule
contract NftModule {
bytes32 internal constant _INITIALIZED_NAME = "NftModule";
}
// @custom:artifact @synthetixio/core-modules/contracts/storage/AssociatedSystem.sol:AssociatedSystem
library AssociatedSystem {
bytes32 public constant KIND_ERC20 = "erc20";
bytes32 public constant KIND_ERC721 = "erc721";
bytes32 public constant KIND_UNMANAGED = "unmanaged";
struct Data {
address proxy;
address impl;
bytes32 kind;
}
function load(bytes32 id) internal pure returns (Data storage store) {
bytes32 s = keccak256(abi.encode("io.synthetix.core-modules.AssociatedSystem", id));
assembly {
store.slot := s
}
}
}
// @custom:artifact @synthetixio/core-modules/contracts/storage/DecayToken.sol:DecayToken
library DecayToken {
bytes32 private constant _SLOT_DECAY_TOKEN_STORAGE = keccak256(abi.encode("io.synthetix.core-modules.DecayToken"));
struct Data {
uint256 interestRate;
uint256 epochStart;
uint256 totalSupplyAtEpochStart;
}
function load() internal pure returns (Data storage store) {
bytes32 s = _SLOT_DECAY_TOKEN_STORAGE;
assembly {
store.slot := s
}
}
}
// @custom:artifact @synthetixio/core-modules/contracts/storage/FeatureFlag.sol:FeatureFlag
library FeatureFlag {
struct Data {
bytes32 name;
bool allowAll;
SetUtil.AddressSet permissionedAddresses;
}
function load(bytes32 featureName) internal pure returns (Data storage store) {
bytes32 s = keccak256(abi.encode("io.synthetix.core-modules.FeatureFlag", featureName));
assembly {
store.slot := s
}
}
}
// @custom:artifact @synthetixio/core-modules/contracts/storage/Initialized.sol:Initialized
library Initialized {
struct Data {
bool initialized;
}
function load(bytes32 id) internal pure returns (Data storage store) {
bytes32 s = keccak256(abi.encode("io.synthetix.code-modules.Initialized", id));
assembly {
store.slot := s
}
}
}
// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeDefinition.sol:NodeDefinition
library NodeDefinition {
enum NodeType {
NONE,
REDUCER,
EXTERNAL,
CHAINLINK,
UNISWAP,
PYTH,
PRICE_DEVIATION_CIRCUIT_BREAKER,
STALENESS_CIRCUIT_BREAKER
}
struct Data {
NodeType nodeType;
bytes parameters;
bytes32[] parents;
}
function load(bytes32 id) internal pure returns (Data storage data) {
bytes32 s = keccak256(abi.encode("io.synthetix.oracle-manager.Node", id));
assembly {
data.slot := s
}
}
}
// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeOutput.sol:NodeOutput
library NodeOutput {
struct Data {
int256 price;
uint256 timestamp;
uint256 __slotAvailableForFutureUse1;
uint256 __slotAvailableForFutureUse2;
}
}
// @custom:artifact contracts/interfaces/external/IPythVerifier.sol:IPythVerifier
interface IPythVerifier {
struct Price {
int64 price;
uint64 conf;
int32 expo;
uint publishTime;
}
struct PriceFeed {
bytes32 id;
Price price;
Price emaPrice;
}
}
// @custom:artifact contracts/modules/SpotMarketFactoryModule.sol:SpotMarketFactoryModule
contract SpotMarketFactoryModule {
bytes32 private constant _CREATE_SYNTH_FEATURE_FLAG = "createSynth";
}
// @custom:artifact contracts/storage/AsyncOrderClaim.sol:AsyncOrderClaim
library AsyncOrderClaim {
struct Data {
SpotMarketFactory.TransactionType orderType;
uint256 amountEscrowed;
uint256 settlementStrategyId;
uint256 settlementTime;
int256 utilizationDelta;
uint256 cancellationFee;
}
}
// @custom:artifact contracts/storage/AsyncOrderConfiguration.sol:AsyncOrderConfiguration
library AsyncOrderConfiguration {
enum SettlementStrategyType {
ONCHAIN,
CHAINLINK,
PYTH
}
struct Data {
mapping(uint256 => AsyncOrderClaim.Data) asyncOrderClaims;
mapping(address => uint256) escrowedSynthShares;
uint256 totalEscrowedSynthShares;
SettlementStrategy[] settlementStrategies;
int256 asyncUtilizationDelta;
}
struct SettlementStrategy {
SettlementStrategyType strategyType;
uint256 fixedFee;
uint256 settlementDelay;
uint256 settlementWindowDuration;
address priceVerificationContract;
}
function load(uint128 marketId) internal pure returns (Data storage store) {
bytes32 s = keccak256(abi.encode("io.synthetix.spot-market.AsyncOrder", marketId));
assembly {
store.slot := s
}
}
}
// @custom:artifact contracts/storage/FeeConfiguration.sol:FeeConfiguration
library FeeConfiguration {
struct Data {
mapping(address => uint) atomicFixedFeeOverrides;
uint atomicFixedFee;
uint asyncFixedFee;
uint utilizationFeeRate;
int wrapFixedFee;
int unwrapFixedFee;
uint skewScale;
address feeCollector;
}
function load(uint128 marketId) internal pure returns (Data storage store) {
bytes32 s = keccak256(abi.encode("io.synthetix.spot-market.Fee", marketId));
assembly {
store.slot := s
}
}
}
// @custom:artifact contracts/storage/Price.sol:Price
library Price {
struct Data {
bytes32 buyFeedId;
bytes32 sellFeedId;
}
function load(uint128 marketId) internal pure returns (Data storage store) {
bytes32 s = keccak256(abi.encode("io.synthetix.spot-market.Price", marketId));
assembly {
store.slot := s
}
}
}
// @custom:artifact contracts/storage/SpotMarketFactory.sol:SpotMarketFactory
library SpotMarketFactory {
bytes32 private constant _SLOT_SPOT_MARKET_FACTORY = keccak256(abi.encode("io.synthetix.spot-market.SpotMarketFactory"));
enum TransactionType {
BUY,
SELL,
ASYNC_BUY,
ASYNC_SELL,
WRAP,
UNWRAP
}
struct Data {
address usdToken;
address oracle;
address synthetix;
address initialSynthImplementation;
address initialAsyncOrderClaimImplementation;
mapping(uint128 => address) marketOwners;
mapping(uint128 => address) nominatedMarketOwners;
}
function load() internal pure returns (Data storage store) {
bytes32 s = _SLOT_SPOT_MARKET_FACTORY;
assembly {
store.slot := s
}
}
}
// @custom:artifact contracts/storage/Wrapper.sol:Wrapper
library Wrapper {
struct Data {
address wrapCollateralType;
uint256 maxWrappableAmount;
}
function load(uint128 marketId) internal pure returns (Data storage store) {
bytes32 s = keccak256(abi.encode("io.synthetix.spot-market.Wrapper", marketId));
assembly {
store.slot := s
}
}
}