Skip to content

Commit

Permalink
fix: msg.sender is avs
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatil12 committed Sep 26, 2024
1 parent 531ba93 commit 65d413f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/contracts/core/RewardsCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,12 @@ contract RewardsCoordinator is
/*
* @notice Facilitates the distribution of rewards to participants through the UniPRInt V1.1 system.
* @dev The function leverages AVS-defined logic and external data for reward calculations.
* @param avs The address of the AVS responsible for managing the reward distribution.
* @param token The address of the ERC20 token used for rewards.
* @param amount The total amount of tokens to be rewarded.
* @param contentHash The keccak256 hash of the JSON manifest file that lists the earners and their rewards.
* @param contentURI The URI where the JSON manifest file is publicly accessible.
*/
function rewardParticipants(
address avs,
IERC20 token,
uint256 amount,
bytes32 contentHash,
Expand All @@ -227,7 +225,7 @@ contract RewardsCoordinator is
token.safeTransferFrom(msg.sender, address(this), amount);

// Emit event indicating a direct reward payment.
emit DirectRewardPayment(msg.sender, avs, token, amount, contentHash, contentURI);
emit DirectRewardPayment(msg.sender, token, amount, contentHash, contentURI);
}

/**
Expand Down
4 changes: 0 additions & 4 deletions src/contracts/interfaces/IRewardsCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,12 @@ interface IRewardsCoordinator {

/// @notice Emitted when a direct reward payment is initiated through the UniPRInt V1.1 system.
/// @dev Supports programmatic rewards for AVS performance, EIGEN incentives, and more.
/// @param sender The address that initiated the reward payment (msg.sender).
/// @param avs The address of the AVS managing this reward.
/// @param token The address of the ERC20 token used for payment.
/// @param amount The total amount of tokens transferred to the RewardsCoordinator.
/// @param contentHash The keccak256 hash of the JSON manifest file listing the earners and amounts.
/// @param contentURI The publicly addressable URI pointing to the JSON manifest file.
event DirectRewardPayment(
address indexed sender,
address indexed avs,
IERC20 token,
uint256 amount,
Expand Down Expand Up @@ -303,14 +301,12 @@ interface IRewardsCoordinator {
/**
* @notice Facilitates the distribution of rewards to participants through the UniPRInt V1.1 system.
* @dev The function leverages AVS-defined logic and external data for reward calculations.
* @param avs The address of the AVS responsible for managing the reward distribution.
* @param token The address of the ERC20 token used for rewards.
* @param totalAmount The total amount of tokens to be transferred to the RewardsCoordinator.
* @param contentHash The keccak256 hash of the JSON manifest file that lists the earners and their rewards.
* @param contentURI The URI where the JSON manifest file is publicly accessible.
*/
function rewardParticipants(
address avs,
IERC20 token,
uint256 totalAmount,
bytes32 contentHash,
Expand Down
5 changes: 2 additions & 3 deletions src/test/unit/RewardsCoordinatorUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2278,7 +2278,6 @@ contract RewardsCoordinatorUnitTests_processClaim is RewardsCoordinatorUnitTests

contract RewardParticipantsTest is RewardsCoordinatorUnitTests {
event DirectRewardPayment(
address indexed sender,
address indexed avs,
IERC20 token,
uint256 amount,
Expand All @@ -2291,10 +2290,10 @@ contract RewardParticipantsTest is RewardsCoordinatorUnitTests {
rewardToken.approve(address(rewardsCoordinator), mockTokenInitialSupply);
cheats.expectEmit(true, true, true, false);
emit DirectRewardPayment(
address(this), address(this), rewardToken, mockTokenInitialSupply, keccak256("content"), "content-uri"
address(this), rewardToken, mockTokenInitialSupply, keccak256("content"), "content-uri"
);
rewardsCoordinator.rewardParticipants(
address(this), rewardToken, mockTokenInitialSupply, keccak256("content"), "content-uri"
rewardToken, mockTokenInitialSupply, keccak256("content"), "content-uri"
);
}
}

0 comments on commit 65d413f

Please sign in to comment.