Closed brozorec closed 1 year ago
I'm implementing some new methods in the sdk, and this issue starts becoming a huge pain in the ass. How should we handle it?
balanceOfDebt()
return shares similar to balanceOf()
-> This implies a good chunk of refactoring (both in the vault and in tests).balanceOfAssets()
that returns amount of assets. Do we still have some margin regarding the contract size?@DaigaroCota wdyt?
I'm implementing some new methods in the sdk, and this issue starts becoming a huge pain in the ass. How should we handle it?
- We make
balanceOfDebt()
return shares similar tobalanceOf()
-> This implies a good chunk of refactoring (both in the vault and in tests).- We introduce a new function like
balanceOfAssets()
that returns amount of assets. Do we still have some margin regarding the contract size?@DaigaroCota wdyt?
To minimize the size of this impact, I suggest to align in the following way:
Keep balanceOfDebt()
as currently implemented in smart contracts. It should returns thedebt
amount. This is how is currently implemented in v0.0.1
We introduce a new method that returns the _debtShares
and we can call it balanceOfDebtShares(address)
. We will need to add this to the {IVault}, return zero in {YieldVault} and return _debtShares
in the {BorrowingVault}.
I suggest the following:
balanceOf()
-> asset shares
balanceOfDebtShares()
-> debt shares
balanceOfDebt()
-> debt amount
balanceOfAsset()
-> asset amount (if we have a method for the debt amount then we need one for the asset amount as well)
I suggest the following:
balanceOf()
-> asset sharesbalanceOfDebtShares()
-> debt sharesbalanceOfDebt()
-> debt amountbalanceOfAsset()
-> asset amount (if we have a method for the debt amount then we need one for the asset amount as well)
Lets proceed this way.
vault.balanceOf
returns shares whilevault.balanceOfDebt
returns amounts. This is inconsistent and should be fixed.