Skip to content

Commit 305c035

Browse files
committed
fix: change operator and contributor event params to initiator
1 parent 656e6cc commit 305c035

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

contracts/ServiceNodeRewards.sol

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,14 @@ contract ServiceNodeRewards is Initializable, Ownable2StepUpgradeable, PausableU
170170
event ClaimThresholdUpdated(uint256 newThreshold);
171171
event ClaimCycleUpdated(uint256 newValue);
172172
event LiquidationRatiosUpdated(uint256 liquidatorRatio, uint256 poolRatio, uint256 recipientRatio);
173-
event ServiceNodeLiquidated(uint64 indexed serviceNodeID, address operator, BN256G1.G1Point pubkey);
173+
event ServiceNodeLiquidated(uint64 indexed serviceNodeID, address initiator, BN256G1.G1Point pubkey);
174174
event ServiceNodeExit(
175175
uint64 indexed serviceNodeID,
176-
address operator,
176+
address initiator,
177177
uint256 returnedAmount,
178178
BN256G1.G1Point pubkey
179179
);
180-
event ServiceNodeExitRequest(uint64 indexed serviceNodeID, address contributor, BN256G1.G1Point pubkey);
180+
event ServiceNodeExitRequest(uint64 indexed serviceNodeID, address initiator, BN256G1.G1Point pubkey);
181181
event StakingRequirementUpdated(uint256 newRequirement);
182182
event SignatureExpiryUpdated(uint256 newExpiry);
183183

@@ -192,7 +192,7 @@ contract ServiceNodeRewards is Initializable, Ownable2StepUpgradeable, PausableU
192192
// @param serviceNodeID The node that has already paired with the Ed25519
193193
// public key.
194194
error Ed25519PubkeyAlreadyExists(uint64 serviceNodeID);
195-
error CallerNotContributor(uint64 serviceNodeID, address contributor);
195+
error CallerNotContributor(uint64 serviceNodeID, address caller);
196196
error ClaimThresholdExceeded();
197197
error ContractAlreadyStarted();
198198
error ContractNotStarted();
@@ -423,7 +423,7 @@ contract ServiceNodeRewards is Initializable, Ownable2StepUpgradeable, PausableU
423423
}
424424

425425
updateBLSNonSignerThreshold();
426-
emit NewServiceNodeV2(allocID, operator, blsPubkey, serviceNodeParams, contributors);
426+
emit NewServiceNodeV2(allocID, tx.origin, blsPubkey, serviceNodeParams, contributors);
427427
SafeERC20.safeTransferFrom(designatedToken, msg.sender, address(this), stakingRequirement);
428428
}
429429

@@ -511,7 +511,7 @@ contract ServiceNodeRewards is Initializable, Ownable2StepUpgradeable, PausableU
511511
}
512512

513513
sn.latestLeaveRequestTimestamp = block.timestamp;
514-
emit ServiceNodeExitRequest(serviceNodeID, caller, sn.blsPubkey);
514+
emit ServiceNodeExitRequest(serviceNodeID, tx.origin, sn.blsPubkey);
515515
}
516516

517517
/// @notice Exits a BLS public key using an aggregated BLS signature from
@@ -567,12 +567,11 @@ contract ServiceNodeRewards is Initializable, Ownable2StepUpgradeable, PausableU
567567
///
568568
/// @param serviceNodeID The ID of the service node to be exited.
569569
function _exitBLSPublicKey(uint64 serviceNodeID, uint256 returnedAmount) internal {
570-
address operator = _serviceNodes[serviceNodeID].operator;
571570
BN256G1.G1Point memory pubkey = _serviceNodes[serviceNodeID].blsPubkey;
572571
serviceNodeDelete(serviceNodeID);
573572

574573
updateBLSNonSignerThreshold();
575-
emit ServiceNodeExit(serviceNodeID, operator, returnedAmount, pubkey);
574+
emit ServiceNodeExit(serviceNodeID, tx.origin, returnedAmount, pubkey);
576575
}
577576

578577
/// @notice Minimum time before a node may exit (normally or via liquidation). This prevents
@@ -649,7 +648,7 @@ contract ServiceNodeRewards is Initializable, Ownable2StepUpgradeable, PausableU
649648
blsPubkey, timestamp, blsSignature, liquidateTag, ids);
650649

651650
// Calculating how much liquidator is paid out
652-
emit ServiceNodeLiquidated(serviceNodeID, node.operator, node.blsPubkey);
651+
emit ServiceNodeLiquidated(serviceNodeID, tx.origin, node.blsPubkey);
653652
uint256 ratioSum = poolShareOfLiquidationRatio + liquidatorRewardRatio + recipientRatio;
654653
uint256 deposit = node.deposit;
655654
uint256 liquidatorAmount = (deposit * liquidatorRewardRatio) / ratioSum;

0 commit comments

Comments
 (0)