Skip to content

Commit

Permalink
Re-add GNO poke
Browse files Browse the repository at this point in the history
  • Loading branch information
jar-o committed Aug 18, 2023
1 parent 6422525 commit c3bd4fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/MegaPoker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ contract PokingAddresses {
// OSMs
address constant btc = 0xf185d0682d50819263941e5f4EacC763CC5C6C42;
address constant eth = 0x81FE72B5A8d1A857d176C3E7d5Bd2679A9B85763;
address constant gno = 0xd800ca44fFABecd159c7889c3bf64a217361AEc8;
address constant reth = 0xeE7F0b350aA119b3d05DC733a4621a81972f7D47;
address constant wsteth = 0xFe7a2aC0B945f12089aEEB6eCebf4F384D9f043F;

Expand All @@ -44,6 +45,7 @@ contract MegaPoker is PokingAddresses {
// poke() = 0x18178358
(ok,) = btc.call(abi.encodeWithSelector(0x18178358));
(ok,) = eth.call(abi.encodeWithSelector(0x18178358));
(ok,) = gno.call(abi.encodeWithSelector(0x18178358));
(ok,) = reth.call(abi.encodeWithSelector(0x18178358));
(ok,) = wsteth.call(abi.encodeWithSelector(0x18178358));

Expand Down
7 changes: 7 additions & 0 deletions src/MegaPoker.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ contract MegaPokerTest is DSTest, PokingAddresses {
hevm.store(btc, bytes32(uint256(4)), hackedValue);
hevm.store(crvv1ethsteth, bytes32(uint256(4)), hackedValue);
hevm.store(eth, bytes32(uint256(4)), hackedValue);
hevm.store(gno, 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);
Expand All @@ -178,6 +179,7 @@ contract MegaPokerTest is DSTest, PokingAddresses {
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(gno, 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)));
Expand All @@ -189,6 +191,7 @@ contract MegaPokerTest is DSTest, PokingAddresses {

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

Expand All @@ -202,6 +205,7 @@ contract MegaPokerTest is DSTest, PokingAddresses {

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

Expand Down Expand Up @@ -243,6 +247,9 @@ contract MegaPokerTest is DSTest, PokingAddresses {
(, mat) = SpotLike(spotter).ilks("RETH-A");
(,, spot,,) = VatLike(vat).ilks("RETH-A");
assertEq(spot, _rdiv(value, mat));
(, mat) = SpotLike(spotter).ilks("GNO-A");
(,, spot,,) = VatLike(vat).ilks("GNO-A");
assertEq(spot, _rdiv(value, mat));

// These collateral types should not be updated after 1 hour
(, mat) = SpotLike(spotter).ilks("CRVV1ETHSTETH-A");
Expand Down

0 comments on commit c3bd4fb

Please sign in to comment.