SIP-220: Fix Debt Synthesis
Author | db, jj |
---|---|
Status | Implemented |
Type | Governance |
Network | Ethereum & Optimism |
Implementor | meb |
Release | Mizar |
Proposal | Loading status... |
Created | 2022-03-24 |
Simple Summary
Bug fix in Debt Pool Synthesis that doesn't correctly match the amount of debt shares to sUSD minted.
Abstract
Update the Issuer
contract on L1 and L2 to correctly account for total debt across both networks when minting and burning.
Motivation
When minting or burning, the Issuer
is supposed to calculate the ratio of global debt shares to global issued synths to figure out how many debt shares to issue. However, when it actually figures out the number of debt shares during mint/burn, it uses the local network's debt share amount. This leads to minting/burning of a lower number of debt shares than actually appropriate, while still minting the full amount of sUSD.
Specification
Overview
The fix involves updating this line in Issuer
to use _debtBalanceOfAndTotalDebt(synthetixDebtShare().balanceOf(_issuer),sUSD)
instead of sds.totalSupply()
Rationale
Technical Specification
Test Cases
TBD
Configurable Values (Via SCCP)
N/A
Copyright
Copyright and related rights waived via CC0.