Open
Conversation
peculiarity
reviewed
Oct 1, 2024
peculiarity
reviewed
Oct 1, 2024
peculiarity
reviewed
Oct 1, 2024
src/interfaces/IERC7540.sol
Outdated
| /// @dev MUST be called by endorsed sender | ||
| function setEndorsedOperator(address owner, bool approved) external; | ||
|
|
||
| /// @notice TODO |
Contributor
There was a problem hiding this comment.
Suggested change
| /// @notice TODO | |
| // --- Helpers --- | |
| /// @notice Price of 1 unit of share, quoted in the decimals of the asset. |
peculiarity
reviewed
Oct 1, 2024
peculiarity
reviewed
Oct 1, 2024
peculiarity
reviewed
Oct 1, 2024
| @@ -0,0 +1,34 @@ | |||
| // SPDX-License-Identifier: AGPL-3.0-only | |||
| pragma solidity >=0.5.0; | |||
Contributor
There was a problem hiding this comment.
Any specific reason why pragma is defined like that ?
Contributor
Author
There was a problem hiding this comment.
Allows any integration to pull in these interfaces, using any Solidity version.
peculiarity
reviewed
Oct 1, 2024
| } | ||
|
|
||
| /// @inheritdoc IInterestDistributor | ||
| function clear(address vault, address controller) external { |
Contributor
There was a problem hiding this comment.
I would rename this to dropOut. Meaning that you want to drop-out from the interest distribution process.
peculiarity
reviewed
Oct 1, 2024
peculiarity
reviewed
Oct 1, 2024
peculiarity
reviewed
Oct 1, 2024
peculiarity
reviewed
Oct 1, 2024
| // Assuming price updates coincide with epoch fulfillments, this results in only requesting | ||
| // interest on the previous outstanding balance before the new fulfillment. | ||
| uint128 request = priceLastUpdated > user.lastUpdate | ||
| ? _computeRequest(user.shares, currentShares, user.peak, uint96(currentPrice)) |
Contributor
There was a problem hiding this comment.
Suggested change
| ? _computeRequest(user.shares, currentShares, user.peak, uint96(currentPrice)) | |
| ? _computerRedeemAmount(user.shares, currentShares, user.peak, uint96(currentPrice)) |
peculiarity
reviewed
Oct 1, 2024
| // Calculate request before updating user.shares, so it is based on the balance at the last price update. | ||
| // Assuming price updates coincide with epoch fulfillments, this results in only requesting | ||
| // interest on the previous outstanding balance before the new fulfillment. | ||
| uint128 request = priceLastUpdated > user.lastUpdate |
Contributor
There was a problem hiding this comment.
Suggested change
| uint128 request = priceLastUpdated > user.lastUpdate | |
| uint128 redeemAmount = priceLastUpdated > user.lastUpdate |
peculiarity
reviewed
Oct 1, 2024
| contract InterestDistributor is IInterestDistributor { | ||
| using MathLib for uint256; | ||
|
|
||
| mapping(address vault => mapping(address user => InterestDetails)) internal _users; |
Contributor
There was a problem hiding this comment.
Suggested change
| mapping(address vault => mapping(address user => InterestDetails)) internal _users; | |
| mapping(address vault => mapping(address user => InterestDetails)) public users; |
|
Coverage after merging interest-distributor into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.