Skip to content

Commit 8c5cb4c

Browse files
chore: remove offboarded collaterals (#48)
1 parent b00f985 commit 8c5cb4c

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Optimized Smart Contract to Poke (`poke`).
55

66
For Now, Hard Coded Addresses and Sequences. Easy for TechOps to Run.
77

8-
MegaPoker current Mainnet Address: [0x37bA4427F664557e92493C5858A81C9B90fC09d6](https://etherscan.io/address/0x37bA4427F664557e92493C5858A81C9B90fC09d6#code)
8+
MegaPoker current Mainnet Address: [0x021CfECaF7027d736f796f8FC62c6513e04ca0D4](https://etherscan.io/address/0x021CfECaF7027d736f796f8FC62c6513e04ca0D4#code)
99

1010
# OmegaPoker
1111

src/MegaPoker.sol

-7
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ contract PokingAddresses {
2222
// OSMs
2323
address constant btc = 0xf185d0682d50819263941e5f4EacC763CC5C6C42;
2424
address constant eth = 0x81FE72B5A8d1A857d176C3E7d5Bd2679A9B85763;
25-
address constant reth = 0xeE7F0b350aA119b3d05DC733a4621a81972f7D47;
2625
address constant wsteth = 0xFe7a2aC0B945f12089aEEB6eCebf4F384D9f043F;
2726
address constant mkr = 0x4F94e33D0D74CfF5Ca0D3a66F1A650628551C56b;
2827

29-
address constant crvv1ethsteth = 0xEa508F82728927454bd3ce853171b0e2705880D4;
3028
address constant guniv3daiusdc1 = 0x7F6d78CC0040c87943a0e0c140De3F77a273bd58;
3129
address constant guniv3daiusdc2 = 0xcCBa43231aC6eceBd1278B90c3a44711a00F4e93;
3230
address constant univ2daiusdc = 0x25D03C2C928ADE19ff9f4FFECc07d991d0df054B;
@@ -45,15 +43,13 @@ contract MegaPoker is PokingAddresses {
4543
// poke() = 0x18178358
4644
(ok,) = btc.call(abi.encodeWithSelector(0x18178358));
4745
(ok,) = eth.call(abi.encodeWithSelector(0x18178358));
48-
(ok,) = reth.call(abi.encodeWithSelector(0x18178358));
4946
(ok,) = wsteth.call(abi.encodeWithSelector(0x18178358));
5047
(ok,) = mkr.call(abi.encodeWithSelector(0x18178358));
5148

5249
// poke(bytes32) = 0x1504460f
5350
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("ETH-A")));
5451
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("ETH-B")));
5552
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("ETH-C")));
56-
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("RETH-A")));
5753
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("WBTC-A")));
5854
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("WBTC-B")));
5955
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("WBTC-C")));
@@ -64,8 +60,6 @@ contract MegaPoker is PokingAddresses {
6460
// Daily pokes, i.e. reduced cost pokes
6561
if (last <= block.timestamp - 1 days) {
6662
// Poke
67-
(ok,) = crvv1ethsteth.call(abi.encodeWithSelector(0x18178358));
68-
6963
// The GUINIV3DAIUSDCX Oracles are very expensive to poke, and the
7064
// price should not change frequently, so they are getting poked
7165
// only once a day.
@@ -75,7 +69,6 @@ contract MegaPoker is PokingAddresses {
7569
(ok,) = univ2daiusdc.call(abi.encodeWithSelector(0x18178358));
7670

7771
// Spotter pokes
78-
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("CRVV1ETHSTETH-A")));
7972
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("GUNIV3DAIUSDC1-A")));
8073
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("GUNIV3DAIUSDC2-A")));
8174
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("UNIV2DAIUSDC-A")));

src/MegaPoker.t.sol

