mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-23 09:18:21 +00:00
rename event RewardsInitiatorSet to SnowbridgeInitiatorSet
This commit is contained in:
parent
1aac6fbb5a
commit
65061ccaa8
7 changed files with 34 additions and 34 deletions
|
|
@ -180,7 +180,7 @@ contract DataHavenServiceManager is OwnableUpgradeable, IAVSRegistrar, IDataHave
|
|||
__Ownable_init();
|
||||
_transferOwnership(initialOwner);
|
||||
snowbridgeInitiator = _snowbridgeInitiator;
|
||||
emit RewardsInitiatorSet(address(0), _snowbridgeInitiator);
|
||||
emit SnowbridgeInitiatorSet(address(0), _snowbridgeInitiator);
|
||||
|
||||
// Set version from parameter (allows flexibility per deployment environment)
|
||||
_version = initialVersion;
|
||||
|
|
@ -567,13 +567,13 @@ contract DataHavenServiceManager is OwnableUpgradeable, IAVSRegistrar, IDataHave
|
|||
}
|
||||
|
||||
/// @inheritdoc IDataHavenServiceManager
|
||||
function setRewardsInitiator(
|
||||
address newRewardsInitiator
|
||||
function setSnowbridgeInitiator(
|
||||
address newSnowbridgeInitiator
|
||||
) external override onlyOwner {
|
||||
require(newRewardsInitiator != address(0), ZeroAddress());
|
||||
require(newSnowbridgeInitiator != address(0), ZeroAddress());
|
||||
address oldInitiator = snowbridgeInitiator;
|
||||
snowbridgeInitiator = newRewardsInitiator;
|
||||
emit RewardsInitiatorSet(oldInitiator, newRewardsInitiator);
|
||||
snowbridgeInitiator = newSnowbridgeInitiator;
|
||||
emit SnowbridgeInitiatorSet(oldInitiator, newSnowbridgeInitiator);
|
||||
}
|
||||
|
||||
// ============ AVS Management Functions ============
|
||||
|
|
|
|||
|
|
@ -91,10 +91,10 @@ interface IDataHavenServiceManagerEvents {
|
|||
/// @param operatorCount The number of operators that received rewards
|
||||
event RewardsSubmitted(uint256 totalAmount, uint256 operatorCount);
|
||||
|
||||
/// @notice Emitted when the rewards initiator address is updated
|
||||
/// @param oldInitiator The previous rewards initiator address
|
||||
/// @param newInitiator The new rewards initiator address
|
||||
event RewardsInitiatorSet(address indexed oldInitiator, address indexed newInitiator);
|
||||
/// @notice Emitted when the snowbridge initiator address is updated
|
||||
/// @param oldInitiator The previous snowbridge initiator address
|
||||
/// @param newInitiator The new snowbridge initiator address
|
||||
event SnowbridgeInitiatorSet(address indexed oldInitiator, address indexed newInitiator);
|
||||
|
||||
/// @notice Emitted when a validator updates their solochain address
|
||||
/// @param validator Address of the validator
|
||||
|
|
@ -343,11 +343,11 @@ interface IDataHavenServiceManager is
|
|||
) external;
|
||||
|
||||
/**
|
||||
* @notice Set the rewards initiator address authorized to submit rewards
|
||||
* @param initiator The address of the rewards initiator (Snowbridge Agent)
|
||||
* @notice Set the snowbridge initiator address authorized to submit rewards
|
||||
* @param initiator The address of the snowbridge initiator (Snowbridge Agent)
|
||||
* @dev Only callable by the owner
|
||||
*/
|
||||
function setRewardsInitiator(
|
||||
function setSnowbridgeInitiator(
|
||||
address initiator
|
||||
) external;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ contract OperatorAddressMappingsTest is AVSDeployer {
|
|||
// Configure the rewards initiator (not strictly needed for these tests,
|
||||
// but keeps setup consistent with other suites).
|
||||
vm.prank(avsOwner);
|
||||
serviceManager.setRewardsInitiator(snowbridgeAgent);
|
||||
serviceManager.setSnowbridgeInitiator(snowbridgeAgent);
|
||||
}
|
||||
|
||||
function _registerOperator(
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ contract RewardsSubmitterTest is AVSDeployer {
|
|||
|
||||
// Configure the rewards initiator
|
||||
vm.prank(avsOwner);
|
||||
serviceManager.setRewardsInitiator(snowbridgeAgent);
|
||||
serviceManager.setSnowbridgeInitiator(snowbridgeAgent);
|
||||
|
||||
// Fund the service manager with reward tokens
|
||||
IERC20(address(rewardToken)).safeTransfer(address(serviceManager), 100000e18);
|
||||
|
|
@ -100,21 +100,21 @@ contract RewardsSubmitterTest is AVSDeployer {
|
|||
|
||||
// ============ Configuration Tests ============
|
||||
|
||||
function test_setRewardsInitiator() public {
|
||||
function test_setSnowbridgeInitiator() public {
|
||||
address newInitiator = address(0x123);
|
||||
|
||||
vm.prank(avsOwner);
|
||||
vm.expectEmit(true, true, false, false);
|
||||
emit IDataHavenServiceManagerEvents.RewardsInitiatorSet(snowbridgeAgent, newInitiator);
|
||||
serviceManager.setRewardsInitiator(newInitiator);
|
||||
emit IDataHavenServiceManagerEvents.SnowbridgeInitiatorSet(snowbridgeAgent, newInitiator);
|
||||
serviceManager.setSnowbridgeInitiator(newInitiator);
|
||||
|
||||
assertEq(serviceManager.snowbridgeInitiator(), newInitiator);
|
||||
}
|
||||
|
||||
function test_setRewardsInitiator_revertsIfNotOwner() public {
|
||||
function test_setSnowbridgeInitiator_revertsIfNotOwner() public {
|
||||
vm.prank(operator1);
|
||||
vm.expectRevert(bytes("Ownable: caller is not the owner"));
|
||||
serviceManager.setRewardsInitiator(address(0x123));
|
||||
serviceManager.setSnowbridgeInitiator(address(0x123));
|
||||
}
|
||||
|
||||
// ============ Access Control Tests ============
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ contract SlashingTest is AVSDeployer {
|
|||
|
||||
// Configure the rewards initiator (because only the reward agent can submit slashing request)
|
||||
vm.prank(avsOwner);
|
||||
serviceManager.setRewardsInitiator(snowbridgeAgent);
|
||||
serviceManager.setSnowbridgeInitiator(snowbridgeAgent);
|
||||
|
||||
vm.prank(operator);
|
||||
delegationManager.registerAsOperator(address(0), 0, "");
|
||||
|
|
@ -93,7 +93,7 @@ contract SlashingTest is AVSDeployer {
|
|||
|
||||
// Configure the rewards initiator (because only the reward agent can submit slashing request)
|
||||
vm.prank(avsOwner);
|
||||
serviceManager.setRewardsInitiator(snowbridgeAgent);
|
||||
serviceManager.setSnowbridgeInitiator(snowbridgeAgent);
|
||||
|
||||
vm.prank(operator);
|
||||
delegationManager.registerAsOperator(address(0), 0, "");
|
||||
|
|
@ -147,7 +147,7 @@ contract SlashingTest is AVSDeployer {
|
|||
function test_fulfilSlashingRequest_skipsUnknownSolochainAddress() public {
|
||||
// Configure the rewards initiator (because only the reward agent can submit slashing request)
|
||||
vm.prank(avsOwner);
|
||||
serviceManager.setRewardsInitiator(snowbridgeAgent);
|
||||
serviceManager.setSnowbridgeInitiator(snowbridgeAgent);
|
||||
|
||||
address unknownSolochainOperator = address(0xDEAD);
|
||||
DataHavenServiceManager.SlashingRequest[] memory slashings =
|
||||
|
|
|
|||
|
|
@ -20,12 +20,12 @@ contract StorageLayoutTest is AVSDeployer {
|
|||
function test_upgradePreservesState() public {
|
||||
// 1. Populate state
|
||||
address testValidator = address(0x1234);
|
||||
address newRewardsInitiator = address(0x9999);
|
||||
address newSnowbridgeInitiator = address(0x9999);
|
||||
address testSubmitter = address(0x5678);
|
||||
|
||||
vm.startPrank(avsOwner);
|
||||
serviceManager.addValidatorToAllowlist(testValidator);
|
||||
serviceManager.setRewardsInitiator(newRewardsInitiator);
|
||||
serviceManager.setSnowbridgeInitiator(newSnowbridgeInitiator);
|
||||
serviceManager.setValidatorSetSubmitter(testSubmitter);
|
||||
vm.stopPrank();
|
||||
|
||||
|
|
|
|||
|
|
@ -2245,7 +2245,7 @@ export const dataHavenServiceManagerAbi = [
|
|||
inputs: [
|
||||
{ name: 'newRewardsInitiator', internalType: 'address', type: 'address' },
|
||||
],
|
||||
name: 'setRewardsInitiator',
|
||||
name: 'setSnowbridgeInitiator',
|
||||
outputs: [],
|
||||
stateMutability: 'nonpayable',
|
||||
},
|
||||
|
|
@ -2535,7 +2535,7 @@ export const dataHavenServiceManagerAbi = [
|
|||
indexed: true,
|
||||
},
|
||||
],
|
||||
name: 'RewardsInitiatorSet',
|
||||
name: 'SnowbridgeInitiatorSet',
|
||||
},
|
||||
{
|
||||
type: 'event',
|
||||
|
|
@ -11204,12 +11204,12 @@ export const writeDataHavenServiceManagerSendNewValidatorSetForEra =
|
|||
})
|
||||
|
||||
/**
|
||||
* Wraps __{@link writeContract}__ with `abi` set to __{@link dataHavenServiceManagerAbi}__ and `functionName` set to `"setRewardsInitiator"`
|
||||
* Wraps __{@link writeContract}__ with `abi` set to __{@link dataHavenServiceManagerAbi}__ and `functionName` set to `"setSnowbridgeInitiator"`
|
||||
*/
|
||||
export const writeDataHavenServiceManagerSetRewardsInitiator =
|
||||
/*#__PURE__*/ createWriteContract({
|
||||
abi: dataHavenServiceManagerAbi,
|
||||
functionName: 'setRewardsInitiator',
|
||||
functionName: 'setSnowbridgeInitiator',
|
||||
})
|
||||
|
||||
/**
|
||||
|
|
@ -11390,12 +11390,12 @@ export const simulateDataHavenServiceManagerSendNewValidatorSetForEra =
|
|||
})
|
||||
|
||||
/**
|
||||
* Wraps __{@link simulateContract}__ with `abi` set to __{@link dataHavenServiceManagerAbi}__ and `functionName` set to `"setRewardsInitiator"`
|
||||
* Wraps __{@link simulateContract}__ with `abi` set to __{@link dataHavenServiceManagerAbi}__ and `functionName` set to `"setSnowbridgeInitiator"`
|
||||
*/
|
||||
export const simulateDataHavenServiceManagerSetRewardsInitiator =
|
||||
/*#__PURE__*/ createSimulateContract({
|
||||
abi: dataHavenServiceManagerAbi,
|
||||
functionName: 'setRewardsInitiator',
|
||||
functionName: 'setSnowbridgeInitiator',
|
||||
})
|
||||
|
||||
/**
|
||||
|
|
@ -11522,12 +11522,12 @@ export const watchDataHavenServiceManagerOwnershipTransferredEvent =
|
|||
})
|
||||
|
||||
/**
|
||||
* Wraps __{@link watchContractEvent}__ with `abi` set to __{@link dataHavenServiceManagerAbi}__ and `eventName` set to `"RewardsInitiatorSet"`
|
||||
* Wraps __{@link watchContractEvent}__ with `abi` set to __{@link dataHavenServiceManagerAbi}__ and `eventName` set to `"SnowbridgeInitiatorSet"`
|
||||
*/
|
||||
export const watchDataHavenServiceManagerRewardsInitiatorSetEvent =
|
||||
export const watchDataHavenServiceManagerSnowbridgeInitiatorSetEvent =
|
||||
/*#__PURE__*/ createWatchContractEvent({
|
||||
abi: dataHavenServiceManagerAbi,
|
||||
eventName: 'RewardsInitiatorSet',
|
||||
eventName: 'SnowbridgeInitiatorSet',
|
||||
})
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue