Skip to content

Commit

Permalink
add check for valid synth target
Browse files Browse the repository at this point in the history
  • Loading branch information
barrasso committed Apr 9, 2024
1 parent c670037 commit 27d86de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contracts/DynamicSynthRedeemer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27d86de

Please sign in to comment.