@@ -123,6 +123,7 @@ contract RootSwapPairContract is
123
123
}(address (this ), tip3Deployer, swapPairCodeVersion);
124
124
125
125
// Storing info about deployed swap pair contracts
126
+ bytes tmp;
126
127
SwapPairInfo info = SwapPairInfo (
127
128
address (this ), // root contract
128
129
tokenRootContract1, // token root
@@ -134,7 +135,8 @@ contract RootSwapPairContract is
134
135
currentTimestamp, // creation timestamp
135
136
contractAddress, // address of swap pair
136
137
uniqueID, // unique id of swap pair
137
- swapPairCodeVersion // code version of swap pair
138
+ swapPairCodeVersion, // code version of swap pair
139
+ tmp
138
140
);
139
141
140
142
swapPairDB.add (uniqueID, info);
@@ -159,6 +161,31 @@ contract RootSwapPairContract is
159
161
160
162
//============Get functions============
161
163
164
+ /**
165
+ * Get all swap pairs
166
+ */
167
+ function getAllSwapPairsID () external override view returns (uint256 [] ids ) {
168
+ // uint256 uniqueId;
169
+ for ((uint256 uniqueId ,): swapPairDB) {
170
+ ids.push (uniqueId);
171
+ }
172
+ }
173
+
174
+ /**
175
+ * Check if pair exists
176
+ * @param uniqueID unique ID of swap pair
177
+ */
178
+ function getPairInfoByID (
179
+ uint256 uniqueID
180
+ ) external view override returns (SwapPairInfo swapPairInfo ) {
181
+ optional (SwapPairInfo) spi = swapPairDB.fetch (uniqueID);
182
+ require (
183
+ spi.hasValue (),
184
+ RootSwapPairContractErrors.ERROR_PAIR_DOES_NOT_EXIST
185
+ );
186
+ return spi.get ();
187
+ }
188
+
162
189
/**
163
190
* Check if pair exists
164
191
* @param tokenRootContract1 Address of token root contract
0 commit comments