From 22ea4369e2879ed36eec8ed1213d6bd1c7a0504c Mon Sep 17 00:00:00 2001 From: jar-o Date: Sat, 12 Nov 2022 09:23:56 -0700 Subject: [PATCH] add RETHUSD OSM to poke() --- scripts/test.sh | 2 +- src/MegaPoker.sol | 3 +++ src/MegaPoker.t.sol | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/test.sh b/scripts/test.sh index 673a3c8..99e52a2 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -3,4 +3,4 @@ set -e [[ "$ETH_RPC_URL" && "$(seth chain)" == "ethlive" ]] || { echo "Please set a mainnet ETH_RPC_URL"; exit 1; } -DAPP_BUILD_OPTIMIZE=1 DAPP_BUILD_OPTIMIZE_RUNS=1000 dapp --use solc:0.6.12 test --rpc-url="$ETH_RPC_URL" -v +DAPP_BUILD_OPTIMIZE=1 DAPP_BUILD_OPTIMIZE_RUNS=1000 dapp --use solc:0.6.12 test --rpc-url="$ETH_RPC_URL" -vvv diff --git a/src/MegaPoker.sol b/src/MegaPoker.sol index 59e821c..6824092 100644 --- a/src/MegaPoker.sol +++ b/src/MegaPoker.sol @@ -33,6 +33,7 @@ contract PokingAddresses { address constant guniv3daiusdc1 = 0x7F6d78CC0040c87943a0e0c140De3F77a273bd58; address constant guniv3daiusdc2 = 0xcCBa43231aC6eceBd1278B90c3a44711a00F4e93; address constant spotter = 0x65C79fcB50Ca1594B025960e539eD7A9a6D434A3; + address constant reth = 0xeE7F0b350aA119b3d05DC733a4621a81972f7D47; } contract MegaPoker is PokingAddresses { @@ -53,6 +54,7 @@ contract MegaPoker is PokingAddresses { (ok,) = matic.call(abi.encodeWithSelector(0x18178358)); (ok,) = wsteth.call(abi.encodeWithSelector(0x18178358)); (ok,) = crvv1ethsteth.call(abi.encodeWithSelector(0x18178358)); + (ok,) = reth.call(abi.encodeWithSelector(0x18178358)); // poke(bytes32) = 0x1504460f @@ -72,6 +74,7 @@ contract MegaPoker is PokingAddresses { (ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("CRVV1ETHSTETH-A"))); (ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("WBTC-B"))); (ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("WBTC-C"))); + (ok,) = spotter.call(abi.encodeWithSelector(0x1504460f, bytes32("RETH-A"))); // Daily pokes diff --git a/src/MegaPoker.t.sol b/src/MegaPoker.t.sol index ac1528d..d5ab96c 100644 --- a/src/MegaPoker.t.sol +++ b/src/MegaPoker.t.sol @@ -178,6 +178,7 @@ contract MegaPokerTest is DSTest, PokingAddresses { hevm.store(crvv1ethsteth, 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); // Whitelisting tester address hevm.store(eth, keccak256(abi.encode(address(this), uint256(5))), bytes32(uint256(1))); @@ -189,6 +190,7 @@ contract MegaPokerTest is DSTest, PokingAddresses { hevm.store(univ2daiusdc, keccak256(abi.encode(address(this), uint256(2))), bytes32(uint256(1))); hevm.store(matic, keccak256(abi.encode(address(this), uint256(5))), bytes32(uint256(1))); hevm.store(wsteth, keccak256(abi.encode(address(this), uint256(5))), bytes32(uint256(1))); + hevm.store(reth, 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(guniv3daiusdc1, keccak256(abi.encode(address(this), uint256(2))), bytes32(uint256(1))); hevm.store(guniv3daiusdc2, keccak256(abi.encode(address(this), uint256(2))), bytes32(uint256(1))); @@ -206,6 +208,7 @@ contract MegaPokerTest is DSTest, PokingAddresses { assertTrue(OsmLike(matic).read() != hackedValue); assertTrue(OsmLike(wsteth).read() != hackedValue); assertTrue(OsmLike(crvv1ethsteth).read() != hackedValue); + assertTrue(OsmLike(reth).read() != hackedValue); assertTrue(OsmLike(guniv3daiusdc1).read() != hackedValue); assertTrue(OsmLike(guniv3daiusdc2).read() != hackedValue); @@ -223,6 +226,7 @@ contract MegaPokerTest is DSTest, PokingAddresses { assertEq(OsmLike(matic).read(), hackedValue); assertEq(OsmLike(wsteth).read(), hackedValue); assertEq(OsmLike(crvv1ethsteth).read(), hackedValue); + assertEq(OsmLike(reth).read(), hackedValue); // Daily OSM's are not updated after one hour assertTrue(OsmLike(guniv3daiusdc1).read() != hackedValue); @@ -281,6 +285,9 @@ 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("GUNIV3DAIUSDC1-A");