Skip to content

feat: [RIO-110] add RioRewardSplitter contract#2

Open
tlip wants to merge 1 commit intomainfrom
feat/rio-110
Open

feat: [RIO-110] add RioRewardSplitter contract#2
tlip wants to merge 1 commit intomainfrom
feat/rio-110

Conversation

@tlip
Copy link
Contributor

@tlip tlip commented Apr 22, 2024

No description provided.

@linear
Copy link

linear bot commented Apr 22, 2024

solimander added a commit that referenced this pull request Apr 23, 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);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nonReentrant is not needed on any of these functions.

@solimander
Copy link
Contributor

Could you add events to this contract so that we can track unclaimed + claimed amounts?

/// @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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants