Skip to content

Commit

Permalink
Remove offboarded assets
Browse files Browse the repository at this point in the history
  • Loading branch information
jar-o committed Feb 12, 2024
1 parent 6422525 commit ad57c8f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
8 changes: 0 additions & 8 deletions src/MegaPoker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ contract PokingAddresses {
// OSMs
address constant btc = 0xf185d0682d50819263941e5f4EacC763CC5C6C42;
address constant eth = 0x81FE72B5A8d1A857d176C3E7d5Bd2679A9B85763;
address constant reth = 0xeE7F0b350aA119b3d05DC733a4621a81972f7D47;
address constant wsteth = 0xFe7a2aC0B945f12089aEEB6eCebf4F384D9f043F;

address constant crvv1ethsteth = 0xEa508F82728927454bd3ce853171b0e2705880D4;
address constant guniv3daiusdc1 = 0x7F6d78CC0040c87943a0e0c140De3F77a273bd58;
address constant guniv3daiusdc2 = 0xcCBa43231aC6eceBd1278B90c3a44711a00F4e93;
address constant univ2daiusdc = 0x25D03C2C928ADE19ff9f4FFECc07d991d0df054B;
Expand All @@ -44,14 +42,12 @@ contract MegaPoker is PokingAddresses {
// poke() = 0x18178358
(ok,) = btc.call(abi.encodeWithSelector(0x18178358));
(ok,) = eth.call(abi.encodeWithSelector(0x18178358));
(ok,) = reth.call(abi.encodeWithSelector(0x18178358));
(ok,) = wsteth.call(abi.encodeWithSelector(0x18178358));

// poke(bytes32) = 0x1504460f
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("ETH-A")));
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("ETH-B")));
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("ETH-C")));
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("RETH-A")));
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("WBTC-A")));
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("WBTC-B")));
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("WBTC-C")));
Expand All @@ -60,9 +56,6 @@ contract MegaPoker is PokingAddresses {

// Daily pokes, i.e. reduced cost pokes
if (last <= block.timestamp - 1 days) {
// Poke
(ok,) = crvv1ethsteth.call(abi.encodeWithSelector(0x18178358));

// The GUINIV3DAIUSDCX Oracles are very expensive to poke, and the
// price should not change frequently, so they are getting poked
// only once a day.
Expand All @@ -72,7 +65,6 @@ contract MegaPoker is PokingAddresses {
(ok,) = univ2daiusdc.call(abi.encodeWithSelector(0x18178358));

// Spotter pokes
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("CRVV1ETHSTETH-A")));
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("GUNIV3DAIUSDC1-A")));
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("GUNIV3DAIUSDC2-A")));
(ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("UNIV2DAIUSDC-A")));
Expand Down
14 changes: 0 additions & 14 deletions src/MegaPoker.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,17 @@ contract MegaPokerTest is DSTest, PokingAddresses {
// Hacking nxt price to 0x123 (and making it valid)
bytes32 hackedValue = 0x0000000000000000000000000000000100000000000000000000000000000123;
hevm.store(btc, bytes32(uint256(4)), hackedValue);
hevm.store(crvv1ethsteth, bytes32(uint256(4)), hackedValue);
hevm.store(eth, bytes32(uint256(4)), hackedValue);
hevm.store(guniv3daiusdc1, bytes32(uint256(4)), hackedValue);
hevm.store(guniv3daiusdc2, bytes32(uint256(4)), hackedValue);
hevm.store(reth, bytes32(uint256(4)), hackedValue);
hevm.store(univ2daiusdc, bytes32(uint256(4)), hackedValue);
hevm.store(wsteth, bytes32(uint256(4)), hackedValue);

// Whitelisting tester address
hevm.store(btc, keccak256(abi.encode(address(this), uint256(5))), bytes32(uint256(1)));
hevm.store(crvv1ethsteth, keccak256(abi.encode(address(this), uint256(2))), bytes32(uint256(1)));
hevm.store(eth, keccak256(abi.encode(address(this), uint256(5))), bytes32(uint256(1)));
hevm.store(guniv3daiusdc1, keccak256(abi.encode(address(this), uint256(2))), bytes32(uint256(1)));
hevm.store(guniv3daiusdc2, keccak256(abi.encode(address(this), uint256(2))), bytes32(uint256(1)));
hevm.store(reth, keccak256(abi.encode(address(this), uint256(5))), bytes32(uint256(1)));
hevm.store(univ2daiusdc, keccak256(abi.encode(address(this), uint256(2))), bytes32(uint256(1)));
hevm.store(wsteth, keccak256(abi.encode(address(this), uint256(5))), bytes32(uint256(1)));

Expand All @@ -189,10 +185,8 @@ contract MegaPokerTest is DSTest, PokingAddresses {

assertTrue(OsmLike(btc).read() != hackedValue);
assertTrue(OsmLike(eth).read() != hackedValue);
assertTrue(OsmLike(reth).read() != hackedValue);
assertTrue(OsmLike(wsteth).read() != hackedValue);

assertTrue(OsmLike(crvv1ethsteth).read() != hackedValue);
assertTrue(OsmLike(guniv3daiusdc1).read() != hackedValue);
assertTrue(OsmLike(guniv3daiusdc2).read() != hackedValue);
assertTrue(OsmLike(univ2daiusdc).read() != hackedValue);
Expand All @@ -202,11 +196,9 @@ contract MegaPokerTest is DSTest, PokingAddresses {

assertEq(OsmLike(btc).read(), hackedValue);
assertEq(OsmLike(eth).read(), hackedValue);
assertEq(OsmLike(reth).read(), hackedValue);
assertEq(OsmLike(wsteth).read(), hackedValue);

// Daily OSM's are not updated after one hour
assertTrue(OsmLike(crvv1ethsteth).read() != hackedValue);
assertTrue(OsmLike(guniv3daiusdc1).read() != hackedValue);
assertTrue(OsmLike(guniv3daiusdc2).read() != hackedValue);
assertTrue(OsmLike(univ2daiusdc).read() != hackedValue);
Expand Down Expand Up @@ -240,14 +232,8 @@ contract MegaPokerTest is DSTest, PokingAddresses {
(, mat) = SpotLike(spotter).ilks("WBTC-C");
(,, spot,,) = VatLike(vat).ilks("WBTC-C");
assertEq(spot, _rdiv(value, mat));
(, mat) = SpotLike(spotter).ilks("RETH-A");
(,, spot,,) = VatLike(vat).ilks("RETH-A");
assertEq(spot, _rdiv(value, mat));

// These collateral types should not be updated after 1 hour
(, mat) = SpotLike(spotter).ilks("CRVV1ETHSTETH-A");
(,, spot,,) = VatLike(vat).ilks("CRVV1ETHSTETH-A");
assertTrue(spot != _rdiv(value, mat));
(, mat) = SpotLike(spotter).ilks("GUNIV3DAIUSDC1-A");
(,, spot,,) = VatLike(vat).ilks("GUNIV3DAIUSDC1-A");
assertTrue(spot != _rdiv(value, mat));
Expand Down

0 comments on commit ad57c8f

Please sign in to comment.