@@ -162,56 +162,51 @@ contract MegaPokerTest is DSTest, PokingAddresses {
162
162
hevm.warp (block .timestamp + 1 hours);
163
163
megaPoker.poke ();
164
164
assertEq (megaPoker.last (), block .timestamp - 1 hours);
165
- //
166
165
167
166
// Hacking nxt price to 0x123 (and making it valid)
168
167
bytes32 hackedValue = 0x0000000000000000000000000000000100000000000000000000000000000123 ;
169
- hevm.store (eth, bytes32 (uint256 (4 )), hackedValue);
170
168
hevm.store (btc, bytes32 (uint256 (4 )), hackedValue);
171
- hevm.store (univ2daiusdc, bytes32 (uint256 (4 )), hackedValue);
172
- hevm.store (wsteth, bytes32 (uint256 (4 )), hackedValue);
173
169
hevm.store (crvv1ethsteth, bytes32 (uint256 (4 )), hackedValue);
170
+ hevm.store (eth, bytes32 (uint256 (4 )), hackedValue);
174
171
hevm.store (guniv3daiusdc1, bytes32 (uint256 (4 )), hackedValue);
175
172
hevm.store (guniv3daiusdc2, bytes32 (uint256 (4 )), hackedValue);
176
173
hevm.store (reth, bytes32 (uint256 (4 )), hackedValue);
177
- hevm.store (gno, bytes32 (uint256 (4 )), hackedValue);
174
+ hevm.store (univ2daiusdc, bytes32 (uint256 (4 )), hackedValue);
175
+ hevm.store (wsteth, bytes32 (uint256 (4 )), hackedValue);
178
176
179
177
// Whitelisting tester address
180
- hevm.store (eth, keccak256 (abi.encode (address (this ), uint256 (5 ))), bytes32 (uint256 (1 )));
181
178
hevm.store (btc, keccak256 (abi.encode (address (this ), uint256 (5 ))), bytes32 (uint256 (1 )));
182
- hevm.store (univ2daiusdc, keccak256 (abi.encode (address (this ), uint256 (2 ))), bytes32 (uint256 (1 )));
183
- hevm.store (wsteth, keccak256 (abi.encode (address (this ), uint256 (5 ))), bytes32 (uint256 (1 )));
184
- hevm.store (reth, keccak256 (abi.encode (address (this ), uint256 (5 ))), bytes32 (uint256 (1 )));
185
- hevm.store (gno, keccak256 (abi.encode (address (this ), uint256 (5 ))), bytes32 (uint256 (1 )));
186
179
hevm.store (crvv1ethsteth, keccak256 (abi.encode (address (this ), uint256 (2 ))), bytes32 (uint256 (1 )));
180
+ hevm.store (eth, keccak256 (abi.encode (address (this ), uint256 (5 ))), bytes32 (uint256 (1 )));
187
181
hevm.store (guniv3daiusdc1, keccak256 (abi.encode (address (this ), uint256 (2 ))), bytes32 (uint256 (1 )));
188
182
hevm.store (guniv3daiusdc2, keccak256 (abi.encode (address (this ), uint256 (2 ))), bytes32 (uint256 (1 )));
183
+ hevm.store (reth, keccak256 (abi.encode (address (this ), uint256 (5 ))), bytes32 (uint256 (1 )));
184
+ hevm.store (univ2daiusdc, keccak256 (abi.encode (address (this ), uint256 (2 ))), bytes32 (uint256 (1 )));
185
+ hevm.store (wsteth, keccak256 (abi.encode (address (this ), uint256 (5 ))), bytes32 (uint256 (1 )));
189
186
190
187
// 0x123
191
188
hackedValue = 0x0000000000000000000000000000000000000000000000000000000000000123 ;
192
189
193
- assertTrue (OsmLike (eth).read () != hackedValue);
194
190
assertTrue (OsmLike (btc).read () != hackedValue);
195
- assertTrue (OsmLike (wsteth).read () != hackedValue);
196
- assertTrue (OsmLike (crvv1ethsteth).read () != hackedValue);
191
+ assertTrue (OsmLike (eth).read () != hackedValue);
197
192
assertTrue (OsmLike (reth).read () != hackedValue);
198
- assertTrue (OsmLike (gno ).read () != hackedValue);
193
+ assertTrue (OsmLike (wsteth ).read () != hackedValue);
199
194
195
+ assertTrue (OsmLike (crvv1ethsteth).read () != hackedValue);
200
196
assertTrue (OsmLike (guniv3daiusdc1).read () != hackedValue);
201
197
assertTrue (OsmLike (guniv3daiusdc2).read () != hackedValue);
202
198
assertTrue (OsmLike (univ2daiusdc).read () != hackedValue);
203
199
204
200
hevm.warp (block .timestamp + 1 hours);
205
201
megaPoker.poke ();
206
202
207
- assertEq (OsmLike (eth).read (), hackedValue);
208
203
assertEq (OsmLike (btc).read (), hackedValue);
209
- assertEq (OsmLike (wsteth).read (), hackedValue);
210
- assertEq (OsmLike (crvv1ethsteth).read (), hackedValue);
204
+ assertEq (OsmLike (eth).read (), hackedValue);
211
205
assertEq (OsmLike (reth).read (), hackedValue);
212
- assertEq (OsmLike (gno ).read (), hackedValue);
206
+ assertEq (OsmLike (wsteth ).read (), hackedValue);
213
207
214
208
// Daily OSM's are not updated after one hour
209
+ assertTrue (OsmLike (crvv1ethsteth).read () != hackedValue);
215
210
assertTrue (OsmLike (guniv3daiusdc1).read () != hackedValue);
216
211
assertTrue (OsmLike (guniv3daiusdc2).read () != hackedValue);
217
212
assertTrue (OsmLike (univ2daiusdc).read () != hackedValue);
@@ -239,9 +234,6 @@ contract MegaPokerTest is DSTest, PokingAddresses {
239
234
(, mat) = SpotLike (spotter).ilks ("WSTETH-B " );
240
235
(,, spot,,) = VatLike (vat).ilks ("WSTETH-B " );
241
236
assertEq (spot, _rdiv (value, mat));
242
- (, mat) = SpotLike (spotter).ilks ("CRVV1ETHSTETH-A " );
243
- (,, spot,,) = VatLike (vat).ilks ("CRVV1ETHSTETH-A " );
244
- assertEq (spot, _rdiv (value, mat));
245
237
(, mat) = SpotLike (spotter).ilks ("WBTC-B " );
246
238
(,, spot,,) = VatLike (vat).ilks ("WBTC-B " );
247
239
assertEq (spot, _rdiv (value, mat));
@@ -251,11 +243,11 @@ contract MegaPokerTest is DSTest, PokingAddresses {
251
243
(, mat) = SpotLike (spotter).ilks ("RETH-A " );
252
244
(,, spot,,) = VatLike (vat).ilks ("RETH-A " );
253
245
assertEq (spot, _rdiv (value, mat));
254
- (, mat) = SpotLike (spotter).ilks ("GNO-A " );
255
- (,, spot,,) = VatLike (vat).ilks ("GNO-A " );
256
- assertEq (spot, _rdiv (value, mat));
257
246
258
247
// These collateral types should not be updated after 1 hour
248
+ (, mat) = SpotLike (spotter).ilks ("CRVV1ETHSTETH-A " );
249
+ (,, spot,,) = VatLike (vat).ilks ("CRVV1ETHSTETH-A " );
250
+ assertTrue (spot != _rdiv (value, mat));
259
251
(, mat) = SpotLike (spotter).ilks ("GUNIV3DAIUSDC1-A " );
260
252
(,, spot,,) = VatLike (vat).ilks ("GUNIV3DAIUSDC1-A " );
261
253
assertTrue (spot != _rdiv (value, mat));
@@ -274,7 +266,6 @@ contract MegaPokerTest is DSTest, PokingAddresses {
274
266
assertEq (OsmLike (guniv3daiusdc1).read (), hackedValue);
275
267
assertEq (OsmLike (guniv3daiusdc2).read (), hackedValue);
276
268
277
-
278
269
(, mat) = SpotLike (spotter).ilks ("GUNIV3DAIUSDC1-A " );
279
270
(,, spot,,) = VatLike (vat).ilks ("GUNIV3DAIUSDC1-A " );
280
271
assertEq (spot, _rdiv (value, mat));
0 commit comments