Skip to content

Commit 0c6f839

Browse files
fix(wallet-registry): update beneficiary retrieval in withdrawRewards function
- Changed the beneficiary retrieval logic in the withdrawRewards function to use the current authorization source, improving accuracy in reward distribution. - This change ensures that the correct beneficiary is identified based on the latest authorization context.
1 parent 0ff7d79 commit 0c6f839

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

solidity/ecdsa/contracts/WalletRegistry.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,9 @@ contract WalletRegistry is
471471
function withdrawRewards(address stakingProvider) external {
472472
address operator = stakingProviderToOperator(stakingProvider);
473473
if (operator == address(0)) revert UnknownOperator();
474-
(, address beneficiary, ) = staking.rolesOf(stakingProvider);
474+
(, address beneficiary, ) = _currentAuthorizationSource().rolesOf(
475+
stakingProvider
476+
);
475477
uint96 amount = sortitionPool.withdrawRewards(operator, beneficiary);
476478
// slither-disable-next-line reentrancy-events
477479
emit RewardsWithdrawn(stakingProvider, amount);

0 commit comments

Comments
 (0)