From 2842af4ed281bd1f3ba71dd5001a992beb4d6fc4 Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Wed, 6 Dec 2023 18:27:57 +0300 Subject: [PATCH] feat(scratch): assign MANAGE_NODE_OPERATOR_ROLE to agent (manager is voting) --- contracts/0.4.24/template/LidoTemplate.sol | 8 ++------ scripts/scratch/checks/scratch-acceptance-test.js | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/contracts/0.4.24/template/LidoTemplate.sol b/contracts/0.4.24/template/LidoTemplate.sol index 150ff1ad4..b589f04d8 100644 --- a/contracts/0.4.24/template/LidoTemplate.sol +++ b/contracts/0.4.24/template/LidoTemplate.sol @@ -608,15 +608,11 @@ contract LidoTemplate is IsContract { // NodeOperatorsRegistry perms[0] = _state.operators.MANAGE_SIGNING_KEYS(); perms[1] = _state.operators.SET_NODE_OPERATOR_LIMIT_ROLE(); - // Need MANAGE_NODE_OPERATOR_ROLE to make current scratch acceptance script - // (scripts/scratch/checks/scratch-acceptance-test.js) work. - // After voting utilities added to the repo should rewrite the acceptance - // script to grant/renounce this role and remove granting from here. - perms[2] = _state.operators.MANAGE_NODE_OPERATOR_ROLE(); - for (i = 0; i < 3; ++i) { + for (i = 0; i < 2; ++i) { _createPermissionForVoting(acl, _state.operators, perms[i], voting); } acl.createPermission(_state.stakingRouter, _state.operators, _state.operators.STAKING_ROUTER_ROLE(), voting); + acl.createPermission(_state.agent, _state.operators, _state.operators.MANAGE_NODE_OPERATOR_ROLE(), voting); // Lido perms[0] = _state.lido.PAUSE_ROLE(); diff --git a/scripts/scratch/checks/scratch-acceptance-test.js b/scripts/scratch/checks/scratch-acceptance-test.js index 03000cbe1..1430c1a70 100644 --- a/scripts/scratch/checks/scratch-acceptance-test.js +++ b/scripts/scratch/checks/scratch-acceptance-test.js @@ -83,8 +83,8 @@ async function prepareProtocolForSubmitDepositReportWithdrawalFlow(protocol, sta await withdrawalQueue.resume({ from: agent.address }) await withdrawalQueue.renounceRole(await withdrawalQueue.RESUME_ROLE(), agent.address, { from: agent.address }) - await nodeOperatorsRegistry.addNodeOperator('1', ADDRESS_1, { from: voting.address }) - await nodeOperatorsRegistry.addNodeOperator('2', ADDRESS_2, { from: voting.address }) + await nodeOperatorsRegistry.addNodeOperator('1', ADDRESS_1, { from: agent.address }) + await nodeOperatorsRegistry.addNodeOperator('2', ADDRESS_2, { from: agent.address }) await nodeOperatorsRegistry.addSigningKeys(0, 1, pad('0x010203', 48), pad('0x01', 96), { from: voting.address }) await nodeOperatorsRegistry.addSigningKeys(