-14
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,9 @@ contract MegaPokerTest is DSTest, PokingAddresses {
169169

170170
// Whitelisting tester address
171171
hevm.store(btc, keccak256(abi.encode(address(this), uint256(5))), bytes32(uint256(1)));
172-
hevm.store(crvv1ethsteth, keccak256(abi.encode(address(this), uint256(2))), bytes32(uint256(1)));
173172
hevm.store(eth, keccak256(abi.encode(address(this), uint256(5))), bytes32(uint256(1)));
174173
hevm.store(guniv3daiusdc1, keccak256(abi.encode(address(this), uint256(2))), bytes32(uint256(1)));
175174
hevm.store(guniv3daiusdc2, keccak256(abi.encode(address(this), uint256(2))), bytes32(uint256(1)));
176-
hevm.store(reth, keccak256(abi.encode(address(this), uint256(5))), bytes32(uint256(1)));
177175
hevm.store(univ2daiusdc, keccak256(abi.encode(address(this), uint256(2))), bytes32(uint256(1)));
178176
hevm.store(wsteth, keccak256(abi.encode(address(this), uint256(5))), bytes32(uint256(1)));
179177
hevm.store(mkr, keccak256(abi.encode(address(this), uint256(5))), bytes32(uint256(1)));
@@ -218,11 +216,9 @@ contract MegaPokerTest is DSTest, PokingAddresses {
218216
// Hacking nxt price to 0x123 (and making it valid)
219217
bytes32 hackedValue = 0x0000000000000000000000000000000100000000000000000000000000000123;
220218
hevm.store(btc, bytes32(uint256(4)), hackedValue);
221-
hevm.store(crvv1ethsteth, bytes32(uint256(4)), hackedValue);
222219
hevm.store(eth, bytes32(uint256(4)), hackedValue);
223220
hevm.store(guniv3daiusdc1, bytes32(uint256(4)), hackedValue);
224221
hevm.store(guniv3daiusdc2, bytes32(uint256(4)), hackedValue);
225-
hevm.store(reth, bytes32(uint256(4)), hackedValue);
226222
hevm.store(univ2daiusdc, bytes32(uint256(4)), hackedValue);
227223
hevm.store(wsteth, bytes32(uint256(4)), hackedValue);
228224
hevm.store(mkr, bytes32(uint256(4)), hackedValue);
@@ -232,11 +228,9 @@ contract MegaPokerTest is DSTest, PokingAddresses {
232228

233229
assertTrue(OsmLike(btc).read() != hackedValue);
234230
assertTrue(OsmLike(eth).read() != hackedValue);
235-
assertTrue(OsmLike(reth).read() != hackedValue);
236231
assertTrue(OsmLike(wsteth).read() != hackedValue);
237232
assertTrue(OsmLike(mkr).read() != hackedValue);
238233

239-
assertTrue(OsmLike(crvv1ethsteth).read() != hackedValue);
240234
assertTrue(OsmLike(guniv3daiusdc1).read() != hackedValue);
241235
assertTrue(OsmLike(guniv3daiusdc2).read() != hackedValue);
242236
assertTrue(OsmLike(univ2daiusdc).read() != hackedValue);
@@ -246,12 +240,10 @@ contract MegaPokerTest is DSTest, PokingAddresses {
246240

247241
assertEq(OsmLike(btc).read(), hackedValue);
248242
assertEq(OsmLike(eth).read(), hackedValue);
249-
assertEq(OsmLike(reth).read(), hackedValue);
250243
assertEq(OsmLike(wsteth).read(), hackedValue);
251244
assertEq(OsmLike(mkr).read(), hackedValue);
252245

253246
// Daily OSM's are not updated after one hour
254-
assertTrue(OsmLike(crvv1ethsteth).read() != hackedValue);
255247
assertTrue(OsmLike(guniv3daiusdc1).read() != hackedValue);
256248
assertTrue(OsmLike(guniv3daiusdc2).read() != hackedValue);
257249
assertTrue(OsmLike(univ2daiusdc).read() != hackedValue);
@@ -283,17 +275,11 @@ contract MegaPokerTest is DSTest, PokingAddresses {
283275
(, mat) = SpotLike(spotter).ilks("WBTC-C");
284276
(,, spot,,) = vat.ilks("WBTC-C");
285277
assertEq(spot, _rdiv(value, mat));
286-
(, mat) = SpotLike(spotter).ilks("RETH-A");
287-
(,, spot,,) = vat.ilks("RETH-A");
288-
assertEq(spot, _rdiv(value, mat));
289278
(, mat) = SpotLike(spotter).ilks("LSE-MKR-A");
290279
(,, spot,,) = vat.ilks("LSE-MKR-A");
291280
assertEq(spot, _rdiv(value, mat));
292281

293282
// These collateral types should not be updated after 1 hour
294-
(, mat) = SpotLike(spotter).ilks("CRVV1ETHSTETH-A");
295-
(,, spot,,) = vat.ilks("CRVV1ETHSTETH-A");
296-
assertTrue(spot != _rdiv(value, mat));
297283
(, mat) = SpotLike(spotter).ilks("GUNIV3DAIUSDC1-A");
298284
(,, spot,,) = vat.ilks("GUNIV3DAIUSDC1-A");
299285
assertTrue(spot != _rdiv(value, mat));

0 commit comments

Comments
 (0)