-
Notifications
You must be signed in to change notification settings - Fork 40
Expose collateralization functions and Keep address #590
Conversation
These functions return per-deposit collateralization details. Exposing these can be useful for monitoring and managing liquidation easily.
Allow for anyone to check the address of the keep associated with the Deposit. This can be useful to obtail operating info about the keep. Status, events, members etc.
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.
LGTM, nice ergonomic improvement. Waiting for one more 👍 for merge
These functions are now implemented in parent. No need to overload.
/// @notice Get the current collateralization level for this Deposit. | ||
/// @dev This value represents the percentage of the backing BTC value the signers | ||
/// currently must hold as bond. | ||
/// @return The severe collateralization level for this deposit. |
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.
@NicholasDotSol potential copypasta re: "severe"?
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.
Also is there a reason why getCollateralizationPercentage
is uint256? Seems like we could return uint16 here too, just curious.
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.
@NicholasDotSol potential copypasta re: "severe"?
yeah good catch, severe -> current
Also is there a reason why getCollateralizationPercentage is uint256? Seems like we could return uint16 here too, just curious.
There is no reason to move this to a smaller uint size. It makes sense for other collateralization values that take up storage since we can take advantage of bit-packing. But Since this value is calculated in memory, converting from and to uint types will just take additional gas
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.
yeah good catch, severe -> current
also note that this is repeated below too.
There is no reason to move this to a smaller uint size. It makes sense for other collateralization values that take up storage since we can take advantage of bit-packing. But Since this value is calculated in memory, converting from and to uint types will just take additional gas
Alright, fair enough. Didn't know that there were gas costs for casting to lower types, thought everything was the same word-size in memory.
These functions return per-deposit collateralization details. Exposing these can be useful for monitoring and managing liquidation easily.
The Keep address can be useful in order to easily obtain useful info about the keep.