diff --git a/scripts/simpledvt/02-clone-nor.js b/scripts/simpledvt/02-clone-nor.js index 01463c2ab..3f6413067 100644 --- a/scripts/simpledvt/02-clone-nor.js +++ b/scripts/simpledvt/02-clone-nor.js @@ -25,6 +25,7 @@ const { SET_NODE_OPERATOR_LIMIT_ROLE, STAKING_ROUTER_ROLE, STAKING_MODULE_MANAGE_ROLE, + REQUEST_BURN_SHARES_ROLE, SIMPLE_DVT_IPFS_CID, } = require('./helpers') const { ETH, toBN } = require('../../test/helpers/utils') @@ -152,6 +153,9 @@ async function deployNORClone({ web3, artifacts, trgAppName = APP_TRG, ipfsCid = const daoTokenAddress = await tokenManager.token() const daoToken = await artifacts.require('MiniMeToken').at(daoTokenAddress) + const burnerAddress = readStateAppAddress(state, `burner`) + const burner = await artifacts.require('Burner').at(burnerAddress) + const easytrackABI = [ { inputs: [ @@ -308,15 +312,30 @@ async function deployNORClone({ web3, artifacts, trgAppName = APP_TRG, ipfsCid = // check missed STAKING_MODULE_MANAGE_ROLE role on Agent if (!(await stakingRouter.hasRole(STAKING_MODULE_MANAGE_ROLE, voting.address))) { - const grantRoleCallData = await stakingRouter.contract.methods - .grantRole(STAKING_MODULE_MANAGE_ROLE, agent.address) - .encodeABI() evmScriptCalls.push({ to: agent.address, - calldata: await agent.contract.methods.execute(stakingRouter.address, 0, grantRoleCallData).encodeABI(), + calldata: await agent.contract.methods + .execute( + stakingRouter.address, + 0, + await stakingRouter.contract.methods.grantRole(STAKING_MODULE_MANAGE_ROLE, agent.address).encodeABI() + ) + .encodeABI(), }) } + // allow to request burner, add REQUEST_BURN_SHARES_ROLE + evmScriptCalls.push({ + to: agent.address, + calldata: await agent.contract.methods + .execute( + burner.address, + 0, + await burner.contract.methods.grantRole(REQUEST_BURN_SHARES_ROLE, trgProxyAddress).encodeABI() + ) + .encodeABI(), + }) + // add module to SR const addModuleCallData = await stakingRouter.contract.methods .addStakingModule( diff --git a/scripts/simpledvt/03-check-deployed.js b/scripts/simpledvt/03-check-deployed.js index dd119ba3d..600c86a5f 100644 --- a/scripts/simpledvt/03-check-deployed.js +++ b/scripts/simpledvt/03-check-deployed.js @@ -12,6 +12,7 @@ const { SET_NODE_OPERATOR_LIMIT_ROLE, STAKING_ROUTER_ROLE, STAKING_MODULE_MANAGE_ROLE, + REQUEST_BURN_SHARES_ROLE, SIMPLE_DVT_IPFS_CID, } = require('./helpers') const { readNetworkState, assertRequiredNetworkState } = require('../helpers/persisted-network-state') @@ -71,7 +72,6 @@ async function deployNORClone({ web3, artifacts, trgAppName = APP_TRG, ipfsCid = const trgAppFullName = `${trgAppName}.${state.lidoApmEnsName}` const trgAppId = namehash(trgAppFullName) - console.log({ trgAppId, ens, artifacts }) const { semanticVersion, contractAddress, contentURI } = await resolveLatestVersion(trgAppId, ens, artifacts) _checkEq(contractAddress, srcContractAddress, 'App APM repo last version: implementation is the same to NOR') @@ -112,6 +112,8 @@ async function deployNORClone({ web3, artifacts, trgAppName = APP_TRG, ipfsCid = const srAddress = readStateAppAddress(state, 'stakingRouter') const dsmAddress = readStateAppAddress(state, 'depositSecurityModule') const stakingRouter = await artifacts.require('StakingRouter').at(srAddress) + const burnerAddress = readStateAppAddress(state, `burner`) + const burner = await artifacts.require('Burner').at(burnerAddress) _checkEq( await stakingRouter.hasRole(STAKING_MODULE_MANAGE_ROLE, agentAddress), @@ -119,6 +121,12 @@ async function deployNORClone({ web3, artifacts, trgAppName = APP_TRG, ipfsCid = 'Agent has role: STAKING_MODULE_MANAGE_ROLE' ) + _checkEq( + await burner.hasRole(REQUEST_BURN_SHARES_ROLE, trgProxyAddress), + true, + 'App has role: REQUEST_BURN_SHARES_ROLE' + ) + _checkEq( await acl.getPermissionManager(trgProxyAddress, MANAGE_SIGNING_KEYS), easyTrackEVMScriptExecutor, @@ -168,16 +176,6 @@ async function deployNORClone({ web3, artifacts, trgAppName = APP_TRG, ipfsCid = 'StakingRouter has permission: STAKING_ROUTER_ROLE' ) - if (state.easytrackAddress) { - _checkEq( - await acl.hasPermission(state.easytrackAddress, trgProxyAddress, SET_NODE_OPERATOR_LIMIT_ROLE), - true, - 'Easytrack has permission: SET_NODE_OPERATOR_LIMIT_ROLE' - ) - } else { - log(yl('[-]'), 'No Easytrack address set - skip!') - } - log.splitter() _checkEq(await stakingRouter.getStakingModulesCount(), 2, 'StakingRouter: modules count = 2') diff --git a/scripts/simpledvt/helpers.js b/scripts/simpledvt/helpers.js index f8b187356..b3abac822 100644 --- a/scripts/simpledvt/helpers.js +++ b/scripts/simpledvt/helpers.js @@ -5,6 +5,7 @@ const MANAGE_NODE_OPERATOR_ROLE = '0x78523850fdd761612f46e844cf5a16bda6b3151d6ae const SET_NODE_OPERATOR_LIMIT_ROLE = '0x07b39e0faf2521001ae4e58cb9ffd3840a63e205d288dc9c93c3774f0d794754' const STAKING_ROUTER_ROLE = '0xbb75b874360e0bfd87f964eadd8276d8efb7c942134fc329b513032d0803e0c6' const STAKING_MODULE_MANAGE_ROLE = '0x3105bcbf19d4417b73ae0e58d508a65ecf75665e46c2622d8521732de6080c48' +const REQUEST_BURN_SHARES_ROLE = '0x4be29e0e4eb91f98f709d98803cba271592782e293b84a625e025cbb40197ba8' const SIMPLE_DVT_IPFS_CID = 'QmaSSujHCGcnFuetAPGwVW5BegaMBvn5SCsgi3LSfvraSo' async function getDeployer(web3, defaultDeployer) { @@ -39,5 +40,6 @@ module.exports = { SET_NODE_OPERATOR_LIMIT_ROLE, STAKING_ROUTER_ROLE, STAKING_MODULE_MANAGE_ROLE, + REQUEST_BURN_SHARES_ROLE, SIMPLE_DVT_IPFS_CID, }