diff --git a/contracts/config/anvil.json b/contracts/config/anvil.json index 4a134ced..e8c901f4 100644 --- a/contracts/config/anvil.json +++ b/contracts/config/anvil.json @@ -26,7 +26,7 @@ }, "avs": { "avsOwner": "0x976EA74026E726554dB657fA54763abd0C3a0aa9", - "rewardsInitiator": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955", + "snowbridgeInitiator": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955", "validatorSetSubmitter": "0x976EA74026E726554dB657fA54763abd0C3a0aa9", "validatorsStrategies": [] }, diff --git a/contracts/config/example.jsonc b/contracts/config/example.jsonc index aeef7cc4..99fc53b3 100644 --- a/contracts/config/example.jsonc +++ b/contracts/config/example.jsonc @@ -68,7 +68,7 @@ /// The address of the account that initiates the rewards calculation. /// This is for the EigenLayer rewards distribution way, using the RewardsCoordinator. /// But for now, we're not using it, and instead sending the rewards directly. - "rewardsInitiator": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955", + "snowbridgeInitiator": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955", /// The EigenLayer strategy addresses for the Validators to stake into. /// The beaconChainETHStrategy is a virtual address representing native beacon chain ETH. /// All networks: diff --git a/contracts/config/mainnet-ethereum.json b/contracts/config/mainnet-ethereum.json index 28775dad..378ae274 100644 --- a/contracts/config/mainnet-ethereum.json +++ b/contracts/config/mainnet-ethereum.json @@ -30,7 +30,7 @@ }, "avs": { "avsOwner": "0x0000000000000000000000000000000000000000", - "rewardsInitiator": "0x0000000000000000000000000000000000000000", + "snowbridgeInitiator": "0x0000000000000000000000000000000000000000", "validatorsStrategies": [ "0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0", "0x93c4b944D05dfe6df7645A86cd2206016c51564D", diff --git a/contracts/config/stagenet-hoodi.json b/contracts/config/stagenet-hoodi.json index 40d80dbc..d71ce581 100644 --- a/contracts/config/stagenet-hoodi.json +++ b/contracts/config/stagenet-hoodi.json @@ -32,7 +32,7 @@ }, "avs": { "avsOwner": "0xe30a38ac89ffE5A86D5389Bfbf70C7EC766FbB6e", - "rewardsInitiator": "0xe30a38ac89ffE5A86D5389Bfbf70C7EC766FbB6e", + "snowbridgeInitiator": "0xe30a38ac89ffE5A86D5389Bfbf70C7EC766FbB6e", "validatorsStrategies": [ "0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0", "0xf8a1a66130d614c7360e868576d5e59203475fe0", diff --git a/contracts/config/testnet-hoodi.json b/contracts/config/testnet-hoodi.json index 3396b7b4..cf37569c 100644 --- a/contracts/config/testnet-hoodi.json +++ b/contracts/config/testnet-hoodi.json @@ -32,7 +32,7 @@ }, "avs": { "avsOwner": "0x0000000000000000000000000000000000000000", - "rewardsInitiator": "0x0000000000000000000000000000000000000000", + "snowbridgeInitiator": "0x0000000000000000000000000000000000000000", "validatorsStrategies": [ "0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0", "0xf8a1a66130d614c7360e868576d5e59203475fe0", diff --git a/contracts/script/deploy/Config.sol b/contracts/script/deploy/Config.sol index 4d076407..e3a84b99 100644 --- a/contracts/script/deploy/Config.sol +++ b/contracts/script/deploy/Config.sol @@ -18,7 +18,7 @@ contract Config { // AVS parameters struct AVSConfig { address avsOwner; - address rewardsInitiator; + address snowbridgeInitiator; address[] validatorsStrategies; address validatorSetSubmitter; } diff --git a/contracts/script/deploy/DeployBase.s.sol b/contracts/script/deploy/DeployBase.s.sol index 145c54aa..67ec925e 100644 --- a/contracts/script/deploy/DeployBase.s.sol +++ b/contracts/script/deploy/DeployBase.s.sol @@ -44,7 +44,7 @@ import {ValidatorsUtils} from "../../script/utils/ValidatorsUtils.sol"; // Shared structs struct ServiceManagerInitParams { address avsOwner; - address rewardsInitiator; + address snowbridgeInitiator; IRewardsCoordinatorTypes.StrategyAndMultiplier[] validatorsStrategiesAndMultipliers; address gateway; address validatorSetSubmitter; @@ -270,7 +270,7 @@ abstract contract DeployBase is Script, DeployParams, Accounts { // Create service manager initialisation parameters struct ServiceManagerInitParams memory initParams = ServiceManagerInitParams({ avsOwner: avsConfig.avsOwner, - rewardsInitiator: agentAddress, + snowbridgeInitiator: agentAddress, validatorsStrategiesAndMultipliers: strategiesAndMultipliers, gateway: address(gateway), validatorSetSubmitter: avsConfig.validatorSetSubmitter, diff --git a/contracts/script/deploy/DeployLive.s.sol b/contracts/script/deploy/DeployLive.s.sol index 3becd30e..f591c44d 100644 --- a/contracts/script/deploy/DeployLive.s.sol +++ b/contracts/script/deploy/DeployLive.s.sol @@ -124,7 +124,7 @@ contract DeployLive is DeployBase { bytes memory initData = abi.encodeWithSelector( DataHavenServiceManager.initialize.selector, params.avsOwner, - params.rewardsInitiator, + params.snowbridgeInitiator, params.validatorsStrategiesAndMultipliers, params.gateway, params.validatorSetSubmitter, diff --git a/contracts/script/deploy/DeployLocal.s.sol b/contracts/script/deploy/DeployLocal.s.sol index 25ee2ebb..429a51ee 100644 --- a/contracts/script/deploy/DeployLocal.s.sol +++ b/contracts/script/deploy/DeployLocal.s.sol @@ -205,7 +205,7 @@ contract DeployLocal is DeployBase { bytes memory initData = abi.encodeWithSelector( DataHavenServiceManager.initialize.selector, params.avsOwner, - params.rewardsInitiator, + params.snowbridgeInitiator, params.validatorsStrategiesAndMultipliers, params.gateway, params.validatorSetSubmitter, diff --git a/contracts/script/deploy/DeployParams.s.sol b/contracts/script/deploy/DeployParams.s.sol index c77f99b9..725ab0a2 100644 --- a/contracts/script/deploy/DeployParams.s.sol +++ b/contracts/script/deploy/DeployParams.s.sol @@ -74,7 +74,7 @@ contract DeployParams is Script, Config { } else { config.avsOwner = vm.parseJsonAddress(configJson, ".avs.avsOwner"); } - config.rewardsInitiator = vm.parseJsonAddress(configJson, ".avs.rewardsInitiator"); + config.snowbridgeInitiator = vm.parseJsonAddress(configJson, ".avs.snowbridgeInitiator"); config.validatorsStrategies = vm.parseJsonAddressArray(configJson, ".avs.validatorsStrategies"); diff --git a/contracts/script/fixtures/DataHavenServiceManagerBadLayout.sol b/contracts/script/fixtures/DataHavenServiceManagerBadLayout.sol index ffaa0018..4c1ec0ab 100644 --- a/contracts/script/fixtures/DataHavenServiceManagerBadLayout.sol +++ b/contracts/script/fixtures/DataHavenServiceManagerBadLayout.sol @@ -12,7 +12,7 @@ contract DataHavenServiceManagerBadLayout is OwnableUpgradeable { uint256 public layoutBreaker; // Original variables (shifted by one slot) - address public rewardsInitiator; + address public snowbridgeInitiator; mapping(address => bool) public validatorsAllowlist; IGatewayV2 private _snowbridgeGateway; mapping(address => address) public validatorEthAddressToSolochainAddress; diff --git a/contracts/src/DataHavenServiceManager.sol b/contracts/src/DataHavenServiceManager.sol index 72389747..3de06a45 100644 --- a/contracts/src/DataHavenServiceManager.sol +++ b/contracts/src/DataHavenServiceManager.sol @@ -58,7 +58,7 @@ contract DataHavenServiceManager is OwnableUpgradeable, IAVSRegistrar, IDataHave // ============ State Variables ============ /// @notice The address authorized to initiate rewards submissions - address public rewardsInitiator; + address public snowbridgeInitiator; /// @inheritdoc IDataHavenServiceManager mapping(address => bool) public validatorsAllowlist; @@ -90,8 +90,8 @@ contract DataHavenServiceManager is OwnableUpgradeable, IAVSRegistrar, IDataHave // ============ Modifiers ============ /// @notice Restricts function to the rewards initiator - modifier onlyRewardsInitiator() { - _checkRewardsInitiator(); + modifier onlySnowbridgeInitiator() { + _checkSnowbridgeInitiator(); _; } @@ -129,8 +129,8 @@ contract DataHavenServiceManager is OwnableUpgradeable, IAVSRegistrar, IDataHave require(msg.sender == proxyAdmin, NotProxyAdmin()); } - function _checkRewardsInitiator() internal view { - require(msg.sender == rewardsInitiator, OnlyRewardsInitiator()); + function _checkSnowbridgeInitiator() internal view { + require(msg.sender == snowbridgeInitiator, OnlyRewardsInitiator()); } function _checkValidator() internal view { @@ -166,21 +166,21 @@ contract DataHavenServiceManager is OwnableUpgradeable, IAVSRegistrar, IDataHave /// @inheritdoc IDataHavenServiceManager function initialize( address initialOwner, - address _rewardsInitiator, + address _snowbridgeInitiator, IRewardsCoordinatorTypes.StrategyAndMultiplier[] memory validatorsStrategiesAndMultipliers, address _snowbridgeGatewayAddress, address _validatorSetSubmitter, string memory initialVersion ) public virtual initializer { require(initialOwner != address(0), ZeroAddress()); - require(_rewardsInitiator != address(0), ZeroAddress()); + require(_snowbridgeInitiator != address(0), ZeroAddress()); require(_snowbridgeGatewayAddress != address(0), ZeroAddress()); require(bytes(initialVersion).length > 0, EmptyVersion()); __Ownable_init(); _transferOwnership(initialOwner); - rewardsInitiator = _rewardsInitiator; - emit RewardsInitiatorSet(address(0), _rewardsInitiator); + snowbridgeInitiator = _snowbridgeInitiator; + emit RewardsInitiatorSet(address(0), _snowbridgeInitiator); // Set version from parameter (allows flexibility per deployment environment) _version = initialVersion; @@ -522,7 +522,7 @@ contract DataHavenServiceManager is OwnableUpgradeable, IAVSRegistrar, IDataHave /// @inheritdoc IDataHavenServiceManager function submitRewards( IRewardsCoordinatorTypes.OperatorDirectedRewardsSubmission calldata submission - ) external override onlyRewardsInitiator { + ) external override onlySnowbridgeInitiator { IRewardsCoordinatorTypes.OperatorDirectedRewardsSubmission memory translatedSubmission = submission; @@ -571,8 +571,8 @@ contract DataHavenServiceManager is OwnableUpgradeable, IAVSRegistrar, IDataHave address newRewardsInitiator ) external override onlyOwner { require(newRewardsInitiator != address(0), ZeroAddress()); - address oldInitiator = rewardsInitiator; - rewardsInitiator = newRewardsInitiator; + address oldInitiator = snowbridgeInitiator; + snowbridgeInitiator = newRewardsInitiator; emit RewardsInitiatorSet(oldInitiator, newRewardsInitiator); } @@ -605,7 +605,7 @@ contract DataHavenServiceManager is OwnableUpgradeable, IAVSRegistrar, IDataHave */ function slashValidatorsOperator( SlashingRequest[] calldata slashings - ) external onlyRewardsInitiator { + ) external onlySnowbridgeInitiator { for (uint256 i = 0; i < slashings.length; i++) { address ethOperator = validatorSolochainAddressToEthAddress[slashings[i].operator]; if (ethOperator == address(0)) continue; diff --git a/contracts/src/interfaces/IDataHavenServiceManager.sol b/contracts/src/interfaces/IDataHavenServiceManager.sol index b6c6348c..c5ef1134 100644 --- a/contracts/src/interfaces/IDataHavenServiceManager.sol +++ b/contracts/src/interfaces/IDataHavenServiceManager.sol @@ -189,7 +189,7 @@ interface IDataHavenServiceManager is /** * @notice Initializes the DataHaven Service Manager * @param initialOwner Address of the initial owner (AVS owner) - * @param rewardsInitiator Address authorized to initiate rewards + * @param snowbridgeInitiator Address authorized to initiate rewards * @param validatorsStrategiesAndMultipliers Array of strategy-multiplier pairs for the validators * operator set. Each multiplier must be non-zero. * @param _snowbridgeGatewayAddress Address of the Snowbridge Gateway @@ -198,7 +198,7 @@ interface IDataHavenServiceManager is */ function initialize( address initialOwner, - address rewardsInitiator, + address snowbridgeInitiator, IRewardsCoordinatorTypes.StrategyAndMultiplier[] memory validatorsStrategiesAndMultipliers, address _snowbridgeGatewayAddress, address _validatorSetSubmitter, diff --git a/contracts/storage-snapshots/DataHavenServiceManager.storage.json b/contracts/storage-snapshots/DataHavenServiceManager.storage.json index 44ac834a..27033dae 100644 --- a/contracts/storage-snapshots/DataHavenServiceManager.storage.json +++ b/contracts/storage-snapshots/DataHavenServiceManager.storage.json @@ -43,7 +43,7 @@ { "astId": 23887, "contract": "src/DataHavenServiceManager.sol:DataHavenServiceManager", - "label": "rewardsInitiator", + "label": "snowbridgeInitiator", "offset": 0, "slot": "101", "type": "t_address" diff --git a/contracts/test/RewardsSubmitter.t.sol b/contracts/test/RewardsSubmitter.t.sol index bd78d649..4796f0cb 100644 --- a/contracts/test/RewardsSubmitter.t.sol +++ b/contracts/test/RewardsSubmitter.t.sol @@ -108,7 +108,7 @@ contract RewardsSubmitterTest is AVSDeployer { emit IDataHavenServiceManagerEvents.RewardsInitiatorSet(snowbridgeAgent, newInitiator); serviceManager.setRewardsInitiator(newInitiator); - assertEq(serviceManager.rewardsInitiator(), newInitiator); + assertEq(serviceManager.snowbridgeInitiator(), newInitiator); } function test_setRewardsInitiator_revertsIfNotOwner() public { diff --git a/contracts/test/ValidatorSetSubmitter.t.sol b/contracts/test/ValidatorSetSubmitter.t.sol index 081b9501..218badd6 100644 --- a/contracts/test/ValidatorSetSubmitter.t.sol +++ b/contracts/test/ValidatorSetSubmitter.t.sol @@ -194,7 +194,7 @@ contract ValidatorSetSubmitterTest is SnowbridgeAndAVSDeployer { abi.encodeWithSelector( DataHavenServiceManager.initialize.selector, avsOwner, - rewardsInitiator, + snowbridgeInitiator, emptyStrategies, address(snowbridgeGatewayMock), address(0), diff --git a/contracts/test/storage/StorageLayout.t.sol b/contracts/test/storage/StorageLayout.t.sol index 69a3cd92..e93671a1 100644 --- a/contracts/test/storage/StorageLayout.t.sol +++ b/contracts/test/storage/StorageLayout.t.sol @@ -31,7 +31,7 @@ contract StorageLayoutTest is AVSDeployer { // 2. Record state before upgrade bool allowlistBefore = serviceManager.validatorsAllowlist(testValidator); - address rewardsInitiatorBefore = serviceManager.rewardsInitiator(); + address snowbridgeInitiatorBefore = serviceManager.snowbridgeInitiator(); address ownerBefore = serviceManager.owner(); address gatewayBefore = serviceManager.snowbridgeGateway(); address submitterBefore = serviceManager.validatorSetSubmitter(); @@ -51,9 +51,9 @@ contract StorageLayoutTest is AVSDeployer { "validatorsAllowlist should be preserved" ); assertEq( - serviceManager.rewardsInitiator(), - rewardsInitiatorBefore, - "rewardsInitiator should be preserved" + serviceManager.snowbridgeInitiator(), + snowbridgeInitiatorBefore, + "snowbridgeInitiator should be preserved" ); assertEq(serviceManager.owner(), ownerBefore, "owner should be preserved"); assertEq( diff --git a/contracts/test/utils/AVSDeployer.sol b/contracts/test/utils/AVSDeployer.sol index 007c236e..a4fadbe1 100644 --- a/contracts/test/utils/AVSDeployer.sol +++ b/contracts/test/utils/AVSDeployer.sol @@ -67,7 +67,7 @@ contract AVSDeployer is Test { address public proxyAdminOwner = address(uint160(uint256(keccak256("proxyAdminOwner")))); address public regularDeployer = address(uint160(uint256(keccak256("regularDeployer")))); address public avsOwner = address(uint160(uint256(keccak256("avsOwner")))); - address public rewardsInitiator = address(uint160(uint256(keccak256("rewardsInitiator")))); + address public snowbridgeInitiator = address(uint160(uint256(keccak256("snowbridgeInitiator")))); address public pauser = address(uint160(uint256(keccak256("pauser")))); address public unpauser = address(uint160(uint256(keccak256("unpauser")))); address public rewardsUpdater = address(uint160(uint256(keccak256("rewardsUpdater")))); @@ -246,7 +246,7 @@ contract AVSDeployer is Test { abi.encodeWithSelector( DataHavenServiceManager.initialize.selector, avsOwner, - rewardsInitiator, + snowbridgeInitiator, defaultStrategyAndMultipliers, address(snowbridgeGatewayMock), avsOwner, diff --git a/test/cli/handlers/contracts/status.ts b/test/cli/handlers/contracts/status.ts index 3c61e04b..33fde8d2 100644 --- a/test/cli/handlers/contracts/status.ts +++ b/test/cli/handlers/contracts/status.ts @@ -24,7 +24,7 @@ export const showDeploymentPlanAndStatus = async (chain: string, environment?: s "Block Explorer": deploymentParams.blockExplorer, "Genesis Time": new Date(deploymentParams.genesisTime * 1000).toISOString(), "AVS Owner": `${config.avs.avsOwner.slice(0, 10)}...${config.avs.avsOwner.slice(-8)}`, - "Rewards Initiator": `${config.avs.rewardsInitiator.slice(0, 10)}...${config.avs.rewardsInitiator.slice(-8)}` + "Rewards Initiator": `${config.avs.snowbridgeInitiator.slice(0, 10)}...${config.avs.snowbridgeInitiator.slice(-8)}` }; if (environment) { diff --git a/test/contract-bindings/generated.ts b/test/contract-bindings/generated.ts index 120968e0..57cc1e5d 100644 --- a/test/contract-bindings/generated.ts +++ b/test/contract-bindings/generated.ts @@ -2149,7 +2149,7 @@ export const dataHavenServiceManagerAbi = [ type: 'function', inputs: [ { name: 'initialOwner', internalType: 'address', type: 'address' }, - { name: '_rewardsInitiator', internalType: 'address', type: 'address' }, + { name: '_snowbridgeInitiator', internalType: 'address', type: 'address' }, { name: 'validatorsStrategiesAndMultipliers', internalType: 'struct IRewardsCoordinatorTypes.StrategyAndMultiplier[]', @@ -2228,7 +2228,7 @@ export const dataHavenServiceManagerAbi = [ { type: 'function', inputs: [], - name: 'rewardsInitiator', + name: 'snowbridgeInitiator', outputs: [{ name: '', internalType: 'address', type: 'address' }], stateMutability: 'view', }, @@ -11022,12 +11022,12 @@ export const readDataHavenServiceManagerOwner = }) /** - * Wraps __{@link readContract}__ with `abi` set to __{@link dataHavenServiceManagerAbi}__ and `functionName` set to `"rewardsInitiator"` + * Wraps __{@link readContract}__ with `abi` set to __{@link dataHavenServiceManagerAbi}__ and `functionName` set to `"snowbridgeInitiator"` */ export const readDataHavenServiceManagerRewardsInitiator = /*#__PURE__*/ createReadContract({ abi: dataHavenServiceManagerAbi, - functionName: 'rewardsInitiator', + functionName: 'snowbridgeInitiator', }) /** diff --git a/test/e2e/suites/rewards-message.test.ts b/test/e2e/suites/rewards-message.test.ts index d76fa97c..25c316f4 100644 --- a/test/e2e/suites/rewards-message.test.ts +++ b/test/e2e/suites/rewards-message.test.ts @@ -123,16 +123,16 @@ describe("Rewards Message Flow", () => { expect(serviceManager.address).toBeDefined(); expect(gateway.address).toBeDefined(); - const rewardsInitiator = (await publicClient.readContract({ + const snowbridgeInitiator = (await publicClient.readContract({ address: serviceManager.address, abi: serviceManager.abi, - functionName: "rewardsInitiator", + functionName: "snowbridgeInitiator", args: [] })) as Address; - // ServiceManager must have a rewardsInitiator configured for EigenLayer rewards submission - expect(rewardsInitiator).toBeDefined(); - logger.debug(`ServiceManager rewardsInitiator: ${rewardsInitiator}`); + // ServiceManager must have a snowbridgeInitiator configured for EigenLayer rewards submission + expect(snowbridgeInitiator).toBeDefined(); + logger.debug(`ServiceManager snowbridgeInitiator: ${snowbridgeInitiator}`); }); it("should wait for era end and emit RewardsMessageSent", async () => { diff --git a/test/e2e/suites/slash.test.ts b/test/e2e/suites/slash.test.ts index 7547a84c..3419b007 100644 --- a/test/e2e/suites/slash.test.ts +++ b/test/e2e/suites/slash.test.ts @@ -91,16 +91,16 @@ describe("Should slash an operator", () => { expect(serviceManager.address).toBeDefined(); expect(gateway.address).toBeDefined(); - const rewardsInitiator = (await publicClient.readContract({ + const snowbridgeInitiator = (await publicClient.readContract({ address: serviceManager.address, abi: serviceManager.abi, - functionName: "rewardsInitiator", + functionName: "snowbridgeInitiator", args: [] })) as Address; - // ServiceManager must have a rewardsInitiator configured for EigenLayer rewards submission - expect(rewardsInitiator).toBeDefined(); - logger.info(`ServiceManager rewardsInitiator: ${rewardsInitiator}`); + // ServiceManager must have a snowbridgeInitiator configured for EigenLayer rewards submission + expect(snowbridgeInitiator).toBeDefined(); + logger.info(`ServiceManager snowbridgeInitiator: ${snowbridgeInitiator}`); }); it("Activate slashing", async () => {