-
Notifications
You must be signed in to change notification settings - Fork 0
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
MYSO-26: Improve programmatic lender access #577
Comments
ImplementationThe append only array for on-chain quote hashes is implemented here: v2/contracts/peer-to-peer/QuoteHandler.sol Lines 49 to 55 in 93bf122
The on-chain quote hashes can be retrieved via: v2/contracts/peer-to-peer/QuoteHandler.sol Lines 284 to 305 in 93bf122
The on-chain quote hash history is stored via the following struct which also stores the valid until time to allow lenders to quickly check which on-chain quotes are currently still active: v2/contracts/peer-to-peer/DataTypesPeerToPeer.sol Lines 156 to 161 in 93bf122
|
Additional ImprovementsTo minimize the overhead when updating and deleting on-chain quotes, lenders now only need to pass on the quotehash rather than the (old) v2/contracts/peer-to-peer/QuoteHandler.sol Lines 97 to 99 in 93bf122
and similarly, the v2/contracts/peer-to-peer/QuoteHandler.sol Lines 97 to 100 in 93bf122
Lastly, the number of signers can now be retrieved via: v2/contracts/peer-to-peer/LenderVaultImpl.sol Lines 417 to 419 in 93bf122
|
Description
Currently, lenders need to keep track of their on-chain quote history with event listeners. However, there aren't any getters to easily access the overall on-chain quote history as well as the overall number of on-chain quotes that were added. This can make deleting open on-chain quotes a bit tedious.
Similarly, there's no function to get return the total number of signers on a vault, hence if a lender wants to know the currently active signers they need to iterate over the signer array.
Recommendation
Add a storage append only array that keeps track of all the added on-chain quote hashes as well as the valid until timestamp. Moreover, add a getter to retrieve the total onchain quote historay length as well as the total number of signers.
The text was updated successfully, but these errors were encountered: