-
Notifications
You must be signed in to change notification settings - Fork 608
SIP-2059: Legacy Spot Synth Migration #2227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
|
||
function _redeem(address synthProxy, uint amountOfSynth) internal { | ||
bytes32 currencyKey = ISynth(IProxy(synthProxy).target()).currencyKey(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it's worthwhile adding a allowForRedemption map, set by governance, in order to protect against situations of things being allowed for redemption, while that not being the intention.... Like SNX
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is one way to do it. Another way would be to simply require the currencyKey
to not be sUSD
. This way all synths except for sUSD
can be redeemed.
Also, since SNX
is not an ISynth
, this function will revert for any non-synth tokens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can also add a setActive
flag to enable/disable dynamic redemptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense 🙏🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed here 5b0ec99
function target() external view returns (address); | ||
} | ||
|
||
contract DynamicSynthRedeemer is Owned, IDynamicSynthRedeemer, MixinResolver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will disabling exchanges / atomic exchanges on all synths be done in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need a code change for that. It can be done with an owner action: SystemStatus.suspendSynthsExchange[]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for killing atomic exchanges I assume?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do synths that are pending fee reclamation go into play here? Should we run a script that eliminates all settles all pending fee reclamations before executing this or should we tackle this in a PR, to kill pending fee reclamations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for killing atomic exchanges I assume?
Yessir. exchangeAtomically
also requires exchangeActive
to be true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do synths that are pending fee reclamation go into play here? Should we run a script that eliminates all settles all pending fee reclamations before executing this or should we tackle this in a PR, to kill pending fee reclamations?
This can be done as part of the release:
- 1 - suspend exchanges
- 2-
settle()
all pending fee reclamations (set waiting period to 0 if needed) - 3 - deploy dynamic redeemer
- 4 - set
redemptionActive = true
contracts/BaseDebtCache.sol
Outdated
@@ -144,7 +151,8 @@ contract BaseDebtCache is Owned, MixinSystemSettings, IDebtCache { | |||
address synthAddress = address(synths[i]); | |||
require(synthAddress != address(0), "Synth does not exist"); | |||
uint supply = IERC20(synthAddress).totalSupply(); | |||
values[i] = supply.multiplyDecimalRound(rates[i]); | |||
uint value = supply.multiplyDecimalRound(rates[i]); | |||
values[i] = value.multiplyDecimalRound(dynamicSynthRedeemer().getDiscountRate()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe sUSD needs to always have a discountRate
of 1. The discountRate
is only applied on synths that are open for dynamic redemption... I think another reason why we may need allowedForRedemption
list. In addition, the old redemption tokens redeemer
, are hopefully not affected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of maintaining a list, we can also add an exception here for sUSD
only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure thing 🙏🏼 and for old tokens like sLINK, i am assuming they are not captured here (rather the sUSD in redeemer is used), because we removed from the exchangeRates and being considered as synths, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure thing 🙏🏼 and for old tokens like sLINK, i am assuming they are not captured here (rather the sUSD in redeemer is used), because we removed from the exchangeRates and being considered as synths, right?
Correct. Old synths like sLINK
have been removed from the Issuer and are no longer considered to be synths in the system. They are only available for redemption through the legacy SynthRedeemer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe sUSD needs to always have a discountRate of 1
Addressed here 0e4eff7
* SIP-2059: Legacy Spot Synth Migration (#2227) * sepolia-ethereum deployment artifacts * update verify * sepolia-ovm deployment artifacts * fix: check valid synth (#2231) * add check for valid synth target * remove unnecessary address casts * impl feedback and update tests * replace proxy param with currency key * add burnAndIssueSynthsWithoutDebtCache func
* SIP-2059: Legacy Spot Synth Migration (#2227) * implements 2096 (#2225) Co-authored-by: Leonardo Massazza <lmassazza@gmail.com> * sccp-2100 (#2235) * update sccp 2099 (#2230) Co-authored-by: Leonardo Massazza <lmassazza@gmail.com> * implements sccp 2104 (#2239) * sccp-2106 (#2241) Co-authored-by: Leonardo Massazza <lmassazza@gmail.com> * Upgrade hardhat-cannon version ^2.12.4 (#2240) * add funding.json (#2244) * sccp-2116 (#2243) Co-authored-by: meb <4982406+barrasso@users.noreply.github.com> * implements sccp-2108 (#2242) Co-authored-by: meb <4982406+barrasso@users.noreply.github.com> * fix: resolve merge conflict * sccp-2125 (#2245) * chore: fix lint issuer (#2247) * legacymarket: prevent self liquidation on v2x once LM is enabled (#2246) * legacymarket: prevent self liquidation on v2x once LM is enabled * add test case --------- Co-authored-by: meb <4982406+barrasso@users.noreply.github.com> * l1 deployment artifacts * l2 deployment artifacts --------- Co-authored-by: kaleb <62237347+kaleb-keny@users.noreply.github.com> Co-authored-by: Leonardo Massazza <lmassazza@gmail.com> Co-authored-by: Noah Litvin <335975+noahlitvin@users.noreply.github.com> Co-authored-by: dbeal <git@danb.email>
Introduces a new contract,
DynamicSynthRedeemer
, which quotes synth redemption prices based on real-time chainlink price data * a discount rate (as opposed to theSynthRedeemer
, which does so by removing the synth from the issuer and redeems at a fixed rate).https://sips.synthetix.io/sips/sip-2059/