From 27d86def6c8e4859b0615f2be0fd3898611bf073 Mon Sep 17 00:00:00 2001 From: meb <4982406+barrasso@users.noreply.github.com> Date: Tue, 9 Apr 2024 09:20:55 -0400 Subject: [PATCH] add check for valid synth target --- contracts/DynamicSynthRedeemer.sol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contracts/DynamicSynthRedeemer.sol b/contracts/DynamicSynthRedeemer.sol index d4e1cd38e..58d644125 100644 --- a/contracts/DynamicSynthRedeemer.sol +++ b/contracts/DynamicSynthRedeemer.sol @@ -80,7 +80,10 @@ contract DynamicSynthRedeemer is Owned, IDynamicSynthRedeemer, MixinResolver { } function _redeem(address synthProxy, uint amountOfSynth) internal { - bytes32 currencyKey = ISynth(IProxy(synthProxy).target()).currencyKey(); + address synthTarget = IProxy(synthProxy).target(); + require(issuer().synthsByAddress(synthTarget) != bytes32(0), "Invalid synth"); + + bytes32 currencyKey = ISynth(synthTarget).currencyKey(); require(currencyKey != sUSD, "Cannot redeem sUSD"); // Discount rate applied to chainlink price for dynamic redemptions