Skip to content

Commit

Permalink
refactor(deployed-x.json): 'owner' and 'multisigAddress' --> 'deployer'
Browse files Browse the repository at this point in the history
  • Loading branch information
arwer13 committed Oct 10, 2023
1 parent 470e9f6 commit d66db72
Show file tree
Hide file tree
Showing 26 changed files with 84 additions and 89 deletions.
2 changes: 1 addition & 1 deletion deployed-goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"apmRegistryFactoryAddress": "0x70B3284fD016a570146cE48fC54D7A81bCd94BBa",
"miniMeTokenFactoryAddress": "0x92E2750729e04c9a5CF21A830Bd00cbd5139D992",
"aragonIDAddress": "0x673cB86B60B9768Eebb05517fbF5a7F9f1Ab62C4",
"multisigAddress": "0x8303B3A462F4Cb4d2468DDcBD4c9f212914A3a7F",
"deployer": "0x8303B3A462F4Cb4d2468DDcBD4c9f212914A3a7F",
"daoTemplateConstructorArgs": [
"0x8303B3A462F4Cb4d2468DDcBD4c9f212914A3a7F",
"0x0B6769F500b293e3adacD97c3961189565069902",
Expand Down
3 changes: 1 addition & 2 deletions deployed-holesky.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"multisigAddress": "0x22896Bfc68814BFD855b1a167255eE497006e730",
"owner": "0x22896Bfc68814BFD855b1a167255eE497006e730",
"deployer": "0x22896Bfc68814BFD855b1a167255eE497006e730",
"gateSeal": {
"factoryAddress": "0x1134F7077055b0B3559BE52AfeF9aA22A0E1eEC2",
"sealDuration": 518400,
Expand Down
2 changes: 1 addition & 1 deletion deployed-mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"apmRegistryFactoryAddress": "0xa0BC4B67F5FacDE4E50EAFF48691Cfc43F4E280A",
"miniMeTokenFactoryAddress": "0x909d05f384d0663ed4be59863815ab43b4f347ec",
"aragonIDAddress": "0x546aa2eae2514494eeadb7bbb35243348983c59d",
"multisigAddress": "0x55Bc991b2edF3DDb4c520B222bE4F378418ff0fA",
"deployer": "0x55Bc991b2edF3DDb4c520B222bE4F378418ff0fA",
"daoInitialSettings": {
"token": {
"name": "Lido DAO Token",
Expand Down
3 changes: 1 addition & 2 deletions deployed-testnet-defaults.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"multisigAddress": "",
"owner": "",
"deployer": "",
"gateSeal": {
"factoryAddress": "",
"sealDuration": 518400,
Expand Down
3 changes: 1 addition & 2 deletions scripts/scratch/00-populate-deploy-artifact-from-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ async function saveDeployParameters({ web3, artifacts }) {
? ZERO_ADDRESS : ''

state.chainId = CHAIN_ID
state.multisigAddress = DEPLOYER
state.owner = DEPLOYER
state.deployer = DEPLOYER
state.gateSeal = {
...state.gateSeal,
factoryAddress: GATE_SEAL_FACTORY,
Expand Down
12 changes: 6 additions & 6 deletions scripts/scratch/01-deploy-lido-template-and-bases.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const REQUIRED_NET_STATE = [
'miniMeTokenFactoryAddress',
'aragonIDAddress',
'apmRegistryFactoryAddress',
'multisigAddress'
'deployer'
]

async function deployTemplate({ web3, artifacts }) {
Expand All @@ -25,7 +25,7 @@ async function deployTemplate({ web3, artifacts }) {
assertRequiredNetworkState(state, REQUIRED_NET_STATE)

const daoTemplateConstructorArgs = [
state.multisigAddress,
state.deployer,
state.daoFactoryAddress,
state.ensAddress,
state.miniMeTokenFactoryAddress,
Expand All @@ -35,14 +35,14 @@ async function deployTemplate({ web3, artifacts }) {

log.splitter()

await deployWithoutProxy('lidoTemplate', 'LidoTemplate', state.multisigAddress, daoTemplateConstructorArgs)
await deployWithoutProxy('lidoTemplate', 'LidoTemplate', state.deployer, daoTemplateConstructorArgs)
const daoTemplateDeployBlock = (await ethers.provider.getBlock('latest')).number

await deployImplementation(`app:${APP_NAMES.LIDO}`, 'Lido', state.multisigAddress)
await deployImplementation(`app:${APP_NAMES.LIDO}`, 'Lido', state.deployer)

await deployImplementation(`app:${APP_NAMES.ORACLE}`, 'LegacyOracle', state.multisigAddress)
await deployImplementation(`app:${APP_NAMES.ORACLE}`, 'LegacyOracle', state.deployer)

await deployImplementation(`app:${APP_NAMES.NODE_OPERATORS_REGISTRY}`, 'NodeOperatorsRegistry', state.multisigAddress)
await deployImplementation(`app:${APP_NAMES.NODE_OPERATORS_REGISTRY}`, 'NodeOperatorsRegistry', state.deployer)

persistNetworkState2(network.name, netId, readNetworkState(network.name, netId), {
lidoTemplate: {
Expand Down
4 changes: 2 additions & 2 deletions scripts/scratch/02-obtain-deployed-instances.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const REQUIRED_NET_STATE = [
'miniMeTokenFactoryAddress',
'aragonIDAddress',
'apmRegistryFactoryAddress',
'multisigAddress',
'deployer',
'lidoTemplate',
`app:${APP_NAMES.LIDO}`,
`app:${APP_NAMES.ORACLE}`,
Expand All @@ -38,7 +38,7 @@ async function deployTemplate({ web3, artifacts }) {
log(`Checking...`)
await assertDeployedBytecode(daoTemplate.address, 'LidoTemplate')
const templateConfig = await daoTemplate.getConfig()
assert.addressEqual(templateConfig._owner, state.multisigAddress, 'tmpl: owner')
assert.addressEqual(templateConfig._owner, state.deployer, 'tmpl: owner')
assert.addressEqual(templateConfig._daoFactory, state.daoFactoryAddress, 'tmpl: daoFactory')
assert.addressEqual(templateConfig._ens, state.ensAddress, 'tmpl: ens')
assert.addressEqual(templateConfig._miniMeFactory, state.miniMeTokenFactoryAddress, 'tmpl: miniMeFactory')
Expand Down
16 changes: 8 additions & 8 deletions scripts/scratch/03-register-ens-domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const REQUIRED_NET_STATE = [
'ensAddress',
'lidoApmEnsName',
'lidoApmEnsRegDurationSec',
'multisigAddress',
'deployer',
'lidoTemplate'
]

Expand Down Expand Up @@ -53,7 +53,7 @@ async function deployTemplate({ web3, artifacts }) {
log(`TLD node: ${chalk.yellow(TLD)} (${tldNode})`)
log(`Label: ${chalk.yellow(domainLabel)} (${labelHash})`)

if ((await ens.owner(node)) !== state.multisigAddress && (await ens.owner(tldNode)) !== state.multisigAddress) {
if ((await ens.owner(node)) !== state.deployer && (await ens.owner(tldNode)) !== state.deployer) {
const tldResolverAddr = await ens.resolver(tldNode)
log(`Using TLD resolver:`, yl(tldResolverAddr))
const tldResolver = await artifacts.require('IInterfaceResolver').at(tldResolverAddr)
Expand Down Expand Up @@ -100,22 +100,22 @@ async function deployTemplate({ web3, artifacts }) {

log.splitter()

await log.makeTx(controller, 'commit', [commitment], { from: state.multisigAddress })
await log.makeTx(controller, 'commit', [commitment], { from: state.deployer })

await log.makeTx(controller, 'register', [domainLabel, domainOwner, domainRegDuration, salt], {
from: state.multisigAddress,
from: state.deployer,
value: '0x' + registerTxValue.toString(16),
})

log.splitter()
} else {
log(`ENS domain new owner:`, yl(domainOwner))
if ((await ens.owner(node)) === state.multisigAddress) {
log(`Transferring name ownership from owner ${chalk.yellow(state.multisigAddress)} to template ${chalk.yellow(domainOwner)}`)
await log.makeTx(ens, 'setOwner', [node, domainOwner], { from: state.multisigAddress })
if ((await ens.owner(node)) === state.deployer) {
log(`Transferring name ownership from owner ${chalk.yellow(state.deployer)} to template ${chalk.yellow(domainOwner)}`)
await log.makeTx(ens, 'setOwner', [node, domainOwner], { from: state.deployer })
} else {
log(`Creating the subdomain and assigning it to template ${chalk.yellow(domainOwner)}`)
await log.makeTx(ens, 'setSubnodeOwner', [tldNode, labelHash, domainOwner], { from: state.multisigAddress })
await log.makeTx(ens, 'setSubnodeOwner', [tldNode, labelHash, domainOwner], { from: state.deployer })
}

log.splitter()
Expand Down
4 changes: 2 additions & 2 deletions scripts/scratch/05-deploy-apm.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const { readNetworkState, assertRequiredNetworkState, persistNetworkState } = re
const { getENSNodeOwner } = require('../components/ens')

const REQUIRED_NET_STATE = [
'multisigAddress',
'deployer',
'lidoTemplate',
'ensAddress',
'lidoApmEnsName',
Expand Down Expand Up @@ -56,7 +56,7 @@ async function deployAPM({ web3, artifacts }) {

logSplitter()

const from = state.multisigAddress
const from = state.deployer

const lidoApmDeployArguments = [parentHash, subHash]
const receipt = await log.makeTx(template, 'deployLidoAPM', lidoApmDeployArguments, { from })
Expand Down
4 changes: 2 additions & 2 deletions scripts/scratch/07-create-app-repos.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const DULL_CONTENT_URI = "0x0000000000000000000000000000000000000000000000000000


const REQUIRED_NET_STATE = [
'multisigAddress',
'deployer',
'lidoTemplate',
`app:${APP_NAMES.LIDO}`,
`app:${APP_NAMES.ORACLE}`,
Expand Down Expand Up @@ -60,7 +60,7 @@ async function createAppRepos({ web3, artifacts }) {
oracleAppState.implementation.address,
DULL_CONTENT_URI,
]
const from = state.multisigAddress
const from = state.deployer

console.log({arguments, from})

Expand Down
4 changes: 2 additions & 2 deletions scripts/scratch/08-deploy-dao.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const VALID_APP_NAMES = Object.entries(APP_NAMES).map((e) => e[1])

const REQUIRED_NET_STATE = [
'ensAddress',
'multisigAddress',
'deployer',
'lidoTemplate',
`app:${APP_NAMES.LIDO}`,
`app:${APP_NAMES.ORACLE}`,
Expand Down Expand Up @@ -68,7 +68,7 @@ async function deployDAO({ web3, artifacts }) {
daoInitialSettings.token.name,
daoInitialSettings.token.symbol,
votingSettings,
], { from: state.multisigAddress })
], { from: state.deployer })
state.lidoTemplateNewDaoTx = receipt.tx
persistNetworkState(network.name, netId, state)
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/scratch/10-issue-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async function issueTokens({ web3, artifacts }) {

await log.makeTx(template, 'issueTokens',
[iHolders, iAmounts, vesting.start, vesting.cliff, vesting.end, vesting.revokable, '0x' + endTotalSupply.toString(16)]
, { from: state.multisigAddress },
, { from: state.deployer },
)
}
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/scratch/11-finalize-dao.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const REQUIRED_NET_STATE = [
'vestingParams',
`app:${APP_NAMES.ARAGON_TOKEN_MANAGER}`,
'stakingRouter',
'deployer',
]

async function finalizeDAO({ web3, artifacts }) {
Expand Down Expand Up @@ -68,7 +69,7 @@ async function finalizeDAO({ web3, artifacts }) {
state.daoAragonId,
state.vestingParams.unvestedTokensAmount,
state.stakingRouter.address
], { from: state.multisigAddress })
], { from: state.deployer })
}

module.exports = runOrWrapScript(finalizeDAO, module)
4 changes: 2 additions & 2 deletions scripts/scratch/13-gate-seal.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { getEventArgument } = require('@aragon/contract-helpers-test')
const { APP_NAMES } = require('../constants')

const REQUIRED_NET_STATE = [
"multisigAddress",
"deployer",
"gateSeal",
"validatorsExitBusOracle",
"withdrawalQueueERC721",
Expand All @@ -25,7 +25,7 @@ async function deployNewContracts({ web3, artifacts }) {
}

const gateSealFactoryAddress = state.gateSeal.factoryAddress
const deployer = state.multisigAddress
const deployer = state.deployer
const sealables = [
state.withdrawalQueueERC721.proxy.address,
state.validatorsExitBusOracle.proxy.address,
Expand Down
18 changes: 9 additions & 9 deletions scripts/scratch/15-grant-roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,39 +45,39 @@ async function deployNewContracts({ web3, artifacts }) {
const validatorsExitBusOracleAddress = state["validatorsExitBusOracle"].address
const depositSecurityModuleAddress = state.depositSecurityModule.address

const owner = state.owner
const deployer = state.deployer

//
// === StakingRouter
//
const stakingRouter = await artifacts.require('StakingRouter').at(stakingRouterAddress)
await log.makeTx(stakingRouter, 'grantRole', [await stakingRouter.STAKING_MODULE_PAUSE_ROLE(), depositSecurityModuleAddress], { from: owner })
await log.makeTx(stakingRouter, 'grantRole', [await stakingRouter.REPORT_EXITED_VALIDATORS_ROLE(), accountingOracleAddress], { from: owner })
await log.makeTx(stakingRouter, 'grantRole', [await stakingRouter.REPORT_REWARDS_MINTED_ROLE(), lidoAddress], { from: owner })
await log.makeTx(stakingRouter, 'grantRole', [await stakingRouter.STAKING_MODULE_PAUSE_ROLE(), depositSecurityModuleAddress], { from: deployer })
await log.makeTx(stakingRouter, 'grantRole', [await stakingRouter.REPORT_EXITED_VALIDATORS_ROLE(), accountingOracleAddress], { from: deployer })
await log.makeTx(stakingRouter, 'grantRole', [await stakingRouter.REPORT_REWARDS_MINTED_ROLE(), lidoAddress], { from: deployer })
logWideSplitter()

//
// === ValidatorsExitBusOracle
//
const validatorsExitBusOracle = await artifacts.require('ValidatorsExitBusOracle').at(validatorsExitBusOracleAddress)
await log.makeTx(validatorsExitBusOracle, 'grantRole', [await validatorsExitBusOracle.PAUSE_ROLE(), gateSealAddress], { from: owner })
await log.makeTx(validatorsExitBusOracle, 'grantRole', [await validatorsExitBusOracle.PAUSE_ROLE(), gateSealAddress], { from: deployer })
logWideSplitter()

//
// === WithdrawalQueue
//
const withdrawalQueue = await artifacts.require('WithdrawalQueueERC721').at(withdrawalQueueAddress)
await log.makeTx(withdrawalQueue, 'grantRole', [await withdrawalQueue.PAUSE_ROLE(), gateSealAddress], { from: owner })
await log.makeTx(withdrawalQueue, 'grantRole', [await withdrawalQueue.FINALIZE_ROLE(), lidoAddress], { from: owner })
await log.makeTx(withdrawalQueue, 'grantRole', [await withdrawalQueue.ORACLE_ROLE(), accountingOracleAddress], { from: owner })
await log.makeTx(withdrawalQueue, 'grantRole', [await withdrawalQueue.PAUSE_ROLE(), gateSealAddress], { from: deployer })
await log.makeTx(withdrawalQueue, 'grantRole', [await withdrawalQueue.FINALIZE_ROLE(), lidoAddress], { from: deployer })
await log.makeTx(withdrawalQueue, 'grantRole', [await withdrawalQueue.ORACLE_ROLE(), accountingOracleAddress], { from: deployer })
logWideSplitter()

//
// === Burner
//
const burner = await artifacts.require('Burner').at(burnerAddress)
// NB: REQUEST_BURN_SHARES_ROLE is already granted to Lido in Burner constructor
await log.makeTx(burner, 'grantRole', [await burner.REQUEST_BURN_SHARES_ROLE(), nodeOperatorsRegistryAddress], { from: owner })
await log.makeTx(burner, 'grantRole', [await burner.REQUEST_BURN_SHARES_ROLE(), nodeOperatorsRegistryAddress], { from: deployer })

}

Expand Down
11 changes: 5 additions & 6 deletions scripts/scratch/16-plug-curated-staking-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ const { APP_NAMES } = require('../constants')
const REQUIRED_NET_STATE = [
"stakingRouter",
"app:node-operators-registry",
"owner",

"deployer",
"app:aragon-agent",
`app:${APP_NAMES.LIDO}`,
`app:${APP_NAMES.ORACLE}`,
Expand Down Expand Up @@ -40,20 +39,20 @@ async function deployNewContracts({ web3, artifacts }) {
let state = readNetworkState(network.name, netId)
assertRequiredNetworkState(state, REQUIRED_NET_STATE)

const owner = state.owner
const deployer = state.deployer
const stakingRouter = await artifacts.require('StakingRouter').at(state.stakingRouter.address)
const nodeOperatorsRegistry = await artifacts.require('NodeOperatorsRegistry').at(state['app:node-operators-registry'].proxy.address)

await log.makeTx(stakingRouter, 'grantRole', [STAKING_MODULE_MANAGE_ROLE, owner], { from: owner })
await log.makeTx(stakingRouter, 'grantRole', [STAKING_MODULE_MANAGE_ROLE, deployer], { from: deployer })

await log.makeTx(stakingRouter, 'addStakingModule', [
state.nodeOperatorsRegistry.parameters.stakingModuleTypeId,
nodeOperatorsRegistry.address,
NOR_STAKING_MODULE_TARGET_SHARE_BP,
NOR_STAKING_MODULE_MODULE_FEE_BP,
NOR_STAKING_MODULE_TREASURY_FEE_BP,
], { from: owner })
await log.makeTx(stakingRouter, 'renounceRole', [STAKING_MODULE_MANAGE_ROLE, owner], { from: owner })
], { from: deployer })
await log.makeTx(stakingRouter, 'renounceRole', [STAKING_MODULE_MANAGE_ROLE, deployer], { from: deployer })
}

module.exports = runOrWrapScript(deployNewContracts, module)
30 changes: 15 additions & 15 deletions scripts/scratch/17-transfer-roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,25 @@ async function deployNewContracts({ web3, artifacts }) {
let state = readNetworkState(network.name, netId)
assertRequiredNetworkState(state, REQUIRED_NET_STATE)

const owner = state.owner
const deployer = state.deployer
const agent = state["app:aragon-agent"].proxy.address

await transferOZAdmin('Burner', state.burner.address, owner, agent)
await transferOZAdmin('HashConsensus', state.hashConsensusForAccounting.address, owner, agent)
await transferOZAdmin('HashConsensus', state.hashConsensusForValidatorsExitBus.address, owner, agent)
await transferOZAdmin('StakingRouter', state.stakingRouter.address, owner, agent)
await transferOZAdmin('AccountingOracle', state.accountingOracle.address, owner, agent)
await transferOZAdmin('ValidatorsExitBusOracle', state.validatorsExitBusOracle.address, owner, agent)
await transferOZAdmin('WithdrawalQueueERC721', state.withdrawalQueueERC721.address, owner, agent)
await transferOZAdmin('OracleDaemonConfig', state.oracleDaemonConfig.address, owner, agent)
await transferOZAdmin('Burner', state.burner.address, deployer, agent)
await transferOZAdmin('HashConsensus', state.hashConsensusForAccounting.address, deployer, agent)
await transferOZAdmin('HashConsensus', state.hashConsensusForValidatorsExitBus.address, deployer, agent)
await transferOZAdmin('StakingRouter', state.stakingRouter.address, deployer, agent)
await transferOZAdmin('AccountingOracle', state.accountingOracle.address, deployer, agent)
await transferOZAdmin('ValidatorsExitBusOracle', state.validatorsExitBusOracle.address, deployer, agent)
await transferOZAdmin('WithdrawalQueueERC721', state.withdrawalQueueERC721.address, deployer, agent)
await transferOZAdmin('OracleDaemonConfig', state.oracleDaemonConfig.address, deployer, agent)

await changeOssifiableProxyAdmin(state.lidoLocator.address, owner, agent)
await changeOssifiableProxyAdmin(state.stakingRouter.address, owner, agent)
await changeOssifiableProxyAdmin(state.accountingOracle.address, owner, agent)
await changeOssifiableProxyAdmin(state.validatorsExitBusOracle.address, owner, agent)
await changeOssifiableProxyAdmin(state.withdrawalQueueERC721.address, owner, agent)
await changeOssifiableProxyAdmin(state.lidoLocator.address, deployer, agent)
await changeOssifiableProxyAdmin(state.stakingRouter.address, deployer, agent)
await changeOssifiableProxyAdmin(state.accountingOracle.address, deployer, agent)
await changeOssifiableProxyAdmin(state.validatorsExitBusOracle.address, deployer, agent)
await changeOssifiableProxyAdmin(state.withdrawalQueueERC721.address, deployer, agent)

await changeDepositSecurityModuleAdmin(state.depositSecurityModule.address, owner, agent)
await changeDepositSecurityModuleAdmin(state.depositSecurityModule.address, deployer, agent)
}

module.exports = runOrWrapScript(deployNewContracts, module)
4 changes: 2 additions & 2 deletions scripts/scratch/custom-deploy-aragon-std-apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require('@aragon/buidler-aragon/dist/bootstrap-paths')


const REQUIRED_NET_STATE = [
'multisigAddress',
'deployer',
]


Expand All @@ -27,7 +27,7 @@ async function deployAragonStdApps({ web3, artifacts, }) {
const state = readNetworkState(network.name, netId)
assertRequiredNetworkState(state, REQUIRED_NET_STATE)

const deployer = state["multisigAddress"]
const deployer = state.deployer
await deployImplementation("app:aragon-agent", "Agent", deployer)
await deployImplementation("app:aragon-finance", "Finance", deployer)
await deployImplementation("app:aragon-token-manager", "TokenManager", deployer)
Expand Down
Loading

0 comments on commit d66db72

Please sign in to comment.