Open
Conversation
solimander
added a commit
that referenced
this pull request
Apr 23, 2024
feat: LRT Factory & Controller
solimander
reviewed
Apr 25, 2024
Comment on lines
+77
to
+113
| function distributeETH() external nonReentrant { | ||
| _distribute(ETH_ADDRESS); | ||
| } | ||
|
|
||
| /// @notice Distributes the currently held undistributed ERC20 to the operators' withdrawal buckets. | ||
| /// @param tokenAddress The address of the token. | ||
| function distributeERC20(address tokenAddress) external nonReentrant { | ||
| _distribute(tokenAddress); | ||
| } | ||
|
|
||
| /// @notice Withdraws the operator's ETH balance from their bucket. | ||
| /// @param operatorId The ID of the operator. | ||
| function withdrawETH(uint8 operatorId) external nonReentrant { | ||
| _withdraw(operatorId, ETH_ADDRESS); | ||
| } | ||
|
|
||
| /// @notice Withdraws the operator's ERC20 balance from their bucket. | ||
| /// @param operatorId The ID of the operator. | ||
| /// @param tokenAddress The address of the token. | ||
| function withdrawERC20(uint8 operatorId, address tokenAddress) external nonReentrant { | ||
| _withdraw(operatorId, tokenAddress); | ||
| } | ||
|
|
||
| /// @notice Distributes the currently held undistributed ETH to the operators' withdrawal buckets and then withdraws it. | ||
| /// @param operatorId The ID of the operator. | ||
| function distributeAndWithdrawETH(uint8 operatorId) external nonReentrant { | ||
| _distribute(ETH_ADDRESS); | ||
| _withdraw(operatorId, ETH_ADDRESS); | ||
| } | ||
|
|
||
| /// @notice Distributes the currently held undistributed ERC20 to the operators' withdrawal buckets and then withdraws it. | ||
| /// @param operatorId The ID of the operator. | ||
| /// @param tokenAddress The address of the token. | ||
| function distributeAndWithdrawERC20(uint8 operatorId, address tokenAddress) external nonReentrant { | ||
| _distribute(tokenAddress); | ||
| _withdraw(operatorId, tokenAddress); | ||
| } |
Contributor
There was a problem hiding this comment.
nonReentrant is not needed on any of these functions.
Contributor
|
Could you add events to this contract so that we can track unclaimed + claimed amounts? |
solimander
reviewed
Apr 25, 2024
| /// @notice Distributes the currently held undistributed ERC20 to the operators' withdrawal buckets and then withdraws it. | ||
| /// @param operatorId The ID of the operator. | ||
| /// @param tokenAddress The address of the token. | ||
| function distributeAndWithdrawERC20(uint8 operatorId, address tokenAddress) external nonReentrant { |
Contributor
There was a problem hiding this comment.
I don't believe there's anything detrimental that can be done, but I don't think we should allow the withdrawal of ETH through withdrawERC20 and distributeAndWithdrawERC20.
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.